Skip to content

Instantly share code, notes, and snippets.

@alexkilla
Last active May 5, 2021 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexkilla/91fae65fe60e274108da09214bb08f50 to your computer and use it in GitHub Desktop.
Save alexkilla/91fae65fe60e274108da09214bb08f50 to your computer and use it in GitHub Desktop.
This is my bash profile
# Ifortune
# In some cases you might need this
export TZ="UTC"
# This is to avoid to have further problems with compass
export LANG=en_US.UTF-8
export PATH="/System/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export WORKON_HOME=~/Envs
# Set up primary paths
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/sbin:$PATH
export PATH=$HOME/bin:$PATH
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH
export PATH=/Users/achavez/.rvm/gems/ruby-2.5.1/bin:$PATH
export PATH=/usr/local/bin:/usr/local/opt/postgresql@9.4/bin:$PATH
export MANPATH=/usr/local/opt/coreutils/libexec/gnuman:$MANPATH
# Set up development paths
export JAVA_HOME=`/usr/libexec/java_home -v1.8`
export ANT_HOME=/usr/share/ant
export MAVEN_HOME=/usr/share/maven/apache-maven-3.2.3
export M3_HOME=$MAVEN_HOME
export M3=$MAVEN_HOME/bin
# Add development paths to PATH
export PATH=$JAVA_HOME/bin:$PATH
export PATH=$ANT_HOME/bin:$PATH # your PATH MUST have this directory before the /usr/bin directory
export PATH=$MAVEN_HOME:$PATH
export PATH=$M2:$PATH
export PLATFORM=/usr/local/platform # does this even exist?
export PG_HOME=/Library/PostgreSQL/9.6
export PGDATA=/Library/PostgreSQL/9.6/data
export PATH=$PG_HOME/bin:$PATH;
# Set up development variables (see below for heap issues)
export MAVEN_OPTS='-Xmx2G -XX:PermSize=128M -XX:MaxPermSize=256m -Djava.awt.headless=true'
# If server does not start up due to Heap issues, you can use the below
# export MAVEN_OPTS='-Xmx2G -Xms2G -XX:PermSize=128M -XX:MaxPermSize=256m -Xdebug -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n'
export ANT_OPTS='-Xmx1024m -Djava.awt.headless=true'
export EDITOR='/usr/bin/vi'
export APP_SERVER_IP=docker.for.mac.localhost
export DB_DATA_DIR=~/mount/postgres/data
################################ THIS ARE MY ALIAS #################################
alias forward='sudo pfctl -ef /etc/pf-switchfly.conf'
alias dev='cd ~/dev/repos/dev'
alias goRuby='cd ~/ruby/headFirstRuby'
alias crewhome='cd ~/crewapp'
alias qbd='ant quick.build.deploy && osx-notifier --message "listo qbd" && say "done quick build deploy"'
alias java8='export JAVA_HOME=`/usr/libexec/java_home -v1.8`'
alias java7='export JAVA_HOME=`/usr/libexec/java_home -v1.7`'
alias build='mvn clean install -DskipTests=true && osx-notifier --message "done build NO dependencies" && say "done build NO dependencies"'
alias build_d='mvn clean install -Pdependencies -DskipTests=true -U && osx-notifier --message "done build dependencies" && say "done build dependencies"'
alias tests='mvn clean install && osx-notifier --message "done tests"'
alias gradlew='~/dev/repos/dev/gradlew'
alias mirror= 'ant mirror_client && osx-notifier --message "done mirror client"'
alias dcfm="ant deploy.cf_all"
alias ibp="initialize_branch_properties"
alias migrate="git reset --hard && gl && ant migrate"
alias docker_stop_all="docker stop $(docker ps -q)"
alias docker_remove_all="docker rm $(docker ps -q)"
########################################### CREW VARIABLES ######################################################
DEV_HOME="~/Development/"
function deploy() {
CLEAN_CMD=""
WAR_CMD=""
if [[ $# -eq 0 ]]; then
CLEAN_CMD="clean"
WAR_CMD="war"
else
for i in $@; do
CLEAN_CMD="$CLEAN_CMD ${i}:clean"
WAR_CMD="$CLEAN_CMD ${i}:war"
done
fi
CMD="docker-compose rm -s -f $@ && ./gradlew $WAR_CMD && docker-compose up -d $@ && docker-compose logs $@";
eval ${CMD}
}
alias deployApi="docker-compose rm -s -f api && ./gradlew war && docker-compose up -d api && dtail -f"
alias crewUp="docker-compose up -d mongo dynamodb dynamodb_admin &&
docker-compose up -d crew-sqs &&
docker-compose up -d redis-cache &&
docker-compose up -d redis-cluster &&
docker-compose up -d haproxy &&
docker-compose up -d crew-activemq &&
docker-compose up -d batch-api &&
docker-compose up -d ws &&
docker-compose up -d crew-sqs &&
docker-compose up -d api &&
docker-compose up -d consumer &&
docker-compose up -d analytics"
alias dapi="docker exec -it api"
alias dconsumer="docker exec -it consumer"
alias dtail="dapi tail /logs/api.log"
alias crewapi="cd ~/crewapp/api-java"
alias dctail="dconsumer tail /logs/api.log"
alias stail="node $DEV_HOME/socket/scripts/socket/test-stream-subscription.js"
alias sltail="NODE_ENV=local stail"
#vpn stuff
alias vpn_internet="ping -c 1 -t 2 google.com &> /dev/null && echo 'Internet OK' || sudo pkill -9 dsAccessService"
alias pull="git stash && git pull && git stash pop"
##rails stuff
alias gorails="~/rails-dev-box/work"
alias gorailsvirtual="vagrant ssh && cd /vagrant/work"
alias killVpn="ping -c 1 -t 2 google.com &> /dev/null && echo ‘Internet OK’ || sudo pkill -9 dsAccessService"
function dbConnect() {
psql -U developers "$1"
}
source /usr/local/bin/virtualenvwrapper.sh
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="/Users/achavez/.sdkman"
[[ -s "/Users/achavez/.sdkman/bin/sdkman-init.sh" ]]
source "/Users/achavez/.sdkman/bin/sdkman-init.sh"
function killjava() {
ps -ef | grep java | awk '{system("sudo kill -9 "$2)}'
}
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="ys"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git ant mvn osx)
source $ZSH/oh-my-zsh.sh
# User configuration
export PATH="/usr/share/maven/apache-maven-3.2.3/bin:/usr/share/maven/apache-maven-3.2.3:/usr/share/ant/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin:/usr/local/opt/coreutils/libexec/gnubin:/Users/achavez/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:$PATH"
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
source ~/.bash_profile
function swflog() {
if [ -z "$1" ];
then
git log --oneline --color | cat;
return;
fi
if [ -z "$2" ];
then
if [[ $1 =~ ^[0-9] ]];
then
git log --oneline --author=$(whoami) --color | grep "$1" | cat;
return;
fi
git log --oneline --author="$1" --color | cat;
return;
fi
if [ -z "$3" ];
then
git log --oneline --author="$1" --color | grep "$2" | cat;
return;
fi
echo "Usage is swflog author tp";
}
export NVM_DIR="/Users/achavez/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="/Users/achavez/.sdkman"
[[ -s "/Users/achavez/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/achavez/.sdkman/bin/sdkman-init.sh"
# tabtab source for jhipster package
# uninstall by removing these lines or running `tabtab uninstall jhipster`
[[ -f /Users/achavez/.nvm/versions/node/v4.0.0/lib/node_modules/generator-jhipster/node_modules/tabtab/.completions/jhipster.zsh ]] && . /Users/achavez/.nvm/versions/node/v4.0.0/lib/node_modules/generator-jhipster/node_modules/tabtab/.completions/jhipster.zsh
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
eval "$(rbenv init -)"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
{
"apiHost":"http://localhost:8080",
"hostname":"localhost:3000",
"socketServer" : "0.0.0.0:10000",
"assetBucket":"crew-dummy-static-assets",
"cdnBaseUrl":"//s3-us-west-2.amazonaws.com/crew-dummy-static-assets/",
"serveAdminRoutes" : true,
"forceHttps" : false,
"crew_cuid" : "000000000000000000000001",
"crew_cutk" : "QuKi5ddH1Alg8t1xj5or",
}
authtoken: 2J35yUSiDSjWQSR8c7RZd_3ZPVPYRfwTw9KSHYwGbnC
tunnels:
api:
addr: 8080
bind_tls: true
proto: http
subdomain: alex-crew-api
ws:
proto: http
bind_tls: true
addr: 7000
subdomain: alex-crew-ws
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment