Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (46 sloc) 1.54 KB
# -*- mode: shell-script -*-
if [ -n "$ZSH_VERSION" ]; then
# assume Zsh
alias up="source ~/.zshrc"
elif [ -n "$BASH_VERSION" ]; then
# assume Bash
alias up="source ~/.bash_profile"
else
# asume something else
: # do nothing
fi
# cr -> lf
alias flip="tr '\r' '\n'"
# -G Enable colorized output.
# -a Include directory entries whose names begin with a dot (.).
# -l List in long format.
# -r Reverse the order of the sort
# -t Sort by time modified (most recently modified first)
alias ll="ls -Galrt"
alias l="ls -G"
alias pp="ping 4.2.2.2"
# which router am I using?
alias router='netstat -rn|egrep "^(0.0.0.0|default)"|awk "{print \$2}"'
if command -v python > /dev/null 2>&1; then
alias jsonpp='python -m json.tool | pygmentize -l json'
fi
if command -v xmlstarlet > /dev/null 2>&1; then
alias xmlpp='xmlstarlet fo | pygmentize -l xml'
fi
# what is my IP?
if command -v python > /dev/null 2>&1; then
alias wimi='curl --silent http://httpbin.org/ip | grep origin | cut -d \" -f 4'
fi
# ssh (ignore the agent)
alias ssh0="SSH_AUTH_SOCK= ssh"
# find files
alias ff="find . -type f"
alias ff0="find . -type f -print0"
alias utc="TZ=UTC date +'%Y-%m-%dT%H:%M:%S%z'"
alias gc="git clone"
# "clean" text
alias c="pbpaste -Prefer txt | pbcopy; pbpaste; echo"
# [e]macs [c]lean
alias ec="find . -type f -iname '*~' -delete"
# What's the water level in California reservoirs?
alias water="curl -s http://cdec.water.ca.gov/cgi-progs/reservoirs/RES | grep 'Group Average' | cut -d '>' -f 25 | cut -d '<' -f 1"