Skip to content

Instantly share code, notes, and snippets.

@virusvn
Created December 23, 2019 03:48
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 virusvn/39e469e8f8ac9ef591db104f9db96eac to your computer and use it in GitHub Desktop.
Save virusvn/39e469e8f8ac9ef591db104f9db96eac to your computer and use it in GitHub Desktop.
# Path to your oh-my-zsh configuration.
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.
#export ZSH_THEME="robbyrussell"
export ZSH_THEME="random"
# Set to this to use case-sensitive completion
# export CASE_SENSITIVE="true"
# Comment this out to disable weekly auto-update checks
# export DISABLE_AUTO_UPDATE="true"
# Uncomment following line if you want to disable colors in ls
# export DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# export DISABLE_AUTO_TITLE="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git textmate osx ruby)
source $ZSH/oh-my-zsh.sh
# Customize to your needs...
# added my path 2011.7.19
export PATH=/usr/local/bin:/usr/local/apache-maven-2.2.1/bin:/usr/local/maven-1.1/bin:/Developer/android/android-sdk-mac_x86/tools:/usr/local/mysql/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/mark/.rvm/bin
# added RVM stuff
# load RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
# copied from .bash_aliases 2001.07.19
# -------------------------------------------------------------------
# some alias settings, just for fun
# -------------------------------------------------------------------
#alias 'today=calendar -A 0 -f ~/calendar/calendar.mark | sort'
alias 'today=calendar -A 0 -f /usr/share/calendar/calendar.mark | sort'
alias 'dus=du -sckx * | sort -nr'
alias 'adventure=emacs -batch -l dunnet'
alias 'mailsize=du -hs ~/Library/mail'
alias 'bk=cd $OLDPWD'
alias 'ttop=top -ocpu -R -F -s 2 -n30'
alias lh='ls -a | egrep "^\."'
# -------------------------------------------------------------------
# make some commands (potentially) less destructive
# -------------------------------------------------------------------
alias 'rm=rm -i'
# -------------------------------------------------------------------
# Jboss
# -------------------------------------------------------------------
alias 'startjboss=/usr/local/jboss-4.0.5.GA/bin/run.sh &'
alias 'stopjboss=/usr/local/jboss-4.0.5.GA/bin/shutdown.sh --shutdown'
# -------------------------------------------------------------------
# Mercurial (hg)
# -------------------------------------------------------------------
alias 'h=hg status'
alias 'hc=hg commit'
alias 'push=hg push'
alias 'pull=hg pull'
alias 'clone=hg clone'
# -------------------------------------------------------------------
# Git
# -------------------------------------------------------------------
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 gra='git remote add'
alias grr='git remote rm'
alias gpu='git pull'
alias gcl='git clone'
alias gta='git tag -a -m'
alias gf='git reflog'
# leverage an alias from the ~/.gitconfig
alias gh='git hist'
# -------------------------------------------------------------------
# Oddball stuff
# -------------------------------------------------------------------
alias 'sloc=/usr/local/sloccount/bin/sloccount'
# necessary to make rake work inside of zsh
alias rake="noglob rake"
# sort files in current directory by the number of words they contain
alias 'wordy=wc -w * | sort | tail -n10'
alias 'filecount=ls -aRF | wc -l'
# -------------------------------------------------------------------
# Functions ported directly from .bashrc
# -------------------------------------------------------------------
# turn hidden files on/off in Finder
function hiddenOn() { defaults write com.apple.Finder AppleShowAllFiles YES ; }
function hiddenOff() { defaults write com.apple.Finder AppleShowAllFiles NO ; }
# postgres functions
function psqlstart() { /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start ; }
function psqlstop() { /usr/local/pgsql/bin/pg_ctl stop ; }
# view man pages in Preview
function pman() { ps=`mktemp -t manpageXXXX`.ps ; man -t $@ > "$ps" ; open "$ps" ; }
# apache tomcat functions
function tomcatup() { /usr/local/tomcat/bin/startup.sh ; }
function tomcatdown() { /usr/local/tomcat/bin/shutdown.sh ; }
# nice mount (http://catonmat.net/blog/another-ten-one-liners-from-commandlingfu-explained)
# displays mounted drive information in a nicely formatted manner
function nicemount() { (echo "DEVICE PATH TYPE FLAGS" && mount | awk '$2="";1') | column -t ; }
# myIP address
function myip() {
ifconfig lo0 | grep 'inet ' | sed -e 's/:/ /' | awk '{print "lo0 : " $2}'
ifconfig en0 | grep 'inet ' | sed -e 's/:/ /' | awk '{print "en0 (IPv4): " $2 " " $3 " " $4 " " $5 " " $6}'
ifconfig en0 | grep 'inet6 ' | sed -e 's/ / /' | awk '{print "en0 (IPv6): " $2 " " $3 " " $4 " " $5 " " $6}'
ifconfig en1 | grep 'inet ' | sed -e 's/:/ /' | awk '{print "en1 (IPv4): " $2 " " $3 " " $4 " " $5 " " $6}'
ifconfig en1 | grep 'inet6 ' | sed -e 's/ / /' | awk '{print "en1 (IPv6): " $2 " " $3 " " $4 " " $5 " " $6}'
}
#
## new functions
#
s() { pwd > ~/.save_dir ; }
i() { cd "$(cat ~/.save_dir)" ; }
#
# finis
# mhn 2011.7.19
export PATH=/usr/local/Cellar/python3/3.7.2_2/bin:/usr/local/sbin:/usr/local/bin:/Volumes/Data/dev/pfff:/Users/nhannguyen/.composer/vendor/bin:/usr/local/kde4/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/Users/nhannguyen/.rvm/bin:/Users/nhannguyen/.composer/vendor/bin:/Volumes/Data/dev/go/bin:/usr/local/go/bin:/usr/local/bin:/Users/nhannguyen/android-ndk/android-ndk-r17c:/Users/nhannguyen/Library/Android/sdk/tools:/Users/nhannguyen/Library/Android/sdk/platform-tools:/Users/nhannguyen/Library/Android/sdk/build-tools/26.0.0:/usr/local/Cellar/gettext/0.19.8.1/bin:$PATH
export PATH=/Volumes/Data/softwares/mongodb-macos-x86_64-4.2.1/bin:~/anaconda3/bin:$PATH
# zappa
#
export AWS_PROFILE=zappa
alias zappashell3='docker run -ti -e AWS_PROFILE=$AWS_PROFILE -v $(pwd):/var/task -v ~/.aws/:/root/.aws --rm lambci/lambda:build-python3.6 bash'
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/nhannguyen/Downloads/google-cloud-sdk/path.zsh.inc' ]; then source '/Users/nhannguyen/Downloads/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell commanda completion for gcloud.
if [ -f '/Users/nhannguyen/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then source '/Users/nhannguyen/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
zappashell='docker run -ti -e AWS_PROFILE=default -v $(pwd):/var/task -v ~/.aws/:/root/.aws --rm airpairzappa'
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export PATH=~/bin:/usr/local/sbin:/usr/local/bin:/Volumes/Data/dev/pfff:/Users/nhannguyen/.composer/vendor/bin:/usr/local/kde4/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/Users/nhannguyen/.rvm/bin:/Users/nhannguyen/.composer/vendor/bin:/Volumes/Data/dev/go/bin:/usr/local/go/bin:/usr/local/bin:/Users/nhannguyen/android-ndk/android-ndk-r17c:/Users/nhannguyen/Library/Android/sdk/tools:/Users/nhannguyen/Library/Android/sdk/platform-tools:/Users/nhannguyen/Library/Android/sdk/build-tools/26.0.0:/usr/local/Cellar/gettext/0.19.8.1/bin:/usr/local/bin:/usr/local/apache-maven-2.2.1/bin:/usr/local/maven-1.1/bin:/Developer/android/android-sdk-mac_x86/tools:/usr/local/mysql/bin:/usr/local/sbin:/Users/nhannguyen/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/mark/.rvm/bin:/Users/nhannguyen/.rvm/bin:/usr/local/cuda/bin:~/anaconda3/bin:$PATH
export ANDROID_NDK=/Users/nhannguyen/android-ndk/android-ndk-r17c
export ANDROID_NDK_HOME='/Users/nhannguyen/android-ndk/android-ndk-r17c'
export CUDA_HOME=/usr/local/cuda
export DYLD_LIBRARY_PATH="$CUDA_HOME/lib:$CUDA_HOME:$CUDA_HOME/extras/CUPTI/lib"a
export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
export PATH=/Developer/NVIDIA/CUDA-10.1/bin/:$PATH
# tabtab source for serverless package
# uninstall by removing these lines or running `tabtab uninstall serverless`
[[ -f /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh ]] && . /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh
# tabtab source for sls package
# uninstall by removing these lines or running `tabtab uninstall sls`
[[ -f /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh ]] && . /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh
#export PYTHONHOME=/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/
#export PYTHONHOME=/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/
export PYTHONPATH=$PYTHONHOME/bin
export PATH="/usr/local/opt/php@7.1/bin:$PATH"
export PATH="/usr/local/opt/php@7.1/sbin:$PATH"
export NVM_DIR="$HOME/.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
export MAGICK_HOME=/usr/local/opt/imagemagick@6
export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"
export GOPATH="/Volumes/Data/dev/go"
export PATH="$PATH:/Volumes/Data/softwares/flutter/bin"
export PATH="/usr/local/opt/openssl/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
export CMAKE_PREFIX_PATH="/Users/nhannguyen/anaconda3/"
export PATH="$HOME/.fastlane/bin:$PATH"
eval $(thefuck --alias)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment