Skip to content

Instantly share code, notes, and snippets.

@hzlzh
Created December 7, 2011 07:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hzlzh/1441823 to your computer and use it in GitHub Desktop.
Save hzlzh/1441823 to your computer and use it in GitHub Desktop.
Generate ip-to-country.bin file from ip-to-country.cvs
# use for WordPress Plugin: Show Useragent
# https://github.com/hzlzh/Show-Useragent
wget http://files.firestats.cc/ip2c/ip2c-2.0.0.zip
unzip ip2c-2.0.0.zip
cd ip2c
wget http://software77.net/geo-ip/?DL=1 -O IpToCountry.csv.gz
gunzip IpToCountry.csv.gz
java -jar ip2c.jar -c IpToCountry.csv IpToCountry.bin
ls -sSh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment