Category Archives: Blog Post

United Airlines Computer “Glitch” or hacked?

In case you were flying United Airlines on Friday the 17th, you may have noticed the United Airlines staff were a bit frantic.

United said its flight departures, airport processing and reservation system, including its website, were affected by the outage.

- http://www.businessweek.com/ap/financialnews/D9NU7J481.htm

My question is simply this…hacked? or did a squirrel chew through the fiber again?

Comment away guys!

How To Python import GeoIP in OS X

python-powered-h-100x130

I’ve recently purchased a MacBook Pro and I started doing some Python/Django development. I came to a point where I had to use some of MaxMind.com’s GeoIP module and setting GeoIP up on OSX was a bit more challenging than Ubuntu but it wasn’t too bad.

In Ubuntu you can essentially sudo apt-get install python-geoip and things start working but it takes a slight bit more in OSX.

 

In order to do this on the Mac/OS X you need to install two things,
1. The MaxMind GeoIP C library http://www.maxmind.com/app/c
./configure
make
make check
make install

and 2. The Python MaxMind GeoIP library http://www.maxmind.com/app/python
python2 setup.py build
python2 setup.py install

 

For further information here’s a great page on MaxMind.com http://www.maxmind.com/app/geoip_resources

Google Adds Voice Search to Homepage

It appears that Google has added voice search to their homepage today.

This feature has been on Android and iPhones for quite a while now, providing nearly hands free searching to it’s users.

Google homepage updated with voice search

Pointless Rants Android Update! v1.1

Hey! I added some new stuff to the android app! You can listen to podcasts now! I know it doesn’t work great but the capability is at least there.

I also added some loading messages. I hope you guys can get some use out of it! Thanks to all those who’ve downloaded already!

If for some reason you don’t have the app then you can download it with the QR code on the right sidebar of the site here or you can go here https://market.android.com/details?id=com.pointlessrants.rss or you can search “pointless rants” in the android market!

Python GeoIP to TimeZone! Plus Daylight Savings Time calculation!

python-powered-h-100x130

Some of you may have read my article about python-geoip for mapping an IP to a city.

If you provide a service which relies on timezones or even just want to display a message at that time then being able to map an IP address to a timezone can be valuable.

This assumes that you have the GeoLiteCity.dat database and that it’s all setup and working. I can show you how to do that in this article.

Once you have that all setup and working all you have to do to get the timezone is pass the country code and region to the GeoIP library function GeoIP.time_zone_by_country_and_region() function.

Here’s an example…

>>> import GeoIP
>>> GeoIP.time_zone_by_country_and_region(gi.record_by_addr("74.125.93.106")['country_code'], gi.record_by_addr("74.125.93.106")['region'])
'America/Los_Angeles'

PyTZ

PyTZ is a nice library that you can use to manipulate timezones in python.

If you want to find out the timezone for an IP address you’ll need to pass it through PyTZ.

>>> from pytz import timezone
>>> tz = timezone(GeoIP.time_zone_by_country_and_region(gi.record_by_addr("74.125.93.106")['country_code'], gi.record_by_addr("74.125.93.106")['region']))

Calculating Daylight Savings Time (DST)

>>> from datetime import datetime
>>> loc_dt = tz.localize(datetime(2011,5,26,16,0,0))
>>> loc_dt.dst()
datetime.timedelta(0, 3600)
>>> loc_dt = tz.localize(datetime(2011,12,26,16,0,0))
>>> loc_dt.dst()
datetime.timedelta(0)

Here you can see that on May 26th 2011 the DST 3600 seconds (an hour), then on December 26th 2011 the DST is 0.

Summary

So here’s the complete code for figuring out daylight savings time from an IP…

>>> import GeoIP
>>> from pytz import timezone
>>> from datetime import datetime

>>> gi = GeoIP.open("/usr/share/GeoIP/GeoIPCity.dat", GeoIP.GEOIP_STANDARD)
>>> googles_tz = GeoIP.time_zone_by_country_and_region(gi.record_by_addr("74.125.93.106")['country_code'], gi.record_by_addr("74.125.93.106")['region'])
>>> tz = timezone(googles_tz)
>>> loc_dt = tz.localize(datetime(2011,5,26,16,0,0))
>>> loc_dt.dst()
datetime.timedelta(0, 3600)
>>> loc_dt = tz.localize(datetime(2011,12,26,16,0,0))
>>> loc_dt.dst()
datetime.timedelta(0)

Authentic Jobs UK

AuthenticJobs.com has branched out into the United Kingdom!
http://uk.authenticjobs.com

You get the same great interface but now in the United Kingdom as well.

AuthenticJobs.com has been around since 2005 and has been providing a great service for freelancers and companies looking for full-time, part-time and contract workers.

PlayStation network turning back on!

zdnet-playstation-network-logo1

As of earlier today Sony announced that PSN – PlayStation Network would begin to be restored .
There is an update that Sony wants you to download which will require you to change your password.
It’s been 24 days since the outage began. Some suspect that the so called “hacker” group “Anonymous” was responsible but Anonymous claims the action to be rogue and that they are not involved.

Regardless of the direct or indirect involvement of Anonymous, I have to say that Sony’s response time clearly indicates a serious structural issue with their network and systems.