OpenGeoIp generator
Score 50%

Tested on Mac & debian server

Result of all IP adresse from internet 130Mb sqlite3 database.

I need this tool for free offline IP query and Mail sorting.

This app dont need SQL from QT or plugin, the small lib is build in...
Not tested on window, any error report help me..

Here the time to handle all IP adress
Update Ip adress one time at week
processor : 4
vendor_id : GenuineIntel
bogomips : 3990.38
cpu MHz : 1995.191
Table geoblocks end - total line:1903157 Time.El.01:16:10
Table geolocation end - total line:470389 Time.El.00:35:53
Table geoipcountrywhois end - total line:82690 Time.El.00:06:15

1° steep
ogeo -d download all data
ogeo -r insert all data on db
ogeo -c && on interactive modus exec comand -sp to write full countryname

Querying the Database
Querying is pretty straight forward, but remember that IP Addresses are used in their integer representation).

Eg. my current IP translates to 1556337994.

A simple lookup then looks like this:

SELECT loc.*
FROM geolocation loc,
geoblocks blk
WHERE blk.idx = (1556337994-(1556337994 % 65536))
AND blk.startIpNum < 1556337994
AND blk.endIpNum > 1556337994
AND loc.locId = blk.locId;

In case you wonder: the modulo operation there makes the lookup *much* faster. It's an optimization I found at the Maxmind website and adapted from MySQL to sqlite.

-- add additional index
-- (Tip by Kamil Kubica.
UPDATE geoblocks SET idx = (endIpNum - (endIpNum % 65536));
CREATE INDEX geoidx ON geoblocks(idx);

Be the first to comment

product-maker 6 6

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
updated Dec 06 2013
added Dec 06 2013
downloads today
page views today 1