# Options set -o shwordsplit # Aliases alias zz='source ~/.zshrc' alias vz='vim ~/.zshrc && source ~/.zshrc' alias vp='vim $ZSH/plugins/david.zsh && source ~/.zshrc' alias vt='vim $ZSH/themes/david.zsh && source ~/.zshrc' alias vi="vim" alias vless="/usr/share/vim/vim73/macros/less.sh" alias publish="python2 -m SimpleHTTPServer" alias push="git push origin master" alias pull="git pull origin master" alias dev="ssh -l david 10.9.0.43" alias t="todo.sh" alias vpn="sudo openvpn --writepid /var/run/openvpn --config /home/david/.vpn/david.conf" alias aec="sshuttle -vvr ftp.aec.at 192.168.6.0/24 90.146.8.0/26 10.9.0.0/26 10.12.0.0/16" alias c="clear" # Functions pingscan() { nmap -sP $@ | grep "Nmap" } rdp() { if [ -z $1 ]; then echo -e "server: \c" read server else server=$1 fi echo -e "username [hubertus]: \c" read username if [ -z $username ]; then username="hubertus" fi echo -e "domain [aec.at]: \c" read domain if [ -z $domain ]; then domain="aec.at" fi #rdesktop -u $username -p - -d $domain -g 1366x768 $server -k de rdesktop -K -u $username -p - -d $domain -g workarea $server -k de } pullmyzsh() { cd $ZSH git pull origin master cd - } pushmyzsh() { cd $ZSH git add **/*[^lastrun] git commit -am "pushmyzsh $(date "+%d.%m.%Y %H:%M")" git push origin master cd - } update() { #checking for system systems="ubuntu arch" issue="$(cat /etc/issue)" for item in $systems; do echo $issue | grep -i $item >> /dev/null if [ $? -eq 0 ]; then system=$item fi done case $system in ubuntu) sudo apt-get update && sudo apt-get dist-upgrade ;; arch) sudo pacman -Syu ;; ?) echo "unknown system. could not run update." ;; esac } install() { #checking for system systems="ubuntu arch" issue="$(cat /etc/issue)" packages=$* for item in $systems; do echo $issue | grep -i $item >> /dev/null if [ $? -eq 0 ]; then system=$item fi done case $system in ubuntu) sudo apt-get install -y $packages ;; arch) sudo pacman -Sy --noconfirm $packages ;; ?) echo "unknown system. could not run install." ;; esac } is_dirty() { local SUBMODULE_SYNTAX='' if [[ $POST_1_7_2_GIT -gt 0 ]]; then SUBMODULE_SYNTAX="--ignore-submodules=dirty" fi if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then return 1 else return 0 fi }