Skip to content

Instantly share code, notes, and snippets.

@colehocking
Last active October 5, 2018 17:54
Show Gist options
  • Save colehocking/dc8653641805db73bb4bca68f3d45580 to your computer and use it in GitHub Desktop.
Save colehocking/dc8653641805db73bb4bca68f3d45580 to your computer and use it in GitHub Desktop.
Bash profile for OSX
# CCH - Bash Profile Settings #
# user@hostname:where<ex.~>$
export PS1="\e[1;33m\u@\h:\e[1;36m\w\e[0m\$ "
# colors
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
alias c='clear'
alias f='open -a Finder ./'
alias cpu_hogs='ps wwaxr -o pid,stat,%cpu,time,command | head -10'
## network ##
# external ip
alias myip='curl ifconfig.me'
# list open ports
alias ports='sudo lsof -i | grep LISTEN'
# root profile
# TODO: sudo doesnt know cmd 'source' from ./.gosu
# alias su_='sudo ./.gosu'
alias mtr='/usr/local/sbin/mtr'
alias sbash='source ~/.bash_profile'
getchmod() {
stat -f "%OLp" $1
}
sha256sum() {
shasum -a 256 $1
}
alias tlist='tmux list-sessions'
export PATH="/usr/bin:$PATH"
# Show and verify code signatures of files
checksig() {
codesign -dv --verbose=4 $1
}
alias sbpro='source ~/.bash_profile'
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
alias amiup='ping archlinux.org'
# show how much battery life is left in minutes
batlife() {
pmset -g batt | awk '/^ /{print $5}'
}
#led keyboard settings
alias ledon='~/led/led-backlight-osx'
alias ledoff='~/led/led-backlight-osx off'
alias flushdns='sudo killall -HUP mdnsresponder; sudo killall mDNSResponderHelper; sudo dscacheutil -flushcache'
alias netbi='netbi.sh $1'
# use the errbot python ve
alias victor='~/.errbot-ve/bin/errbot'
alias epip='~/.errbot-ve/bin/pip'
# serve the working dir at http://$HOSTNAME:8000/
alias serveit='python -m SimpleHTTPServer'
# Invoke a command into an editor with ctrl-x e
export EDITOR="vim"
# Show the URL source of a git repo
alias git_show='git config --get remote.origin.url'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment