Skip to content

Instantly share code, notes, and snippets.

@bendaizer
Created April 9, 2013 13:22
Show Gist options
  • Save bendaizer/5345653 to your computer and use it in GitHub Desktop.
Save bendaizer/5345653 to your computer and use it in GitHub Desktop.
.bash_profile file I use at work
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
black='\[\e[0;30m\]'
GREY='\[\e[1;30m\]'
red='\[\e[0;31m\]'
RED='\[\e[1;31m\]'
green='\[\e[0;32m\]'
GREEN='\[\e[1;32m\]'
brown='\[\e[0;33m\]'
YELLOW='\[\e[1;33m\]'
blue='\[\e[0;34m\]'
BLUE='\[\e[1;34m\]'
purple='\[\e[0;35m\]'
PURPLE='\[\e[1;35m\]'
cyan='\[\e[0;36m\]'
CYAN='\[\e[1;36m\]'
grey='\[\e[0;37m\]'
WHITE='\[\e[1;37m\]'
reset='\[\e[0m\]'
PS1="\n${red}\u${reset}@${red}\h${reset} ${YELLOW}[${reset}\W${YELLOW}]${reset}> "
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
export GIT_PATH=/usr/local/git/bin
export MYSQL_PATH=/usr/local/mysql/bin
export IPYTHON=/usr/local/share/python
export SCRIPTS_PATH=~/scripts
export LATEX_PATH=/usr/texbin
export PATH=${PATH}:${IPYTHON}:${MYSQL_PATH}:${GIT_PATH}:${LATEX_PATH}:${SCRIPTS_PATH}:/usr/local/sbin:
export JAVA_HOME=$(/usr/libexec/java_home)
# Tell ls to be colourful
export CLICOLOR=1
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl'
alias sed='ssed'
alias l='ls -CF'
alias ll='ls -l'
alias la='ls -a'
alias lal='la -alh'
alias l.='ls -d .* --color=auto'
alias mysql='/usr/local/mysql/bin/mysql'
alias mysqladmin='/usr/local/mysql/bin/mysqladmin'
alias mysql.server='/usr/local/mysql/support-files/mysql.server'
alias showhidden='defaults write com.apple.Finder AppleShowAllFiles TRUE && killall Finder'
alias hidehidden='defaults write com.apple.Finder AppleShowAllFiles FALSE && killall Finder'
alias sourceprofile="source ~/.bash_profile"
alias ..='cd ..'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
alias ......='cd ../../../../../'
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
mcd() {
mkdir -p "$1" && cd "$1";
}
calc() {
python -c "print $1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment