Skip to content

Instantly share code, notes, and snippets.

@elijahr
Created February 2, 2012 17:16
Show Gist options
  • Save elijahr/1724649 to your computer and use it in GitHub Desktop.
Save elijahr/1724649 to your computer and use it in GitHub Desktop.
elijahr .bash_profile
#!/bin/bash
#######
# My .bash_profile
#######
export LANG=en_US.UTF-8
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \1/'
}
# add my ssh public keys
find ~/.ssh/ -name "*.pem" | while read FILENAME; do
ssh-add $FILENAME
done
export PS1='\[\e[1;37m\][\[\e[1;35m\]\u\[\e[1;37m\]@\[\e[1;32m\]\h\[\e[1;37m\]:\[\e[1;36m\]\w\[\e[1;33m\]$(type -t parse_git_branch | grep$
spkgs(){
# echos the path to site-packages in the current python environment
# use like:
# $ cd `spkgs`
# this is a crossplatform way of simulating "readlink -f" to get the actual thing pointed at by a symlink
PYBIN=$(python -c 'import os,sys;print os.path.realpath(sys.argv[1])' `which python`)
BINDIR=$(dirname $PYBIN)
PYVERSION=$(basename $PYBIN)
echo `cd $BINDIR/../lib/$PYVERSION/site-packages/; pwd`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment