######################################################################## # file: $HOME/.zshrc.mine # available: http://www.guckes.net/Setup/zshrc.mine # written by: Sven Guckes guckes-setup-zshrc(at)guckes.net # purpose: setup file for the shell "zsh" # Latest change: Fri Oct 23 23:23:23 CEST 2020 ######################################################################## # 2020-09-02 2020-08-22 2020-09-04 MY Apt Get Install # making all those installations available from my shell :-) function MYAGI { echo installing basic packages: time sudo apt-get install \ coreutils dateutils grep gzip procps psmisc px # coreutils: # arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp # csplit cut date dd df dir dircolors dirname du echo env expand expr # factor false flock fmt fold groups head hostid id install join link ln # logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc numfmt # od paste pathchk pinky pr printenv printf ptx pwd readlink realpath rm # rmdir runcon sha*sum seq shred sleep sort split stat stty sum sync tac # tail tee test timeout touch tr true truncate tsort tty uname unexpand # uniq unlink users vdir wc who whoami yes # dateutils -> date # grep -> egrep fgrep grep # gzip -> gunzip # procps: free, kill, pkill, pgrep, pmap, ps, pwdx, skill, slabtop, # snice, sysctl, tload, top, uptime, vmstat, w, and watch. # psmisc: fuser, killall, peekfd, *pstree*, prtstat # px: ptop # echo echo installing standard packages: time sudo apt-get install \ a2ps agrep apt bc boxes bzip2 figlet file less locate \ man mmv netcat ncdu ncftp px tar telnet watch whois # echo echo installing complex/interactive programs: time sudo apt-get install \ elinks fetchmail firefox-esr-l10n-en-gb gpg irssi \ mosh mtr mutt ncftp neomutt perl \ screen sed ssh uudeview vim wget zsh # echo echo installing special packages: time sudo apt-get install \ feh imagemagick libjpeg-progs scrot # imagemagick -> convert identify # libjpeg-progs -> jpegtran # feh - picture viewer # scrot - scr(eensh)ot - takes screenshots # echo echo installing PDF tools: time sudo apt-get install \ evince poppler-tools # poppler-tools -> pdftotext # echo echo installing audio+video tools: time sudo apt-get install \ beep pulseaudio mplayer mpv youtube-dl # echo echo installing audio+video tools: time sudo apt-get install \ pandoc # pandoc -> youtube-dl # # TODO ack autoconf colorized-logs cowsay figlet gawk # TODO htop hugo iotop par pcre2 pinentry pwgen stress youtube-dl # TODO tilde (editor), hexyl (hexdump in color), gcalcli (calendar) # TODO exa ("ls"), xsel # TODO grub-customizer # TODO nopackage: bat } # echo personal begin # NEW # 2020-11-21 alias me='who|grep $USER' # 2020-11-20 # tmux commands # list available sessions: alias tt='tmux list-sessions' alias tr='pkill -USR1 tmux' # recreate socket file alias te='tmux showenv -g' # tmux showenv -g | grep LANG # LANG=en_US.UTF-8 # 2020-11-19 # start neomutt for reading news: alias news='neomutt -F ~/.neomutt/newsgroups -G' # 2020-11-19 tmux processes overview: alias tmuxsockets='/bin/ls -rtdl tmux-*' alias tmuxusers='stat -c %U /tmp/tmux-*(/) | sort' alias tmuxsession="tmux display-message -p '#S'" # 2020-11-18 # seems like a good idea ;-) alias my='mutt -y' alias ny='neomutt -y' # 2020-11-04 alias Date:="date +'%a, %d %b %Y %T %z'" # 2020-10-24 use the old screen binary for sharing (":multiuser on" + "acladd $user") alias Screen=/usr/bin/screen # 2020-10-09 show manuals with "--no-hyphenation" alias mmm='man --nh' # 2020-10-02 # vim version: request all features which contain "foo" function vv { vim --version | grep -P -o "[-+]\w*$1\w*" | eol2sp } # examples: # vv farsi -> -farsi # vv auto -> +autocmd +autochdir -autoservername # vv cursor -> +cursorbind +cursorshape # vv info -> +terminfo +cmdline_info +viminfo -ltinfo # 2020-09-30 # "EOLs to spaces" function eol2sp () { tr '\n' ' ' } # example: # vim --version | grep -P -o '\+\S+' | eol2sp # vim --version | sed -e '/system vimrc/,$d' -e 's/-[^ ]*//' -e 's/-[^ ]*//g' -e 's/ */ /g' | tr # -d '\n' # 2020-09-23 # example: to_seconds 23:42:05 --> 85325 to_seconds() { local epoch=$(date --utc -d @0 +%F) date --utc -d "$epoch $1" +%s } # 2020-09-22 # "follow the link" alias lll='ls -lL' # 2020-09-13 alias YD='noglob youtube-dl --restrict-filenames -f 18 \ -o '\''%(upload_date)s.%(id)s.%(duration)s.%(title)s.%(ext)s'\' # 2020-09-05 autoload -U edit-command-line zle -N edit-command-line bindkey '^x^x' edit-command-line # 2020-08-23 # get descriptions from a package function desc () { apt-cache show $1 | sed -n '/^Desc/,/^Desc/p' } # 2020-03-12 alias nocaps='setxkbmap -option caps:none' # 2020-02-16 alias exit='echo there is no exit strategy' # hehehe # 2020-02-07 # copy some file/file_pattern to server "k": function cpk () { scp $1 k: } # 2020-01-31 -> 2020-02-08 email performance alias hayek='neomutt -F ~/.mutt/muttrc.short me' # 2020-01-31 alias wa='which -a' # 2019-12-23 # fc "find command"(?) alias fdil='fc -dil' # -d date/time stamps # -i iso format # -l list on stdout # 2018-12-19 function techisb { cd ~/.P/techisb/ SOURCE=http://www.techisb.de/mobile.html FILE=$(date +%F).mobile.techisb.de.short.html wget -q -c -O $FILE sed -i -f techisb.sed $FILE elinks $FILE } # 2018-12-12 # alias nds='neomutt -D -S | grep' function nds='neomutt -D -S | grep' # -D Dump all configuration variables as 'name=value' pairs to stdout # -D -S Like -D, but hide the value of sensitive variables # 2018-08-31 # alias dump='elinks -dump -no-numbering -no-references' # 2018-05-10 # alias ls='ls -agG' # 2019-09-26 # playing around with vdir function ls () { vdir --color=always -gACFGH $* | less -rS } # 2018-04-28 alias ds='dig +short' # ds kudu.in-berlin.de # 2018-04-18 alias FIG='figlet -m0' # 2018-04-05 alias system-info='lsb_release -irc' # MAILCAP=$HOME/.mailcap:/etc/mailcap:/usr/share/etc/mailcap:/usr/local/etc/mailcap MAILCAP=/etc/mailcap:/etc/mailcap.order:/etc/w3m/mailcap:/usr/bin/run-mailcap:/usr/lib/mime/mailcap # show all mailcap files function llmailcap { ls -ld `echo ${MAILCAP//:/ }` } # 2018-02-09, 2018-04-05 alias lns='ln -s' alias mvi='mv -i' alias cpp='cp -p' # 2018-02-05 alias cal='ncal -M -C -h' alias ul='unzip -l' alias uz='unzip' # 2017-12-17 # "ls - wie viele dateien gibt es hier?" # "ls - how many files are there in here?" alias lsw='/bin/ls *(.)|wc -l' # datenspuren event # show talks within neomutt: alias cod='screen -t Computer_ohne_Desktop neomutt -f ~/.P/datenspuren2017/computer_ohne_desktop.txt' alias eee='screen -t Emails_Effektiv_Editieren neomutt -f ~/.P/talks/emails_effektiv_editieren.txt' alias pit='screen -t Pastebins_IRC_Textpads neomutt -f ~/.P/talks/pastebins_irc_textpads.txt' # 2017-10-03 # show files in long format and "reverse time" alias rtl='/bin/ls -rtl' alias rt='/bin/ls -rt' # 2018-07-13 # 2017-09-28, 2017-12-17 alias scpp='time scp -p' # 2017-09-27, 2017-12-17 alias x60='grep x60 $WEBLOG | tail -1 | sed "s/ .*//"' # 2017-09-27 # show version of neomutt as "neomutt version", eg "NeoMutt 20170912-48-0df7d3" alias nmv="neomutt -v | head -1 | sed 's/\([^ ]*\) \([^ ]*\) (\([^ ]*\))/neomutt-\3-\2/'" # 2017-09-01 alias sv='screen -t EDIT vim -S ~/Session.vim' domain_check () { for domain in \ etteivr.es gramli.ch guckes.net marcq.org quret.net \ sedusers.org slrn.org xn--rea1k.de xn--tea5k.de zshbuch.org; do whois $domain done } # 2017-07-08 # send a file to sprunge.us sprunge () { cat "$1" | curl -F 'sprunge=<-' http://sprunge.us } # 2017-07-06 qrencode () { curl qrenco.de/"$1" } # 2017-06-26 # ipinfo - show IP Address Details ipinfo () { curl ipinfo.io/$1 } # 2017-06-05, 2017-06-22 tuebixprog () { if [[ $# = 0 ]] then echo "Usage: $0 wort" echo "Example: $0 vim" else #URL=http://www.guckes.net/tuebix2017/programm.kurz.txt; #wget -q -O - $URL | grep -i $1 PROGRAMM~/.P/tuebix/programm fi } # 2017-04-17 # show next 5 events from calendar: _next () { URL=http://www.guckes.net/cal/calendar.current.txt wget -q -O - $URL \ | grep -A 6 'div.*class.*today' \ | grep -v soon | tail -5 | less -S } # 2017-04-13 # these bindings address a problem in vi mode. # after appending with 'A' you cannot delete # beyond the beginning of the appended text. # using "backward-delete-char" does allow it, though. bindkey -M viins '^?' backward-delete-char bindkey -M viins '^H' backward-delete-char # 2017-03-30 # automatic timeout # let's see if this works.. # TMOUT=300 # 2017-01-26 # show how many "cells" there are in the current matrix of the terminal: function matrix { stty size; echo $(( $( stty size | sed 's/ /*/' ) )) } # 2017-01-06 alias nom='echo time for some FOOD!' # 2017-01-03 # send text to ix.io -> replies with URL ix () { echo $@ | curl -F 'f:1=<-' ix.io } # 2016-12-31 # "ps forest" alias psf='ps --forest -au guckes' # 2016-12-01 alias vrk='links https://user.in-berlin.de/vrkalender/view-schedule.php' # 2016-11-25 # use the name ":" to access the # latest file in the current directory alias -g :=' *(.om[1])' # 2016-09-25, 2016-10-19, 2017-07-06, 2017-07-10 alias ,=neomutt alias nm=neomutt alias nmv='neomutt -v | head -1' alias neomuttversion='which neomutt; neomutt -v | head -1' alias muttversion='which mutt; mutt -v | head -1' # 2016-08-23, 2020-10-23 # findfile creates a list of all findfile () { file1=$HOME/.find file2=/home/www/$USER/public_html/.find if [[ -f $file1 ]]; then grep -h -i $1 $file1; fi if [[ -f $file2 ]]; then grep -h -i $1 $file2; fi } # 2016-08-22, 2016-08-23 restorels () { if [[ $# = 0 ]] then echo "Usage: $0 dateiname" echo "Example: $0 .profile" else for dir in daily.0 daily.1 daily.2 daily.3 daily.4 daily.5 daily.6 \ weekly.0 weekly.1 weekly.2 weekly.3 monthly.0 monthly.1; do DIR=$(/bin/pwd) DIR=${DIR/user/shell} FILE=/restore/$dir$DIR/$1 if [[ -e $FILE ]] ls -l $FILE done fi } # 2016-08-14 # myps () {ps -o pid,tt,user,start,time,args $(pidof $1) } myps () {ps -o pid,user,start,time,args $(pidof $1) } # 2016-08-13 alias gmail='mutt -F ~/.mutt/imap.gmail' # 2016-08-09 # gettting quota info from "service" host via wget quota () { TEMPFILE=/tmp/foo.html URL=https://service.in-berlin.de/intern/en/diskquota.cgi wget --quiet --user=guckes --password=chaePh2n $URL -O $TEMPFILE lynx -dump $TEMPFILE | sed -e 's/granted/& foo/' | \ /bin/egrep '(home.shell|home.www|nobackup.shell|used.total|granted)' | column -t rm -f $TEMPFILE } # 2016-07-12 alias kr='TZ=Asia/Seoul date' # 2016-05-24 # bindkey "\M-C\M-<" undo # 2016-04-25 alias smile='vim -c :smile' # 2016-03-30, 2016-12-23 alias sttysize='stty size' alias ssi='stty size' # 2016-03-05 # switch between emacs and vi mode alias e='bindkey -e' alias v='bindkey -v' # 2016-02-20 # alias wetter='wget --quiet -O - http://wttr.in/Berlin | head -7' # alias wttr='wget --quiet -O - http://wttr.in/Berlin' # 2018-07-17 function wetter { curl -s http://wttr.in/${1:=Berlin} | head -7 } # 2016-02-18 function talkmutt () { cd ~guckes/.P/talks/mutt/; mutt -n -F advantages.muttrc -f advantages.txt } # 2016-01-21 von wikimatze function zsh-stats() { fc -l 1 \ | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' \ | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n25 } # 2016-01-21 von wikimatze autoload -Uz history-beginning-search-menu zle -N history-beginning-search-menu bindkey '^X^X' history-beginning-search-menu # list the (ten) biggest open files lsofbig () { lsof / | awk '{ if($7 > 1048576) print $7/1048576 "MB" " " $9 " " $1 }' | sort -n -u | tail } # 2016-01-21 gpg_show_sigs_by_time () { gpg --list-sigs $1 \ | sed -n \ -e 's/^sig..........//' \ -e 's/^\(........\) \(....-..-..\) /\2 \1 /' \ | sort -n -u | less } # 2016-01-22 alternative from kuroi: # gpg_show_sigs_by_time2 ({ gpg --list-sigs $MYKEY | # awk 'BEGIN{FIELDWIDTHS="3 10 8 1 10 2 80";} # /^sig/{print $3 " " $5 " " $7}' | sort -k 2 -u } # 2016-01-08 alias mane='LC_ALL=en_EN man' # 2015-12-22 showhostpubkey='ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub' # -> "2048 4f:1b:89:4b:18:1e:c3:a9:05:5d:c3:84:cc:2e:5c:be root@impala (RSA)" # BROWSER=elinks # BROWSER=links BROWSER=browser # ~/bin/browser -> elinks ;-) alias bc='bc -l -q' # libmath + quiet xevshow () { xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p' } SIGS=~/.P/sig/sven.signatures # 2015-10-29 from izabera seek () { SIGS=~/.P/sig/sven.signatures awk /$1/ RS='\n-- \n' $SIGS } # 2015-10-29 both from Riviera: seek2 () { sed "/^-- $/!{H;d;};x;/$1/!d" $SIGS } seek3 () { sed -e '/^-- $/!{' -e H -e d -e '}' -e "x;/$1/!d" $SIGS } # 2015-10-29 function finde () { awk -v pattern=$1 '/^-- $/ { if (section ~ pattern) print section; section = "-- "; next } { if (length(section)) section = section "\n" $0; else section = $0 }' $SIGS } # 2015-10-04 alias today='grep "$(date +"%Y[- ]%m[- ]%d")" ~/.cal.dat' # 2015-09-28 alias pdf2txt='pdftotext -raw -enc Latin1' # 2015-05-05 alias tick='watch -d -n 1 date' # 2015-03-11 # use "column" to "tabelize" the output of "mount": alias mnt='mount | column -t | less -S' # 2015-02-12 # myscan () { # for p in {1..1023}; do # (echo >/dev/tcp/${1:=localhost}/$p) >/dev/null 2>&1 && echo "$p open" # done # } # 2014-11-21 # show entries from the linuxday.at schedule: dorn () { URL=http://www.guckes.net/dornbirn/programm.txt wget -O - --quiet $URL | grep -i $1 | sort | uniq } # 2014-11-15 alias psu='ps -u $USER' # 2014-09-27 # show the next twenty weekdays - default:Monday show_weekdays () { LC_TIME=de_DE.UTF-8 FORMAT="%F = %a %e. %b %Y" for n in {0..${2:=20}}; do /bin/date -d "${1:=mon} + $n weeks" +$FORMAT done } # example: # show_weekdays fri 3 # shows this and the next 3 fridays # 2014-09-23 # show entries from the T-DOSE schedule: # tdoss () { # URL=http://www.guckes.net/t-dose2014/schedule.txt; # wget -O - --quiet $URL | grep -i $1 | sort | uniq } # 2014-09-20 # "grep" puts off newbies. so i simply "search" :-) alias suche=grep alias search=grep # git stuff alias gh='git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short' # alias g="git" # alias gr="git rm -rf" # alias gs="git status" # alias ga="g add" # alias gc="git commit -m" # alias gp="git push origin master" # alias gl="git pull origin master" # 2014-05-14 # http://stackoverflow.com/questions/2980297/how-can-i-use-cpan-as-a-non-root-user # eval $( perl -I ~/perl5/lib/perl5 -Mlocal::lib ) # 2014-04-15 uebernommen von maclemon :) alias please=sudo # eg: $ please rm file # 2015-01-28 a more drastic way to "ask" for something alias fucking=sudo # eg: $ fucking reboot # 2013-01-19 # a little bit of vi fun: alias :q=exit # 2014-02-22 # showing the visible outer IP: function IP { IPservice=http://ip.icb.at/ IPout=$(wget $IPservice -O - 2>/dev/null); echo $IPout } # 2013-11-03 # converting a link from facebook into a normal one: # ff () { # echo $1 | \ # sed -e 's+^http://www.facebook.com/l.php?u=++' \ # -e 's:%2F:/:g' -e 's/%3A/:/g' -e 's/&h=.*//' # } # 2013-01-22, 2013-02-03, 2020-02-07 alias cdwww='cd /home/www/guckes' alias cdsed='cd /home/www/guckes/sedusers.org' alias cdlog='cd /home/log/guckes/www.guckes.net/' alias mmd='make -f ~/bin/markdown.make' # 2010-11-17 # function gricalbackup() { # FILE=grical.org:/usr/local/django-projects/gridcalendar/gridcalendar.sqlite # BACKUP_FILE=gridcalendar.sqlite.$(date +%F_%T) # BACKUP_DIR=~/.P/grical/backup/ # scp -p $FILE $BACKUP_DIR/$BACKUPFILE # ls -l $BACKUP_DIR | tail # } # 2010-08-19 # ifdata -> packet "moreutils" # http://joeyh.name/code/moreutils/ # see also: Linux-Magazin 02/2013: # Charly Kuenast: "Aus dem Alltag eines Sysadmin: Ifdata" # http://www.linux-magazin.de/Ausgaben/2013/02/Einfuehrung alias i='ifdata -pa eth0' # show inet address alias max='ifdata -ph eth0' # show mac address # requires zsh 4.3.9 # bindkey "^R" history-incremental-pattern-search-forward # 2010-07-26 # export REPORTTIME=23 export REPORTTIME=2 # If nonnegative, commands whose combined user and system # execution times (measured in seconds) are greater than # this value have timing statistics printed for them. # 2010-04-30 # show output of "df" nicely, # ie prevent long mount points # to be show on separate line. function df() { /bin/df -a --portability "$@" | column -t |\ sed 's/Mounted[[:space:]]*on/Mounted on/' } # 2010-04-30, 2011-03-14 # function WH { whois $1 | less } # function WH { whois -T dn $1 | less } function WH { whois $1 | less +/^$ } # 2010-04-27 # get the latest picture from the realraum webcam # realraum () { # wget http://www.realraum.at/cgi/webcam.cgi \ # -O realraum.$(date +%Y-%m-%d_%H_%M).jpg # } # 2010-04-24, 2012-05-11, 2015-11-24 ## smslax () { echo $* | mutt -s 1950 436769581140@sms.t-mobile.at } ## smsme () { echo $* | mutt -s 1950 436769353101@sms.t-mobile.at } # smslax () { echo $* | mutt -s 1788 436769581140@sms.t-mobile.at } # smsme () { echo $* | mutt -s 1788 436769353101@sms.t-mobile.at } # 2010-02-24 # shift text through the alphabet, ie # shift all letters by one - 26 times. rot26 () { TEXT="$1"; for i in {1..26}; do TEXT=$(echo $TEXT | tr A-Za-z B-ZAb-za) echo $TEXT done } # 2009-11-29 alias tp=tracepath # 2009-10-27 myfinger () { getent passwd | grep $1 } # 2009-10-15, 2015-01-23 # show my IP address when i am logged in elsewhere: # alias myip="host $(last -1 -a $USER | head -1 | sed 's/^.* //')" myip () { LASTLOG=$(last -1 -a $USER | head -1) LASTHOSTNAME=$(echo $LASTLOG | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' ) echo host $LASTHOSTNAME '->' $(host $LASTHOSTNAME|sed -e 's/.*pointer//' -e 's/\.$//') } # 2009-07-22 # how many colors does the current terminal show? alias colors='tput colors' # 2009-07-17, 2009-07-20 # show the last ten logins of myself: alias LA='last $USER | head' # 2009-07-08 # alias LW='links http://www.linuxwiki.de/linuxworks' # http://www.commandlinefu.com/commands/view/2012/graph-of-connections-for-each-hosts. # Graph number of connections for each hosts: # function graph { # netstat -an | \ # grep ESTABLISHED | \ # awk '{print $5}' | \ # awk -F: '{print $1}' | \ # sort | uniq -c | \ # awk '{ printf("%s\t%s\t",$2,$1) ; \ # for (i = 0; i < $1; i++) \ # {printf("*")}; print "" }' # } function graph { netstat -4tn | awk -F'[\t :]+' \ '/ESTABLISHED/{hosts[$6]++} END\ {for(h in hosts)\ {printf("%s\t%s\t",h,hosts[h]);\ for(i=0;i.*>,,' } # function kal { # TODAY=$(date +"%Y-%m-%d") # CALOLD=~/.P/cal/calendar.2014.txt # CALNEW=~/.P/cal/calendar.2015.txt # CALCUR=~/.P/cal/calendar.current.txt # grep -h -i ${1:=$TODAY} $CALOLD $CALNEW $CALCUR } # 2016-06-30 function kal { TODAY=$(date +"%Y-%m-%d") CAL2014=~/.P/cal/calendar.2014.txt CAL2015=~/.P/cal/calendar.2015.txt CAL2016=~/.P/cal/calendar.2016.txt CALNOW=~/.P/cal/calendar.current.txt grep -h -i ${1:=$TODAY} $CAL2014 $CAL2015 $CAL2016 $CALNOW } # dusch... alias dusch='du -sch' # 2013-12-04 dusck # use "du" to display disk usage in kilobytes (k) and zsh's # globbing to apply to all files with more than 1MB in size. # finally sort it all by numbers: alias dusck='du -sck *(.Lm+1) | sort -n' # function lower { zmv '(*)' '${(C)1}' } # function upper { zmv '(*)' '${(U)1}' } # 2006-03-08, 2006-04-05 # gotta test shared histories.. export HISTFILE=~/.zsh_history export HISTSIZE=8192 export SAVEHIST=8192 setopt APPEND_HISTORY setopt HIST_EXPIRE_DUPS_FIRST setopt HIST_FIND_NO_DUPS setopt SHARE_HISTORY # 2007-07-17 alias he='history -E' # 2007-10-03: complete word from history # completes the current prefix # to a word from the history: # _hist_complete() { # _main_complete _history # } # zle -C hist-complete menu-select _hist_complete # bindkey '^H' hist-complete # # bindkey "[5~" history-beginning-search-backward bindkey "[6~" history-beginning-search-forward bindkey "A" up-line-or-history bindkey "B" down-line-or-history # 2006-02-12: add up the sizes of all parameters (files) # example: sum *.pdf function sum { du -sch $* | tail -1 } # 2006-01-01 zstyle ':completion:*' menu yes=long-list zstyle ':completion:*' menu select=2 alias bashem='bash --rcfile /dev/null' # 2006-01-27, 2014-06-18: # show recently installed packages: # alias whatsnew='ls -crtl /var/cache/apt/archives L' function whatsnew () { ARCHIVES=/var/cache/apt/archives /bin/ls -crtl $ARCHIVES | egrep -v '(apache|lib|mysql|php|postgres)' | less +G } # 2005: show the schedule (fahrplan) and wiki of the 22C3 events: alias PLAN='links http://events.ccc.de/congress/2005/fahrplan/day_2.en.html' alias WIKI='links https://events.ccc.de/congress/2005/wiki/22C3_Public_Wiki' # 2005-12-23, 2013-07-01 # show text in morse code using "figlet": # function morse { echo $* | figlet -m0 -k -f morse } function morse { echo $* | figlet -m0 -k -f morse -d ~/share/figlet } # 2016-05-25 # alias LAST='last -10' # show last login from a list of users LAST () { for user in \ beejay c2064 dirkgomez epost esc f4m8 guckes hofmann \ maxmuen prenzel ramiro rct schmeil skalitz snug; do # echo -n -e $user:\\t last -1 $user | head -1 done } # 2005-11-21 # catching errors # TRAPZERR() { echo 'dang!'; } # ;-) # adding the colon and the tick to the list of # word characters, so you jump over URLs, too, eg # "echo 'http://www.guckes.net/foo.php?pass=xyxxy'" WORDCHARS="*?_-.[]~=/&;!#$%^(){}<>:\'" # uptime dick size wars - function by Julius Plenz function dick () { uptime | perl -ne "/(\d+) d/;print 8,q(=)x\$1,\"D\n\"" } setopt AUTO_CD # alias PDF='wget http://infotage.pf-lug.de/vortraege.pdf' alias bz='bzip2 -v9' alias dfg="df -h ." alias duh="du -ks" # alias _spacemove="mmv '* *' '#1_#2'" # function _zmv_remove_spaces { autoload zmv; zmv '* *' '$f:gs/ /_' } function zs { autoload zmv; zmv '* *' '$f:gs/ /_' } function zaous () { autoload zmv; zmv -n '*ä*' '$f:gs/ä/ae/'; zmv -n '*Ä*' '$f:gs/Ä/Ae/' zmv -n '*ö*' '$f:gs/ö/oe/'; zmv -n '*Ö*' '$f:gs/Ö/Oe/' zmv -n '*ü*' '$f:gs/ü/ue/'; zmv -n '*Ü*' '$f:gs/Ü/ue/' zmv -n '*ß*' '$f:gs/ß/sz/' } # 2005-04-29 cartoon get, 2005-10-07 s/--http-pass/&word/ alias cget='wget -Y off --http-user=bitte --http-password=danke' # 2005-04-22 # function shortcuts { # grep SHORTCUTURL bookmarks.html | \ # sed 's/.*HREF=.\([^ ]*\).*SHORTCUTURL=.\([^ ]*\).*/\2\t\1/' # } # 2005-03-15 # request "help" from a program's "--help" output # and catch it with the PAGER function help { $1 --help | $PAGER } # directly connect to a "wikipedia page" (wp) # example: wp NSA function wp () { links http://en.wikipedia.org/wiki/$1 } # looking at the previous load times with atsar: # atsar - system activity report # -P Statistics about processes and load-averages. # alias LOAD='atsar -P' # alias LOAD='\grep load ~/Mail.IN/CRON | less' # change to a directoty with documents # example: doc mutt function doc { cd /usr/share/doc/$1 } # "ls file count" - Dateien zaehlen alias lsfc='/bin/ls *(.)|wc -l' # add a comment to a picture. # i use this to add the originating URL # so i'll remember where i have found it. function _comment_add { if [[ $# -ne 2 ]] then echo "Usage: $0 picture comment" echo "Purpose: add the comment to the picture" echo "suggested info:" echo "YYYY-MM-DD, Place, Event_Name, Photographer, Original_URL, Names of People, License" else # remember the current date+time of the file: TMPFILE=/tmp/$$ touch -r $1 $TMPFILE # add the comment: convert -comment $2 $1 $1.new && mv $1.new $1 # change back the date+time: touch -r $TMPFILE $1 fi } # show all the comments in those JPEG files function _comm () { for file in $*; do jhead $1 | sed 's/.*Comment *: //p' done } ################################ ### Dealing with pictures ################################ # 2010-10-19 # updating the time stamp of photos # from the date+time within themselves: alias upd='time (jhead -ft *(.); chmod 644 *(.) )' # for pic in *.big.jpg; do # echo convert -verbose -geometry 1024x768 $pic `basename $pic .big.jpg`.jpg # done # for pic in *.big.jpg; do # touch -r $pic `basename $pic .big.jpg`.jpg; # done alias _watch='watch -d -n 1 du -hks' alias _public='setopt GLOB_DOTS; _P . index.html * .tmp/**/*' # kicking (deleting) those temporary files # for a given list of picture names function kick { for pic in $*; do rm -f .tmp/**/*$pic* done } # JPEG Rotate Left function _JRL { for pic in $*; do TEMPFILE=$1_rot270_$$_tmp.jpg [ -f "$pic" ] echo "$pic"; /usr/bin/jpegtran -rotate 270 -copy all "$pic" >$TEMPFILE && touch -r "$pic" $TEMPFILE; mv $TEMPFILE "$pic" done } # JPEG Rotate Right function _JRR { for pic in $*; do TEMPFILE=$1_rot090_$$_tmp.jpg [ -f "$pic" ] echo "$pic"; /usr/bin/jpegtran -rotate 90 -copy all "$pic" >$TEMPFILE && touch -r "$pic" $TEMPFILE; mv $TEMPFILE "$pic" done } function _jpg_rotate_right { TEMPFILE=$1_rot090_$$_tmp.jpg [ -f "$1" ] /usr/bin/jpegtran -rotate 90 -copy all "$1" >$TEMPFILE && mv $TEMPFILE "$1" } function _jpg_rotate_left { TEMPFILE=$1_rot270_$$_tmp.jpg [ -f "$1" ] /usr/bin/jpegtran -rotate 270 -copy all "$1" >$TEMPFILE && mv $TEMPFILE "$1" } alias ALBUM='album -file_sizes -geometry 200x200 -medium 640x480' # APT-CACHE function acse { apt-cache search $1 | sort | less -S +/$1 } function acsh { apt-cache show $1 | less -S +/$1 } # 2014-03-11, 2015-01-29 alias aptse='apt-cache search' alias aptsh='apt-cache show' alias aptgi='apt-get install' alias install='apt-get install' # alias home='ssh guckes@home.guckes.net' # contact Andreas Borchert on his own chat system alias aditalk='telnet adi.mathematik.uni-ulm.de 4711' # table of contents of an archive - gziped only alias toc='tar tvvzf' # wget # "-N": timestamping # "-Y off": proxY off alias WGET='wget -N -Y off' alias wncc='wget --no-check-certificate' # FETCHMAIL # Option "-a" (all): Retrieve both old (seen) and new messages from the mailserver. # alias F="fetchmail -a" # also shows when it has finished: # alias F="fetchmail -a; date" # also keep a date stamp: # alias F='date >> ~/.fetchmail.times ; fetchmail -a; date' # also show the last two lines of the timestamp log: #alias F='date >> ~/.fetchmail.times ; fetchmail -a; tail -1 ~/.fetchmail.times; date' alias F='FILE=~/.fetchmail.times; TIME=$(date); echo $TIME >> $FILE; fetchmail -a; echo $TIME; date' alias FF='tail -10 ~/.fetchmail.times' # see the last ten fetchmail requests # alias whois="links http://www.domaininformation.de/whoisserver_list.html" # function whois { links http://www.domaininformation.de/whois/$1 } # 2004-09-07 www.domaininformation.de is down! ################################################################### ### GnuPG aka GPG, Keys, Keyserver ################################################################### # GPG # gpgh -> help # gpgs -> search-keys # gpgc -> check alias gpgh='gpg --help|$PAGER' alias gpgs='gpg --search-keys' alias gpgc='cd ~/.P/gpg/LOG; time gpg --check-trustdb' # 2006-02-28, 2014-04-24, 2015-10-15, 2016-11-21 # i know these key IDs heart - # but i hate typing them still. ;) # export MYOLDKEY=0x57F77F09 export MYOLDKEY=BFD6EE5857F77F09 # export MYNEWKEY=0x0185391B export MYNEWKEY=EAB97F200185391B # 2006-02-22 function _my_fingerprint { MYKEYID=${1:="0x57F77F09"} FINGERPRINT=`gpg --fingerprint $MYKEYID` ( for count in `seq 7` ; do echo ' DATE: ________-____-____ PLACE:___________________________________' echo 'CHECK: [__] Identity [__] Fingerprint Secret:___________________' echo 'PREFS: please upload your signature directly to a server' echo 'and please notify me about the upload by email - thankyou!' echo ------------------------------------------------------------------------ echo $FINGERPRINT echo ------------------------------------------------------------------------ echo done ) > $MYKEYID.fingerprint.`date +'%Y-%m-%d'`.txt } # function _my_fingerprint { # MYKEYID=${1:="0x57F77F09"} # FINGERPRINT=`gpg --fingerprint $MYKEYID` # ( for count in `seq 7` ; do # echo '[__] Identity [__] Fingerprint' # echo $FINGERPRINT # echo please upload your signature directly to server and # echo please notify me about the upload by email - thanks! # echo ------------------------------------------------------------------------ # echo # done ) > $MYKEYID.fingerprint.`date +'%Y-%m-%d'`.txt # } # 2005-12-06 alias asc='gpg --export -a' # 2005-01-24 # avoid "gpg: please do a --check-trustdb" messages # alias gpg='gpg --no-auto-check-trustdb' # 2004-02-12 some more aliases + functions function gpgls { gpg --list-sigs ${1:="0x57f77f09"} | \ sed 's/^.....................//' | sort -n | tail $2 } # 2004-01-18, 2014-01-30 - for monster key signing #alias -g G='2&>1| grep -v "^gpg: "' alias gpgh='gpg --help|$PAGER' # alias gsearch='gpg --search-keys' alias gs='gpg --search-keys' # might conflict with GhostScript alias glist='gpg --list-keys --with-fingerprint' alias gl='gpg --list-keys --with-fingerprint' alias grecv='gpg --recv-keys' alias gr='gpg --recv-keys' # alias gsign='gpg --sign-key' alias gsigs='gpg --list-sigs' alias gsend='gpg --send-keys' # was: gupload alias gimp='gpg --import' # who uses "gimp" on a server, anyway? ;) # 2016-11-22, 2016-11-25 # "gpg import" # example: GIMP http://blog.fefe.de/fefesblog.asc function GIMP { wget -q --no-check-certificate -O - $1 | gpg --import } # alias newsig='gpg --list-sigs 0x57f77f09 | \ # sed 's/^.....................//' | sort -n | tail' function newsig { gpg --list-sigs ${1:=0x57f77f09} | \ sed 's/^.....................//' | sort -n | tail } # 2014-11-05, 2019-11-27 # adding the keys which are listed # in the list of signatures - but # which could not be found locally. # _gpg_not_found -> glink glink () { gpg --recv-keys $( gpg --list-sigs $1 \ | grep not.found \ | grep -o '[0-9A-F]\{16\}' ) } # .... alias KSPadd="gpg --no-default-keyring --keyring $HOME/.gnupg/LC05-keys.gpg --recv-keys" ################################################################### # mal - mutt aliases # 2005-02-15: added pager call # 2007-03-28 added maillists file # 2008-09-05: added "aliases*" # 2015-02-10: added "NEW" function mal { grep -h -i $1 ~/.mutt/aliases* ~/.mutt/NEW ~/.mutt/maillists | less +/$1 } # 2004-01-05, 2006-04-25 alias WHOIS="links 'http://www.gandi.net/whois?l=en'" # 2016-08-05, 2016-08-17 # starting neomutt on its own setup file: # alias n='~/bin/neomutt -F ~/.neomuttrc' # alias n=neomutt function m { mutt -f ~/Mail.IN/$1 } function n { neomutt -f ~/Mail.IN/$1 } # function mf { mutt -f ~/Mail/$1 } function mf { if [[ -f ./$1 ]] then; mutt -f $1 ; fi if [[ -f ~/Mail/$1 ]] then; mutt -f ~/Mail/$1 ; fi if [[ -f ~/Mail.IN/$1 ]] then; mutt -f ~/Mail.IN/$1 ; fi echo $1 } # 2016-08-16 function nf { if [[ -f ./$1 ]] then; neomutt -f $1 ; fi if [[ -f ~/Mail/$1 ]] then; neomutt -f ~/Mail/$1 ; fi if [[ -f ~/Mail.IN/$1 ]] then; neomutt -f ~/Mail.IN/$1 ; fi echo $1 } # start mutt and neomutt without setup files on an empty folder: alias muttem='mutt -n -f /dev/null -F /dev/null' # alias neomuttem='neomutt -n -f /dev/null -F /dev/null' # -> "/dev/null is not a mailbox" alias neomuttem='neomutt -n -f ~/Mail/empty -F /dev/null' alias LL='/bin/ls -rtld --color=auto *(/) | head -30' # 031003 # sorting the contents of a zip file by date using sed and sort: # unzip -l foo.zip | \ # sed 's/.*\([0-9][0-9]-[0-9][0-9]\)-\([09][0-9]\).*/\2-\1/' | sort -n # 2003-10-03 # "identify" is much too long ;-) # alias I='identify' # function I { identify $* | sed 's/^\([^[]*\)\[\([0-9]*\)\]/\2 \1/' } # # 2016-08-04 # IMG_20160804_085634~2.jpg JPEG 3840x2160 3840x2160+0+0 8-bit sRGB 2.002MB 0.000u 0:00.000 function I { identify $* | \ sed 's/^\([0-9]*\) *\([^ ]*\) \(GIF\|JPEG\|PNG\) \([0-9]*x[0-9]*\).*/\3 \4 \2/' } # 2018-05-31 # add the dimensions in pixels to the filename before the extension: function Imv { PIXELS=$(identify $1 | sed 's/^\([0-9]*\) *\([^ ]*\) \(GIF\|JPEG\|PNG\) \([0-9]*x[0-9]*\).*/\4/') # echo $PIXELS BASE=${1//.???} EXT=${1#*[.]} NEWFILENAME=$BASE.$PIXELS.$EXT mv -i $1 $NEWFILENAME ls -lh $NEWFILENAME } # 2003-09-03 # GG $MID $outfile # Google Groups: get an article by MID and save it in file as given by $2 function GG { wget -U links "http://groups.google.de/groups?selm=$1&output=gplain" -O ${2:=ARTICLE} } # http://www.google.com/search?q=WORD1+WORD2 alias gg='TERM=linux links www.google.com' # 2003-09-06 # access the database of the mounted ftp server ftp.fu-berlin.de # alias loftp='locate -d /import/ftp/.locatedb' # 2003-07-26, 2007-11-08, 2008-05-19 # alias lo='locate -d ~/.locate/locatedb' # alias low='locate -d ~/.locate/locatedb.public_html' function lo { pushd ~ ; locate -d ~/.locate/locatedb "$@"; popd } function low { pushd ~ ; locate -d ~/.locate/locatedb.public_html "$@"; popd } # # alias updb='updatedb --localpaths="$HOME /import/Mweb/guckes" --output=$HOME/.locatedb --prunefs=/' # function updb { updatedb --localpaths="$HOME /import/Mweb/guckes" \ # --output=$HOME/.locatedb --prunefs="/ ~/INSTALL ~/share" } # # function updb { updatedb --localpaths="$HOME /import/Mweb/guckes" \ # --output=$HOME/.locatedb \ # --prunefs="/ $HOME/INSTALL $HOME/share" } # "--preunefs=/" seems to be required - but why?? # # function updb { updatedb --localpaths="$HOME" \ # --output=$HOME/.locatedb \ # --prunefs="/" } function updb { DATE=`date +%Y-%m-%d` DIRWEB=/home/www/$USER/public_html LOCATEDIR=$HOME/.locate LOCATEDBHOME=$LOCATEDIR/locatedb.$DATE LOCATEDBPUBL=$LOCATEDIR/locatedb.$DATE.public_html # date cd; time updatedb -U ./ -o $LOCATEDBHOME cd $DIRWEB; time updatedb -U $DIRWEB -o $LOCATEDBPUBL date # cd $LOCATEDIR time bzip2 -cv9 $LOCATEDBHOME > $LOCATEDBHOME.bz2 time bzip2 -cv9 $LOCATEDBPUBL > $LOCATEDBPUBL.bz2 ln -fs $LOCATEDBHOME $LOCATEDIR/locatedb ln -fs $LOCATEDBPUBL $LOCATEDIR/locatedb.public_html ls -l *$DATE*(.) } alias 80="stty columns 80" alias 113="stty columns 113" alias 145="stty columns 145" # alias getslrn='cd ~/.P/INSTALL/ && \ #mkdir slrn-cvs-`date +%y%m%d` && \ #cd slrn-cvs-`date +%y%m%d` && \ #cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/slrn login && \ #cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/slrn co slrn' alias ch='./configure --help' ################################################################### # GLOBAL ALIASES ################################################################### # include the pipe symbol # idea from Franz Lax :-) alias -g L="| less" # view the output # these come quite natural, too: alias -g H="| head" # see the beginning alias -g H1="| head -1" # see the first line alias -g T="| tail" # see the end alias -g T1="| tail -1" # see the last line alias -g V='| vim -' # edit it with vim! # grepping the fast way! # alias -g A='agrep -d "^-- $\"' # 2005-02-28 alias -g G='| grep' alias -g GG='| grep --color' # alias -g g='| grep -i' # alias -g g='grep -i' # problem with zmv! alias -g gg='| grep -i' alias -g GV='| grep -iv' # 2017-06-14 alias -g P='|' # "type the pipe!" :) alias -g S='| sort ' alias -g U='| urlview' # 2014-09-22, 2017-07-19 alias wg='wget -O - --quiet ' # alias -g u="| grep -o 'http[^ >\"]*' | sort | uniq" alias -g u="| grep -o 'http[^ ]*' | sort | uniq" alias -g pix="| egrep -i '(gif|jpe?g|png)'" # example: wg http://ubucon.de/2014/programm u pix # 2014-09-28 # extract URLs from files alias urls="grep -o 'http:[^ ]*'" # example: # command G searchword L alias -g PN='~/.P/pics/NEW' # alias -g grep='grep -in --color=auto' # counting the lines of an output alias -g W='| wc -l' # example: "locate . W" # suffix aliases! alias -s pdf=xpdf alias -s tex=vim alias -s txt=less # alias -s txt=vim alias -s htm="exec links" alias -s html="exec links" alias -s shtml="exec links" # alias -s at="exec links" alias -s ch="exec links" alias -s de="exec links" alias -s lu="exec links" alias -s com="exec links" alias -s net="exec links" alias -s org="exec links" ################################################################### # calendar in colour # alias CAL8='cal-4.0 -e -f -u -a=8' alias CAL='cal-4.0 -e -f -u' # alias CAL='~/ccal.py/ccal.py' ################################################################### # DATE stuff ################################################################### # request date+time from timeserver TIMESERVER=time.fu-berlin.de alias dt="/usr/sbin/ntpdate -q $TIMESERVER" # 2010-06-28, 2014-08-25, 2018-07-02 # date+time in different formats: alias DT='/bin/date +%F_%T' # YYYY-MM-DD_HH:MM:SS alias zeit='/bin/date +%T' # HH:MM:SS alias Zeit='/bin/date +%R' # HH:MM alias epoc='/bin/date +%s' # @NNNNNNNNNN (10digits) alias now1='/bin/date +'%Y%m%d%H%M%S' --date "$(date)"' alias now2='/bin/date +'%Y-%m-%dT%H:%M:%S' --date "$(date)"' # september date - days since Sep 1st 1993 aka the "eternal september" alias sepdate='echo $(((`date +%s` - 746748000) / 86400)). September 1993' alias fravia='days "30 aug 1952"' # 2003-06-27 function showdays { BIRTHDAY="6 apr 1967" DATE=${1:=$BIRTHDAY} for offset in \ $( echo 1111 2222 3333 4444 5555 6666 7777 8888 9999 11111 12345 ) \ $( seq -w 1000 1000 20000 ); do # echo -n "$DATE + $offset = "; /bin/date +%Y-%m-%d -d "$DATE $offset days" echo -n $(/bin/date +%F -d $DATE) "+ $offset = "; /bin/date +%F -d "$DATE $offset days" done } function days () { BIRTHDAY="6 apr 1967" print = $(( ( $( /bin/date +%s -d ${2:="now"} ) - $( /bin/date +%s -d ${1:=$BIRTHDAY} ) )/60/60/24 )) } # 2015-04-07 # how many days has it been since the official first opening day of the airport Berlin? function BER () { EROEFFNUNG="3 jun 2012"; print $(( ( $( date +%s -d ${1:="now"} ) - $( date +%s -d $EROEFFNUNG ) )/60/60/24 )) } # function days () { # BIRTHDAY="6 apr 1967" # if [[ $# = 0 ]] # then # echo 'Usage: $0 [date1] [date2]' # echo 'Purpose: give the number of days from date1 to date2.' # echo 'if date2 is not given then the current day assumed.' # echo "if date1 is not given then $BIRTHDAY is assumed." # else # print $(( (`date +%s -d ${2:="now"}` - `date +%s -d ${1:=$BIRTHDAY}` )/60/60/24 )) # fi # } # alias dad='days "28 jan 1944"' # $ date -d '28 jan 1944 22222 days' # Tue Nov 30 00:00:00 CET 2004 # 2006-06-27 # show the weekday of a given date function day () { /bin/date +%a -d ${1:="today"} } # tests: # day now # day today # day tomorrow ################################################################### function gif2png { if [[ $# = 0 ]] then echo "Usage: $0 foo.gif" echo "Purpose: change a GIF file to a PNG file" else output=`basename $1 .gif`.png convert $1 $output touch -r $1 $output ls -l $1 $output fi } ################################################################### # LOOKUPS ################################################################### # mutt manual - lookup for options function mm { noglob less "+/6.* $1" ~/.P/mutt/doc/manual.txt } # 2015-10-30, 2016-11-22 # find something im my zsh setup files function zfind () { grep $1 ~/.zshrc ~/.zshrc.forall ~/.zshrc.local ~/.zshrc.mine } function fon { /bin/grep --color -h -i $1 ~/.phone/*.txt } # function tel { agrep -h -i -d '^$' $1 ~/.phone/*.txt } function tel { awk "BEGIN{IGNORECASE=1}; /$1/" RS='\n\n' ~/.phone/*.txt } # extract signatures from my signature file # was: _sig function s { if [[ $# = 0 ]] then echo "show a signature" echo "Usage: $0 searchword" else FILE=~/.P/sig/sven.signatures # agrep -d '^-- $' $1 $FILE # echo # somehow it's necessary # awk /$1/ RS='\n-- \n' $FILE awk "BEGIN{IGNORECASE=1}; /$1/" RS='\n-- \n' $FILE fi } # extract signatures from my quotes collection function q { if [[ $# = 0 ]] then echo "show a quote" echo "Usage: $0 searchword" else FILE=~/.P/quotes/collection # agrep -d '^-- $' $1 ~/.P/quotes/collection # awk /$1/ RS='\n-- \n' $FILE awk "BEGIN{IGNORECASE=1}; /$1/" RS='\n-- \n' $FILE fi } # 2015-11-02 # extract film tips from te youtube file: function y { FILE=~/.P/youtube/favourites.txt if [[ $# = 0 ]] then echo "show a film snippet" echo "Usage: $0 searchword" else #agrep -d '^-- $' $1 $FILE awk /$1/ RS='\n-- \n' $FILE fi } ## moving old mail folders # function mmove { # SOURCE=~/Mail/$1 # TARGET=~/Mail.OLD/$1.gz # gzip -v9c $SOURCE > $TARGET # touch -r $SOURCE $TARGET # ls -l $SOURCE $TARGET #} ################################################################### ### IRC ################################################################### # alias IRC='epic SvenG satanii.enemy.org' # alias IRC='irc SvenG irc.lugs.ch' # alias ircclt="screen -t IRC 10 epic SvenG irc.fu-berlin.de -c '#clt2004'" # alias irclog='$PAGER +G ~/.IRC' # 2010-06-02 show recently used IRC channels: # ircchans() { # cd ~/irclogs # ls -rt */\#* | sed -e 's:^[^/]*/:/join :' -e 's:.log::' # } # 2013-05-16 show recently used IRC channels (using find+sed): # ircchannels () { # cd ~/irclogs; # find . -name '\#*' -atime -14 | \ # sed 's:./\([-a-z]*\)/\(#.*\).log:\1 \2:' # } # 2015-10-29 alias ircchannels='cd ~/irclogs; ls -1rt **/#*(.c-14)' ################################################################### ### MAIL ################################################################### # alias maillog='$PAGER +G ~/.LOG/maillog' # alias M='$PAGER +G ~/.LOG/maillog' # alias maillog="tail -1000 ~/.LOG/maillog | \ # sed -e 'N;N;/CRON/d' \ # -e 'N;N;/SPAM.SPAM/d' \ # -e 's,/var/mail/guckes,INBOX,' | \ # less +/'^ Folder:.*'" # # alias maillog="tail -1000 ~/.LOG/maillog | \ # sed -e '/From .*\n^ Subject.*\n^ Folder:.*SPAM/d' \ # -e 's,/var/mail/guckes,INBOX,' | \ # less +/'^ Folder:.*'" # # alias maillog="tail -1000 ~/.LOG/maillog | \ # \grep -v SPAM | \grep Folder: | \ # sed -e 's/^ *Folder: //' \ # -e 's,/var/mail/guckes,INBOX,' \ # -e 's/ [ ]*\([0-9][0-9]*\)$/\t\t\1/' | \ # less -N" # # less -p 'Folder: [A-Z][-A-Z]* '" # alias maillog="tail -1000 ~/.LOG/maillog | less +/'^ Folder:.*'" # -e '/^From guckes@antilope.in-berlin.de/N;N;d' # From guckes@antilope.in-berlin.de Sun Jan 2 01:13:02 2005 # Subject: Cron uptime # Folder: CRON 879 # 2007-06-27, 2010-08-28, 2010-11-17, 2014-06-20, 2017-11-30, 2020-04-01 alias maillog="tail -3000 ~/.LOG/maillog \ | \grep Folder: \ | \egrep -v '(dev.null|SPAM|VIM)' \ | sed 's/^ Folder: \([-a-zA-Z0-9.]*\)[\t ]*\([0-9][0-9]*\)$/\2\t\1/' \ | less -N" alias MM=maillog # 2015-04-01 # alias M='less +G ~/.LOG/maillog' # alias M='less +/"Folder: [0-9A-Z]*" ~/.LOG/maillog' # 2015-12-08, 2016-07-22 alias M='sed "s/^\(From [^ ]* \)\(.*\)/\2 \1/" ~/.LOG/maillog | less +G -S' # 2020-11-16 alias M="sed 's/^\(From [^ ]* \)\(.*\)/\2 \1/' ~/.LOG/maillog | less +G -S +/'Subj.*job.*'" # this shoud highlight the lines with "Subject: Output from your job.*NUMBER" ################################################################### ### NEWS ################################################################### # alias gmane='screen -t GMANE slrn -n -C -k0 -h news.gmane.org' # alias tugnews='screen -t TU-GRAZ slrn -n -C -k0 -h news.tugraz.at' # read all those uppercase files which usually come with most programs: alias lAZ='$PAGER [A-Z]*' # _lap foo -- list all programs with prefix "foo": # function _lap { for i in ${(@)$(hash -m $1\*)#*=}; do ls -l $i; done} # function _lap { for i in "${(@f)$(whence -pm $1\*)}"; do ls -l $i; done} # Peter Stephenson: function _lap { local tmp tmp=("${(@f)$(whence -pm $1\*)}") (( $#tmp )) && ls -l $tmp } # display free inodes for ufs disks alias dfiu='df -o i -F ufs' alias dfi='df -i .' # 2002-01-10 # DM -> Euro # function dm2euro { noglob echo $1/1.95583 | bc } # function euro2dm { noglob echo $1*1.95583 | bc } # check the existence of each dir in $PATH: function _pathcheck { # for dir in `echo ${PATH//:/ }`; do for dir in $path; do ls -ld $dir done } # use pstree with "hup" options :-) # alias pshup='pstree -hup' alias pst='pstree -hup $USER' alias psxaf='ps xaf' # psg = ps grep alias psg='ps -u $USER| grep' # example: psg vim ############# # Variables # ############# # a list of directories to check also when using the "cd" command CDPATH=..:~/:~/.P:~/.P/EVENTS:~/.P/PERSONS # CDPATH=..:~/.P:~/.P/PERSONS:~/.P/pics:~/.P/pics/cartoons:~/.P/pics/2005/ # CDPATH=..:~/.P:~/.P/PERSONS:~/.P/pics/2004/:~/.P/pics/2005/ # 2003-06-15, 2014-06-10 # export LC_ALL=en_EN # export LC_ALL=de_DE.UTF-8 # 2016-12-07 export LC_ALL=en_US.UTF-8 # 2008-07-02: prompt like on windows: # bash> PS1='C:${PWD//\//\\\}>' # See below for more settings for the prompt! # PS1='guckes@f451:%4c> ' # PS1='guckes@in-berlin:%4c> ' # PS1='guckes@in-luxembourg.lu:%4c> ' # 2007-02-06 vortrag # RPS1='%l %D{%A %y%m%d %T}' # PS1='$#jobstates guckes@in-berlin:%4c> ' # PS1='%j guckes@in-berlin:%4c> ' # 2010-10-30 alias _="PS1='$ '" # 2019-12-29 alias __="PS1='%y %n@%m:%4c%1v> '" PS1='%y %n@%m:%4c%1v> ' # 2017-09-30 testing "%s...%S" # alias __="PS1='%s%n@%m:%4c%1v> %S'" # PS1='%s%n@%m:%4c%1v> %S' # _example : Special Prompt for shell examples # alias _example='PS1="";RPS1="";' #function _promptreset { PS1='%n@%m:%4c%1v>'; RPS1='%l %D{%A %y%m%d %T}' } function _promptreset { PS1='%n@%m:%4c%1v>'; RPS1='%l %D{%A %F %T}' } function _promptexample { PS1='guckes@example:%3c>'; RPS1='' } function _promptshort { PS1='$ '; RPS1='' } # 2001-11-26: # http://www.guckes.net/unix/#bc export BC_ENV_ARGS="$HOME/.bcrc" # PRINTER=a2central # PRINTER=a3og1b # PRINTER=a3eg # export PRINTER=A3EG # export PRINTER=A2CENTRAL export EDITOR=vim export PAGER=less # TERM=vt100 export VIEW=$PAGER # gzip GZIP=-v9 # irc clients: # export IRCNAME='Sven Guckes (0x57F77F09)' # export IRCNAME='Sven Guckes (gpg:57F77F09 gpg:0185391B)' export IRCNAME='Sven Guckes (gpg:EAB97F200185391B)' # export IRCNAME='Sven Guckes' export IRCNICK=SvenG # export IRCSERVER=irc.fu-berlin.de # http://www.guckes.net/less/ export LESS=aCMsei # 2007-07-03: Colorize you man pages! :) export LESS_TERMCAP_mb=$'\E[01;31m' export LESS_TERMCAP_md=$'\E[01;31m' export LESS_TERMCAP_me=$'\E[0m' export LESS_TERMCAP_se=$'\E[0m' export LESS_TERMCAP_so=$'\E[01;44;33m' # export LESS_TERMCAP_so=$'\E[01;47;34m' export LESS_TERMCAP_ue=$'\E[0m' export LESS_TERMCAP_us=$'\E[01;32m' # Check for logins # WATCH=notme # WATCHFMT="%D %T %M %l %n %a" ######### # bindkey ######### bindkey "," copy-prev-word # Alt-comma bindkey "-" copy-prev-word # Alt-dot # up: OA # down: OB # right: OC # left: OD ######### # Aliases ######### # function HOMEIP { echo 160.45.216.101 } # alias -g HOMEIP='212.42.238.183' # alias -g HOMEIP='217.197.85.183' alias ftp=ncftp # alias ftp=ncftp3 # alias ncftp=ncftp3 alias _cdmail='cd /var/spool/mail' # Directories on the mounted ftp server: # alias _cdless='cd /import/ftp/unix/gnu/less' # alias _cdmutt='cd /import/ftp/unix/mail/mutt/' # alias _cdslrn='cd /import/ftp/unix/news/slrn/' # alias _cdvim='cd /import/ftp/misc/editors/vim/' # alias _cdzsh='cd /import/ftp/unix/shells/zsh/' # alias _home='TERM=xterm; stty rows 30 columns 80' # alias _homexterm='TERM=xterm; stty rows 36 columns 80' # alias _dec-vt220='TERM=vt220; stty rows 49 columns 80' ######### # picture conversion ######### alias _GIF='convert -verbose -interlace LINE' alias _thumb='convert -geometry 100x100 -interlace LINE -verbose' alias _thumb150='convert -geometry 150x150 -interlace LINE -verbose' alias _thumb200='convert -geometry 200x200 -interlace LINE -verbose' alias _mpo='mutt -f ~/News/posted' alias _lposted='$PAGER ~/News/posted' function _thumbs { for bild in PATTERN; do echo convert -verbose -geometry 640x480 $bild `basename $bild .EXT`.640x480.jpg done } ######### # NEWS/USENET ######### # show (un)subscribed newsgroups # alias _sub="sed -e 's/^\(.*\) .*/\1/' ~/.newsrc | grep : | sort | $PAGER" # alias _unsub="sed -e 's/^\(.*\) .*/\1/' ~/.newsrc | grep ! | sort | $PAGER" # # easier with "grep -o": alias _sub="grep -o '^.*:' ~/.newsrc | sort" alias _unsub="grep -o '^.*!' ~/.newsrc | sort" # alias _netscape='/import/communicator/netscape &' ############# # Functions # ############# function COWSAY { COWDIR=/usr/share/cowsay/cows ( for file in $COWDIR/*; do echo -----; echo file: $file echo ${1:=moo} | cowsay -f $file done ) | less } # display sample text in all available figlet fonts: function FIGLET { #for font in ~/lib/fonts/*.flf; do for font in /usr/share/figlet/*.flf; do echo $font: echo $1 | figlet -m0 -k -f $font echo ----------------------------------------- done } # create a new webpage # updated on 2003-11-11 function _newpage { if [[ $# = 0 ]] then echo "Usage: $0 pagename" else cd ~/.P mkdir $1 cd $1 touch $1.index.html ln -s $1.index.html index.html chmod 755 . chmod 644 index.html fi } # 2017-05-06 function _newevent { if [[ $# = 0 ]] then echo "Usage: $0 eventname" else cd ~/.P/EVENTS mkdir $1 cd $1 touch $1.index.html ln -s $1.index.html index.html chmod 755 . chmod 644 index.html cd ~/.P ln -s EVENTS/$1 ls -l $1 fi } # "ma" = (find) "mail alias" # grep through my mail aliases file for addresses: # function _ma { grep -i $1 ~/.mutt.aliases ~/.mutt.personal } function _ma { mutt -A $1 } # send a message to a pager: # function _scall { echo -n '$*' | mutt 9162793@scall.de } #################################################################### # installing programs ( configure && make && make install ) #################################################################### # 2003-10-29 generic configure command for myself alias compile="./configure --prefix=$HOME" # 2003-05-12 function _configure_cicq { ./configure --prefix=$HOME \ --disable-nls \ --with-included-gettext } # 2007-05-09 function _configure_centercim { ./configure --prefix=$HOME \ --disable-nls \ --disable-aim \ --disable-irc \ --disable-gg \ --disable-msn \ --disable-rss \ --disable-lj \ --with-included-gettext } # 2002-12-12, 2003-08-19, 2008-02-06, 2020-09-12 # function _configure_elinks { # ./configure --prefix=$HOME --without-gpm --disable-ipv6 --enable-leds # } # 2020-09-12 added --with-gnutls function _configure_elinks { ./configure --prefix=$HOME \ --enable-256-colors \ --enable-exmode \ --enable-html-highlight \ --without-lua \ --with-gnutls } # 2002-08-16 function _configure_elvis { ./configure --prefix=$HOME --without-x --verbose } # 2003-10-28 function _configure_gcal { ./configure --prefix=$HOME --disable-nls --with-included-regexps --with-included-gettext } # 2002-11-27, 2016-11-23, 2020-01-03 # function _configure_gnupg { # ./configure --disable-nls \ # --prefix=$HOME \ # --with-libgpg-error-prefix=$HOME/2_INSTALL/libgpg-error-1.25 \ # --with-libgcrypt-prefix=$HOME/2_INSTALL/libgcrypt-1.7.3/ \ # --with-libassuan-prefix=$HOME/2_INSTALL/libassuan-2.4.3/ \ # --with-ksba-prefix=$HOME/2_INSTALL/libksba-1.3.5 # } # function _configure_gnupg { # ./configure --disable-nls \ # --prefix=$HOME \ # --with-libgpg-error-prefix=$HOME/2_INSTALL/ \ # --with-libgcrypt-prefix=$HOME/2_INSTALL/ \ # --with-libassuan-prefix=$HOME/2_INSTALL/ \ # --with-ksba-prefix=$HOME/2_INSTALL/ # } # 2020-01-03 function _configure_gnupg { ./configure --disable-nls --prefix=$HOME --with-libgpg-error-prefix=$HOME \ --with-libgcrypt-prefix=$HOME \ --with-libassuan-prefix=$HOME \ --with-ksba-prefix=$HOME } # function _configure_gnupg { # ./configure \ # --prefix=$HOME \ # --with-npth-prefix=$HOME \ # --with-libgpg-error-prefix=$HOME \ # --with-libgcrypt-prefix=$HOME \ # --with-libassuan-prefix=$HOME \ # --with-ksba-prefix=$HOME \ # LDFLAGS="-Wl,--rpath=$HOME/lib" \ # ; # } # 2003-03-18, 2016-10-14 function _configure_irssi { ./configure --prefix=$HOME --enable-true-color } # --with-textui is a default now # 2002-04-24 function _configure_less { ./configure --prefix=$HOME --disable-nls --with-included-gettext --with-editor=vim } # 2003-08-27 function _configure_links { ./configure --prefix=$HOME } # 2003-07-15 function _configure_lynx { ./configure --prefix=$HOME --with-ssl --enable-color-style --enable-prettysrc --enable-read-eta --enable-underlines } # 2002-01-07,2002-11-04,2003-06-13 # 2007-04-27 NEW: --enable-hcache # 2007-04-30 NEW: --without-idn # 2007-05-01 NEW: IDN problem requires iconv, # so i have removed "--disable-iconv" again. # # function _configure_mutt { # ./configure --prefix=$HOME \ # --disable-nls \ # --enable-hcache \ # --enable-locales-fix \ # --enable-imap \ # --enable-pop \ # --without-idn \ # --with-included-gettext \ # --without-wc-funcs # } # the options "--enable-buffy-size" seems # to have been dropped by mutt-1.5.21 # compiling with "--with-regex" gave an # error within function "regex_compile". # 2016-01-14 # adding IMAP and SSL # plus --with-gnutls --with-gss and --with-sasl # function _configure_mutt { # ./configure --prefix=$HOME \ # --disable-nls \ # --enable-hcache \ # --enable-locales-fix \ # --enable-imap \ # --enable-pop \ # --without-idn \ # --with-gnutls \ # --with-gss \ # --with-sasl \ # --with-included-gettext \ # --without-wc-funcs # } # 2016-03-10, 2016-04-19 # adding IMAP and SSL # deleted --with-gnutls - wasnt found any more function _configure_mutt { ./configure --prefix=$HOME \ --disable-nls \ --enable-hcache \ --enable-locales-fix \ --enable-imap \ --enable-pop \ --without-idn \ --with-gss \ --with-ssl \ --with-included-gettext \ --without-wc-funcs } # 2017-07-08 back to basics.. # 2017-07-17 added debugging # 2019-02-18 added gpgme # -> "Error: Unable to find GPGME" function _configure_neomutt { ./configure --prefix=$HOME \ --disable-nls \ --enable-debug } # 2017-07-08: old # function _configure_neomutt { # ./configure --prefix=$HOME \ # --disable-nls \ # --disable-dependency-tracking \ # --enable-fcntl \ # --enable-locales-fix \ # --with-curses \ # --with-gnutls \ # --with-idn \ # --with-ssl \ #} # "configure: WARNING: unrecognized options: # --disable-pop, --enable-imap, --enable-nntp, --enable-sidebar, --with-regex # some more available options: # removed: # --enable-compressed \ # --enable-debug \ # --enable-hcache \ requires Tokyo Cabinet, Kyoto Cabinet, QDBM, GDBM, Berkeley DB or LMDB # --enable-pop \ -> --disable-pop # --enable-gpgme \ -> my gpg works # --with-gss \ # --enable-smtp \ # --with-included-gettext \ -> 2017-04-16 possible problem # --with-mixmaster \ # --with-sasl # what are these?: # --enable-notmuch # --enable-silent-rules # --with-docdir=$HOME/share/neomutt \ # --with-homespool=mails # 2016-11-26 function _make_neomutt { # time make clean time git clean -xdf time autoreconf -if time ( _configure_neomutt ) time make time make install time ~/bin/neomutt-post-install cd ~/bin } # 2005-02-07, no IMAP or POP, but NNTP # function _configure_muttng { ./configure --prefix=$HOME \ --disable-iconv \ --disable-nls \ --enable-buffy-size \ --enable-hcache \ --enable-locales-fix \ --enable-pop \ --with-included-gettext \ --with-regex \ --without-wc-funcs } # no nntp! # 2007-05-03, 2008-02-07, 2016-02-01 function _configure_nano { ./configure --prefix=$HOME --enable-utf8 } # 2016-02-01 "--enable-all" is not recognized any more # function _configure_nano { # ./configure --prefix=$HOME \ # --disable-nls \ # --enable-all # --enable-color \ # --enable-extra \ # --enable-multibuffer \ # --enable-nanorc \ # --enable-undo \ # --enable-utf8 # } # 2003-09-02 function _configure_ncftp { ./configure --prefix=$HOME } # 2002-01-28 function _configure_screen { ./configure --prefix=$HOME --enable-colors256 } # 2003-03-13 function _configure_sed { ./configure --prefix=$HOME --disable-nls --enable-html --with-included-gettext } # 2003-10-27 function _configure_slang { ./configure --prefix=$HOME } # 2002-11-18 function _configure_slrn { ./configure --prefix=$HOME --disable-nls --with-included-gettext } # 020325, 2013-03-13, 2013-03-18, 2017-08-05 # --enable-multibyte isnt ON by default?? argh! function _configure_vim { ./configure --prefix=$HOME --enable-gui=no --enable-terminal --enable-multibyte \ --with-compiledby="Sven Guckes guckes@vim.org" --without-x } # 2016-07-18: # VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul 18 2016 01:37:52) # Inklusive der Korrekturen: 1-2066 # Übersetzt von Sven Guckes guckes@vim.org # Riesige Version ohne GUI. Ein- (+) oder ausschließlich (-) der Eigenschaften: # 2003-09-13 function _configure_wget { ./configure --prefix=$HOME --disable-nls } # 2003-09-08 function _configure_zsh { ./configure --prefix=$HOME --enable-maildir-support --with-curses-terminfo } #################################################################### # SCREEN #################################################################### # taking a look at the timestamps in the source code: # tar tvvzf screen-4.0.3.tar.gz # | grep -o '[12][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]' # | sort -n -u | less +G function screen_timestamps { grep -r -o '[12][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]' . | sort -n -u | less +G } # show the current settings for caption and hardstatus lines for screen: alias screen_cap_hard="egrep '^ (caption|hardstatus) ' .screenrc" # 2009-06-18 function caphard { if [[ $# = 0 ]] then echo "Usage: $0 on|off" echo "Purpose: turn caption and hardstatus lines on/off." fi if [[ $1 == "off" ]] then screen -X caption splitonly screen -X hardstatus ignore fi if [[ $1 == "on" ]] then screen -X caption always screen -X hardstatus alwayslastline fi } # 2003-07-08 # fix the broken setup for DISPLAY # export DISPLAY="`cat ~/.ip`:0.0" # alias _su='screen -X setenv DISPLAY `cat ~/.ip`:0.0' # # 2005-01-08 # full communication # alias COMM='screen -t COMM 9 screen -m -e^xx -S communication irssi' alias COMM='screen -t COMM 9 screen -m -c ~/.screenrc.comm' alias COMM='screen -t COMM 9 screen -m -c ~/.screenrc.comm' alias WORK='screen -m -c ~/.screenrc.work' alias work='screen -d -r work' alias comm='screen -t COMM -x comm' # alias U='screen -U -r' # # 2005-01-21 # rename current screen session to PID.$HOST.newname # function sessionname {screen -S $STY -X sessionname $HOST.$1 } # todo: this needs to adjust $STY to allow another change. # usage: number N # change number of current shell window to N alias number='screen -S $STY -X number' # I needed a quick way to start the page on the 23C3: # alias 23='exec links http://www.guckes.net/cccc2006/' # alias 23='screen -t 23C3 links http://www.guckes.net/cccc2006/' # alias 23='screen -t 23C3 links http://events.ccc.de/' # 2009-03-10 # function 's' selects the window $1 # and sends $2 as text into it. # could be used from within vim # within a subshell. # ss () { # # TODO: echo usage instructions # screen -p $1 -X stuff $2 # } # for my own version of screen in ~/bin/screen # export SCREENDIR=/var/run/screen/S-guckes # export SCREENDIR=/home/user/guckes/.screen/ # pick up the communications session again # on window #9 with title "COMM": function screen_pickupcomm { screen -S work -X screen 9 screen -S work -X title COMM screen -S work -X stuff '! comm ' } # 2001-10-24 # st == screen-title # set the title of the current screen window to $1: # function st { echo ""$1\" } # this won't break vim's syntax coloring: function st { print -n "\E\"$*\E\134" } #################################################################### # completion control for mutt aliases by Anthony Tong #################################################################### # requires zsh with completion control supporting option "-W"! # function _ma() { # if [[ -r ~/.mutt.aliases ]] { # < ~/.mutt.aliases | while read token alias addy # do if [[ $token == alias ]] reply=($reply $alias) done } # } # # compctl -K _ma + -f + -k "(-f)" -S "=" + -x 's[-f=]' -f -W ~/Mail -- mutt #################################################################### # requesting info from webpages or starting the text browser on them #################################################################### # call "links" - but without the pattern globbing alias li='noglob links' # fir () { firefox -a firefox -remote "openURL($1)" } # ..,2003-07-25 # startup on special webpages # alias rich="links http://www.richholmes.net/genealogy/academic.html" # alias kino='links http://www.kino-berlin.de' # alias kino='links http://berlin.stadtus.de/kino/' # alias limd='links http://orga.mdlug.de/gruni/neu/vortrag.html' # 2002-01-11 # alias netmind='links http://www.netmind.com/URL-minder/new/register.html' # changed its name to changemind.com - and has been discontinued. # now is changedetect.com ("web page monitoring"| # 2015-11-03 cost: 2$/m 24$/y # 2001-11-17,2001-12-05 # call the dictionary interface at TU Chemnitz: # alias dict='screen -t DICT links dict.tu-chemnitz.de' # calling it usually from within screen with "CTRl-A d" # 2001-12-23, 2002-11-17, 2017-06-21 # _acro -> expand an acronym # todo: take a look at the site # http://www.abbreviations.com/ function _acro { if [[ $# = 0 ]] then echo "Usage: $0 acronym" echo "Purpose: expand an acronym" else #links "http://www.ucc.ie/cgi-bin/acronym?$1" #links "http://www.acronymfinder.com/af-query.asp?String=exact&Acronym=$1" links "http://www.acronymfinder.com/$1.html" fi } ##################################################################### # special stuff comes last - much easier to debug ;-) ##################################################################### # an easy example for completion - the cities in austria # which takes part in the "linux weeks" (lw) event: # staedte=(bregenz dornbirn eisenstadt graz innsbruck klagenfurt linz salzburg stpoelten wien) staedte=(dornbirn eisenstadt graz linz wien) compctl -k staedte lw # Tetris! :-) autoload -U tetris zle -N tetris bindkey "^Xt" tetris # C-x t zum Spielen # Viele vorinstallierte Completions für *diverse* Programme. autoload -U compinit ; compinit -u # U.A. farbige Completion zmodload -i zsh/complist # cd & co.: Nur Verzeichnisse anzeigen. compctl -g '*(-/)' + -g '.*(/)' cd chdir dirs pushd rmdir dircmp cl # tar & co.: Nur Archivdateien und Verzeichnisse anzeigen. compctl -g '*.(gz|z|Z|t[agp]z|tarZ|tz)' + -g '*(-/)' gunzip gzcat zcat # Soundprogramme: Sounds + Playlisten + Verzeichnisse anzeigen. compctl -g '*.(mp3|MP3|ogg|OGG|temp|TEMP|m3u|pls)' + -g '*(-/)' mpg123 xmms EP # Browser: Nur HTML-Seiten und Verzeichnisse. compctl -g "*.html *.htm" + -g "*(-/) .*(-/)" + -H 0 '' w3m lynx elinks wget opera EL O # xpdf: Nur PDFs und Verzeichnisse. # compctl -g '*.(pdf|PDF)' + -g '*(-/)' xpdf pdf2ps # compctl -g '*.(pdf|PDF)' xpdf pdf2ps compctl -g '*.pdf' xpdf pdf2ps # Bilderanzeige: Nur Bilder und Verzeichnisse. compctl -g '*.(jpg|JPG|jpeg|JPEG|gif|GIF|png|PNG|bmp)' + -g '*(-/)' gimp xv display gqview # xdvi: DVIs und Verzeichnisse anzeigen. compctl -g '*.dvi' + -g '*(-/)' dvips xdvi gxdvi # lp und gv: Postscript-Dateien und Verzeichnisse anzeigen. compctl -g '*.ps' + -g '*(-/)' lp gv # autoload compinit complist # zstyle ':completion:*:ssh:*' hosts `sed -e 's/[ \t,].*//' ~/.ssh/known_hosts` # snarf snarf.. # local _myhosts # _myhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts|grep -v '#')"}:#[0-9]*}%%\ *}%%,*} ) # zstyle ':completion:*' hosts $_myhosts # kill - unglaubliche Completions! zstyle ':completion:*:kill:*' command 'ps xf -u $USER -o pid,%cpu,tty,cputime,cmd' zstyle ':completion:*:kill:*' insert-ids single zstyle ':completion:*:*:kill:*' menu yes select zstyle ':completion:*:kill:*' force-list always # less und mutt: Umfangreiches Menü. zstyle ':completion:*:*:less:*' menu yes select zstyle ':completion:*:*:mutt:*' menu yes select ### OBSOLETE ### # alias MMV="mmv 'img_????.jpg' 'img_2#1#2#3#4.jpg'" # alias MMV2="mmv 'IMG_????.JPG' 'img_2#1#2#3#4.jpg'" # alias wm='telnet ascii-wm.net 2006' # alias irckl='screen -t IRC 10 irssi -c irc.kunstlabor.at' # alias to='links http://gw.kunstlabor.at/to/' # the /bin/ln seems to be broken. # use /usr/bin/ln instead: # alias lns='/usr/bin/ln -s' # /bin/ls seems to be broken on Solaris # alias lns='/usr/bin/ln -s' ## obsolete picture conversion project # alias _cd='cd /vol/druckerei' # alias _cdb1='cd /vol/druckerei/buch1/tex' # alias _cdb2='cd /vol/druckerei/buch2/tex' # alias _cdbuch='cd /Vol/druckerei/pics' # alias _cdbuch='cd /import/druckerei/' # alias _cdbuchpics='cd ~`echo hgrshpuf|rot13`/.public_html/buch/pics' # function _such { grep $1 /import/druckerei/buch?/tex/*tex } # start mutt on some big folders - # does not require a shell and they # can start up in the background. # alias AU='screen -t AUGSBURG mutt -f ~/Mail/AUGSBURG' # 2006-03-08 # alias BB='screen -t BLIT mutt -f ~/Mail/BRANDENBURG' # alias BR='screen -t BLIT mutt -f ~/Mail/BRANDENBURG' alias CH='screen -t Chemnitz mutt -f ~/Mail/CHEMNITZ' # alias DD='screen -t Dresden mutt -f ~/Mail.IN/DRESDEN' # alias EA='screen -t EH07 mutt -f ~/Mail/EASTERHEGG' # alias FO='screen -t FOSDEM mutt -f ~/Mail/FOSDEM' # alias FR='screen -t FrOSCon mutt -f ~/Mail/FROSCON' # 2006-06-13 # alias FS='screen -t Graz mutt -f ~/Mail/FREESUMMER' alias GR='screen -t Graz mutt -f ~/Mail/GRAZ' # 2010-04-03, 2016-04-17 # alias KA='screen -t Karlsruhe mutt -f ~/Mail/KARLSRUHE' # alias LI='screen -t LINZ mutt -f ~/Mail/LINZ' # 2006-06-13 # alias LT='screen -t LinuxTag mutt -f ~/Mail/LINUXTAG' # 2004-11-15 # alias MD='screen -t Magdeburg mutt -f ~/Mail.IN/MAGDEBURG' # alias PF='screen -t Pforzheim mutt -f ~/Mail/PFORZHEIM' # alias TT='screen -t THINKTANK mutt -f ~/Mail/THINKTANK' # 2007-01-21 # alias UK='screen -t UKUUG mutt -f ~/Mail/UKUUG' # 2005-04-25 # alias VO='screen -t VORTRAEGE mutt -f ~/Mail/VORTRAEGE' # 2005-09-02 # alias WI='screen -t WIEN mutt -f ~/Mail/WIEN' # 2005-04-26 # alias WI='screen -t WIESBADEN mutt -f ~/Mail/WIESBADEN' # 2006-04-26 # alias ZW='screen -t Zweibruecken mutt -f ~/Mail/ZWEIBRUECKEN' # 2005-07-23 # # alias scmail='screen -t +MAIL 7 mutt -y' # alias scmutt='screen -t +MUTT 8 mutt -f ~/Mail.IN/MUTT' # alias scvim=' screen -t +VIM 9 mutt -f ~/Mail.IN/VIM' # invoke special manual # alias screenh='man ~/man/man1/screen.1' # 2018-03-23 # source ~/scripts/z.sh # 2018-11-26 # [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh # echo personal end # vim: set et ft=sh tw=99: THPXRF EOF