determine to use something besides jqnatividad/qsv
format with black
Get public IP and location of local machine
scripts/dbip-lite-to-sqlite3
: Python script to convert DB-IP "IP to City Lite" CSV database to SQLite
scripts/ip-lookup
: Python script to show public IP address of local machine - fancier alternative to curl -s https://api.ipify.org
etc
scripts/ip-to-geolocation
: Python script to convert IP address to geolocation - based on DB-IP "IP to City Lite" database
scripts/dbip-lite-to-sqlite3.sh
: Bash version of scripts/dbip-lite-to-sqlite3
- very slow, introduces gawk
and sqlite3
dependencies
scripts/dig-geoip.sh
: simple Bash version of scripts/ip-to-geolocation
- slow, introduces awk
dependency, doesn't require passing IP address argument
scripts/ip-to-geolocation.sh
: simplified Bash version of scripts/ip-to-geolocation
- also returns ISP, but reliant on web services, introduces jq
dependency
Warning: CSV file is over 500 MB as of May 2023.
# this only takes a few seconds
./dbip-lite-to-sqlite3 dbip-city-lite-YYYY-MM.csv dbip-city-lite-YYYY-MM.sqlite
dbip-city-lite-YYYY-MM.sqlite
should be about half the size of the CSV.
./ip-lookup
./ip-to-geolocation <ip-address> dbip-city-lite-YYYY-MM.sqlite
OpenAI GPT-4 wrote most of this code.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.