Skip to content

Instantly share code, notes, and snippets.

@jhanstra
Created March 18, 2015 14:17
Show Gist options
  • Save jhanstra/69cd015682345a88c9c2 to your computer and use it in GitHub Desktop.
Save jhanstra/69cd015682345a88c9c2 to your computer and use it in GitHub Desktop.
bash_profile
# Load ~/.extra, ~/.bash_prompt, ~/.exports, ~/.aliases and ~/.functions
# ~/.extra can be used for settings you don’t want to commit
for file in ~/.{extra,bash_prompt,exports,aliases,functions}; do
[ -r "$file" ] && source "$file"
done
unset file
export PATH=$PATH:bin
export PATH=$PATH:usr/local/bin
export PYTHONPATH=/usr/local/lib/python2.7/site-packages/
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}
function removeFromPath() {
export PATH=$(echo $PATH | sed -E -e "s;:$1;;" -e "s;$1:?;;")
}
setjdk 1.7
# From Vertein
PROJECTS_HOME=~/uw/git/
UPHOME=$PROJECTS_HOME/uportal/uPortal/
function upDeployPortlet(){
pushd $UPHOME/
echo "pushed to $UPHOME"
echo "what am I deploying $@"
ant deployPortletApp -DportletApp="$@"
popd
pwd
}
function upRebuildPortlet()
{
pushd $PROJECTS_HOME/${1}/
pwd
mvn clean
mvn package | tee /tmp/${1}.build.log
echo "jared fdsafdsakl /tmp ${1}"
WAR=`cat /tmp/${1}.build.log | grep ".war" | grep "$1" | grep "Building war" | uniq | cut -d" " -f4`
echo "Deploying war $WAR"
upDeployPortlet $WAR
popd
pwd
date
}
cmdstatus(){
CMD=$1
shift
$CMD $@
RETCODE=$?
BUILD_DIR=${PWD##*/}
BUILD_CMD=`basename $CMD`
if [ $RETCODE -eq 0 ]
then
notify-send -c $BUILD_CMD -i emblem-default -t 15000 "$BUILD_DIR: $BUILD_CMD successful" "$(date)"
else
notify-send -c $BUILD_CMD -i emblem-important -t 15000 "$BUILD_DIR: $BUILD_CMD failed" "$(date)"
fi
return $RETCODE
}
# init z https://github.com/rupa/z
. ~/z/z.sh
# configure what is shown on each line
export PS1="\W \$ "
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
source ~/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment