Created
April 20, 2020 23:17
-
-
Save denniswon/f247f0da5a44370791277839ce650271 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash_profile | |
# Add Homebrew `/usr/local/bin` and User `~/bin` to the `$PATH` | |
PATH=$HOME/bin:$PATH | |
PATH=/usr/local/bin:$PATH | |
PATH=/sbin/:$PATH | |
PATH=/usr/sbin/:$PATH | |
export PATH="/usr/local/sbin:$PATH" | |
alias ls='ls -GFh' | |
# Tell grep to highlight matches | |
export GREP_OPTIONS='--color=auto' | |
export CLICOLOR='true' | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
export EDITOR=vi | |
alias ebp='vim ~/.bash_profile' | |
alias sbp='source ~/.bash_profile' | |
if [ -f $(brew --prefix)/etc/bash_completion ]; then | |
. $(brew --prefix)/etc/bash_completion | |
fi | |
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then | |
. `brew --prefix`/etc/bash_completion.d/git-completion.bash | |
fi | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi | |
# Prompt with Git branch | |
# Explanation of the weird lines: \u Username, \h Host, \w Path, tput setaf is the color definition | |
# Git branch in good-looking prompt. | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1='\[$(tput setaf 7)\]\u@\[$(tput setaf 2)\]\h:\[$(tput setaf 4)\]\w\[$(tput setaf 1)\]$(parse_git_branch)\[$(tput sgr0)\] $ ' | |
# Bonus track: SSH autocompleting hostnames, write ssh and press tab | |
complete -W "$(while read line; do echo ${line%%[, ]*}; done < ~/.ssh/known_hosts)" ssh | |
export NVM_DIR="/Users/dennis.won/.nvm" | |
# [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
# [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
[ -f $(brew --prefix)/etc/bash_completion ] && . $(brew --prefix)/etc/bash_completion | |
# Virtualenv/VirtualenvWrapper | |
source /usr/local/bin/virtualenvwrapper.sh | |
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" | |
[[ -s "/Users/dennis.won/.gvm/scripts/gvm" ]] && source "/Users/dennis.won/.gvm/scripts/gvm" | |
# https://blog.liquidbytes.net/2018/09/quick-and-easy-guide-for-migrating-to-go-1-11-modules/ | |
export GO111MODULE=on | |
export GO_VERSION=1.14.1 | |
export GIMME_GO_VERSION="go${GO_VERSION}" | |
gowhich=$(which go 2>/dev/null || echo FALSE) | |
if [[ FALSE != "$gowhich" ]]; then | |
goversion=$(go version) | |
else | |
goversion=NULL | |
fi | |
if ! [[ $goversion =~ "${GO_VERSION}" ]]; then | |
echo "installing go version ${GIMME_GO_VERSION}" | |
eval "$(gimme -f ${GO_VERSION})" | |
fi | |
# gimme | |
unset GOOS; | |
unset GOARCH; | |
export GOROOT="${HOME}/.gimme/versions/${GIMME_GO_VERSION}.darwin.amd64"; | |
export PATH="${HOME}/.gimme/versions/${GIMME_GO_VERSION}.darwin.amd64/bin:${PATH}"; | |
export GIMME_ENV="${HOME}/.gimme/envs/${GIMME_GO_VERSION}.env" | |
source $GIMME_ENV | |
# Go | |
export GOPATH=$HOME/go | |
export GOBIN=$GOPATH/bin | |
export PATH=$PATH:$GOPATH/bin | |
export PATH=$PATH:$GOROOT/bin | |
# harmony https://github.com/harmony-one/harmony | |
export CGO_CFLAGS="-I$GOPATH/src/github.com/harmony-one/bls/include -I$GOPATH/src/github.com/harmony-one/mcl/include -I/usr/local/opt/[email protected]/include" | |
export CGO_LDFLAGS="-L$GOPATH/src/github.com/harmony-one/bls/lib -L/usr/local/opt/[email protected]/lib" | |
export LD_LIBRARY_PATH=$GOPATH/src/github.com/harmony-one/bls/lib:$GOPATH/src/github.com/harmony-one/mcl/lib:/usr/local/opt/[email protected]/lib | |
export LIBRARY_PATH=$LD_LIBRARY_PATH | |
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH | |
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH | |
export CFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk" | |
export CCFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk" | |
export CXXFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk" | |
export CPPFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk" | |
alias runharmony='docker run -it harmonyone/main:stable /bin/bash' | |
# MongoDB | |
export MONGODB_CLI_ROOT="/usr/local/Cellar/mongodb-community-shell/4.0.11/" | |
if [ -f $MONGODB_CLI_ROOT ]; then . export PATH=$PATH:$MONGODB_CLI_ROOT/bin; fi | |
# Java version | |
alias j8="export JAVA_HOME=`/usr/libexec/java_home -v 1.8`; java -version" | |
alias j12="export JAVA_HOME=`/usr/libexec/java_home -v 12`; java -version" | |
# Ruby | |
export PATH="/usr/local/opt/ruby/bin:$PATH" | |
# Python | |
export PATH="/usr/local/opt/python/libexec/bin:$PATH" | |
export WORKON_HOME=$HOME/.virtualenvs | |
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3 | |
source /usr/local/bin/virtualenvwrapper.sh | |
# openssl | |
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig" | |
export PATH="/usr/local/opt/[email protected]/bin:$PATH" | |
export LDFLAGS="-L/usr/local/opt/[email protected]/lib" | |
export CPPFLAGS="-I/usr/local/opt/[email protected]/include" | |
# NodeJS | |
export PATH="/usr/local/opt/node@10/bin:$PATH" | |
# aws alias | |
export AWS_BNBRIDGE='[email protected]' | |
alias ssh_bnbridge='ssh -i ~/.ssh/keys/bnbridge-ebs.pem [email protected]' | |
alias mosh_bnbridge='mosh --ssh="ssh -i ~/.ssh/keys/bnbridge-ebs.pem" [email protected]' | |
export AWS_NATIVEBRIDGE='[email protected]' | |
alias ssh_nativebridge='ssh -i ~/.ssh/keys/bnbridge-ebs.pem [email protected]' | |
alias mosh_nativebridige='mosh --ssh="ssh -i ~/.ssh/keys/bnbridge-ebs.pem" [email protected]' | |
export AWS_VALIDATOR='ec2-13-56-210-117.us-west-1.compute.amazonaws.com' | |
alias ssh_validator="ssh -i ~/.ssh/keys/denniswon-private.pem ubuntu@${AWS_VALIDATOR}" | |
alias mosh_validator="mosh --ssh='ssh -i ~/.ssh/keys/denniswon-private.pem' ubuntu@${AWS_VALIDATOR}" | |
export AWS_NODE='ec2-18-144-51-20.us-west-1.compute.amazonaws.com' | |
alias ssh_node="ssh -i ~/.ssh/keys/denniswon-private.pem ubuntu@${AWS_NODE}" | |
alias mosh_node="mosh --ssh='ssh -i ~/.ssh/keys/denniswon-private.pem' ubuntu@${AWS_NODE}" | |
export AWS_DEV='ec2-18-144-57-28.us-west-1.compute.amazonaws.com' | |
alias ssh_dev="ssh -i ~/.ssh/keys/denniswon-private.pem ubuntu@${AWS_DEV}" | |
alias mosh_dev="mosh --ssh='ssh -i ~/.ssh/keys/denniswon-private.pem' ubuntu@${AWS_DEV}" | |
export AWS_EXPLORER_PROXY='ec2-18-163-212-191.ap-east-1.compute.amazonaws.com' | |
alias ssh_explorer_proxy="ssh -i ~/.ssh/keys/explorer-proxy.pem ubuntu@${AWS_EXPLORER_PROXY}" | |
alias mosh_explorer_proxy="mosh --ssh='ssh -i ~/.ssh/keys/explorer-proxy.pem' ubuntu@${AWS_EXPLORER_PROXY}" | |
export AWS_EXPLORER='44.232.43.231' | |
alias ssh_explorer="ssh -i ~/.ssh/keys/oregon-key-benchmark.pem ec2-user@${AWS_EXPLORER}" | |
alias mosh_explorer="mosh --ssh='ssh -i ~/.ssh/keys/oregon-key-benchmark.pem' ec2-user@${AWS_EXPLORER}" | |
PATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PATH}))')" | |
export AWS_ACCESS_KEY_ID="AKIAZRWVEKULFRK4MAEV" | |
export AWS_SECRET_ACCESS_KEY="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" | |
# export AWS_SESSION_TOKEN= | |
export HARMONY_EXPLORER_BACKEND="$HOME/harmony-one/harmony-dashboard-backend" | |
export GOOGLE_APPLICATION_CREDENTIALS="$HARMONY_EXPLORER_BACKEND/harmony-explorer-local.json" | |
export HARMONY_BLOCK_EXPLORER_PROJECT=https://harmony-explorer-local.firebaseio.com | |
alias check_ports="sudo lsof -i -P -n | grep LISTEN" | |
# The next line updates PATH for the Google Cloud SDK. | |
if [ -f '/Users/dennis.won/google-cloud-sdk/path.bash.inc' ]; then . '/Users/dennis.won/google-cloud-sdk/path.bash.inc'; fi | |
# The next line enables shell command completion for gcloud. | |
if [ -f '/Users/dennis.won/google-cloud-sdk/completion.bash.inc' ]; then . '/Users/dennis.won/google-cloud-sdk/completion.bash.inc'; fi | |
export SSL_KEY_FILE=/etc/letsencrypt/live/localhost/privkey.pem | |
export SSL_CERT_FILE=/etc/letsencrypt/live/localhost/fullchain.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment