Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thc2cat/geocli
geoip cli for ip address localization
https://github.com/thc2cat/geocli
cli dns geoip2 logs
Last synced: 2 days ago
JSON representation
geoip cli for ip address localization
- Host: GitHub
- URL: https://github.com/thc2cat/geocli
- Owner: thc2cat
- License: other
- Created: 2021-04-30T14:42:07.000Z (about 3 years ago)
- Default Branch: production
- Last Pushed: 2022-09-16T12:41:47.000Z (almost 2 years ago)
- Last Synced: 2024-03-18T11:34:51.791Z (4 months ago)
- Topics: cli, dns, geoip2, logs
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-stars - thc2cat/geocli - geoip cli for ip address localization (Go)
README
# GeoCli
## Purpose
`geocli` is a CLI that provide Geoip and dns checkout.
`geocli` come with geolite country database directly embedded into the cli binary.## Needs
* Create an account on Maxmind site for downloading database.
## Build
* Makefile download and extract maxmind geolite database.
* Makefile get exact asset name and replace in template init.go
* ~~Makefile build name.go from assets with go-bindata.~~
* Asset is embedded with go embed facility## Usage
* "-V" is used to show maxmind geolite database version.
* "-r" option read stdin and try to resolve dns in parallel.
* otherwise arg1 is checked.```Shell
$/local/bin/geocli -V
/local/bin/geocli build with GeoLite2-Country_20191001/GeoLite2-Country.mmdb# rg "imap\[.* login: " /var/log/imapd.log | cut -d: -f5- | sed "s/ User.*//g" | rg -v "webmail|TLS" | sort -u|rg -v uvsq | cut -d\[ -f2 | cut -d\] -f1 | sor
37.171.85.185 [37-171-85-185.coucou-networks.fr.] France, FR
10.172.16.103 [unknown] ,
37.164.163.41 [unknown] France, FR
37.170.73.3 [37-170-73-3.coucou-networks.fr.] France, FR
37.164.246.169 [unknown] France, FR
176.179.79.3 [176-179-79-3.abo.bbox.fr.] France, FR
37.170.3.114 [37-170-3-114.coucou-networks.fr.] France, FR
37.171.67.201 [37-171-67-201.coucou-networks.fr.] France, FR
```## References
* go-bindata > go get -u github.com/jteeuwen/go-bindata/...
* go embed see [golang embed](https://golang.org/pkg/embed/)