-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
193 lines (173 loc) · 4.64 KB
/
.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# ls
alias ll='ls -alF'
alias lh='ls -lhF'
alias la='ls -AF'
alias l1='ls -1F'
alias 1='l1'
alias la1='ls -A1'
alias l='ls -CF'
alias lnew='ls -lhrtc | tail'
alias lnewr='find . -printf "%TY-%Tm-%Td %TH:%TM %p\n" | sort | tail'
alias lbig='ls -lhrsS | tail'
function adv_ls() {
alias 1='LC_ALL=C ls -1F --group-directories-first'
alias l='LC_ALL=C ls -CF --group-directories-first'
alias ll='LC_ALL=C ls -alF --group-directories-first'
alias lh='LC_ALL=C ls -lhF --group-directories-first'
}
# term
alias :q='exit'
alias c='clear'
alias dc='cd'
alias gh='cat ~/.zsh_history | grep --text'
alias psg='ps aux | grep'
alias pstree='ps -AHwef'
function mkcd() {
mkdir -p -- "$1" && cd -- "$1"
}
# vim.
alias -- -='vim -R -'
alias v-='vim -'
alias v='vim'
alias vd='vimdiff'
alias vs='vim -O'
alias vt='vim -p'
# CLI tools.
alias bc='bc -ql'
alias colerr='exec 2>>( while read X; do print "\e[91m${X}\e[0m" > /dev/tty; done & )'
alias dus='du -sh *'
alias f='fndi'
alias fcount='find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n'
alias fxml='xmllint --format - | pygmentize -l xml'
alias g='grep'
alias grep='grep --color=auto'
alias mgsvc='sudo sysv-rc-conf'
alias mtr='mtr -o LDSNABWV'
alias t='tail'
alias tf='tail -f'
alias tre='tree -F --filelimit 15'
alias uuid='uuidgen | tr 'A-Z' 'a-z''
alias uwc='tr -s " " | tr " " "\n" | tr "[:upper:]" "[:lower:]" | sort | uniq -c | sort -gr'
alias wifi='wicd-curses'
alias ta='tmux a -d || tmux'
#ssh
alias vissh='vi ~/.ssh/config'
alias host-fingerprint='ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub'
# Apt.
alias aptu='sudo aptitude update'
alias aptsu='sudo aptitude safe-upgrade -V'
alias apts='aptitude search'
alias aptsh='aptitude show'
alias apti='sudo aptitude install --without-recommends'
# Linux GUI.
alias fr='file-roller'
alias gmp='gnome-mplayer'
alias gnome-disc-util='palimpsest'
alias op='xdg-open'
alias poke='gnome-screensaver-command -d'
alias xc='xclip -selection clip-board'
# dev tools.
alias mci='mvn clean install'
alias mvn-tree='mvn -Dverbose dependency:tree'
alias mvn-get-src='mvn dependency:sources && mvn dependency:resolve -Dclassifier=javadoc'
alias mvn-find-updates='mvn versions:display-dependency-updates versions:display-plugin-updates'
alias pip-upgrade='pip freeze --local | cut -d = -f 1 | xargs pip install -U'
#alias node='env NODE_NO_READLINE=1 rlwrap node'
alias share_http='python -m SimpleHTTPServer 44444'
function serve {
port="${1:-44444}"
ruby -run -e httpd . -p $port
}
# SVN.
alias svngrep="find . \( \( ! -name .svn -and ! -name target \) -o -prune \) -type f -print0 | xargs -0 grep --color"
alias sg='svngrep'
alias snv='svn'
alias svnst='svn st'
alias svd='svn diff -x -b | vim -R -'
alias svdf='svn diff --diff-cmd vimdiffsvn'
alias sup='svn up'
alias svp='svn up'
function svn-lg {
if [ $# -lt 1 ] ; then
svn log -l 30 | nicelogs
else
svn log "$@" | nicelogs
fi
}
# Git.
alias gitgrep="find . \( \( ! -name .git -and ! -name target -and ! -name bin \) -o -prune \) -type f -print0 | xargs -0 grep --color"
alias gg='gitgrep'
alias gitst='git st'
alias gst='git status --short && echo && git lg'
alias gdf='git df | vim -R -'
alias gdfc='git df --cached | vim -R -'
function s() {
if [ -e './.svn' ] || svn info > /dev/null 2>&1 ; then
if [ $# -lt 1 ] ; then
svn status
elif [ "$1" = "edit" ] ; then
$EDITOR $(svn status | awk '$1 ~ /^M$/ {print $2}')
elif [ "$1" = "lg" ] ; then
shift
svn-lg "$@"
else
svn "$@"
fi
elif [ -e './.git' ] || git rev-parse --git-dir > /dev/null 2>&1; then
if [ $# -lt 1 ] ; then
git status .
else
git "$@"
fi
else
echo "Unknown SCM."
fi
}
alias se='s edit'
alias sl='s lg'
alias sd='s diff .'
alias sc='s commit'
alias push='git-push-all-remotes'
alias pull='git-pull-all-remotes'
# Maths.
function b() {
echo "$@" | bc
}
function hextobin() {
in="$(echo $1 | tr "[:lower:]" "[:upper:]")"
echo "ibase=16; obase=2; $in"|bc
}
function bintohex() {
echo "obase=16; ibase=2; $1"|bc
}
function hextodec() {
in=$(echo $1 | tr "[:lower:]" "[:upper:]")
echo "ibase=16; $in"|bc
}
function dectohex() {
echo "obase=16; $1"|bc
}
function bintodec() {
echo "ibase=2; $1"|bc
}
function dectobin() {
echo "obase=2; $1"|bc
}
# Time.
alias utime='date +%s'
function etime() {
if [ "$(uname -s)" = "Linux" ] ; then
date -d "@${1}"
else
date -r "${1}"
fi
}
# Work.
alias mon='nc localhost 33898'
# Img tools.
alias im-compress-photo='convert -density 150 -quality 60'
alias im-smaller-photo='convert -density 150 -quality 60 -resize 50%'
# Media.
alias vlcgif='vlc --demux avformat'
# Strings.
function join { local IFS="$1"; shift; echo "$*"; }