OpenGeoIp generator

Database

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Available as/for:
Description:
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 92.195.213.74 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. https://www.maxmind.com/app/csv)
ALTER TABLE geoblocks ADD COLUMN idx INTEGER;
UPDATE geoblocks SET idx = (endIpNum - (endIpNum % 65536));
CREATE INDEX geoidx ON geoblocks(idx);

Ratings & Comments

0 Comments

Be the first to comment
Pling
0 Affiliates
Details
license
version 0.2.3
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

Other Database:

Navicat (MySQL Manager)
navicat
last update date: 17 years ago

Score 4.7

Navicat (MySQL Manager)
navicat
last update date: 17 years ago

Score 4.7

konsultant
umeboshi
last update date: 20 years ago

Score 5.0

[idea] KRestaurantDB
pandarsson
last update date: 17 years ago

Score 5.0

LogMiles
vafada
last update date: 17 years ago

Score 5.0

Nepomuk set videos Duration
yehielb
last update date: 12 years ago

Score 5.7



System Tags