Store CSV from dp-ip.com to MySQL or SQLite for fast IP-based search.
This is based on the simplest IP -> Country database.
Download country-db:
gunzip -c downloaded_file.gz > iplogs.csv
Filter out only IPv4 addresses into ipv4log.csv:
touch ipv4logs.csv
head -n `grep '224.0.0.0' iplogs.csv -n | cut -d':' -f1` iplogs.csv > ipv4logs.csv
Then run
$ python initsqlite.py
$ python savetosqlite.py
$ python iplookup.py '123.45.67.89'
You will need to manually create the database and table for the MySQL version found under _mysql/