Last active
February 5, 2017 13:58
-
-
Save bacher09/ae63a1c00cda3226670e to your computer and use it in GitHub Desktop.
Useful aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myip() { | |
curl -4 "http://icanhazip.com/" | |
} | |
myip6() { | |
curl -6 "http://icanhazip.com/" | |
} | |
reverse_ipv4() { | |
local ip="$1" | |
echo "$ip" | awk -F. '{print $4 "." $3 "." $2 "." $1}' | |
} | |
dig_asn() { | |
local rev_ip=$(reverse_ipv4 $1) | |
dig -t TXT +short "$rev_ip.origin.asn.cymru.com" | |
} | |
whois_asn() { | |
whois -h whois.cymru.com " -v $1" | |
} | |
case $(uname -s) in | |
Darwin) | |
pdfman() { | |
man -t $@ | open -f -a /Applications/Preview.app | |
} | |
;; | |
*) | |
evince_stdin() { | |
local temp_file=$(mktemp -t evince-$USER.XXXXXX || exit 1) | |
cat > "$temp_file" | |
evince "$temp_file" | |
sleep 2 | |
rm -f "$temp_file" | |
} | |
pdfman() { | |
man -Tpdf $@ | evince_stdin & | |
} | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment