added some explanations to zshrc

This commit is contained in:
templis 2018-04-09 03:38:41 +02:00
parent 01fba0e979
commit 0d9dec905f

27
.zshrc
View File

@ -10,7 +10,7 @@
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias vi="vim"
# alias vi="vim"
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
@ -31,32 +31,54 @@
# 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
alias update="yaourt -Syua --noconfirm"
#check directory sizes
alias ducks="du -cksh * | sort -rn | head"
# for backup in git
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
# 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
plugins=(git archlinux)
#include the oh my zsh config
source $ZSH/oh-my-zsh.sh
# Customize to your needs...
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
# Aktuelle LS Colors fällt auf die fresse?
# if colors of ls don't work as expected the following line delete all colors from ls
# 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:$"
# 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
source /usr/share/zsh/plugins/zsh-dircolors-solarized/zsh-dircolors-solarized.zsh
# function to detect ddos attacks
function detect-ddos { $
sudo netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort - n $
}
# function to simple block suspicious IPs
# simply type ipt-block ipadress
function ipt-block {
sudo iptables -A INPUT -s $1 -j DROP
echo "permblocked $1"
}
#function to load actual IP Blocklist from openbl and ban them out
function update-blacklist {
CHAINLIST=$(sudo /sbin/iptables -nL | grep 'Chain block-traffic-from-openbl' | cut -d\ -f 2)
@ -82,6 +104,7 @@ source /usr/share/zsh/plugins/zsh-dircolors-solarized/zsh-dircolors-solarized.zs
done
}
# add some PERL Path variables
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;