https://github.com/dutchcoders/geodig
Command line tool for looking up Geolocation info for an ip address.
https://github.com/dutchcoders/geodig
Last synced: about 1 year ago
JSON representation
Command line tool for looking up Geolocation info for an ip address.
- Host: GitHub
- URL: https://github.com/dutchcoders/geodig
- Owner: dutchcoders
- License: mit
- Created: 2015-01-11T22:29:16.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-22T21:22:34.000Z (over 11 years ago)
- Last Synced: 2025-03-25T12:12:54.765Z (over 1 year ago)
- Language: Go
- Size: 230 KB
- Stars: 15
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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/](http://www.maxmind.com).
## Demo

## Build
```
$ go build -o geodig geodig.go
```
## Install using Homebrew
```
$ brew tap dutchcoders/homebrew-geodig
$ 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**
-
-
## Copyright and license
Code and documentation copyright 2011-2014 Remco Verhoef.
Code released under [the MIT license](LICENSE).