]> git.wh0rd.org - home.git/blame - .profile.d/aliases.sh
test.cc: new C++ test
[home.git] / .profile.d / aliases.sh
CommitLineData
1afdf944 1alias axine='xine -A null'
de7f2c38 2alias b='bzr'
5b61754d 3alias bc='bc -q'
1afdf944
MF
4#alias bittorrent-curses='bittorrent-curses --max_upload_rate 10'
5#alias bt='bittorrent-curses --max_upload_rate 10 --save_in . --save_incomplete_in .'
83b07a3a 6alias cdrecord='cdrecord -vvv -eject driveropts=burnfree'
5b61754d 7alias duh='du . --max-depth=1 -h'
63d15f58 8alias eclipse='eclipse-3.2 -vmargs -Xmx512m'
ca0cd585 9alias g='git'
5b61754d 10alias gdb='gdb --quiet'
1afdf944 11alias gdbtui='gdbtui --quiet'
8a844016 12alias nohist='export HISTFILE=/dev/null'
d85737d7 13alias kpdf='okular'
14031d68 14if command -v elinks >/dev/null ; then
78ddcb31
MF
15 alias links='elinks -default-mime-type text/html'
16 alias lynx=links
14031d68
MF
17elif command -v lynx >/dev/null ; then
18 alias lynx='lynx -nopause -accept_all_cookies -use_mouse'
19fi
5b61754d
MF
20alias minicom='minicom -w -c on'
21alias nslookup='nslookup -sil'
d80dd902
MF
22alias p1='patch -p1'
23alias p1d='patch -p1 --dry-run'
24alias p1dr='patch -p1 --dry-run -R'
25alias p1r='patch -p1 -R'
1afdf944 26alias quake4='quake4 +set s_driver oss'
aa909367 27alias rrsync='rsync -Hav --inplace --progress'
5b61754d 28alias s='aspell -a'
375dc529 29sss() { aspell -a <<<"$*"; }
598dd9e3 30smplayer() { sudo -u smriti sh -c 'export DISPLAY=:0; xset s reset; exec mplayer "$@" >/dev/null 2>&1' sh "$@" ; }
98895774 31smpv() { sudo -u smriti sh -c 'export DISPLAY=:0; xset s reset; exec mpv "$@"' sh "$@" ; }
b598da0c 32svlc() { sudo -u smriti sh -c 'export DISPLAY=:0; xset s reset; exec vlc "$@" >/dev/null 2>&1' sh "$@" ; }
e034a752 33svnc() { sudo -u smriti sh -c 'export DISPLAY=:0; xset s reset; exec x11vnc -q -nopw' ; }
1c9edcf2 34alias trc=transmission-remote-cli
1afdf944 35alias xine='xine -l'
5b61754d 36
276cf0d7 37alias 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'
145ec29a 38
22072cde
MF
39_ipython() {
40 # These guys keep changing their CLI because they hate their users.
41 local cmd=$1; shift
42 local args=(
43 --no-banner
44 --no-confirm-exit
45 --pdb
46 --nosep
47 --term-title
48 --pprint
49 )
50
51 case $(command ${cmd} --version) in
52 0*) ;;
53 [123]*)
54 args+=(
55 --PromptManager.in_template='>>> '
56 --PromptManager.out_template=''
57 --PromptManager.justify=False
58 )
59 ;;
60 esac
61
62 command ${cmd} "${args[@]}" "$@"
63}
64ipython() { _ipython ${FUNCNAME}; }
65ipython2() { _ipython ${FUNCNAME}; }
66ipython3() { _ipython ${FUNCNAME}; }
67
019bffbb
MF
68adk_path() {
69 local adk=/usr/local/src/android/adk/current/sdk
70 PATH+=":${adk}/tools:${adk}/platform-tools"
71}
72
06ac7c77
MF
73pd() {
74 if [[ $# -eq 0 ]] ; then
75 popd
cf68f8b6
MF
76 elif [[ $# -eq 1 && $1 == "--" ]] ; then
77 dirs -v
06ac7c77
MF
78 else
79 pushd "$@"
80 fi
81}
82
cf68f8b6
MF
83cd_history() {
84 if [[ $# -eq 1 ]] ; then
85 case $1 in
86 -h)
87 command dirs "$1" |& tail -1
88 command cd "$1" |& tail -1
89 return
90 ;;
91 --help)
92 command dirs "$1"
93 command cd "$1"
94 return
95 ;;
96 -[clpv])
97 command dirs "$1"
98 return
99 ;;
100 -[0-9]*)
101 set -- "$(dirs "+${1:1}")"
102 ;;
103 esac
104 fi
d3a35d3c 105
cf68f8b6
MF
106 if command cd "$@" ; then
107 pushd -n "${PWD}" >/dev/null
d3a35d3c
MF
108 else
109 local ret=$?
110
111 if [[ $# -gt 1 ]] ; then
112 # The `cd` above should have shown an error message for us.
113 local arg first_arg="$1"
114 while [[ $# -gt 0 ]] ; do
115 arg="$1"
116 shift
117 if [[ -d ${arg} ]] ; then
118 if [[ $# -gt 0 ]] ; then
119 printf 'cd: remaining: %s\n' "$@" >&2
120 fi
121 printf 'cd: entering: %s\n' "${arg}" >&2
122 cd_history "${arg}"
123 return
124 else
125 printf 'cd: skipping: %s\n' "${arg}" >&2
0e8e59e6 126 fi
d3a35d3c
MF
127 done
128 # If we're still here, then we didn't cd anywhere.
129 echo "cd: cwd is unchanged!" >&2
130 fi
131
132 return ${ret}
cf68f8b6
MF
133 fi
134}
135alias cd='cd_history'
136
77ee95d3 137if [[ ${TERM} != "dumb" ]] ; then
aa909367 138 export GREP_COLORS=ne #470810
4c1fde46 139 alias grep='grep --colour=auto -d skip'
77ee95d3
MF
140 alias ls='ls --color=auto'
141fi
142
5b61754d 143scrub_patch() {
4c1fde46
MF
144 sed -i \
145 -e '/^index /d' \
5b61754d 146 -e '/^new file mode /d' \
4c1fde46 147 -e '/^Index:/d' \
5b61754d
MF
148 -e '/^=========/d' \
149 -e '/^RCS file:/d' \
150 -e '/^retrieving/d' \
151 -e '/^diff/d' \
152 -e '/^Files .* differ$/d' \
1c9edcf2 153 -e '/^Binary files .* differ$/d' \
5b61754d
MF
154 -e '/^Only in /d' \
155 -e '/^Common subdirectories/d' \
4c1fde46
MF
156 -e '/^deleted file mode [0-9]*$/d' \
157 -e '/^+++/s:\t.*::' \
158 -e '/^---/s:\t.*::' \
159 "$@"
5b61754d
MF
160}
161
1afdf944 162scrub_html() {
e0db24bd
MF
163 local a=(
164 'lt' '<'
165 'gt' '>'
166 'nbsp' ' '
167 'amp' '&'
168 'quot' '"'
169 )
170 [[ $# -gt 0 ]] && set -- "$@" -i
171 eval sed \"\$@\" $(printf -- ' -e "s|\&%s;|%q|g"' "${a[@]}")
5b61754d 172}