6 # Former \!* using tcsh aliases have been converted to functions
11 # One character aliases
24 # Two character aliases
25 alias eg='egrep --color=auto'
26 function ff() { find . -name "$@" }
28 alias gr='fgrep --color=auto'
32 function df() { command df -TP "$@" | column -t }
34 alias mx="nslookup -sil -q=mx"
35 alias ns="nslookup -sil -q=ns"
37 alias ls='ls -F --color=auto'
41 alias uc='perl -Mlocale -pe "\$_=uc(\$_);"'
42 alias lc='perl -Mlocale -pe "\$_=lc(\$_);"'
46 if alias md > /dev/null; then unalias md; fi
47 function md { mkdir -p "$@" && cd "$@" }
49 if alias au > /dev/null; then unalias au; fi
50 alias au='aptitude -u'
52 # Needed for /usr/bin/ag
53 if alias ag > /dev/null; then unalias ag; fi
55 # Three character aliases
56 alias acs='apt-cache show --no-all-versions'
57 alias acsa='apt-cache show -a'
58 alias acp='apt-cache policy'
59 alias acd='apt-cache depends'
60 alias acr='apt-cache rdepends'
61 alias ac/='apt-cache search'
62 alias acn='apt-cache search -n'
63 alias af/='apt-file search'
64 alias afs='apt-file search'
65 alias afl='apt-file list'
66 alias afu='apt-file update'
67 alias ag/='aptitude search'
68 salias agi='aptitude install'
69 salias ag+='aptitude install'
70 salias ag-='aptitude remove'
71 salias agr='aptitude remove'
72 salias ag_='aptitude purge'
73 salias agp='aptitude purge'
74 salias agu='apt-get update'
75 salias agh='aptitude hold'
76 salias agc='apt-get clean'
77 alias agw='aptitude why'
78 alias asv='apt-show-versions'
79 function ffi() { find . -iname "$@" }
80 function lpr() { command lpr "$@"; lpq }
81 alias cls=clear # Yeah, that's from DOS
82 alias ecn='emacsclient -n'
83 alias ecc='emacsclient -c'
84 alias ino='inotail -f'
85 alias gap='git add -p'
87 alias mpfs='mplayer -fs'
88 alias mpau='mplayer -vo none'
93 if which ack > /dev/null; then
94 alias gnf='ack --passthru'
95 elif which ack-grep > /dev/null; then
97 alias gnf='ack-grep --passthru'
101 # Set the title to something more obvious, e.g. the expanded
102 # alias, eh, function
103 print -Pn "\e]0;%n@%m: autossh -t $* 'screen -RdU'\a";
105 # For the following hack for getting ssh-agent to work inside the
106 # reattached screen session, see
107 # http://samrowe.com/wordpress/ssh-agent-and-gnu-screen/ and
108 # http://www.stderr.nl/Blog/Software/Mutt/MuttRemoteAttachments.html?seemore=y
109 autossh -x -A -t "$@" 'test -x ~/.mutt/bin/setup-ssh-screen && exec ~/.mutt/bin/setup-ssh-screen || exec screen -RdU'
113 # Four character aliases
115 # Set the title to something more obvious, e.g. the expanded
116 # alias, eh, function
117 print -Pn "\e]0;%n@%m: autossh $*\a";
122 alias root='ssh root@localhost'
123 alias acss='apt-cache showsrc'
124 salias agsu='aptitude safe-upgrade'
125 salias agdu='aptitude full-upgrade'
126 salias agma='aptitude markauto'
127 salias agum='aptitude unmarkauto'
128 salias agri='aptitude reinstall'
129 salias aguh='aptitude unhold'
130 salias agbd='aptitude build-dep'
131 alias agwn='aptitude why-not'
133 alias eccn='emacsclient -c -n'
135 # apt-file search for Perl Modules, by gregoa
137 apt-file search $(echo "/$@" | sed -e 's|::|/|g ; s|-|/|g ; s|$|.pm|') | uniq
140 # Five character aliases
142 alias cgrep='ack-grep --passthru'
143 alias deurl='$HOME/bin/url_decode.pl'
144 function perlv() { perl -le "use $1; print "'$'"$1"'::VERSION;' }
145 alias acsrc='apt-cache showsrc'
146 salias aguma='aptitude unmarkauto'
148 if [[ $# -eq 0 ]]; then
149 command mount | column -t
156 alias mmv='noglob mmv'
157 alias translate='noglob translate'
162 # ls sorting (Idea from zsh book)
164 alias lssmall=ls -lhS
168 # grep with color by default
169 alias grep='grep --color=auto'
170 alias fgrep='fgrep --color=auto'
171 alias egrep='egrep --color=auto'
174 for i in sha512 sha256 sha1 md5; do
175 ssl-cert-$i() { openssl x509 -noout -fingerprint -$i -in $1 }
178 ssl-cert-fingerprints() {
179 for i in sha512 sha256 sha1 md5; do
185 openssl x509 -noout -text -in $1
186 ssl-cert-fingerprints $1
190 alias setvi='export EDITOR=vi VISUAL=vi'
191 alias setvim='export EDITOR=vim VISUAL=vim'
192 alias setzile='export EDITOR=zile VISUAL=zile'
193 alias setemacs='export EDITOR="emacsclient -a emacs" VISUAL="emacsclient -a emacs"'
194 #alias edit='$EDITOR'
195 alias vt100='export TERM=vt100'
197 ### Package Management ###
198 alias aptitude-just-recommended='aptitude -o "Aptitude::Pkg-Display-Limit=!?reverse-depends(~i) ( ?reverse-recommends(~i) | ?reverse-suggests(~i) ) !?reverse-recommends(^abe-) !?reverse-suggests(^abe-) ~M !?essential"'
199 alias aptitude-also-via-dependency='aptitude -o "Aptitude::Pkg-Display-Limit=~i !~M ( ?reverse-depends(~i) | ?reverse-recommends(~i) | ?reverse-suggests(~i) ) !?essential"'
200 alias aptitude-review-unmarkauto-libraries='aptitude -o "Aptitude::Pkg-Display-Limit=( ^lib !-dev$ !-dbg$ !-utils$ !-tools$ !-bin$ !-doc$ !-progs$ !-clients$ !-examples$ !^libreoffice | -data$ | -common$ | -base$ !^r-base ) !~M ~i"'
201 alias aptitude-upgradable-to-experimental='aptitude -o "Aptitude::Pkg-Display-Limit=~i ?narrow(!~VCURRENT, ~Aexperimental)"'
202 alias aptitude-newer-than-in-archive='aptitude -o "Aptitude::Pkg-Display-Limit=~i ?any-version(!~O.) !~U !~o"'
205 alias btsmutt='bts --mbox show'
207 # TODO: Remove links and patch tracker section (but not the ubuntu
208 # section) as well as footer
210 if which netrik > /dev/null; then
211 netrik --no-builtin-http --dump http://packages.qa.debian.org/$1
212 elif which w3m > /dev/null; then
213 w3m -dump http://packages.qa.debian.org/$1
214 elif which links > /dev/null; then
215 links -dump -html-numbered-links 0 http://packages.qa.debian.org/$1
216 elif which links2 > /dev/null; then
217 links2 -dump -html-numbered-links 0 http://packages.qa.debian.org/$1
218 elif which elinks > /dev/null; then
219 elinks -dump -no-numbering http://packages.qa.debian.org/$1
220 elif which lynx > /dev/null; then
221 lynx -dump -nolist http://packages.qa.debian.org/$1
222 fi 2>&1 | perl -ne '$links_seen = 1 if /^(\s*|\e\S*)links(\s*|\e\S*)$/; print unless $links_seen or /jump to|history\s+graph|^\s*Link:|URL:http:|^\e\S*[<>]\e\S*$/;' | uniq | less -RSXE
227 if [ -x /org/qa.debian.org/mia/mia-query ]; then
228 /org/qa.debian.org/mia/mia-query "$@"
230 ssh -xa qa.debian.org /org/qa.debian.org/mia/mia-query "$@"
235 #alias y='echo "Hallo, sind wir noch wach, oder sind wir wieder auf die Y-Taste gefallen? ;-)"'
244 ### Laden weiterer Aliasse
246 #alias xal='source ~/.Xalias'
248 #if ( -f $home/.alias.mtools ) then
249 # source $home/.alias.mtools
251 #if ( -f $home/.alias.wapua ) then
252 # source $home/.alias.wapua
256 # Idea from Sven's zsh Book (and yeah I overwrite the previous reload
257 # function which reloaded the zshrc.
258 start stop restart reload force-reload() {
259 sudo invoke-rc.d $1 $0
262 # From http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=299228
264 grep-dctrl -F Build-Depends "$1" -s Package /var/lib/apt/lists/*_Sources \