Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####################################################################################################################
- # Convert CSV GeoIPCountryWhois.csv file of Maxmind to a sqlite database to use with Kippo and other bash scripts: #
- ####################################################################################################################
- pepe@juan:~/maxmind$ sqlite3 GeoIPCountryWhois.db
- SQLite version 3.5.13 2011-06-11 02:05:22
- Enter ".help" for instructions
- Enter SQL statements terminated with a ";"
- sqlite> .tables
- sqlite> .mode csv
- sqlite> .separator '","'
- sqlite> create table GeoIPCountryWhois(initip varchar(15),endip varchar(15),initipdec integer,endipdec,cty_acronym varchar(3),cty_name varchar(20));
- sqlite> .import GeoIPCountryWhois.csv GeoIPCountryWhois
- sqlite> .tables
- GeoIPCountryWhois
- sqlite> select * from GeoIPCountryWhois limit 10;
- 1.0.0.0,1.0.0.255,16777216,16777471,AU,Australia
- 1.0.1.0,1.0.3.255,16777472,16778239,CN,China
- 1.0.4.0,1.0.7.255,16778240,16779263,AU,Australia
- 1.0.8.0,1.0.15.255,16779264,16781311,CN,China
- 1.0.16.0,1.0.31.255,16781312,16785407,JP,Japan
- 1.0.32.0,1.0.63.255,16785408,16793599,CN,China
- 1.0.64.0,1.0.127.255,16793600,16809983,JP,Japan
- 1.0.128.0,1.0.255.255,16809984,16842751,TH,Thailand
- 1.1.0.0,1.1.0.255,16842752,16843007,CN,China
- 1.1.1.0,1.1.1.255,16843008,16843263,AU,Australia
- sqlite>.q
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement