some fun with a python

Python on debian testing and 64 bit is a bit hit and miss, i386 is a lot more easy especially with the apt-get install modules – but i do like an over complex thing since i am bananas in the falklands.

Anyhow i was losing the battle with a geoip lookup output in some bash scripting which brought me to python, as a newbie to python i found an extract that read a file and with a bit of changing put the country and the ip on the same line.  Sounds simple but my attempts before where not usable in a large dataset if it was five records then its not a huge headache but there where way more than that.

Python looks impressive when bash scripting is not up to the job through command output (so not really a bash issue) even with pipes and redirection  (back to plumbing again).  It is worth considering.

The geoip lookup is quite interesting and how it varies from whois data using the maxmind databases in a fast database file.   Who is* right and wrong on the matter is a debate worth having with ‘None’.  although is None and a decision i do agree with

I primarily use the output like a milter (think dkim), before moving back to bash which can do the rest of the stuff easily –  although i am sure i could get python to do the lot if i desired it however with something that takes a list and converts it means i use it with other log files too with the specific input.

It works for the zoo.  So less is more  – I like python.

*not intended as a pun

2 responses

  1. Pingback: An ill-informed and a rather late look at dns security logs | Bananas in the Falklands

  2. Pingback: The paradox of cavemen selling art | Bananas in the Falklands

by golly but...

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.