Blog

How to zip an entire directory with Python

January 22, 2011

I’m finally done with the Python project I’m working on and now just working on the build script. I want my build script to zip the entire build directory at the end so at first I got lazy and I figured I’d just call an external zip application (7-Zip) and let it do all the work. This would of course require the person doing the build to have 7-Zip installed, so I decided …

How to use configuration files in Python

December 31, 2010

I’ve been doing quite a bit of Python lately and the application I’m working on right now is actually a rewrite of scripts that we wrote over a year ago. The scripts started out to be pretty simple but they have now grown to a point that to be able to maintain and extend them quickly they’ll need to be completely rewritten with a new design.

One of the things we’re adding is a configuration …

How to check if a file is locked in Python

December 14, 2010

My colleague showed me a trick on how to do this earlier. What I was trying to do is poll a folder for a bunch of files and if they’re not there keep polling until they arrive, then process them. The problem is before they can be processed we need to be sure that the file transfer is complete.

The trick on how to do this is to try and open the file once it …

How to unlock your Dell Streak for free

December 13, 2010

If you’ve searched around for “Dell Streak unlock” you’ve probably seen results to unlock it using a Rebel Simcard or some ridiculously priced unlock service where you give them your IMEI number and they’ll give you the unlock code within 24 hours after paying.

Luckily, I stumbled upon this post before I did any of that which told stories of customers who were able to get unlock codes for their Streaks by simply calling …

How to convert a Large Integer value to normal date format using PowerShell

December 6, 2010

My co-worker was wondering last week whether an old Windows domain user account was still being used by someone. Having managed Windows domain environments at my previous jobs, the first thing I did of course was go to Active Directory and check the LastLogonTimestamp attribute. This attribute is stored in the Active Directory database as a Large Integer so it will need to be converted to a normal date format to make sense of it. …