55 lines
1.4 KiB
Bash
Executable file
55 lines
1.4 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
hyfetch
|
|
|
|
#test
|
|
|
|
# Quality of Life
|
|
#enable using sudo with functions
|
|
function Sudo {
|
|
local firstArg=$1
|
|
if [ $(type -t $firstArg) = function ];then
|
|
shift && command sudo bash -c "$(declare -f $firstArg);$firstArg $*"
|
|
elif [ $(type -t $firstArg) = alias ];then
|
|
alias sudo='\sudo '
|
|
eval "sudo $@"
|
|
else
|
|
command sudo "$@"
|
|
fi
|
|
}
|
|
#find in history
|
|
alias h="history|grep "
|
|
#search files in current and sub dirs
|
|
#alias f="find . |grep "
|
|
find_file() {
|
|
find . -name *"${1}"*
|
|
}
|
|
#find running processes
|
|
alias p="ps aux |grep "
|
|
#open file
|
|
alias o="open "
|
|
#find large files
|
|
#alias find_largest_files="du -h -x -s -- * | sort -r -h | head -20"
|
|
sort_filesizes() {
|
|
[ -z ${1} ] && local dir="$(pwd)" || local dir="${1}"
|
|
du -ah --max-depth=1 "$( realpath ${dir} )" | sort --human-numeric-sort
|
|
}
|
|
# connect to android via adb as root
|
|
alias adb_root="adb shell -t exec run-as com.termux files/usr/bin/bash -c 'su -'"
|
|
|
|
#User Env Vars
|
|
export DEBEMAIL="support@pogmom.me"
|
|
export DEBFULLNAME="Penelope Gwen"
|
|
|
|
#SSH Personal Machines
|
|
alias pogmommy-omen-328p1aa="ssh pogmommy-omen-328p1aa"
|
|
alias pogmommy-apple-a2337="ssh pogmommy-apple-a2337"
|
|
alias pogmommy-apple-a2337-vpn="ssh pogmommy-apple-a2337-vpn"
|
|
|
|
#Git env vars
|
|
GIT_AUTHOR_NAME="Penelope Gwen"
|
|
GIT_AUTHOR_EMAIL="penelope@pogmom.me"
|
|
|
|
alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg"
|
|
. /usr/share/bash-completion/completions/quilt
|
|
complete -F _quilt_completion -o filenames dquilt
|