{"id":19397327,"url":"https://github.com/tuxxy/ip-location-map","last_synced_at":"2025-07-06T13:33:53.463Z","repository":{"id":29669305,"uuid":"33211521","full_name":"tuxxy/ip-location-map","owner":"tuxxy","description":null,"archived":false,"fork":false,"pushed_at":"2016-05-27T11:25:27.000Z","size":15,"stargazers_count":44,"open_issues_count":0,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T05:33:56.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuxxy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-31T21:40:21.000Z","updated_at":"2024-09-03T12:32:32.000Z","dependencies_parsed_at":"2022-09-14T21:22:01.036Z","dependency_job_id":null,"html_url":"https://github.com/tuxxy/ip-location-map","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tuxxy/ip-location-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuxxy%2Fip-location-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuxxy%2Fip-location-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuxxy%2Fip-location-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuxxy%2Fip-location-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuxxy","download_url":"https://codeload.github.com/tuxxy/ip-location-map/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuxxy%2Fip-location-map/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263908494,"owners_count":23528462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T10:42:24.090Z","updated_at":"2025-07-06T13:33:53.412Z","avatar_url":"https://github.com/tuxxy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ip-location-map\n\nHere are some python scripts you can use to plot ip-addresses on a map\n\nIf you don't have a non-free email account and can't get an API key, see the [freegeoip branch](https://github.com/tuxmascot/ip-location-map/tree/freegeoip).\n\n### Dependencies:\n\n* [matplotlib basemap](http://matplotlib.org/basemap/)\n* [pyipinfodb](https://github.com/mossberg/pyipinfodb)\n\n\nYou can install pyipinfodb very easily with the requirements.txt file:\n\n    pip install -r requirements.txt\n\nThis will satisfy the pyipinfodb dependency, but, as of the current release, you will still need to install matplotlib basemap manually.\n\n### Short usage guide:\n\n* First, you need to get an API key for [ipinfodb](http://ipinfodb.com/)\n\n* Put your IP-addresses in a file called **ips.txt**, with one IP on each line. (Note: only tested with IPv4)\n\n* Run the **getlocation.py** script, like so: `python getlocation.py \u003cAPI_KEY\u003e \u003c ips.txt \u003e geo.txt` It will create a file called **geo.txt**, which contains coordinates on each line.\n\n* Finally, run the **generatemap.py** script, like so: `python generatemap.py \u003c geo.txt` It will create an image file called map.png.\n\nYou can play around with the settings in **generatemap.py**, to use different map projections, different colors and so on.\n\n\nI used this to plot refused SSH connections on my linux machine. I used the following command to fill ips.txt:\n\n    grep \"refused\" /var/log/auth.log | awk '{ print $9 }' | sort | uniq \u003e ips.txt\n\nYou can also run the whole process as a single pipeline:\n    \n    grep \"refused\" /var/log/auth.log | awk '{ print $9 }' | sort | uniq | python getlocation.py \u003cAPI_KEY\u003e | python generatemap.py\n\nNote that I grep for lines with \"refused\". These are connections refused because of rules in /etc/hosts.deny and /etc/hosts.allow. You may need to change the command to suit your configuration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuxxy%2Fip-location-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuxxy%2Fip-location-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuxxy%2Fip-location-map/lists"}