# Docker
#alias d='docker $*'
#alias d-c='docker-compose $*'

# git
# Use `hub` as our git wrapper:
#   http://defunkt.github.com/hub/
hub_path=$(which hub)
if (( $+commands[hub] ))
then
  alias git=$hub_path
fi

# The rest of my fun git aliases
alias gl='git pull --prune'
alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
alias gp='git push origin HEAD'

# Remove `+` and `-` from start of diff lines; just rely upon color.
alias gd='git diff --color | sed "s/^\([^-+ ]*\)[-+ ]/\\1/" | less -r'

alias gc='git commit'
alias gca='git commit -a'
alias gco='git checkout'
alias gcb='git copy-branch-name'
alias gb='git branch'
alias gs='git status -sb' # upgrade your git if -sb breaks for you. it's fun.
alias gac='git add -A && git commit -m'
alias ge='git-edit-new'

# metasploit
alias msftun="msfconsole -q -a -x 'setg lhost tun0; setg lport 443; setg exitfunc thread; setg payload windows/x64/meterpreter/reverse_tcp; setg EnableStagedEncoding true; use exploit/multi/handler'"

# openvpn
alias vpn-kill="killall openvpn"
alias vpn-htb='openvpn $CTF/htb/borari.ovpn > /dev/null 2>&1 &'
alias vpn-oscp='openvpn --config $OFFSEC/oscp/lab/vpn/pwk2.ovpn --auth-user-pass $OFFSEC/oscp/lab/vpn/pass.txt > /dev/null 2>&1 &'
alias vpn-osep='openvpn --config $OFFSEC/osep/vpn/pen300.ovpn --auth-user-pass $OFFSEC/osep/vpn/pass.txt > /dev/null 2>&1 &'
alias vpn-oswe='openvpn --config $OFFSEC/oswe/vpn/awae.ovpn --auth-user-pass $OFFSEC/oswe/vpn/pass.txt > /dev/null 2>&1 &'
alias vpn-pg='openvpn --config $OFFSEC/proving_grounds/vpn/vpn_config.ovpn --auth-user-pass $OFFSEC/proving_grounds/vpn/pass.txt > /dev/null 2>&1 &'

# python
alias pytp="python2 -m SimpleHTTPServer 80"

# rdesktop
alias rdp="rdesktop"

# ssh
alias ssh-pw='ssh -o PubkeyAuthentication=no'
alias pubkey="more ~/.ssh/id_rsa.pub"

# system
alias sudo='sudo env \"PATH=$PATH\"'
alias la-'ls -lAh --color'
alias ls1='ls -1 --color'
alias ll='ls -lh --color'

# tmux
# Some tmux-related shell aliases
# Attaches tmux to the last session; creates a new session if none exists.
alias t='tmux attach || tmux new-session'
alias ta='tmux attach -t'
alias tn='tmux new-session'
alias tl='tmux list-sessions'

# xclip
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'

# zsh
alias reload!=". ~/.config/zsh/.zshrc"
