# Path to oh-my-zsh installation export ZSH=~/.oh-my-zsh # Disable auto-updates DISABLE_AUTO_UPDATE=true # Set history config HISTFILE=~/.histfile HISTSIZE=1000 SAVEHIST=1000000 # Theme ZSH_THEME="fishy" # Ignore duplicate lines in history setopt HIST_IGNORE_DUPS # Allow autocompletion of alias switches setopt completealiases # Autocorrect commands ENABLE_CORRECTION="true" # Select which plugins to load plugins=(sudo tmux history autojump common-aliases systemd encode64) # Set path export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/games:/usr/bin/core_perl:$HOME/bin:$HOME/gems/bin" # Set gems path export GEM_HOME="$HOME/gems" # Source config file source $ZSH/oh-my-zsh.sh # Set language environment export LANG=en_US.UTF-8 # Set up Go environment export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin # Enable command completion autoload -U compinit compinit autoload -U bashcompinit bashcompinit # Allow arrow key control of completions zstyle ':completion:*' menu select # Find any new executables in path zstyle ':completion:*' rehash true # Preferred editor for local (vim) and remote (nano) sessions if [[ -n $SSH_CONNECTION ]]; then export EDITOR='nano' else export EDITOR='vim' fi ## Aliases alias rec='LC_ALL=en_US.UTF-8 asciinema rec' alias ls='ls --color' alias vim="stty stop '' -ixoff ; vim" alias mirror='wget -p -k -H -P ~/Mirrored/ -e robots=off' alias nat-create='ssh router /config/scripts/nat-create' alias nat-delete='ssh router /config/scripts/nat-delete' alias nat-forward='ssh router /config/scripts/nat-forward' alias nat-unforward='ssh router /config/scripts/nat-unforward' alias nat-list='ssh router /config/scripts/nat-list' alias update-apt='ansible-playbook ~/ansible/update.yml --vault-password-file=~/ansible/vault.txt' alias update-nginx='ansible-playbook ~/ansible/nginx.yml --vault-password-file=~/ansible/vault.txt' alias update-netdata='ansible-playbook ~/ansible/netdata.yml --vault-password-file=~/ansible/vault.txt' alias web-perms='sudo chown -R www-data:www-data /var/www/ && sudo chmod -R 775 /var/www/' alias portcheck='sudo lsof -i -P -n | grep LISTEN' alias wg='sudo wg' alias wg-quick='sudo wg-quick' alias blog-publish='cd ~/blog && JEKYLL_ENV=production bundle exec jekyll build -s /home/sinc/blog -d /var/www/html/docs.seednode.co' alias block='sudo ufw deny from' # function to check the current weather weather (){ curl wttr.in/$1 } # function to monitor and log dropped pings to a host pinglog (){ if [ "$#" -ne 2 ]; then echo "Usage: pinglog
" exit fi pinghost="$1" account="$2" ping -O "$pinghost" 2>&1 | while read pong; do echo "$(date): $pong" | tee -a "$account".log;done } # function to generate thumbnails of all JPGs in a directory thumbnail() { find . ! -name "*_thumb*" -type f -iname "*.JPG" -execdir sh -c "if [ ! -f {}_thumb.JPG ]; then convert -resize 800x800 {} {}_thumb.JPG;fi" -- ';' } # Enable syntax highlighting source $ZSH/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)