]> git.wh0rd.org - home.git/blob - .profile.d/aliases.sh
3ee83b7f206b561e5c1e5e1922b97fca2e6e8d3a
[home.git] / .profile.d / aliases.sh
1 alias axine='xine -A null'
2 alias b='bzr'
3 alias bc='bc -q'
4 #alias bittorrent-curses='bittorrent-curses --max_upload_rate 10'
5 #alias bt='bittorrent-curses --max_upload_rate 10 --save_in . --save_incomplete_in .'
6 alias cdrecord='cdrecord -vvv -eject driveropts=burnfree'
7 alias duh='du . --max-depth=1 -h'
8 alias eclipse='eclipse-3.2 -vmargs -Xmx512m'
9 alias g='git'
10 alias gdb='gdb --quiet'
11 alias gdbtui='gdbtui --quiet'
12 alias nohist='export HISTFILE=/dev/null'
13 alias kpdf='okular'
14 alias ipython='ipython --no-banner --no-confirm-exit --pdb --nosep --PromptManager.in_template=">>> " --PromptManager.out_template="" --PromptManager.justify=False'
15 if command -v elinks >/dev/null ; then
16 alias links='elinks -default-mime-type text/html'
17 alias lynx=links
18 elif command -v lynx >/dev/null ; then
19 alias lynx='lynx -nopause -accept_all_cookies -use_mouse'
20 fi
21 alias minicom='minicom -w -c on'
22 alias nslookup='nslookup -sil'
23 alias p1='patch -p1'
24 alias p1d='patch -p1 --dry-run'
25 alias p1dr='patch -p1 --dry-run -R'
26 alias p1r='patch -p1 -R'
27 alias quake4='quake4 +set s_driver oss'
28 alias rrsync='rsync -Hav --inplace --progress'
29 alias s='aspell -a'
30 sss() { aspell -a <<<"$*"; }
31 smplayer() { sudo -u smriti sh -c 'export DISPLAY=:0; xset s reset; exec mplayer "$@" >/dev/null 2>&1' sh "$@" ; }
32 svlc() { sudo -u smriti sh -c 'export DISPLAY=:0; xset s reset; exec vlc "$@" >/dev/null 2>&1' sh "$@" ; }
33 svnc() { sudo -u smriti sh -c 'export DISPLAY=:0; xset s reset; exec x11vnc -q -nopw' ; }
34 alias trc=transmission-remote-cli
35 alias xine='xine -l'
36
37 alias wol-vapier='wakeonlan -i 192.168.1.255 00:25:22:64:19:79; wakeonlan -i 192.168.0.255 00:25:22:64:19:79'
38
39 adk_path() {
40 local adk=/usr/local/src/android/adk/current/sdk
41 PATH+=":${adk}/tools:${adk}/platform-tools"
42 }
43
44 pd() {
45 if [[ $# -eq 0 ]] ; then
46 popd
47 elif [[ $# -eq 1 && $1 == "--" ]] ; then
48 dirs -v
49 else
50 pushd "$@"
51 fi
52 }
53
54 cd_history() {
55 if [[ $# -eq 1 ]] ; then
56 case $1 in
57 -h)
58 command dirs "$1" |& tail -1
59 command cd "$1" |& tail -1
60 return
61 ;;
62 --help)
63 command dirs "$1"
64 command cd "$1"
65 return
66 ;;
67 -[clpv])
68 command dirs "$1"
69 return
70 ;;
71 -[0-9]*)
72 set -- "$(dirs "+${1:1}")"
73 ;;
74 esac
75 fi
76 if command cd "$@" ; then
77 pushd -n "${PWD}" >/dev/null
78 fi
79 }
80 alias cd='cd_history'
81
82 if [[ ${TERM} != "dumb" ]] ; then
83 export GREP_COLORS=ne #470810
84 alias grep='grep --colour=auto -d skip'
85 alias ls='ls --color=auto'
86 fi
87
88 scrub_patch() {
89 sed -i \
90 -e '/^index /d' \
91 -e '/^new file mode /d' \
92 -e '/^Index:/d' \
93 -e '/^=========/d' \
94 -e '/^RCS file:/d' \
95 -e '/^retrieving/d' \
96 -e '/^diff/d' \
97 -e '/^Files .* differ$/d' \
98 -e '/^Binary files .* differ$/d' \
99 -e '/^Only in /d' \
100 -e '/^Common subdirectories/d' \
101 -e '/^deleted file mode [0-9]*$/d' \
102 -e '/^+++/s:\t.*::' \
103 -e '/^---/s:\t.*::' \
104 "$@"
105 }
106
107 scrub_html() {
108 local a=(
109 'lt' '<'
110 'gt' '>'
111 'nbsp' ' '
112 'amp' '&'
113 'quot' '"'
114 )
115 [[ $# -gt 0 ]] && set -- "$@" -i
116 eval sed \"\$@\" $(printf -- ' -e "s|\&%s;|%q|g"' "${a[@]}")
117 }