71 lines
1.8 KiB
Bash
71 lines
1.8 KiB
Bash
#!/bin/bash
|
|
|
|
# aliases common to bash and zsh
|
|
|
|
alias lime2connect='ssh $USER@2px.info'
|
|
alias git-summary='~/github_misc/git-summary/git-summary'
|
|
|
|
# color support for ls and grep
|
|
if [ -x /usr/bin/dircolors ]; then
|
|
if [ -r ~/.dircolors ]; then
|
|
eval "$(dircolors -b ~/.dircolors)"
|
|
else
|
|
eval "$(dircolors -b)"
|
|
fi
|
|
alias ls='ls --color=auto'
|
|
alias grep='grep --color=auto'
|
|
alias fgrep='fgrep --color=auto'
|
|
alias egrep='egrep --color=auto'
|
|
fi
|
|
|
|
alias rm='rm -I --preserve-root'
|
|
|
|
# Add an "alert" alias for long running commands. Use like so:
|
|
# sleep 10; alert
|
|
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
|
|
|
alias weather='curl wttr.in'
|
|
|
|
alias ll='ls -lh'
|
|
alias lla='ls -lArth'
|
|
alias la='ls -A'
|
|
alias l='ls -CF'
|
|
|
|
alias envactivate='source .env/bin/activate'
|
|
alias visudo='export EDITOR=$EDITOR && sudo -E visudo'
|
|
|
|
# For common errors
|
|
alias :q=' exit'
|
|
alias :x=' exit'
|
|
alias cd..='cd ..'
|
|
|
|
clitip() {
|
|
curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md |
|
|
sed '/cowsay[.]png/d' |
|
|
pandoc -f markdown -t html |
|
|
xmlstarlet fo --html --dropdtd |
|
|
xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" |
|
|
xmlstarlet unesc | fmt -80 | iconv -t US
|
|
}
|
|
|
|
hello() {
|
|
sudo protonvpn c -f
|
|
echo
|
|
# Don't update if its a kernel update that will require reboot
|
|
case "$(checkupdates)" in
|
|
*linux*)
|
|
echo "Not performing update"
|
|
;;
|
|
*)
|
|
sudo pacman -Syu
|
|
esac
|
|
cd ~/SetupCockpit && git pull
|
|
cd ~/Keepass && git pull
|
|
cd ~/Lessons/TSSR && git pull
|
|
}
|
|
|
|
bye() {
|
|
cd ~/SetupCockpit && git push
|
|
cd ~/Keepass && git push
|
|
cd ~/Lessons/TSSR && git push
|
|
}
|