From 6d97cbb8c5d0c59dff36cbd996b65b6c751c8170 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 28 Sep 2014 04:35:11 +0200 Subject: Adding further aliases, cleaning up systemd aliases and others. --- .zsh.after/aliases.zsh | 225 ++++++++++++++++++++++++++----------------------- 1 file changed, 121 insertions(+), 104 deletions(-) diff --git a/.zsh.after/aliases.zsh b/.zsh.after/aliases.zsh index 7659e00..c9ee541 100644 --- a/.zsh.after/aliases.zsh +++ b/.zsh.after/aliases.zsh @@ -1,6 +1,4 @@ # < ZSH ALIASES -## SOURCE ALIASES -#[ -e $HOME/.zsh.after/aliases.sh ] && source $HOME/.zsh.after/aliases.sh ## EXTENSIONS alias -s pdf='mupdf' alias -s ps='mupdf' @@ -15,8 +13,7 @@ alias -s tlz='tar --lzma -xvf' alias -s rar='unrar x' alias -s tex='mkpdf' - -#ls aliases +##LS alias ls='ls --group-directories-first --color=auto' alias ll="ls -lh" alias la="ls -a" @@ -32,152 +29,172 @@ alias lla='ls -lA' alias lsfw='ls -lah /dev|grep fw' alias lsvid='ls -lah /dev|grep video' +##DU +alias du1='du -hd1' + +##TREE +alias tree='tree -aC' #grep aliases (with excluded directories) alias grepdot='grep -rI --exclude-dir=".steam" --exclude-dir=".local" --exclude-dir=".thunderbird" --exclude-dir=".mozilla" --exclude-dir="git" --exclude-dir=".rvm" --exclude-dir=".log" --exclude-dir=".dropbox-dist" --exclude-dir=".config" ' -## systemd related aliases + +##SYSTEMD +#tree alias psc='ps xawf -eo pid,user,cgroup,args' alias treeg='tree -d /cgroup/systemd/' -alias sdstree='tree -aC /usr/lib/systemd/system' -alias sdutree='tree -aC /etc/systemd/system' +alias sdptree='tree -aC /usr/lib/systemd/' +alias sdstree='tree -aC /etc/systemd/' +alias sdutree='tree -aC $HOME/.config/systemd/' +#systemctl alias sdl='sudo systemctl --all' alias sdlerr='sudo systemctl --all --full |grep error' alias sdlfail='sudo systemctl --all --full |grep failed' -alias sddreload='sudo systemctl daemon-reload' +#timers +alias sdt='sudo systemctl list-timers' +#journalctl alias sdj='sudo journalctl' +alias sdjf='sudo journalctl -f' alias sdjgrep='sudo journalctl -an1000 |grep ' -alias sdstart='sudo systemctl start' -alias sdstop='sudo systemctl stop' -alias sdreload='sudo systemctl reload' -alias sdenable='sudo systemctl enable' -alias sddisable='sudo systemctl disable' -alias sdreenable='sudo systemctl reenable' -alias sdisactive='sudo systemctl is-active' -alias sdisenabled='sudo systemctl is-enabled' -alias sdstat='sudo systemctl status --all --full' -alias sdcwants='sudo systemctl show -p "Wants"' -alias sdcwantedby='sudo systemctl show -p "WantedBy"' -alias sdcrequires='sudo systemctl show -p "Requires"' -alias sdcrequiredby='sudo systemctl show -p "RequiredBy"' -alias sdcconflicts='sudo systemctl show -p "Conflicts"' -alias sdcconflictedby='sudo systemctl show -p "ConflictedBy"' -alias sdcbefore='sudo systemctl show -p "Before"' -alias sdcafter='sudo systemctl show -p "After"' +#systemd system services +alias sdsstart='sudo systemctl start' +alias sdsstop='sudo systemctl stop' +alias sdsrestart='sudo systemctl restart' +alias sdsreload='sudo systemctl reload' +alias sdsenable='sudo systemctl enable' +alias sdsdisable='sudo systemctl disable' +alias sdsreenable='sudo systemctl reenable' +alias sdsisactive='sudo systemctl is-active' +alias sdsisenabled='sudo systemctl is-enabled' +alias sdsstat='sudo systemctl status --all --full' +alias sdswants='sudo systemctl show -p "Wants"' +alias sdswantedby='sudo systemctl show -p "WantedBy"' +alias sdsrequires='sudo systemctl show -p "Requires"' +alias sdsrequiredby='sudo systemctl show -p "RequiredBy"' +alias sdsconflicts='sudo systemctl show -p "Conflicts"' +alias sdsconflictedby='sudo systemctl show -p "ConflictedBy"' +alias sdsbefore='sudo systemctl show -p "Before"' +alias sdsafter='sudo systemctl show -p "After"' +alias sdst='sudo systemctl list-timers' +alias sdsreload='sudo systemctl daemon-reload' +#systemd user services +alias sdustart='systemctl --user start' +alias sdustop='systemctl --user stop' +alias sdurestart='systemctl --user restart' +alias sdureload='systemctl --user reload' +alias sduenable='systemctl --user enable' +alias sdudisable='systemctl --user disable' +alias sdureenable='systemctl --user reenable' +alias sduisactive='systemctl --user is-active' +alias sduisenabled='systemctl --user is-enabled' +alias sdustat='systemctl --user status --all --full' +alias sduwants='systemctl --user show -p "Wants"' +alias sduwantedby='systemctl --user show -p "WantedBy"' +alias sdurequires='systemctl --user show -p "Requires"' +alias sdurequiredby='systemctl --user show -p "RequiredBy"' +alias sduconflicts='systemctl --user show -p "Conflicts"' +alias sduconflictedby='systemctl --user show -p "ConflictedBy"' +alias sdubefore='systemctl --user show -p "Before"' +alias sduafter='systemctl --user show -p "After"' +alias sdut='systemctl --user list-timers' +alias sdureload='systemctl --user daemon-reload' +#poweroff/reboot/isolate alias sdiso='sudo systemctl isolate ' -alias sdrestart='sudo systemctl restart' alias sdreboot='sudo systemctl reboot' alias sdpoweroff='sudo systemctl poweroff' +#systemd bootchart alias sda='systemd-analyze' alias sdab='systemd-analyze blame' -alias sdap='rm -f $HOME/Dropbox/sync/archlinux/sdap-$HOST.svg; systemd-analyze plot > $HOME/Dropbox/sync/archlinux/sdap-$HOST.svg' +if [ -x /usr/bin/xsvg ]; then + alias sdap='xsvg $HOME/ownCloud/photos/systemd/sdap-$HOST.svg' +fi -## Pacman related aliases +##PACMAN alias paclid="sudo pacman -Qi | sed '/^Depends On/,/^Required By/{ s/^Required By.*$//; H; d }; /^Name/!d; /^Name/{ n;x;}'| sed '/^$/s//==================================================================================/'" -alias pacsize="pacman -Qi | awk '/^Name/ {pkg=\$3} /Size/ {print \$4\$5,pkg}' | sort -n" #All packages by size -alias pacall="sudo pacman -Qi | awk '/^Name/ {pkg=\$3} /Version/ {ver=\$3} /Size/ {size=\$4\$5} {print pkg,ver,size}' | uniq" #All packages uniquely with name, version, size -#alias pacremorph='sudo pacman -Rs $(pacman -Qtdq)' #Remove all orphaned packages -alias pacup='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. -alias pac='sudo pacman -S' # Install specific package(s) from the repositories -alias pacu='sudo pacman -U' # Install specific package not from the repositories but from a file -alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies -alias pacrem='sudo pacman -Rns' # Remove specified package(s), its configuration(s) and unneeded depends -alias pacsearch="pacman -Sl | cut -d' ' -f2 | grep " # Search through all available packages in repo -alias pacname="sudo pacman -Qi|grep Name|grep " #Search through names of packages by string -alias pacri='pacman -Si' # Display information about a given package in the repositories -alias pacrs='pacman -Ss' # Search for package(s) in the repositories -alias pacli='pacman -Qi' # Display information about a given package in the local database -alias pacls='pacman -Qs' # Search for package(s) in the local database -alias pacorph='sudo pacman -Qdt' # Search for orphan packages -alias paclal='sudo pacman -Ql' # List installed files of a given package -alias pacg='pacman -Sg' #List all groups or all packages in specified group -alias pacclean='sudo pacman -Sc' # Remove all packages from local repository, not installed atm, remove all unused repos -alias pacconf='sudo find /etc -name "*.pac*" -type f -print' # Search for .pacnew and .pacsave files -alias pacfile='sudo pacman -Qo' # Find out what package a give file belongs to -alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories -alias pacdep='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package -alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist -alias packup='comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > $HOME/Dropbox/sync/archlinux/pkglist-$HOST' # Backup the current list of non-local packages -alias pacret='sudo pacman -S $(< $HOME/Dropbox/sync/archlinux/pkglist-$HOST)' # Install from the backup list -alias pacredown='sudo pacman -S $(comm -23 <(pacman -Qeq) <(pacman -Qmq))' # Redownload all installed packages (minus AUR) -alias pacdis='rm -f $HOME/Dropbox/sync/archlinux/non-pkg-$HOST; sudo pacman-disowned > $HOME/Dropbox/sync/archlinux/non-pkg-$HOST' # Getting a list of files not owned by any package -alias packimp='sudo pacman-key -r ' #Import a key ID to the pacman keyring -alias packsign='sudo pacman-key --lsign-key ' #Sign a key ID after importing it to the keyring -alias packref='sudo pacman-key --refresh-keys' #Refresh the list of master keys - -##Yaourt aliases -alias yaup='yaourt -Syu --devel --aur' # Updates all locally installed repository, AUR and git packages -alias yadb='yaourt -B $HOME/Dropbox/sync/archlinux' # Backs up the yaourt database - - - -#[ -e ~/Dropbox/sync/archlinux ] && source ~/Dropbox/sync/archlinux/handies.bashrc && source ~/Dropbox/sync/archlinux/color.bashrc && source ~/Dropbox/sync/archlinux/pacman.bashrc && source ~/Dropbox/sync/archlinux/systemd.bashrc - +alias pacsize="pacman -Qi | awk '/^Name/ {pkg=\$3} /Size/ {print \$4\$5,pkg}' | sort -n" #Show all packages by size +alias pacall="sudo pacman -Qi | awk '/^Name/ {pkg=\$3} /Version/ {ver=\$3} /Size/ {size=\$4\$5} {print pkg,ver,size}' | uniq" #All packages uniquely with name, version, size +alias pacup='sudo pacman -Syu' #Synchronize with repositories before upgrading packages that are out of date on the local system. +alias pac='sudo pacman -S' #Install specific package(s) from the repositories +alias pacu='sudo pacman -U' #Install specific package not from the repositories but from a file +alias pacre='sudo pacman -R' #Remove the specified package(s), retaining its configuration(s) and required dependencies +alias pacrem='sudo pacman -Rns' #Remove specified package(s), its configuration(s) and unneeded depends +alias pacsearch="pacman -Sl | cut -d' ' -f2 | grep " #Search through all available packages in repo +alias pacname="sudo pacman -Qi|grep Name|grep " #Search through names of packages by string +alias pacri='pacman -Si' #Display information about a given package in the repositories +alias pacrs='pacman -Ss' #Search for package(s) in the repositories +alias pacli='pacman -Qi' #Display information about a given package in the local database +alias pacls='pacman -Qs' #Search for package(s) in the local database +alias pacorph='sudo pacman -Qdt' #Search for orphan packages +alias paclal='sudo pacman -Ql' #List installed files of a given package +alias pacg='pacman -Sg' #List all groups or all packages in specified group +alias pacclean='sudo pacman -Sc' #Remove all packages from local repository, not installed atm, remove all unused repos +alias pacconf='sudo find /etc -name "*.pac*" -type f -print' #Search for .pacnew and .pacsave files +alias pacfile='sudo pacman -Qo' # Find out what package a give file belongs to +alias pacupd='sudo pacman -Sy && sudo abs' #Update and refresh the local package and ABS databases against repositories +alias pacdep='sudo pacman -S --asdeps' #Install given package(s) as dependencies of another package +alias pacmir='sudo pacman -Syy' #Force refresh of all package lists after updating /etc/pacman.d/mirrorlist +alias packup='comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > $HOME/Dropbox/sync/archlinux/pkglist-$HOST' #Backup the current list of non-local packages +alias pacret='sudo pacman -S $(< $HOME/Dropbox/sync/archlinux/pkglist-$HOST)' #Install from the backup list +alias pacredown='sudo pacman -S $(comm -23 <(pacman -Qeq) <(pacman -Qmq))' #Redownload all installed packages (minus AUR) +alias pacdis='sudo pacman-disowned > /tmp/$USERNAME/non-pkg-$HOST' #Getting a list of files not owned by any package +alias packimp='sudo pacman-key -r ' #Import a key ID to the pacman keyring +alias packsign='sudo pacman-key --lsign-key ' #Sign a key ID after importing it to the keyring +alias packref='sudo pacman-key --refresh-keys' #Refresh the list of master keys + +##YAOURT +alias yaup='yaourt -Syu --devel --aur' #Updates all locally installed repository, AUR and git packages +alias yadb='yaourt -B $HOME/ownCloud/backup/settings/' #Backs up the yaourt database + +##XCLIP alias cpx="xclip -selection clipboard" +alias cpx="xclip" -#load bluetooth headphone module for pulseaudio -alias bthp="pactl load-module module-bluetooth-device address='00:1B:66:01:6C:D1'" -#dir aliases -alias cd.sdu="cd /etc/systemd/system" -alias cd.sds="cd /usr/lib/systemd/system" -alias cd.courses="cd /home/dave/Dropbox/tu-berlin/courses" -alias cd.cks="cd /home/dave/Dropbox/tu-berlin/courses/SE\ Klanganalyse\ und\ Synthese/project" -alias cd.cksp="cd /home/dave/Dropbox/tu-berlin/courses/SE\ Klanganalyse\ und\ Synthese/paper" -alias cd.atlab="cd /home/dave/Dropbox/tu-berlin/courses/PR\ Audiotechnik" -alias cd.atue="cd /home/dave/Dropbox/tu-berlin/courses/UE\ Audiotechnik\ 2" -alias cd.semin="cd /home/dave/Dropbox/tu-berlin/courses/SE\ Minimal\ music\ and\ art" -alias cd.sere="cd /home/dave/Dropbox/tu-berlin/courses/SE\ Digital\ reenactments\ of\ scores\ originally\ requiring\ analog\ electronics" -alias cd.seti="cd /home/dave/Dropbox/tu-berlin/courses/SE\ Time\ and\ space\ perceptions\ in\ sound\ installations" -alias cd.archlinux="cd /home/dave/Dropbox/software/archlinux" -alias cd.syncarchlinux="cd /home/dave/Dropbox/sync/archlinux" -alias cd.scpref="cd /home/dave/.config/SuperCollider" - -#program aliases +##CD +alias cd.sds="cd /etc/systemd/system" +alias cd.sdp="cd /usr/lib/systemd/system" +alias cd.courses="cd $HOME/ownCloud/documents/university/tu-berlin/courses" +alias cd.backup="cd $HOME/ownCloud/backup" +alias cd.scpref="cd $HOME/.config/SuperCollider" + +##OCTAVE #alias octave="octave --silent --braindead --force-gui" alias octave="octave --force-gui" + +##MATLAB alias matlabc="matlab -nodesktop -nosplash" -alias "dbrestart"="dropbox stop && dropbox start" -alias psgrep='ps xa | grep $1' -#nmcli aliases +##NMCLI alias nmup="sudo nmcli con up id" alias nmdown="sudo nmcli con down id" -alias nmstat="sudo nmcli con status" +alias nmstat="sudo nmcli con show --active" alias nmlist="sudo nmcli con list" alias nmdev="sudo nmcli dev" -#ssh aliases +#SSH alias pool='ssh pool -Y' alias sshtunnel="ssh -ND 44350 -v -p 46399 dave@frqb.zapto.org" # tunnel through home alias frqtun="ssh -ND 44350 -v frq" alias scp=scp -#keychain aliases +#KEYCHAIN alias keyflush="keychain --clear && keychain -k mine" -#pulseaudio aliases +#PULSEAUDIO alias pak='pulseaudio --kill' alias pas='pulseaudio --start' alias paflush='pax11publish -r' +alias bthp="pactl load-module module-bluetooth-device address='00:1B:66:01:6C:D1'" #load bluetooth headphone module for pulseaudio -#wake on lan aliases -alias woldave_in='wol -i dave 00:15:f2:e0:e0:c6' -alias woldave_ex='wol -p X -i frqb.zapto.org 00:15:f2:e0:e0:c6' - -#truecrypt mount aliases -alias tc.fav='truecrypt -t --protect-hidden=no -k="" --auto-mount=favorites' -alias tc.v='truecrypt -t --mount --fs-options=users,uid=$(id -u),gid=$(id -g),fmask=0113,dmask=0002 --protect-hidden=no -k="" /dev/disk/by-id/ata-ST9500325AS_6VE457TN /mnt/photos' -alias tc.m='truecrypt -t --mount --fs-options=users,uid=$(id -u),gid=$(id -g),fmask=0113,dmask=0002 --protect-hidden=no -k="" /dev/disk/by-id/ata-ST9500325AS_6VE152RS /mnt/music' -alias tc.d='truecrypt -t -d' - +#WOL +alias woldave_in='wol -i homey 00:15:f2:e0:e0:c6' #wake up homey +alias woldave_ex='wol -p X -i frqb.zapto.org 00:15:f2:e0:e0:c6' #wake up homey via ## OVERRIDES # Colorize grep output alias grep='grep --color=auto --exclude-dir=.git' +alias psgrep='ps aux | grep -v "grep"| grep $1' alias exit="clear; exit" alias du='du -h' alias .='source' -unalias brew -# unalias scp ## HELP alias helpdd='echo dd if=bla | pv -s 10M | dd of=blob' -- cgit v1.2.3-70-g09d2