Last active
June 27, 2016 04:38
-
-
Save jiapengjun/a1e1a25b95c410f95b85ab091504f54f to your computer and use it in GitHub Desktop.
Config the ~/.bash_profile
This file contains 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
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' |
This file contains 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
# 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 | |
} |
This file contains 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
# 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 | |
} |
This file contains 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
# 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