ip2loc-lean - ip2location search on low-end hardware

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Contributions Upload
Author Message
nibb13
DD-WRT Novice


Joined: 12 Mar 2011
Posts: 3
Location: Ukraine

PostPosted: Sat Aug 06, 2016 13:37    Post subject: ip2loc-lean - ip2location search on low-end hardware Reply with quote
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.
Sponsor
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Contributions Upload All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum