Created
June 24, 2013 19:11
-
-
Save rappleg/5852620 to your computer and use it in GitHub Desktop.
.bash_profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vi keybindings | |
#set -o vi | |
# Color for ls | |
export CLICOLOR=true | |
export LSCOLORS="exfxcxdxbxegedabagacad" | |
# Prompt | |
if [ -f $HOME/scripts/bash/.git_ps1 ]; then | |
. $HOME/scripts/bash/.git_ps1 | |
fi | |
PS2="[\w]> " | |
# JAVA_OPTS | |
#export JAVA_OPTS="-server -Xms1024m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:NewSize=64m" | |
export GRAILS_OPTS="-Xms512M -Xmx2G -XX:PermSize=128M -XX:MaxPermSize=512M -Dfile.encoding=UTF-8" | |
export MAVEN_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=128m" | |
# Environment Variables | |
export DSE_HOME=/usr/local/dse | |
export OPSC_HOME=/usr/local/opscenter | |
export CASSANDRA_HOME=$DSE_HOME/resources/cassandra | |
export DEV_HOME=~/Development | |
export JAVA_HOME=/Library/Java/Home | |
export ANT_HOME=/usr/local/ant | |
export TOMCAT_HOME=/usr/local/tomcat | |
export GROOVY_HOME=/usr/local/groovy | |
export GRAILS_HOME=/usr/local/grails | |
export GRIFFON_HOME=/usr/local/griffon | |
#export MYSQL_HOME=/usr/local/mysql | |
export GIT_HOME=/usr/local/git | |
export M2_HOME=/usr/local/apache-maven | |
export M2=$M2_HOME/bin | |
export SCRIPTS=/usr/local/scripts | |
export EDITOR=vi | |
export PATH=$DSE_HOME/bin:$OPSC_HOME/bin:$CASSANDRA_HOME/bin:$GIT_HOME/bin:$DEV_HOME/Scripts:$ANT_HOME/bin:$TOMCAT_HOME/bin:$GRAILS_HOME/bin:$GROOVY_HOME/bin:$GRIFFON_HOME/bin:$SCRIPTS/grails/env-switch:$PATH | |
# Developer | |
export PATH=/Developer/usr/bin:$PATH | |
# Rabbit MQ Scripts | |
PATH=$PATH:/usr/local/sbin | |
# Vert X | |
PATH=$PATH:/usr/local/sbin | |
# Bash Completion | |
if [ -f `brew --prefix`/etc/bash_completion ]; then | |
. `brew --prefix`/etc/bash_completion | |
fi | |
# Aliases | |
alias c='clear' | |
alias x='exit' | |
alias df='df -h' | |
alias du='du -h' | |
alias t='telnet' | |
alias la='ls -hal' | |
alias ll='ls -hl' | |
alias ls='ls -F -CF -color' | |
alias ls1='ls -1' | |
alias cd..='cd ..' | |
alias pro='vi ~/.bash_profile' | |
alias srcpro='. ~/.bash_profile' | |
alias mate='open -a TextMate.app' | |
# Rabbit MQ Aliases | |
alias mq-stop='cd /usr/local/sbin; ./rabbitmqctl stop' | |
alias mq-start='rabbitmq-server -detached' | |
alias mq-st='cd /usr/local/sbin; ./rabbitmqctl status' | |
# Grails Aliases | |
alias testgrails='./gradlew install' | |
alias buildgrails='./gradlew -stacktrace --refresh-dependencies --continue clean populateDependencies test' | |
alias g='grails' | |
alias gra='echo "" > stacktrace.log; grails run-app' | |
alias grac='echo "" > stacktrace.log; grails clean; grails run-app' | |
alias grad='echo "" > stacktrace.log; grails-debug grails run-app' | |
# grails > 1.2 | |
export GRAILS_TEST_LOG_DIRECTORY=target/test-reports | |
# after grails-test if there were ERROR messages, you can open those logs with the Console.app using this | |
alias testlog='for F in `grep -lE "FAILED|Caused\ an\ ERROR" $GRAILS_TEST_LOG_DIRECTORY/plain/*.txt`; do echo ">>> opening" $F; mate $F; done;' | |
# grails-debug-suspend doesn't exist by default, it's a copy of grails-debug with the suspend flag changed to "y" so that | |
# we can attach a remote debugger before it proceeds past startup | |
# aliases where you can optionally pass in a set of tests to run (or no argument to run all tests in that group) | |
alias gta=grailsTestApp | |
alias gtac=grailsTestAppClean | |
alias gtad=grailsTestAppDebug | |
alias gtau=grailsTestAppUnit | |
alias gtaud=grailsTestAppUnitDebug | |
alias gtai=grailsTestAppIntegration | |
alias gtaid=grailsTestAppIntegrationDebug | |
alias gtafu=grailsTestAppFunctional | |
alias gtafud=grailsTestAppFunctionalDebug | |
# aliases that will rerun any failed tests (or all tests if there aren't any failed tests) | |
alias gtaf=grailsTestAppFailed | |
alias gtadf=grailsTestAppDebugFailed | |
alias gtauf=grailsTestAppUnitFailed | |
alias gtaudf=grailsTestAppUnitDebugFailed | |
alias gtaif=grailsTestAppIntegrationFailed | |
alias gtaidf=grailsTestAppIntegrationDebugFailed | |
alias gtafuf=grailsTestAppFunctionalFailed | |
alias gtafudf=grailsTestAppFunctionalDebugFailed | |
function grailsTestApp() { | |
grailsTest grails unit: integration: $1 | |
} | |
function grailsTestAppClean() { | |
grails clean; grailsTest grails unit: integration: $1 | |
} | |
function grailsTestAppFailed() { | |
grailsFailedTests grails "" | |
} | |
function grailsTestAppDebug() { | |
grailsTest grails-debug-suspend "" $1 | |
} | |
function grailsTestAppDebugFailed() { | |
grailsFailedTests grails-debug-suspend "" | |
} | |
function grailsTestAppUnit() { | |
grailsTest grails unit: $1 | |
} | |
function grailsTestAppUnitFailed() { | |
grailsFailedTests grails unit: | |
} | |
function grailsTestAppUnitDebug() { | |
grailsTest grails-debug-suspend unit: $1 | |
} | |
function grailsTestAppUnitDebugFailed() { | |
grailsFailedTests grails-debug-suspend unit: | |
} | |
function grailsTestAppIntegration() { | |
grailsTest grails integration: $1 | |
} | |
function grailsTestAppIntegrationFailed() { | |
grailsFailedTests grails integration: | |
} | |
function grailsTestAppIntegrationDebug() { | |
grailsTest grails-debug-suspend integration: $1 | |
} | |
function grailsTestAppIntegrationDebugFailed() { | |
grailsFailedTests grails-debug-suspend integration: | |
} | |
function grailsTestAppFunctional() { | |
grailsTest grails functional: $1 | |
} | |
function grailsTestAppFunctionalFailed() { | |
grailsFailedTests grails functional: | |
} | |
function grailsTestAppFunctionalDebug() { | |
grailsTest grails-debug-suspend functional: $1 | |
} | |
function grailsTestAppFunctionalDebugFailed() { | |
grailsFailedTests grails-debug-suspend functional: | |
} | |
function grailsFailedTests() { | |
FAILED_TESTS='' | |
for F in `grep -lE "FAILED|Caused\ an\ ERROR" $GRAILS_TEST_LOG_DIRECTORY/plain/*.txt`; do | |
FAILED_TESTS="$FAILED_TESTS `echo $F | sed -E 's/.*TEST-.*-.*-(.*)Tests.txt/\1/g'`" | |
done; | |
echo "failed tests: $FAILED_TESTS" | |
grailsTest $1 $2 $FAILED_TESTS | |
} | |
function grailsTest() { | |
echo "Running: $1 test-app $2 $3 || testlog " | |
time $1 test-app $2 $3 || testlog | |
} | |
# GIT aliases | |
if [ -f ~/scripts/bash/.git_aliases ]; then | |
. $HOME/scripts/bash/.git_aliases | |
fi | |
alias log='tail -100f /usr/local/tomcat/logs/catalina.out' | |
alias longlog='tail -1000f /usr/local/tomcat/logs/catalina.out' | |
alias ip='ifconfig en0 |grep inet |grep -v inet6' | |
# MySql aliases | |
#alias mysql=/usr/local/mysql/bin/mysql | |
#alias mysqladmin=/usr/local/mysql/bin/mysqladmin | |
alias dbl='mysql -u root -p datamgmt_dev' | |
# Rebuild the LaunchServices database (http://www.macosxhints.com/article.php?story=20071102084155353) | |
alias rebuildlaunchdb='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user' | |
# SSH Tunnel | |
alias tunnel='ssh -D 8888 -f -C -q -N' $1 | |
# Tab completion config | |
# shopt -s progcomp | |
# . ~/.tab_completion_rc | |
# Tab completion for known hosts | |
# complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh | |
function rm () { | |
local path | |
for path in "$@"; do | |
# ignore any arguments | |
if [[ "$path" = -* ]]; then : | |
else | |
local dst=${path##*/} | |
# append the time if necessary | |
while [ -e ~/.Trash/"$dst" ]; do | |
dst="$dst "$(date +%H-%M-%S) | |
done | |
mv "$path" ~/.Trash/"$dst" | |
fi | |
done | |
} | |
# MacPorts Installer addition on 2012-06-27_at_10:50:59: adding an appropriate PATH variable for use with MacPorts. | |
export PATH=/opt/local/bin:/opt/local/sbin:$PATH | |
# Finished adapting your PATH environment variable for use with MacPorts. | |
#THIS MUST BE AT THE END OF THE FILE FOR GVM TO WORK!!! | |
[[ -s "/Users/rappleg/.gvm/bin/gvm-init.sh" ]] && source "/Users/rappleg/.gvm/bin/gvm-init.sh" | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment