# we'll split this up into multiple files for a super dot-files setup export EDITOR="/opt/local/bin/mate -w" export CVSEDITOR="/opt/local/bin/mate -w" export SVN_EDITOR="/opt/local/bin/mate -w" export PATH=$PATH:"/Users/drnic/bin" export PATH=$PATH:"/Users/drnic/Documents/ruby/bin" #export PATH=$PATH:"$JRUBY_HOME/bin" export PATH=$PATH:"/Users/drnic/Applications/jets3t-0.5.0/bin" export RUBYGEMS_PATH="/opt/local/lib/ruby/gems/1.8/gems/" export RAILS_APPS="~/Documents/rails_apps" export CLASSPATH=$CLASSPATH:"/Users/drnic/Documents/java/junit4.3.1/junit-4.3.1.jar" export SVN_USER="drnic" # FINK initialisation . /sw/bin/init.sh # http://errtheblog.com/post/33 complete -C /Users/drnic/Documents/ruby/bin/rake_autocomplete -o default rake complete -C /Users/drnic/Documents/ruby/bin/sake_autocomplete -o default sake complete -C /Users/drnic/Documents/ruby/bin/cap_autocomplete -o default cap # complete -C gem_autocomplete -o default edit_gem # complete -C gem_autocomplete -o default find_gem # complete -C gem_autocomplete -o default gem # complete -C gem_autocomplete -o default "sudo gem" function have() { unset -v have PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null && have="yes" } . /Users/drnic/.profile_helpers/ruby-bash-completion/gem . /Users/drnic/.profile_helpers/misc-bash-completion/script-generate complete -C rails_plugin_autocomplete -o default "./script/plugin" complete -C rails_plugin_autocomplete -o default "ruby script/plugin" # complete -C git_autocomplete -o default git source ~/bin/git-completion.sh complete -C git_autocomplete -o default gco alias ll='ls -laf' alias lrt='ls -lart' alias et="mate ." alias etr="mate app config db lib public test" alias etrp="mate app config db lib public test vendor/plugins" alias etim="mate app config lib public public/javascripts/jsviz/0.3.3 test" alias r='iterm.sh $1' # alias imindi="cd /Users/drnic/Documents/rails_apps/imindi_article_editing" alias imindi="cd \`latest_branch --app=imindi\`" alias ssh_imindi='ssh -l deploy 208.78.97.164' alias ssh_idofme='ssh -l deploy 67.207.146.33' alias ssh_academy='ssh -l deploy 208.78.99.82' alias ssh_drnic='ssh -l anaptism mocra.com' alias ssh_drnicacademy='ssh -l deploy 208.78.99.82' alias ssh_myconfplan='ssh -l serveradmin@myconfplan.com s17337.gridserver.com' ####### # GIT # ####### alias gst='git status' alias gl='git pull' alias gp='git push' alias gpa='git push-all' # see [alias] in ~/.gitconfig alias gd='git diff | mate' alias ga='git add' alias gcl='git config --list' alias gc='git commit -v' alias gca='git commit -v -a' alias gb='git branch' alias gbc='git branch --color' alias gba='git branch -a' alias gco='git checkout' alias gdc='git-svn dcommit' alias gk='gitk --all &' alias gpatch='git diff master -p' # alias up='sake git:update' - need to priorities origin vs git-svn function gpall() { git push rubyforge master --tags git push origin master --tags } alias gitrm="git stat | grep deleted | awk '{print $3}' | xargs git rm" alias gitx="open -b nl.frim.GitX" parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } PS1="\w\$(parse_git_branch) $ " ####### # SVN # ####### alias sup='svn up' # trust me 3 chars makes a different alias sst='svn st' # local file changes alias sstu='svn st -u' # remote repository changes alias scom='svn commit' # commit alias svnclear='find . -name .svn -print0 | xargs -0 rm -rf' # removes all .svn folders from directory recursively alias svnaddall='svn status | grep "^\?" | awk "{print \$2}" | xargs svn add' # adds all unadded files alias svns='svn status' alias svnci='svn ci' alias svna='svn add' alias svnr='svn remove' alias svn_branch_start='svn log --verbose --stop-on-copy .' alias svnaddall='svn st | grep "?" | sed -e "s/? *//" | xargs svn add' ######### # MySQL # ######### alias start_mysql='sudo mysqld_safe --user=mysql &' ############ # POSTGRES # ############ alias pgstart="/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start" alias pgstop="/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile stop" alias pgreload="/usr/local/pgsql/bin/pg_ctl reload" # For WD export WDHOME=$HOME/.wd source $WDHOME/wdaliases.sh # perforce/p4 export P4CONFIG=.p4config # Setting PATH for MacPython 2.5 # The orginal version is saved in .profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}" export PATH # alias tm_dialog=/Applications/TextMate.app/Contents/PlugIns/Dialog.tmplugin/Contents/Resources/tm_dialog alias tm_dialog=~/"Library/Application\ Support/TextMate/PlugIns/Dialog.tmplugin/Contents/Resources/tm_dialog" ######### # SHELL # ######### function pwdcopy() { pwd | pbcopy } function hf() { history | grep $1 } function findgrep { find * -exec grep -l "$1" {} \; } function findname { find * -name "$1" } ######## # RUBY # ######## alias r='rake' # its one of my top commands in history alias a='autotest' # makes autotesting even quicker alias anc='NO_CONNECTION=1 autotest' # makes autotesting even quicker alias gemi="sudo gem install" alias cbp="pbpaste | sake pastie:send | xargs open" function pastiepackcommit() { git show $1 | grep "+++ b" | sed -e "s/+++ b\///" | pastiepacker | xargs open } function glg() { gem list | grep $1 } function gemdocs() { if [[ -n "$(which gem_server)" ]]; then gem_server >/dev/null 2>&1 & sleep 5 open http://127.0.0.1:8808/ fi } gemdoc() { local gemdir=`gem env gemdir` open $gemdir/doc/`ls $gemdir/doc/ | grep $1 | sort | tail -1`/rdoc/index.html } _gemdocomplete() { COMPREPLY=($(compgen -W '$(ls `gem env gemdir`/doc)' -- ${COMP_WORDS[COMP_CWORD]})) return 0 } complete -o default -o nospace -F _gemdocomplete gemdoc alias rake?="rake -T | grep $1" ######### # RAILS # ######### alias ss='mongrel_rails start' # start up the beast alias server="ruby script/server" alias sc='script/console' # obvious alias console="ruby script/console development" alias gen="ruby script/generate" alias destroy="ruby script/destroy" alias jsa="script/js_autotest" # generate something, and svn add anything new function sgen() { gen $1 $2 $3 $4 $5 $6 | grep " *create " | sed -e "s/ *create *//" | xargs svn add } function erails() { ruby ~/Documents/ruby/gems/rails/railties/bin/rails -d mysql $1 && cd $1 && cp -R ~/Documents/ruby/gems/rails vendor/rails && rm -rf vendor/rails/.git && ruby script/generate app_layout --force && ruby script/generate home_route . --force && rm public/index.html && ruby script/generate check_migration_version && git init && git add . && git commit -m "Initial import" && mate . } alias readrails="mate `ruby -rubygems -e "puts( ['rails', 'activerecord', 'actionwebservice', 'actionpack', 'activesupport'].collect { |gem| gems = Gem.source_index.find_name(gem); gems.last.full_gem_path; }.join(' '))"`" alias readerails="mate ~/Documents/ruby/gems/rails" # capistrano alias cap1="cap _1.4.1_" alias capst="cap1 show_tasks" alias capstg="cap1 show_tasks | grep " # tail log alias taildev='tail -f log/development.log' alias tailtest='tail -f log/test.log' # rdoc alias rdoc_ar='open ~/gems/rails/activerecord/doc/index.html' alias rdoc_ap='open ~/gems/rails/actionpack/doc/index.html' alias rdoc_as='open ~/gems/rails/activesupport/doc/index.html' ######### # MERB # ######### export MERB_ORM=datamapper export MERB_TEST_SUITE=spec ######### # JRUBY # ######### # export PATH=$PATH:/Users/drnic/java/jruby/bin # export JRUBY_HOME="/Users/drnic/Documents/java/jruby" export PATH=$PATH:/usr/local/jruby/bin export JRUBY_HOME=/usr/local/jruby export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home # export CLASSPATH=/usr/local/jruby/lib/jdbc/postgresql.jdbc3.jar ############## # JAVASCRIPT # ############## export BROWSERS=safari,firefox ########### # GENERAL # ########### alias home='cd ~' # the tilda is too hard to reach alias l='ls -lah' # l for list style, a for all including hidden, h for human readable file sizes alias h='history' # shortcut for history alias c='clear' # shortcut to clear your terminal alias ..='cd ..' # move up 1 dir alias ...='cd ../..' # move up 2 dirs alias eprof='mate ~/.bash_profile' # because i edit my bash_profile a lot with new things alias sprof='source ~/.bash_profile' # same as previous, after editing you have to source it for the new stuff to work function f() { find * -name $1 } function manpdf() { man -t $@ | open -f -a /Applications/Preview.app/ } # Setting PATH for MacPython 2.5 # The orginal version is saved in .profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}" export PATH export RUBYDOCTEST="ruby /Users/drnic/gems/rubydoctest/bin/rubydoctest" ############ # ORACLE ### ############ export DYLD_LIBRARY_PATH="/usr/local/oracle/instantclient_10_2" export SQLPATH="/usr/local/oracle/instantclient_10_2" export TNS_ADMIN="/usr/local/oracle/network/admin" # export NLS_LANG="AMERICAN_AMERICA.UTF8" export PATH=$PATH:$DYLD_LIBRARY_PATH # from http://blog.macromates.com/2008/working-with-history-in-bash/ export HISTCONTROL=erasedups export HISTSIZE=10000 shopt -s histappend # replacement netstat cmd to find ports used by apps on OS X alias netstat_osx="sudo lsof -i -P"