Skip to content

Instantly share code, notes, and snippets.

@jiapengjun
Last active June 27, 2016 04:38
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 jiapengjun/a1e1a25b95c410f95b85ab091504f54f to your computer and use it in GitHub Desktop.
Save jiapengjun/a1e1a25b95c410f95b85ab091504f54f to your computer and use it in GitHub Desktop.
Config the ~/.bash_profile
set -o vi
export PS1='\h@\[\033[00;32m\]\W\[\033[00m\]:\u \$ '
alias ls='ls -GF'
alias ll='ls -l'
#alias func='typeset -f'
alias func='declare -f'
alias ip='curl ipecho.net/plain; echo'
#alias phs='python3 -m http.server'
alias phs='python -m SimpleHTTPServer'
alias pjn='python -m json.tool'
alias gpl='git pull'
alias gph='git add .; git commit -m"no comments"; git push'
alias glg='git log --oneline --abbrev-commit --all --graph --decorate --color'
# change the bootup volume and reboot.
function boot()
{
if [ $# -ne 1 ] ;then
echo "Input which OS you want to boot [1: El Captian, 2: Fuji]?"
return
fi
if [ $1 -eq 1 ] ;then
sudo bless --mount /Volumes/Glitz --setBoot
elif [ $1 -eq 2 ] ;then
sudo bless --mount /Volumes/Fuji --setBoot
else
echo "Wrong choice, abort!"
return
fi
sudo reboot
}
# build up your todo list
function plan()
{
if [ $# -eq 1 ] && ([ $1 == 'e' ] || [ $1 == '-e' ]) ;then
vi ~/.bash_profile
source ~/.bash_profile
else
echo -e '\033[00;36m' # Can use "printf" to replace "echo -e"
echo 'cancel Unicome service'
echo -e '\033[00m'
fi
}
# build up your tool box
function usage()
{
echo ''
echo "** ANSI ** : 0[black], 1[red], 2[green], 3[yellow], 4[blue]"
echo "** ANSI ** : 5[magenta], 6[Cyan], 7[white]"
echo ''
echo '** Package ** : brew, port, pip[python], gem[ruby], npm[nodejs]'
echo '** Tools ** : git, plutil, diskutil, opensnoop'
echo '** Python ** : easy_install, virtualenv, pyenv, pylint'
echo '** DNS ** : whois, nslookup, dig'
echo ''
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment