Skip to content

Instantly share code, notes, and snippets.

@nnja
Last active December 18, 2015 18:29
Show Gist options
  • Save nnja/5825791 to your computer and use it in GitHub Desktop.
Save nnja/5825791 to your computer and use it in GitHub Desktop.
# Setup Amazon EC2 CLI
export EC2_HOME=~/.ec2
export EC2_PRIVATE_KEY=`ls $EC2_HOME/pk-*.pem`
export EC2_CERT=`ls $EC2_HOME/cert-*.pem`
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home/
# Path entry for AWS EC2 Command line tools
PATH=$PATH:$EC2_HOME/bin
# Path entry for AWS CLI Elastic Bean Command line tools
#PATH=/Users/nina/software/aws-cli/eb/macosx/python2.7:$PATH
# Ruby Stuff
PATH=$HOME/.rbenv/bin:$PATH
eval "$(rbenv init -)"
# pyramid stuff
export PYRAMID_RELOAD_TEMPLATES=1
## terminal colors
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export GREP_OPTIONS='--color=always'
### aliases
alias dev='ssh dev'
### raspberry pi, local network
alias pim='ssh -X pi@169.254.0.1 lxsession'
alias pi='ssh -X pi@169.254.0.1'
# navigation
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
# mac specific
alias finder='open .'
alias ql='qlmanage -p 2>/dev/null'
alias lock='/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend'
# start git aliases
alias ga='git add'
alias gp='git push'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gm='git commit -m'
alias gma='git commit -am'
alias gb='git branch'
alias gc='git checkout'
alias gpu='git pull'
alias fulldiff='git diff origin/master...HEAD'
# other stuff
alias lsl='ls -laGpFh'
# set up colors
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_BLUE="\[\033[01;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
LIGHT_CYAN="\[\033[1;36m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\033[00m\]"
LIGHT_YELLOW="\[\033[1;33m\]"
# git stuff
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
function prompt_func() {
if [ -n "$VIRTUAL_ENV" ]
then VENV_NAME="($(basename ${VIRTUAL_ENV}))"
else VENV_NAME=""
fi
prompt="${LIGHT_GREY}${VENV_NAME}${TITLEBAR}${LIGHT_CYAN}\u${LIGHT_YELLOW}(\w)${GREEN}$(parse_git_branch)${LIGHT_YELLOW} \$${COLOR_NONE} "
PS1="${prompt}"
}
PROMPT_COMMAND=prompt_func
. /Users/nina/util/scripts/git-completion.bash
# rabbit mq stuff
alias rabbit_start='sudo ~/software/rabbitmq_server-3.1.1/sbin/rabbitmq-server -detached'
alias rabbit='sudo ~/software/rabbitmq_server-3.1.1/sbin/rabbitmqctl'
### Added by the Heroku Toolbelt
PATH="/usr/local/heroku/bin:$PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment