Skip to content

Instantly share code, notes, and snippets.

@alvaromuir
Last active November 26, 2016 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alvaromuir/f098a6e35687f7693e46 to your computer and use it in GitHub Desktop.
Save alvaromuir/f098a6e35687f7693e46 to your computer and use it in GitHub Desktop.
PS1="\n\u@\h: \[\e[1;36m\]\w\n\[\e[1;32m\]=> \[\e[0m\]"
alias ls='ls -G'
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH=/Users/alvaro/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1
export EC2_HOME=/usr/local/ec2/api-tools
export EC2_AMITOOL_HOME=/usr/local/ec2/ami-tools
if [[ -r /usr/local/bin/virtualenvwrapper.sh ]]; then
source /usr/local/bin/virtualenvwrapper.sh
else
echo "WARNING: Can't find virtualenvwrapper.sh"
fi
# Django
export DATABASE_URL=postgres://localhost/${PWD##*/}
export PYTHONSTARTUP=~/.pythonrc
alias migrate='bin/rake db:migrate && bin/rake db:test:prepare'
alias resetdb='bin/rake db:drop:all && bin/rake db:create:all && bin/rake db:migrate && bin/rake db:test:prepare && bin/rake db:seed'
alias migratetest='bin/rake db:migrate RAILS_ENV=test'
alias hra='heroku restart --app'
alias herokuresetdb='heroku pg:reset HEROKU_POSTGRESQL_JADE_URL'
alias rconsole='bin/rails c'
alias webserver='python -m SimpleHTTPServer'
alias mysqlserver='/usr/local/bin/mysql.server'
alias mongod-start='launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist'
alias mongod-stop='launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist'
alias postgres-start='launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist'
alias postgres-stop='launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist'
alias hive='/usr/local/hive/bin/hive --database=workspace_db'
alias hivedebug='hive --hiveconf hive.root.logger=INFO,console'
alias hive2='$HIVE_HOME/bin/beeline --color=true --showHeader=true --headerInterval=10 -u jdbc:hive2://localhost:10000/workspace_db -n alvaro'
alias start-all='$HADOOP_HOME/sbin/start-dfs.sh; $HADOOP_HOME/sbin/start-yarn.sh'
alias stop-all='$HADOOP_HOME/sbin/stop-yarn.sh; $HADOOP_HOME/sbin/stop-dfs.sh'
alias spark-repl='/usr/local/spark/bin/spark-shell'
alias docker-stopall='docker stop `docker ps -q`'
alias docker-purge='docker rm `docker ps -aq --no-trunc --filter "status=exited"`'
alias docker-prune='docker rmi `docker images --filter 'dangling=true' -q --no-trunc`'
alias irb='osascript -e "tell application \"Terminal\" to set background color of window 1 to {13000,0,0,-20750}" && irb'
alias python='osascript -e "tell application \"Terminal\" to set background color of window 1 to {0,0,24000,-20750}" && python'
alias node='osascript -e "tell application \"Terminal\" to set background color of window 1 to {0,13000,0,-20750}" && node'
alias swift='osascript -e "tell application \"Terminal\" to set background color of window 1 to {40606,13621,0,1,-20750}" && swift'
alias scala='osascript -e "tell application \"Terminal\" to set background color of window 1 to {16896,2816,3072,-20750}" && scala'
alias r='osascript -e "tell application \"Terminal\" to set background color of window 1 to {10800,12300,13900,-20750}" && r'
alias julia='osascript -e "tell application \"Terminal\" to set background color of window 1 to {16900,11900,19000,-20750}" && julia'
alias ipython='osascript -e "tell application \"Terminal\" to set background color of window 1 to {15045,26775,40035,-20750}" && ipython'
alias reinit='osascript -e "tell application \"Terminal\" to set background color of window 1 to {0,0,0,-20750}" && `source ~/.profile`'
alias setswift1='sudo xcode-select -s /Applications/Xcode.app/Contents/Developer'
alias setswift2='sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer'
export PATHexport PATH=/usr/local/bin:$PATH
eval "$(rbenv init -)"
function check_for_virtual_env {
[ -d .git ] || git rev-parse --git-dir &> /dev/null
if [ $? == 0 ]; then
local ENV_NAME=`basename \`pwd\``
if [ "${VIRTUAL_ENV##*/}" != $ENV_NAME ] && [ -e $WORKON_HOME/$ENV_NAME/bin/activate ]; then
workon $ENV_NAME && export CD_VIRTUAL_ENV=$ENV_NAME
fi
elif [ $CD_VIRTUAL_ENV ]; then
deactivate && unset CD_VIRTUAL_ENV
fi
}
function cd {
builtin cd "$@" && check_for_virtual_env
}
check_for_virtual_env
PHP_AUTOCONF="/usr/local/bin/autoconf"
source /usr/local/opt/nvm/nvm.sh
function reset {
`osascript -e "tell application \"Terminal\" to set background color of window 1 to {0,0,0,-20750}"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment