rendered paste body#!/bin/bash######################################## MEINE EINSTELLUNGEN# enable color support of ls and also add handy aliasesif[ -x /usr/bin/dircolors ]; then eval "`dircolors -b`"alias ls='ls -h --color=auto'alias dir='dir --color=auto'alias vdir='vdir --color=auto'alias grep='grep -i --color=auto'alias fgrep='fgrep --color=auto'alias egrep='egrep -i --color=auto'#alias today=date +"%A, %B %-d, %Y"# some more ls aliasesalias lll='ls -alF'alias ll='ls -lF'#alias ll='stat -c "%A %a %U:%G %n" ?*'alias lsd='ls -d */'alias la='ls -ACF'alias l='ls -CF'fi## Miscalias logout='gnome-session-save --kill'alias beedit='beesu gedit'alias TV='DISPLAY=:0.1'## Xorgalias xcat='cat /etc/X11/xorg.conf'alias xnano='sudo nano /etc/X11/xorg.conf'alias xtree='nvidia-xconfig -c'alias Xlog='cat /var/log/Xorg.0.log'## Custom Misc,BU-/-REalias backup-deskmenu='cp ~/.config/compiz/deskmenu/menu.xml /opt/backups/Configurations/deskmenu/menu.xml'alias restore-deskmenu='mkdir ~/.config/compiz/deskmenu && cp /opt/backups/Configurations/deskmenu/menu.xml ~/.config/compiz/deskmenu/menu.xml'alias ..='cd ..'alias ...='cd ../..'alias cd..='cd ..'alias du='du -h'alias df='df -h'alias pu='pushd'alias po='popd'alias myrepo='cd /usr/local/repo/12/Everything'##alias mount='mount | column -t'alias webshare='python -c "import SimpleHTTPServer; SimpleHTTPServer.test();"'alias pbin='paste2pastebin.pl'alias gmnext='gmusicbrowser -launch_or_cmd NextSong'## Packageprocessing_distissue="`cat /etc/issue`"# FIXME: this should probably be somewhere else as root doesn't read this file. somewhere inside the global bash definitions,## FIXME: make sure this is sourced by a shell _PKGMNGR= if [ $UID != "0" ];then _PKGMNGR="`which sudo` " fi##case "$_distissue" in *Fedora*|*fedora*|*FEDORA* )# echo "Fedora" _PKGMNGR="$_PKGMNGR `which yum` " ;; *suse*|*Suse*|*SuSE*|*SUSE* )# echo "SuSE" _PKGMNGR="$_PKGMNGR `which zypper`" ;; *debian*|*Debian*|*ubuntu*|*Ubuntu* )# echo "Debian" _PKGMNGR="$_PKGMNGR `which aptitude`" ;; * ) #echo "unknown" _PKGMNGR= ;;esac# ====== DEBUG ============alias yue="echo $_PKGMNGR"# =============================## Define aliases for common commands if a package-manager existsif [ "$_PKGMNGR" != "" ]; then alias yumi="$_PKGMNGR install" alias yup="$_PKGMNGR update" alias yurp="$_PKGMNGR remove" alias yus="$_PKGMNGR search" alias yusi="$_PKGMNGR info"fiunset _PKGMNGR _distissue# WAN IPfunction myip{curl icanhazip.com}# wiki from clifunction wiki(){dig +short txt ${1}.wp.dg.cx}# cmdlinefu searchcmdfu(){ curl "http://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; }# duplicate file finder, based on size, then md5, can take longdupesfind(){find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate}# modinfo - info of all loaded modulesfunction moduleinfo#{modinfo $(cut -d" " -f1 /proc/modules) | sed '/^dep/s/$/\n/; /^file\|^desc\|^dep/!d'}## =============SSH================= ## ##tar cXpf - /some/important/data | ssh user@destination-machine "tar xpf - -C /some/directory/"#rsync -a -e ssh source/ username@remotemachine.com:/path/to/destination/# ### ================================= #export HISTTIMEFORMAT="%F %T "alias lh='ls -a | egrep "^\."'# make dir and change into itmkcd () { mkdir -p "$@" && cd "$@"; }function get-my-pubkey{ gpg --recv-keys --keyserver pgp.mit.edu E7B20A8E}function get-my-rpm-key{ rpm --import http://omploader.org/vMmwyZA/loomsen-pub.asc}# tarviewtarview() { echo -n "Displaying contents of $1 " if [ ${1##*.} = tar ] then echo "(uncompressed tar)" tar tvf $1 elif [ ${1##*.} = tgz ] then echo "(gzip-compressed tar)" tar tvf $1 elif [ ${1##*.} = gz ] then echo "(gzip-compressed tar)" tar tzvf $1 elif [ ${1##*.} = bz2 ] then echo "(bzip2-compressed tar)" cat $1 | bzip2 -d | tar tvf - fi}function createarchive(){tar cvf "$1.tar" $2}# add a new alias to curr shell and the ~/bash.bash_aliases file.function add_alias (){ if [ ! "$1" -a ! "$2" ]; then echo -e "\nUSAGE:#=> \t add_alias mynewalias \"some very long command\"" && exit 1 else local name=$1 value="$2" echo alias $name=\'$value\' >>~/bash.bash_aliases eval alias $name=\'$value\' alias $name fi}myDebugFkt () { echo -e "i'm a function in $_ but I don't know my name";}