nibb13 DD-WRT Novice
Joined: 12 Mar 2011 Posts: 3 Location: Ukraine
|
Posted: Sat Aug 06, 2016 13:37 Post subject: ip2loc-lean - ip2location search on low-end hardware |
|
Searches for geolocation data by IP address in tightest environment (~1mb RAM available, no swap on my D-Link DIR-620, works perfect). Doesn't require database, uses ad-hoc search in CSV file.
Source code: https://github.com/nibb13/ip2loc-lean
Usage example:
Code: | # ./ip2loc-lean.sh -sc 8.8.8.8 csv
"US","United States" |
Key features:
- As lean as possible. Only tools required: POSIX-shell (busybox/ash is OK), awk, stat or ls -l, dd.
- Fast enough. ~0.4s per query on D-Link DIR-620.
- IPv4 & IPv6 are supported. bc can be used for IPv6 calculations if available. Pure awk fallback (bit slower) is used if not.
- Uses free databases provided by http://lite.ip2location.com Automatic download/update is available (require more tools: wget or curl, crontab, unzip, grep)
Suggestions, bug reports etc. are appreciated. |
|