Copyright James Budiono 2013, 2019
Distributed under GNU General Public License Version 3 or later
(http://www.gnu.org/licenses/gpl.html).

Intro
=====
This is a simple world-map stat counter.
It reads a bunch of IP addresses, and a world map in png format,
and output the same world map in jpeg format with markers where those 
IP address are located.

Dependency: fly (http://martin.gleeson.com/fly) and netpbm tools.
Data file: City IP address: https://dev.maxmind.com/geoip/geoip2/geolite2/
(this file was used: https://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip).

How to install
==============
1. Get the GeoIP Lite City database
2. use https://github.com/maxmind/geoip2-csv-converter to convert the
   Blocks.csv to use integer-range.
3. Preprorcess the converted Blocks.csv using "convert2.sh".
   This generates ipinfo2.dat, the binary representation  of the blocks,
   which will be used by ipgeocode2.
4. A sample map (from wikimedia) is provided (map.png), you can change this
   to others as needed.
5. Copy "ipgeocode2", and "genimage2.sh" to your cgi-bin directory, along with 
   the data files: ipinfo2.dat, and map.png
6. Edit genimage2.sh as needed to set the location of the executables and
   map image details (if you change the map image).
7. Make sure you have "fly" & netpbm installed somewhere.
8. Test your installation by feeding an IP address to genimage2.sh like this:
   echo $INTERNET_FACING_IPADDRESS | ./genimage2.sh > out.jpg and check that
   your own location is marked properly. If you don't know your Internet-
   facing-IP-address, visit icanhazip.com from your browser.
9. If it works, then configure your cgi script to call genimage2.sh properly.
   genimage2.sh reads IP addresses, one of each line, which will be marked on
   the map.
10. That's all!
11. If you have mawk, edit genimage2.sh and change awk to mawk. That will give
    you a 3-fold speed increase.

All the source files are included. Static 32-bit binaries are also included,
so you don't need to compile. If you do need to re-compile, just run "make".

Enjoy,
James, June 2019
