Created
June 2, 2013 16:47
-
-
Save SunnyBingoMe/5694098 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# this file should be ln -s to home | |
source /etc/profile | |
if [ -d "$HOME/bin" ] ; then | |
PATH="$HOME/bin:$PATH" | |
fi | |
PATH="/usr/local/foxit_reader_1_1:$PATH:/sbin:/usr/sbin:/usr/local/bin:/home/ats/bin:/home/solo/bin" | |
PS1='`a=$?; | |
if [ $a -ne 0 ]; then | |
echo -n -e "[e[01;32;41m]ERR:$a.[e[m]"; | |
fi | |
`[e[01;42m]$[e[m][e[01;32m]A.u@h:[e[m][e[01;34m]$PWD[e[m]`B=$(git branch 2>/dev/null | sed -e "/^ /d" -e "s/* (.*)/1/"); | |
if [ "$B" != "" ]; then | |
S="git"; | |
elif [ -e .bzr ]; then | |
S=bzr; | |
elif [ -e .hg ]; then | |
S="hg"; | |
elif [ -e .svn ]; then | |
S="svn"; | |
else | |
S=""; | |
fi; | |
if [ "$S" != "" ]; then | |
if [ "$B" != "" ]; then | |
M=$S:$B; | |
else | |
M=$S; | |
fi; | |
fi; | |
[[ "$M" != "" ]] && echo -n -e "[e[01;33m]($M)[e[m][e[01;32m][e[m]" | |
`[e[01;42m]$[e[m] ' | |
alias cls='clear' | |
alias setv='set -o vi' | |
alias sete='set -o emacs' | |
alias s='sudo -s' | |
alias suai='sudo apt-get install' | |
alias suau='sudo apt-get update' | |
alias suar='sudo apt-get remove' | |
alias suas='sudo apt-cache search' | |
alias suashow='sudo apt-cache show' | |
alias suv='sudo vim' | |
#alias ls='/bin/ls --color=always -p' | |
alias l='ls -ACp' | |
alias la='ls -ACp' | |
alias ll='ls -halp' | |
alias lsd='ls -haldp' | |
alias lld='lsd' | |
alias rmr='rm -r' | |
alias cpr='cp -r' | |
alias psauxf='ps auxf' | |
alias pslyA='ps -lyA' | |
alias psfajx='ps -fajx' | |
alias grepi='grep -i' | |
alias freemt='echo "Size in MB. /proc/meminfo"; free -mt' | |
alias netstattu_l_vpn='echo "Including listen and non-listen."; netstat -tulvpn; netstat -tuvpn' | |
alias netstati='netstat -i' | |
alias hdWc='hdparm -W' | |
alias duhs='echo "Dir Usage list:"; du -hs .' | |
alias dfhaT='echo "Disk usage of Filesystems: df -haT:"; df -haT' | |
alias dfh='echo "Disk usage of Filesystems: df -h:"; df -h' | |
#alias ctags='ctags -R --fields=+lS' | |
alias wgetFile='wget -c -t 20 -T 120 -w' | |
alias wgetSite='wget -r -p -k -np -nc -E -owget.log -t3 -l0 -U "User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2" ' | |
alias rsyncBackup='rsync -avh --progress --delete --log-file=rsyncBackupLog.txt' | |
alias split99M='split -b 99MB' | |
alias jumpstat='autojump --stat'; alias j='autojump'; alias autojumpstat='jumpstat' | |
alias sshunsafe='ssh -i /home/solo/.ssh/openSsh_from_ssh2048rsa_unsafe' | |
alias g='git' | |
alias gitdiff__stat='git diff --stat ' | |
alias gitstatus='git status' | |
alias gitlg='git lg' | |
alias gitadd='gadd' | |
alias gitb='git br' | |
gadd () { | |
git add -v $*; | |
git status; | |
} | |
alias 7zUltra='7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on' | |
alias 7zUltraHeader='7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -mhe=on -p' | |
alias 7z100mbUltraHeader='7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -mhe=on -p -v100m' | |
alias 7z100mbUltraHeaderWeekly='cd /media/now/; 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -mhe=on -p -v100m /media/temp/weekly.7z ./weekly ./Dropbox/Thesis ./Dropbox/dropbox_sync_fs ./Dropbox/system_variable' | |
alias 7z100mbUltraHeaderMonthly='cd /media/now/; 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -mhe=on -p -v100m /media/temp/monthly.7z ./Dropbox' | |
#alias 7zUltraVim="7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -xr@$HOME/.vim/.compressIgnore $HOME/.vim.7z $HOME/.vim" | |
alias tgzVim='cd $HOME; tar -X $HOME/.vim/.compressIgnore -cvzf .vim.tgz .vim' | |
alias tarLab='cd $HOME; tar -h -cvf lab.tar .vim.tgz .bash_aliases .bashrc .profile hosts thesis/dropbox_sync_fs .gitconfig .gitignore_global .ssh/authorized_keys .ssh/lab' | |
alias bz2Keep="echo 'bzip2 --keep (keep original files)'; bzip2 -k" | |
alias bunz2Keep="echo 'bunzip2 --keep (keep original files)'; bunzip2 -k" | |
alias bz2Test='bunzip2 -t' | |
alias md='echo "Message-Digest algorithm-5, binary mode."; md5sum -b' | |
alias sha='echo "Secure Hash Algorithm-1, binary mode."; sha1sum -a 1 -b' | |
alias dateTime='date +%Y-%m-%d %H:%M:%S' | |
alias dateTimeUnderline='date +%Y_%m_%d_T_%H_%M_%S' | |
alias findiname='find ./ -iname' | |
alias findminMaxdepth1Typef='find -mindepth 1 -maxdepth 1 -type f' | |
alias findminMaxdepth1Typed='find -mindepth 1 -maxdepth 1 -type d' | |
alias findminMaxdepth1TypefXargsChmoda_x='find -mindepth 1 -maxdepth 1 -type f |xargs chmod a-x' | |
alias ntpqp='ntpq -p' | |
# mgmt | |
alias processCounterPerUser="type processCounterPerUser; ps aux |cut -c 1-8|sort |uniq -c" | |
# variables | |
export HISTCONTROL=ignoredups:ignorespace | |
export HISTTIMEFORMAT='[%F %T] ' | |
shopt -s histappend | |
alias generateLocalesZh='sudo echo "zh_CN.UTF-8 UTF-8" > /var/lib/locales/supported.d/zh && sudo locale-gen' | |
export MANPAGER="/bin/sh -c "unset PAGER;col -b -x | | |
vim -R -c 'set ft=man nomod nolist' -c 'set nospell' -c 'nmap q :q<CR>' -c 'nmap K :Man <C-R>=expand("<cword>")<CR><CR>' -"" | |
########################################### | |
############# thesis ###################### | |
alias tcs='tc -s qdisc' | |
alias tcQdiscDel='tc qdisc del dev eth1 root; tc qdisc del dev eth2 root' | |
alias bcql='bc -q -l' | |
alias matlabNoDesktop='type matlabNoDesktop; matlab -nodesktop -nodisplay -nojvm -nosplash -r' | |
alias matlabDisableFcitx='export XMODIFIERS=@im=xxxxxxx; matlab' | |
alias ethtool10='ethtool -s eth1 speed 10 duplex full autoneg on advertise 0x002' | |
alias ethtool100='ethtool -s eth1 speed 100 duplex full autoneg on advertise 0x008' | |
#alias mountnfs_FromServer='mount -t nfs server:/home/ats/thesis/dropbox_sync_fs/ /home/ats/thesis/dropbox_sync_fs/' | |
#alias mountnfsnolock_FromServer='mount -t nfs -o nolock server:/home/ats/thesis/dropbox_sync_fs/ /home/ats/thesis/dropbox_sync_fs/' | |
alias mountnfs_FromClient='mount -t nfs 192.168.1.151:/home/ats/thesis/dropbox_sync_fs/ /home/ats/thesis/dropbox_sync_fs/' | |
alias mountnfsnolock_FromClient='mount -t nfs -o nolock 192.168.1.151:/home/ats/thesis/dropbox_sync_fs/ /home/ats/thesis/dropbox_sync_fs/' | |
#alias rsyncFromServer="rsync -auz ats@server:/home/ats/thesis/dropbox_sync_fs/ $HOME/thesis/dropbox_sync_fs/" | |
#alias rsyncToServer="rsync -auz $HOME/thesis/dropbox_sync_fs/ ats@server:/home/ats/thesis/dropbox_sync_fs/" | |
alias tcformat='echo "tc qdisc add dev eth0 root tbf rate 22Mbit latency 50ms burst 1540"' | |
C_INCLUDE_PATH="$C_INCLUDE_PATH:/usr/local/src/dpmi7/qod_libcap_utils-0.7.8" | |
CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/local/src/dpmi7/qod_libcap_utils-0.7.8" | |
alias mpstart='/data/qodoh/mp -v --show-packets -i dag0 -i dag1 --local --caplen 1514 -o' | |
alias stoshiba='ssh solo@toshiba' | |
hometoshiba='solo@toshiba:/home/solo' | |
alias smarc_root_v2427="ssh -i $HOME/.ssh/lab root@marc" | |
homemarc='root@marc:/root' | |
alias srouter='ssh ats@router' | |
homerouter='ats@router:/home/ats' | |
alias sthesisrouter='ssh -p 2222 ats@thesisrouter.no-ip.org' | |
homethesisrouter="ats@thesisrouter.no-ip.org:/home/ats" | |
############# thesis ###################### | |
########################################### | |
########################################### | |
############# nplc ######################## | |
alias sserver211='ssh bisu10@10.0.1.211' | |
homeserver='bisu10@10.0.1.211:/home/bisu10' | |
alias sclient10='ssh bisu10@10.0.1.10' | |
homeclient='bisu10@10.0.1.10:/home/bisu10' | |
alias snplc41='ssh bisu10@10.0.1.41' | |
homenplc='bisu10@10.0.1.41:/home/bisu10' | |
alias sshaper52='ssh bisu10@10.0.1.52' | |
homeshaper='bisu10@10.0.1.52:/home/bisu10' | |
############# nplc ######################## | |
########################################### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment