Robert 3 months ago
parent b8e889875e
commit b042cb25fc
  1. 2
      .aliases.d/folders.sh
  2. 19
      .aliases.d/help.sh
  3. 14
      .aliases.d/obs.sh
  4. 13
      cheats/guide
  5. 5
      scripts/git/gitprojects.sh
  6. 44
      scripts/git/locate_gits.sh
  7. 15
      scripts/helper/scan_aliases.sh

@ -108,7 +108,7 @@ videos() {
photos() {
cd ~/Pictures/"$1"
}
alias aliases='cd $_ENV_PATH'
alias aliases='cd ~/.aliases.d'
alias space-used='ncdu'
www() {
cd /var/www/"$1"

@ -9,11 +9,11 @@ alias-new() {
else
pushd ~/.aliases.d
nano "${1//.sh}".sh
if [ -f "~/.data/.sane_checker.sum" ]; then
if [ -f ~/.data/.sane_checker.sum ]; then
echo -e "Enter sudo password for sane_checker...\n"
sudo chattr -i "~/.data/.sane_checker.sum"
sudo chmod 644 "~/.data/.sane_checker.sum"
rm "~/.data/.sane_checker.sum"
sudo chattr -i ~/.data/.sane_checker.sum
sudo chmod 644 ~/.data/.sane_checker.sum
rm ~/.data/.sane_checker.sum
fi
popd
fi
@ -34,9 +34,9 @@ alias-help() {
echo -e "cheat - Followed by Cheat file to view. If empty, all cheat files are displayed.\n"
echo -e "cheats - will cd into cheats folder.\n"
}
cheats="~/cheats/"
cheats=~/cheats/
alias cheats="cd ${cheats}"
alias list-cheats='ls -1 ~/cheats/*.txt | sed -e "s,${cheats},,g"'
alias list-cheats='ls -1 ${cheats}*.txt | sed -e "s,${cheats},,g"'
cheat() {
if [ -f ~/cheats/$1.txt ]; then
less -X ~/cheats/$1.txt
@ -50,12 +50,11 @@ cheat() {
}
alias alias-reload='unalias -a && . $HOME/.bashrc'
alias alias-guide='dialog --title "Alias Profiles Guide" --textbox /opt/profiles/cheats/guide 0 0; clear'
alias alias-guide='dialog --title "Alias Profiles Guide" --textbox ~/cheats/guide 0 0; clear'
my-aliases() {
local sys_aliases=$(find "~/.aliases.d" -type f -name "*.sh")
local all_the_aliases=("$sys_aliases")
local selected_alias=$(printf "%s\n" "${all_the_aliases[@]}" | fzf --prompt "Select Alias file: ")
local sys_aliases=$(find ~/.aliases.d/ -type f -name "*.sh")
local selected_alias=$(printf "%s\n" "${sys_aliases[@]}" | fzf --prompt "Select Alias file: ")
if [ -z "$selected_alias" ]; then
echo "No Alias selected."
return 1

@ -1,21 +1,21 @@
recording_banner() {
if [ $(ps -C obs | wc -l) == "2" ]; then
# if [ -x /opt/profiles/custom_aliases/host_of_show.sh ]; then
# /opt/profiles/custom_aliases/host_of_show.sh
# fi
if [ -f ~/.data/host_of_show.txt ]; then
cat ~/.data/host_of_show.txt
fi
echo -ne "\033[1;34mRecording on\033[5;33m:\033[0;0m\033[2;37m ";
# print date and time
date +"%A, %B %-d, %Y %r"
echo -ne "\033[0m\033[37m"
else
# if [ -x /opt/profiles/custom_aliases/banner.sh ]; then
# /opt/profiles/custom_aliases/banner.sh
# fi
if [ -f ~/.data/banner.txt ]; then
cat ~/.data/banner.txt
fi
echo -ne "\033[0m\033[37m"
date +"%A, %B %-d, %Y %r"
fi
}
recording_banner
alias mysite='clear; cat /opt/profiles/mysite.txt; recording_banner'
alias mysite='clear; cat ~/.data/mysite.txt; recording_banner'

@ -0,0 +1,13 @@
$ alias-help
$ sshto work
$ sshto home
# Example Proxy Server Port Forwarding
nano ~/.ssh/EXAMPLEconfigs_proxy.conf
# GUI git project auto updater....
$ gp
# GUI git project Change DIR - Note: RUN gp @ least once before...this.
$ gpcd

@ -9,7 +9,7 @@ fi
git_projects=~/.data/.gitprojects
tmp_projects=/tmp/gitprojects
git_util=${_MAIN_PATHGP}git/dogit
git_gen=${_MAIN_PATHGP}locate_gits.sh
git_gen=${_MAIN_PATHGP}git/locate_gits.sh
refresh() {
cmdlist=()
@ -87,9 +87,6 @@ run_dialog() {
esac
}
what=$(${_MAIN_PATHGP}display_check.sh)
[[ "$what" == "" ]] && echo "" || { echo "$what"; exit 1; }
run_dialog
clear

@ -0,0 +1,44 @@
#!/bin/bash
if [ ! -x /bin/mlocate ] && [ ! -x /usr/bin/mlocate ] \
&& [ ! -x /bin/locate ] && [ ! -x /usr/bin/locate ]; then
echo "Install mlocate system package"
exit 1
fi
if [ ! -x /bin/sed ] && [ ! -x /usr/bin/sed ]; then
echo "Install sed system package"
exit 1
fi
if [ ! -x /bin/awk ] && [ ! -x /usr/bin/awk ]; then
echo "Install awk system package"
exit 1
fi
if [ -x /usr/bin/updatedb ] || [ -x /bin/updatedb ]; then
echo "Updating dbsearch cache for git projects to be fresh...."
sudo updatedb
fi
if [ -x /bin/mlocate ] || [ -x /usr/bin/mlocate ]; then
list=$(mlocate '*/.git')
elif [ -x /bin/locate ] || [ -x /usr/bin/locate ]; then
list=$(locate '*/.git')
fi
#Set the field separator to new line
OLD_IFS=$IFS
IFS=$'\n'
git_prj=/tmp/gitprojects
echo "#Name,Path_to_project,short desc." > $git_prj
for item in $list
do
PP=${item///.git/}
NAME=$(echo "$PP" | awk -F'/' '{print $(NF)}')
echo "${NAME},${PP}," >> $git_prj
done
IFS=$OLD_IFS
nano $git_prj

@ -95,7 +95,7 @@ prompter_for_fix() {
good=1
if [ ! -f "$SANE_CHECKER" ]; then
echo -e "\033[0;34m 1st run added to sane sum file! \033[0m"
$SHA_SUM_APP {~/scripts/*.sh,~/scripts/helper/*.sh,~/.aliases.d/*.sh,~/.bash_aliases,~/.bashrc,~/.bash_logout,~/scripts/helper/.git_bash_prompt,~/.profile,~/scripts/helper/.kube-ps1,~/scripts/helper/theme} > "$tmpsum" 2>/dev/null
$SHA_SUM_APP {~/scripts/*.sh,~/scripts/sshto/*.sh,~/scripts/git/*.sh,~/scripts/git/dogit,~/scripts/git/gpull,~/scripts/git/gpull-and-push,~/scripts/helper/gpg/*.sh,~/scripts/helper/*.sh,~/.aliases.d/*.sh,~/.bash_aliases,~/.bashrc,~/.bash_logout,~/scripts/helper/.git_bash_prompt,~/.profile,~/scripts/helper/.kube-ps1,~/scripts/helper/theme} > "$tmpsum" 2>/dev/null
require_root "$SANE_CHECKER" "$tmpsum"
good=0
else
@ -123,12 +123,25 @@ check_certificates() {
SANE_TEST_FAILED=1
fi
done
for FILE in ~/scripts/sshto/*.sh; do
if [ -f "$FILE" ] && ! grep -q "$FILE" "$SANE_CHECKER"; then
echo -e "\033[0;31m $FILE is a new file! \r\n Please Scan it for viruses. \033[0m" >> "$error_status"
SANE_TEST_FAILED=1
fi
done
for FILE in ~/scripts/helper/*.sh; do
if [ -f "$FILE" ] && ! grep -q "$FILE" "$SANE_CHECKER"; then
echo -e "\033[0;31m $FILE is a new file! \r\n Please Scan it for viruses. \033[0m" >> "$error_status"
SANE_TEST_FAILED=1
fi
done
for FILE in ~/scripts/helper/gpg/*.sh; do
if [ -f "$FILE" ] && ! grep -q "$FILE" "$SANE_CHECKER"; then
echo -e "\033[0;31m $FILE is a new file! \r\n Please Scan it for viruses. \033[0m" >> "$error_status"
SANE_TEST_FAILED=1
fi
done
for FILE in ~/.aliases.d/*.sh; do
if [ -f "$FILE" ] && ! grep -q "$FILE" "$SANE_CHECKER"; then
echo -e "\033[0;31m $FILE is a new file! \r\n Please Scan it for viruses. \033[0m" >> "$error_status"

Loading…
Cancel
Save