Skip to content

Instantly share code, notes, and snippets.

@anonymelon
Last active March 22, 2016 06:00
Show Gist options
  • Save anonymelon/bc36fdfbf99286df18c2 to your computer and use it in GitHub Desktop.
Save anonymelon/bc36fdfbf99286df18c2 to your computer and use it in GitHub Desktop.
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
alias l='ls -G'
alias ls='ls -G'
alias ll='ls -alh'
alias px='ssh -Nf -D *:7070 '
alias priv='/usr/local/sbin/privoxy --no-daemon /usr/local/etc/privoxy/config &'
alias ep="export http_proxy='http://localhost:8118' && export https_proxy='http://localhost:8118'"
alias up="unset http_proxy && unset https_proxy"
alias si='sudo -i'
alias mysql='/usr/local/mysql/bin/mysql'
#================git=================
alias g='git'
alias gs='git status'
alias gck='git checkout'
alias gf='git fetch'
alias gt='git log --graph --pretty=oneline --abbrev-commit'
#==================docker==============
alias dk='docker'
alias rb='ruby'
alias be='bundle exec'
alias brake='bundle exec rake'
alias nt='netstat -antp tcp'
alias lsl='lsof -Pn | grep LISTEN'
alias cdw='cd ~/workspace'
alias cdwd='cd ~/workspace/dm/DM'
alias lst="ls -R|grep ':$'|sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'"
alias pg="/Applications/Postgres.app/Contents/Versions/9.4/bin/psql -p5432"
alias pyserver='python -m SimpleHTTPServer'
alias dns_flush='sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say cache flushed'
export LSCOLORS='ExFxCxDxBxEgDxDEhGAcHd'
#export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '
export PS1="\[\033[01;32m\]\u@mac:\w\[\033[00m\] $ "
export CLICOLOR="xterm-color"
export LSCOLORS="gxfxcxdxbxegedabagacad"
#export PS1='[\\u@\\h \\W]\\$ ' mac
MYSQL=/usr/local/mysql/bin
export PATH=$PATH:$MYSQL
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
export LESS='--raw-control-chars --quiet --HILITE-UNREAD --ignore-case --long-prompt'
# export LESS='--raw-control-chars --quiet --LINE-NUMBERS --HILITE-UNREAD --ignore-case --long-prompt'
#PS1="\[\e[1;32m\]\u@mac:\w\[\033[00m\]\$(parse_git_branch)\[\e[0m\]"
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
alias sshzt='ssh [email protected]'
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}
function removeFromPath() {
export PATH=$(echo $PATH | sed -E -e "s;:$1;;" -e "s;$1:?;;")
}
setjdk 1.8.0_20
#setjdk 1.7.0_80-ea
# Maven env
export M2_HOME=/usr/local/maven
export PATH=$PATH:$M2_HOME/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment