2018-04-09 03:38:41 +02:00
# Path to your oh-my-zsh configuration.
2018-04-09 01:08:12 +02:00
ZSH = $HOME /.oh-my-zsh
2018-04-09 03:38:41 +02:00
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
2018-04-09 01:08:12 +02:00
ZSH_THEME = "af-magic"
2018-04-09 03:38:41 +02:00
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# alias vi="vim"
2018-04-09 01:08:12 +02:00
2018-04-09 03:38:41 +02:00
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
2018-04-09 01:08:12 +02:00
2018-04-09 03:38:41 +02:00
# Comment this out to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
2018-04-09 01:08:12 +02:00
2018-04-09 03:38:41 +02:00
# Uncomment to change how many often would you like to wait before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13
2018-04-09 01:08:12 +02:00
2018-04-09 03:38:41 +02:00
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
2018-04-09 01:08:12 +02:00
2018-04-09 03:38:41 +02:00
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
2018-04-09 01:08:12 +02:00
2018-04-09 03:38:41 +02:00
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
# Example format: plugins=(rails git textmate ruby lighthouse)
#ALIASES
# vi starts vim
alias vi = "vim"
# update for archlinux
# in debian like oses you should change it to sudo apt update && sudo apt upgrade
# for nixos sudo nix-channel --update && sudo nixos rebuild-switch
2018-04-09 01:08:12 +02:00
alias update = "yaourt -Syua --noconfirm"
2018-04-09 03:38:41 +02:00
#check directory sizes
2018-04-09 01:08:12 +02:00
alias ducks = "du -cksh * | sort -rn | head"
2018-04-09 03:38:41 +02:00
# for backup in git
2018-04-09 01:08:12 +02:00
alias config = '/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
2018-04-09 03:38:41 +02:00
# bind page up and page down? can't remember but think this must be. :)
bindkey "\033[1~" beginning-of-line
bindkey "\033[4~" end-of-line
#Add Plugins to oh my zsh
2018-04-09 01:08:12 +02:00
plugins = ( git archlinux)
2018-04-09 03:38:41 +02:00
#include the oh my zsh config
2018-04-09 01:08:12 +02:00
source $ZSH /oh-my-zsh.sh
2018-04-09 03:38:41 +02:00
# Customize to your needs...
2018-04-09 01:08:12 +02:00
export PATH = $PATH :/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin
export PYTHONPATH = /usr/lib/python3.4/site-packages
2018-04-09 03:38:41 +02:00
# if colors of ls don't work as expected the following line delete all colors from ls
2018-04-09 01:08:12 +02:00
# export LS_COLORS="rs=0:di=01;96:ln=04;01;35:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30; 43:ca=30;41:tw=30;42:$"
2018-04-09 03:38:41 +02:00
# Add dircolors plugin from:
# add it with: yaourt -S zsh-dircolors-solarized-git
# alternatively you can add it with: git clone --recursive git://github.com/joel-porquet/zsh-dircolors-solarized $ZSH_CUSTOM/plugins/zsh-dircolors-solarized
# and than add it to plugins line above (line 40)
# enable it with: setupsolarized
2018-04-09 02:52:48 +02:00
source /usr/share/zsh/plugins/zsh-dircolors-solarized/zsh-dircolors-solarized.zsh
2018-04-09 01:08:12 +02:00
2018-04-09 03:38:41 +02:00
# function to detect ddos attacks
2018-04-09 01:08:12 +02:00
function detect-ddos { $
sudo netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort - n $
}
2018-04-09 03:38:41 +02:00
# function to simple block suspicious IPs
# simply type ipt-block ipadress
2018-04-09 01:08:12 +02:00
function ipt-block {
sudo iptables -A INPUT -s $1 -j DROP
echo " permblocked $1 "
}
2018-04-09 03:38:41 +02:00
#function to load actual IP Blocklist from openbl and ban them out
2018-04-09 01:08:12 +02:00
function update-blacklist {
CHAINLIST = $( sudo /sbin/iptables -nL | grep 'Chain block-traffic-from-openbl' | cut -d\ -f 2)
if [ -z $CHAINLIST ] ; then
sudo /sbin/iptables -N block-traffic-from-openbl
sudo /sbin/iptables -A INPUT -j block-traffic-from-openbl
fi
BLACKLIST = $( /usr/bin/curl -fs http://www.openbl.org/lists/base_7days.txt.gz | gunzip | egrep "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1, 3}\.[0-9]{1,3}" )
if [ $? -ne 0 ] ; then
echo "Blacklist download failed."
exit
fi
sudo /sbin/iptables -F block-traffic-from-openbl
IPCOUNT = $( echo $BLACKLIST | tr ' ' '\n' | wc -l)
echo " Adding $IPCOUNT IPs to blacklist. - $( date) "
echo $BLACKLIST | tr ' ' '\n' | while read -r line ; do
case " $line " in \# *) continue ; ; esac
sudo /sbin/iptables -A block-traffic-from-openbl -p tcp -s $line -j REJECT --reject-with tcp-reset
done
}
2018-04-09 03:38:41 +02:00
# add some PERL Path variables
2018-04-09 01:08:12 +02:00
PATH = " $HOME /perl5/bin ${ PATH + : } ${ PATH } " ; export PATH;
PERL5LIB = " $HOME /perl5/lib/perl5 ${ PERL5LIB + : } ${ PERL5LIB } " ; export PERL5LIB;
PERL_LOCAL_LIB_ROOT = " $HOME /perl5 ${ PERL_LOCAL_LIB_ROOT + : } ${ PERL_LOCAL_LIB_ROOT } " ; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT = " --install_base \" $HOME /perl5\" " ; export PERL_MB_OPT;
PERL_MM_OPT = " INSTALL_BASE= $HOME /perl5 " ; export PERL_MM_OPT;