Last active
August 29, 2015 14:16
-
-
Save luginbash/bd3b418f6324b1439ef1 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
printf "%s\n" "Setting up vanilla enviroment" | |
# BSD | |
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" | |
# OSX Server Specific | |
PATH="$PATH:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin" | |
# sanity locale | |
export LC_ALL=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
# sanity shell command | |
setopt no_nomatch # if there are no matches for globs, leave them alone and execute the command | |
setopt no_cdable_vars # don't use named directories in cd autocompletion | |
setopt rmstarsilent # no more prompts in rm | |
printf "%s\n" "Setting up enviroment for 3rd-party" | |
printf "%s\n" "Intel C/C++ Compiler" | |
PATH="$PATH:/opt/intel/composerxe/bin" | |
printf "%s\n" "Anaconda Scientifi Python" | |
PATH="$PATH:/Users/qzhou/anaconda/bin" | |
printf "%s\n" "FSL tools" | |
PATH="/usr/local/fsl/bin:${PATH}" | |
FSLDIR="/usr/local/fsl" | |
export FSLDIR | |
if [[ -s "${FSLDIR}/etc/fslconf/fsl.sh" ]]; then | |
source "${FSLDIR}/etc/fslconf/fsl.sh" | |
fi | |
printf "%s\n" "Mathworks Matlab R2014B" | |
PATH="/Applications/MATLAB_R2014a.app/bin:${PATH}" | |
alias matlab="/Applications/MATLAB_R2014b.app/bin/matlab -nojvm" # cli sanity | |
printf "%s\n" "Haskell" | |
PATH="$PATH:$HOME/Library/Haskell/bin" | |
printf "%s\n" "NVIDIA CUDA 6.5" | |
export PATH=/Developer/NVIDIA/CUDA-6.5/bin:$PATH | |
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-6.5/lib:$DYLD_LIBRARY_PATH | |
printf "%s\n" "Applying Changes" | |
export PATH | |
printf "%s\n" "Personalizing Enviroment" | |
function setProxy { # $1 - switch | |
# too lazy to check argn | |
# note that not all apps supports socks | |
# note that apple use socks as socks5, yet don't recognize socks5:// | |
if [ $1 == 'proxy_name' ]; then | |
HTTP_PROXY='http://user:[email protected]:port' | |
HTTPS_PROXY='http://user:[email protected]:port' | |
fi | |
if [ $1 == 'null' ]; then | |
unset HTTP_PROXY, HTTPS_PROXY | |
fi | |
} | |
printf "%s\n" "Setting up editors" | |
# change editor to use lime | |
EDITOR=/usr/bin/vim | |
VISUAL=/usr/local/bin/lime | |
printf "%s\n" "Hooking up utilities" | |
# xunlei-lixian downloader | |
alias lx="python /usr/local/xunlei-lixian/lixian_cli.py" | |
# Google Say - Google TTS Command line | |
function gSay { | |
wget -q -U Mozilla -O "$1.mp3" "http://translate.google.com/translate_tts?tl=zh&ie=UTF-8&q=$2" | |
} | |
# quick dns flush | |
alias flushdns='dscacheutil -flushcache' | |
# cd to forefront finder window in terminal | |
function ff { osascript -e 'tell application "Finder"'\ | |
-e "if (${1-1} <= (count Finder windows)) then"\ | |
-e "get POSIX path of (target of window ${1-1} as alias)"\ | |
-e 'else' -e 'get POSIX path of (desktop as alias)'\ | |
-e 'end if' -e 'end tell'; };\ | |
function cdff { cd "`ff $@`"; }; | |
printf "\e[1;32m%76s\e[0m\n" | |
# ls: better listing | |
alias ll='ls -lGA' | |
alias ls='ls -GF ' | |
# Source Prezto. | |
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then | |
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" | |
fi | |
prompt kylewest | |
printf "\e[1;32m%76s\e[0m\n" | |
clear |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment