logo

dotfiles

My dotfiles, one branch per machine, rebased on base git clone https://hacktivis.me/git/dotfiles.git
commit: 0a2a67d7659f33021df9989dc6b9eb4c71d7a2e5
parent 4119dc6f0323808c21095d4aa03ea4e722f36cad
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 23 Jul 2022 18:48:10 +0200

.common.sh: Add ASN lookup functions

Diffstat:

M.common.sh8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/.common.sh b/.common.sh @@ -228,6 +228,14 @@ gitclone() { cd "$dir" } +# https://team-cymru.com/community-services/ip-asn-mapping/ +ip2asn_stdin() { + ( echo begin ; cat - ; echo end ) | nc whois.cymru.com 43 | sort -n +} + +ip2asn_arg() { + echo "$@" | nc whois.cymru.com 43 +} # startup