Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vicendominguez
Created February 4, 2014 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vicendominguez/8803359 to your computer and use it in GitHub Desktop.
Save vicendominguez/8803359 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
# a lot of years ago... recovered
use Geo::IP2Location;
if ($#ARGV != 1 ) {
print "usage: checkip.pl <fichero.bin.ip> <ip>\n";
exit;
}
$fichero=$ARGV[0];
$IP=$ARGV[1];
$obj = Geo::IP2Location->open($fichero);
my ($countryshort, $countrylong, $region, $city, $latitude, $longitude, $zipcode, $timezone, $isp, $domain, $netspeed) = $obj->get_all($IP);
print "\nhash: $obj\n";
print "isp: $isp\n";
print "ciudad: $city\n";
print "pais: $countrylong\n";
print "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment