geodig

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2015 License: MIT Imports: 12 Imported by: 0

README

geodig

Command line tool for looking up Geolocation info for an ip address.

Database

This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.

Build

$go build -o geodig geodig.go

Install using Homebrew

$brew install geodig

Examples

Get location for ip address

$geodig 192.30.252.131
United States (San Francisco)%

Ip addresses can be piped, for use with log files

$echo 192.30.252.131|geodig
United States (San Francisco)%

Analyzing log files

$curl http://#####.###/logs/access.log | awk '{print $1}' | sort | uniq | go run geodig.go --format "(country)\n"| sort | uniq
Afghanistan
Australia
Belarus
Bulgaria
Canada
China
Finland
France
Germany
India
Indonesia
Ireland
Israel
Netherlands
Poland
Romania
Russia
Rwanda
Spain
Thailand
Ukraine
United Kingdom
United States

Creating a shell alias

$alias geodig='go run geodig.go --format "(country)\n"'

Contributions

Contributions are welcome.

Creators

Remco Verhoef

Code and documentation copyright 2011-2014 Remco Verhoef.

Code released under the MIT license.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL