Get the geographical location of an IP address and other networking tricks.

To get the geographical location of an IP address, use this command. This uses ipinfo.io and gets a lot of information about the IP address. 4.4 Tue Mar 17 jason@Yog-Sothoth 0: $ curl -s ipinfo.io/203.113.124.148 | awk ‘{print $2}’ | sed ‘s/"//g’   203.113.124.148, 203-113-124-148.revip.totidc.net, Bangkok, Bangkok, TH, 13.7540,100.5014, AS131293 10100, Asia/Bangkok, https://ipinfo.io/missingauth4.4 Tue Mar … Read more

How to convert an IP address to binary. This is very easy with this command.

This simple one-liner allows conversion of an IP address from decimal to binary. I came up with this after playing around with cut and grep. homer@deusexmachina ~/Documents $ ipcalc 172.18.31.2 | grep Address | cut -b 33-68 10101100.00010010.00011111. 00000010homer@deusexmachina ~/Documents $ ipcalc 172.18.31.2 | grep Address | cut -b 33-68 10101100.00010010.00011111. 00000010 The -b parameter … Read more