The quintessential random's local profile ||| http://elliottcable.name/
# Created by elliottcable (elliottcable.name)
# Licensed as Creative Commons BY-NC-SA 3.0 (creativecommons.org/licenses/by-nc-sa/3.0)
# -------------------------------------
# The allmighty .profile!
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
cd ~/
if [ ! -f /etc/system ]; then
# No system type! Can't use this bash profile.
echo -e "** No /etc/system file! ${RED}Going down NOW.${CLEAR} **"
sleep 2
exit
fi
. /etc/system
export SYSTEM_OSX='Mac OS X'
export SYSTEM_TIGER='Mac OS X 10.4'
export SYSTEM_LEOPARD='Mac OS X 10.5'
export SYSTEM_CENTOS='Centos'
if [ -f ~/.profile_local ]; then
. ~/.profile_local
fi
# fix less
export PAGER='less'
export LESS='-fXemPm?f%f .?lbLine %lb?L of %L..:$' # Set options for less command
export HISTIGNORE=''
export HISTSIZE=100000
export HISTFILESIZE=409600
if [[ $SYSTEM =~ $SYSTEM_OSX ]]; then
export EDITOR='mate -w'
export VISUAL='mate -w'
else
export EDITOR='vim'
export VISUAL='vim'
fi
export PAGER='less'
export CLICOLOR='yes'
export INPUTRC='~/.inputrc'
export EVENT_NOKQUEUE=1 # for memcached
export LD_LIBRARY_PATH=/usr/local/lib # for pound
alias q='exit'
alias m='mate'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias mkdir='mkdir -p'
alias trash="mv $1 ~/.Trash"
if [[ $SYSTEM =~ $SYSTEM_CENTOS ]]; then
alias ls='ls --color=always -lAFh'
else
alias ls='ls -lAFh'
fi
alias cdd='cd - ' # goto last dir cd'ed from
alias sus='screen -US'
alias sls='screen -list'
alias surd='screen -aAURD'
alias irb='irb --readline -r irb/completion'
alias control='sudo /srv/script/control'
alias sapr='sudo apachectl restart'
alias e='mate .'
alias et='mate .' # d-:
alias ett='mate app config lib db public spec test vendor/plugins Rakefile &'
alias etts='mate app config lib db public script spec test vendor/plugins Rakefile &'
alias ettttttt='echo "u r a nooblet!!!!1!"' # d-:
alias sc='./script/console'
alias ss='./script/server'
alias ri='ri -Tf ansi'
alias df='df -kTh'
if [[ $SYSTEM =~ $SYSTEM_LEOPARD ]]; then
alias rails="/usr/bin/rails"
export ERAILS='/Library/Open Source/Ruby on Rails/Edge'
elif [[ $SYSTEM =~ $SYSTEM_TIGER ]]; then
alias rails="ruby /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.3/bin/rails"
export ERAILS='/Library/Rails/source/edge'
else
alias rails="ruby /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/bin/rails"
export ERAILS='/usr/src/rails/edge'
fi
alias erails="ruby $ERAILS/railties/bin/rails"
alias sshewn='ssh enterwiki@enterwiki.net'
alias sshme='ssh elliottcable@elliottcable.com'
alias sshde='ssh deploy@elliottcable.com'
alias grep='grep --color=auto'
# if [[ ! $SYSTEM =~ $SYSTEM_CENTOS ]]; then
# alias mysql='/usr/local/mysql/bin/mysql'
# alias mysqladmin='/usr/local/mysql/bin/mysqladmin'
# alias mysqlstart='sudo /usr/local/mysql/bin/mysqld_safe -d'
# fi
alias tu='top -o cpu'
alias tm='top -o vsize'
alias sco='svn co'
alias sup='svn up'
alias sci='svn ci -m'
alias saa='svn status | grep "^\?" | awk "{print \$2}" | xargs svn add'
alias sclr='find . -name .svn -print0 | xargs -0 rm -rf'
if [[ $SYSTEM =~ $SYSTEM_CENTOS ]]; then
alias supbs='sudo /srv/script/control update backstage'
alias supstage='sudo /srv/script/control update stage'
fi
alias xt='exit'
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
# Cache, and complete, Cheats
if [ ! -r ~/.cheats ]; then
echo "Rebuilding Cheat cache... "
cheat sheets | egrep '^ ' | awk {'print $1'} > ~/.cheats
fi
complete -W "$(cat ~/.cheats)" cheat
if [ -f /usr/local/bin/rake_completion ]; then
complete -C /usr/local/bin/rake_completion -o default rake
fi
if [[ $SYSTEM =~ $SYSTEM_TIGER ]]; then
alias gem="MACOSX_DEPLOYMENT_TARGET=10.4 gem"
elif [[ $SYSTEM =~ $SYSTEM_LEOPARD ]]; then
alias gem="MACOSX_DEPLOYMENT_TARGET=10.5 gem"
fi
if [[ $SYSTEM =~ $SYSTEM_OSX ]]; then
export FIGNORE=DS_Store
fi
export LANG=en_US.UTF-8
# Create files as u=rwx, g=rx, o=rx
umask 022
shopt -s cdspell
# Tab complete for sudo
complete -cf sudo
#prevent overwriting files with cat
set -o noclobber
#stops ctrl+d from logging me out
set -o ignoreeof
#Treat undefined variables as errors
set -o nounset