From 988a4652e4501ec03ef814e62a5760ba5d69994c Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 3 Nov 2013 14:47:57 +0100 Subject: Merging of several source files for zsh and others. --- .zsh.after/aliases.sh | 36 ---------------- .zsh.after/aliases.zsh | 109 +++++++++++++++++++++++++++++++++++++++++++++-- .zsh.after/export.zsh | 4 ++ .zsh.after/functions.zsh | 96 +++++++++++++++++++++++++++++++++-------- 4 files changed, 188 insertions(+), 57 deletions(-) delete mode 100644 .zsh.after/aliases.sh (limited to '.zsh.after') diff --git a/.zsh.after/aliases.sh b/.zsh.after/aliases.sh deleted file mode 100644 index d6946c7..0000000 --- a/.zsh.after/aliases.sh +++ /dev/null @@ -1,36 +0,0 @@ -# < ALIASES -## ANDROID - alias logcats='adb logcat QMI-RIL:S QMI_FW:S QC-QDI:S QC-NETMGR:S QC-time-services:S LocSvc_api_v02:S LocSvc_utils_q:S LocSvc_utils_ll:S LocSvc_eng:S LocSvc_adapter:S GpsLocationProvider:S AK8975:S dalvikvm:S dalvikvm-heap:S alsa_ucm:S rmt_storage:S ALSAModule:S Adreno200-EGLSUB:S NetworkManagementSocketTagger:S LocationManagerService:S Sensors:S AudioStreamOutALSA:S' - alias fastbootx="fastboot -i 0x0fce" - alias vlog="vim \$(ls -1tr *.log | tail -n 1)" - -## CUSTOM COMMANDS - alias lsmnt='mount | grep \/dev\/sd' - -## HELP - alias helpdd='echo dd if=bla | pv -s 10M | dd of=blob' - -## PACMAN/APT-GET - alias Syu='sudo pacman -Syu' - alias S='sudo pacman -S $@' - alias apt-get='sudo apt-get -o Acquire::http::Pipeline-Depth=0' - -## SHELL - alias .='source' - alias ls='ls --group-directories-first --color=auto' - alias l='ls' - alias lt='ls -tr' - alias ll='ls -l' - alias llh='ls -lh' - alias llt='ls -ltr' - alias la='ls -A' - alias lla='ls -lA' - alias grep='grep --color=auto --exclude-dir=.git' - alias psgrep='ps xa | grep $1' - - alias beep="xset b 100 400 50; echo -e '\a'; xset b off" - -## SHORTCUTS - alias ncm=ncmpcpp - alias cu_omnomnom='cu -s 115200 -l ttyUSB0' -# ALIASES > diff --git a/.zsh.after/aliases.zsh b/.zsh.after/aliases.zsh index afed6ff..6598edb 100644 --- a/.zsh.after/aliases.zsh +++ b/.zsh.after/aliases.zsh @@ -15,6 +15,96 @@ alias -s tlz='tar --lzma -xvf' alias -s rar='unrar x' alias -s tex='mkpdf' + +#ls aliases +alias ls='ls --group-directories-first --color=auto' +alias ll="ls -lh" +alias la="ls -a" +alias lal="ls -alh" +alias ls='ls --group-directories-first --color=auto' +alias l='ls' +alias lt='ls -tr' +alias ll='ls -l' +alias llh='ls -lh' +alias llt='ls -ltr' +alias la='ls -A' +alias lla='ls -lA' + + +## systemd related aliases +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 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' +alias sdj='sudo journalctl' +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"' +alias sdiso='sudo systemctl isolate ' +alias sdrestart='sudo systemctl restart' +alias sdreboot='sudo systemctl reboot' +alias sdpoweroff='sudo systemctl poweroff' +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' + +## Pacman related aliases +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 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 paclist='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 cpx="xclip -selection clipboard" @@ -39,10 +129,12 @@ alias cd.scpref="cd /home/dave/.config/SuperCollider" #program aliases alias octave="octave --silent --braindead" alias matlabc="matlab -nodesktop -nosplash" -alias "dropbox restart"="dropbox stop && dropbox start" +alias "dbrestart"="dropbox stop && dropbox start" +alias psgrep='ps xa | grep $1' #nmcli aliases alias nmup="sudo nmcli con up id" +alias nmstat="sudo nmcli con status id" #ssh aliases alias pool='ssh pool -Y' @@ -60,9 +152,18 @@ alias tc.v='truecrypt -t --mount --fs-options=users,uid=$(id -u),gid=$(id -g),fm 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' + ## OVERRIDES - alias du='du -h' - unalias vim - unalias brew +# Colorize grep output +alias grep='grep --color=auto --exclude-dir=.git' +alias exit="clear; exit" +alias du='du -h' +alias .='source' +unalias vim +unalias brew # unalias scp + +## HELP +alias helpdd='echo dd if=bla | pv -s 10M | dd of=blob' + # ZSH ALIASES > diff --git a/.zsh.after/export.zsh b/.zsh.after/export.zsh index 81f117c..bcbe780 100644 --- a/.zsh.after/export.zsh +++ b/.zsh.after/export.zsh @@ -1,6 +1,10 @@ export REPORTTIME=30 export PAGER="less -j4" +export GREP_COLOR="1;33" ## let RVM ignore global ruby export rvm_ignore_gemrc_issues=1 + +#Java font settings/ renderings +export _JAVA_OPTIONS='-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true' diff --git a/.zsh.after/functions.zsh b/.zsh.after/functions.zsh index 1a87ab5..e43dbd6 100644 --- a/.zsh.after/functions.zsh +++ b/.zsh.after/functions.zsh @@ -15,17 +15,6 @@ fi } -## COMPRESSION - function tar_tgz { - tar cvfz $1.tgz $1 - } - function tar_tbz { - tar cvfj $1.tbz $1 - } - function tar_tlz { - tar --lzma -cvf $1.tlz $1 - } - ## DOTFILES function update_dot() { for i in $HOME/dropbox/dot/[a-zA-Z]*; @@ -170,13 +159,86 @@ function publish() { } function securium { - port=44350 - chromium --proxy-server="socks://localhost:$port" & - exit + port=44350 + chromium --proxy-server="socks://localhost:$port" & + exit } ## ZSH - refresh() { - source $HOME/.zshrc - } +refresh() { + source $HOME/.zshrc +} + + + +#Decompress any given compressed file +extract () { +if [ -f $1 ] ; then +case $1 in + *.tar.bz2) tar xvjf $1 ;; + *.tar.gz) tar xvzf $1 ;; + *.bz2) bunzip2 $1 ;; + *.rar) unrar x $1 ;; + *.gz) gunzip $1 ;; + *.tar) tar xvf $1 ;; + *.tbz2) tar xvjf $1 ;; + *.tgz) tar xvzf $1 ;; + *.zip) unzip $1 ;; + *.Z) uncompress $1 ;; + *.7z) 7z x $1 ;; + *) echo "don't know how to extract '$1'..." ;; +esac +else +echo "'$1' is not a valid file!" +fi +} + +extract_to() { + if [ -f $2 ] ;then + echo "Extracting to '$2'" + local out = $2 + else + echo "Extracting to '$( pwd )'" + local out = $( pwd ) + fi + if [ -f $1 ] ;then + echo "'$1'" + else + echo "'$1' is not a valid file!" + fi +} + +## compress stuff +function tar_tgz { + tar cvfz $1.tgz $1 +} +function tar_tbz { + tar cvfj $1.tbz $1 +} +function tar_tlz { + tar --lzma -cvf $1.tlz $1 +} + +##CRYPTSETUP AND LUKS +function lopen () { + case $1 in + "music") + sudo cryptsetup luksOpen /dev/disk/by-uuid/b2a8c89e-22f3-4e16-bdd3-ef4bcac8ed4f $1 + ;; + "photos") + sudo cryptsetup luksOpen /dev/disk/by-uuid/b2a8c89e-22f3-4e16-bdd3-ef4bcac8ed4f $1 + ;; + esac + sudo mount /dev/mapper/$1 /mnt/$1 +} + +function lclose () { + mountpoint /mnt/$1 + notmounted=$? + if [[ $notmounted != 0 ]] ; then + sudo umount /mnt/$1 + sudo cryptsetup luksClose $1 + fi +} + # FUNCTIONS > -- cgit v1.2.3-70-g09d2