Skip to content

Instantly share code, notes, and snippets.

@dannymcc
Last active December 10, 2015 02:19
Show Gist options
  • Save dannymcc/4366712 to your computer and use it in GitHub Desktop.
Save dannymcc/4366712 to your computer and use it in GitHub Desktop.
My bash_profile
# Danny McClelland
# The great bash profile of 2013
export HISTTIMEFORMAT='%Y-%b-%d %a %H:%M:%S - '
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# Create a POW entry for the current site
function powify() {
ln -s $PWD ~/.pow/${1:-$(basename $PWD | tr A-Z a-z)}
}
# Color details - http://wiki.archlinux.org/index.php/Color_Bash_Prompt
txtblk='\[\e[0;30m\]' # Black - Regular
txtred='\[\e[0;31m\]' # Red
txtgrn='\[\e[0;32m\]' # Green
txtylw='\[\e[0;33m\]' # Yellow
txtblu='\[\e[0;34m\]' # Blue
txtpur='\[\e[0;35m\]' # Purple
txtcyn='\[\e[0;36m\]' # Cyan
txtwht='\[\e[0;37m\]' # White
bldblk='\[\e[1;30m\]' # Black - Bold
bldred='\[\e[1;31m\]' # Red
bldgrn='\[\e[1;32m\]' # Green
bldylw='\[\e[1;33m\]' # Yellow
bldblu='\[\e[1;34m\]' # Blue
bldpur='\[\e[1;35m\]' # Purple
bldcyn='\[\e[1;36m\]' # Cyan
bldwht='\[\e[1;37m\]' # White
unkblk='\[\e[4;30m\]' # Black - Underline
undred='\[\e[4;31m\]' # Red
undgrn='\[\e[4;32m\]' # Green
undylw='\[\e[4;33m\]' # Yellow
undblu='\[\e[4;34m\]' # Blue
undpur='\[\e[4;35m\]' # Purple
undcyn='\[\e[4;36m\]' # Cyan
undwht='\[\e[4;37m\]' # White
bakblk='\[\e[40m\]' # Black - Background
bakred='\[\e[41m\]' # Red
badgrn='\[\e[42m\]' # Green
bakylw='\[\e[43m\]' # Yellow
bakblu='\[\e[44m\]' # Blue
bakpur='\[\e[45m\]' # Purple
bakcyn='\[\e[46m\]' # Cyan
bakwht='\[\e[47m\]' # White
txtrst='\[\e[0m\]' # Text Reset
PS1="$bldcyn\W $bldpur\$(parse_git_branch): $txtrst"
alias .bash_profile="mate ~/.bash_profile"
alias .gitconfig="mate ~/.gitconfig"
## RAILS SPECIFIC
alias devlog="tail -f -n 100 log/development.log"
alias testlog="tail -f -n 100 log/test.log"
alias console="script/console --debugger"
alias debug="touch tmp/debug.txt;touch tmp/restart.txt"
alias ls="ls -G"
alias be="bundle exec"
## PROJECT SPECIFIC
alias work="cd /Users/danny/Projects/"
alias projects="cd /Users/danny/Projects/"
## SHOW INCOMING CONNECTIONS COUNT GROUPED BY IP
alias ddos="netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1"
## TEXTMATE
export EDITOR=mate
## RBENV
eval "$(rbenv init -)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment