45 lines
1.3 KiB
Text
45 lines
1.3 KiB
Text
# aliases common to bash and zsh
|
|
|
|
alias lime2connect='ssh flyingscorpio@2px.info'
|
|
|
|
|
|
# enable color support of ls and also add handy aliases
|
|
if [ -x /usr/bin/dircolors ]; then
|
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
|
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 ll='ls -lh'
|
|
alias lla='ls -lArth'
|
|
alias la='ls -A'
|
|
alias l='ls -CF'
|
|
|
|
if [ -x /bin/vim ] && [ ! -x /bin/vi ]; then
|
|
alias vi='vim'
|
|
fi
|
|
|
|
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
|
|
}
|