A python script to lookup ip4 addresses and retrieve locational information about them.
e.g :
$ip2location 189.90.151.209
Brazil, Rio Grande do Sul, Sao Luiz Gonzaga
$sudo cat /var/log/nginx/access.log | ag -o "^[\d\.]+ " | uniq | ip2location
Brazil, Rio Grande do Sul, Sao Luiz Gonzaga
...
$ip2location <<< echo 189.90.151.209
Brazil, Rio Grande do Sul, Sao Luiz Gonzaga
$ip2location -c 86.124.71.2
26.133329391479, 44.46667098999
$echo "89.40.97.143\n62.76.8.138" | ip2location -v
<...too long, but you get the idea...>
$ip2location < ips.txt
<...too long, but you get the idea...>
Press Ctrl-C
to gracefully quit.