# ██ # ░██ # ██████ ██████░██ # ░░░░██ ██░░░░ ░██████ # ██ ░░█████ ░██░░░██ # ██ ░░░░░██░██ ░██ # ██████ ██████ ░██ ░██ # ░░░░░░ ░░░░░░ ░░ ░░ # # ▓▓▓▓▓▓▓▓▓▓ # ░▓ author ▓ xero # ░▓ code ▓ https://code.x-e.ro/dotfiles # ░▓ mirror ▓ https://git.io/.files # ░▓▓▓▓▓▓▓▓▓▓ # ░░░░░░░░░░ # #█▓▒░ aliases alias c="clear" alias l="ls -hF --color=auto" alias ll="ls -lahF --color=auto" alias e="$EDITOR" alias se="sudo $EDITOR" alias g="git" alias u="node ~/src/unicoder/unicoder.js " #lazy alias "cd.."="cd ../" alias rmrf="rm -rf" alias psef="ps -ef" alias ZZ="exit" #git alias ga="git add" alias gc="git commit -m" alias gs="git status" alias gd="git diff" alias gf="git fetch" alias gm="git merge" alias gr="git rebase" alias gp="git push" alias gu="git unstage" alias gg="git graph" alias ggg="git graphgpg" alias gco="git checkout" alias gcs="git commit -S -m" alias gpr="gh pr create" #overrides alias mkdir="mkdir -p" alias cp="cp -r" alias scp="scp -r" alias vimdiff="nvim -d -u ~/.vimrc" alias apt="sudo apt" alias doc="sudo docker" alias docker="sudo docker" alias systemctl="sudo systemctl" alias proxychains="proxychains -q" alias ag="ag --color --color-line-number '0;35' --color-match '46;30' --color-path '4;36'" alias tree='tree -CAFa -I "CVS|*.*.package|.svn|.git|.hg|node_modules|bower_components" --dirsfirst' #curl alias curlh="curl -sILX GET" alias curld="curl -A \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36\"" alias curlm="curl -A \"Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) CriOS/28.0.1500.12 Mobile/10B329 Safari/8536.25\"" #security alias checkrootkits="sudo rkhunter --update; sudo rkhunter --propupd; sudo rkhunter --check" alias checkvirus="clamscan --recursive=yes --infected /home" alias updateantivirus="sudo freshclam" #silly alias xyzzy="echo nothing happens" alias up="cd ../" alias fuck='sudo $(fc -ln -1)' alias lol="base64 $date\n" export GIT_AUTHOR_DATE=$date export GIT_AUTHOR_EMAIL=$email export GIT_AUTHOR_NAME=$author export GIT_COMMITTER_DATE=$date export GIT_COMMITTER_EMAIL=$email export GIT_COMMITTER_NAME=$author [ ! "$1" ] && git commit || git commit -S$1 unset GIT_AUTHOR_DATE unset GIT_AUTHOR_EMAIL unset GIT_AUTHOR_NAME unset GIT_COMMITTER_DATE unset GIT_COMMITTER_EMAIL unset GIT_COMMITTER_NAME } function greynoise() { IP="${1:-/dev/stdin}" [[ "$IP" =~ "stdin" ]] && read IP < "$IP" [[ "$IP" =~ "([0-9]{1,3}[\.]){3}[0-9]{1,3}" ]] || IP=`dig +short ${IP}` curl -sX GET "https://api.greynoise.io/v2/noise/context/${IP}" -H "Accept: application/json" -H "key: ${GREY_TOKEN}" } function dnsdumpster() { TMP=`mktemp /tmp/dnsdumpXXX` DNS="${1:-/dev/stdin}" cat << EOF > $TMP #!env python from dnsdumpster.DNSDumpsterAPI import DNSDumpsterAPI domain = '$DNS' res = DNSDumpsterAPI().search(domain) print("\n╓───── domain: \n╙────────────────────────────────────── ─ ─") print(res['domain']) print("\n╓───── dns servers: \n╙────────────────────────────────────── ─ ─") for entry in res['dns_records']['dns']: print(("{domain} ({ip})\n {as} {provider} {country}".format(**entry))) print("\n╓───── mx records: \n╙────────────────────────────────────── ─ ─") for entry in res['dns_records']['mx']: print(("{domain} ({ip})\n {as} {provider} {country}".format(**entry))) print("\n╓───── host records: \n╙────────────────────────────────────── ─ ─") for entry in res['dns_records']['host']: if entry['reverse_dns']: print(("{domain} ({reverse_dns}) ({ip})\n {as} {provider} {country}".format(**entry))) else: print(("{domain} ({ip})\n {as} {provider} {country}".format(**entry))) print("\n╓───── txt records: \n╙────────────────────────────────────── ─ ─") for entry in res['dns_records']['txt']: print(entry) EOF chmod +x $TMP && python3 $TMP; rm $TMP }