Displaying 11 posts tagged with 'python'

I'm not dead!

...and neither is this blog!

It's been a long time in the making, but I've finally managed to get my shiny, newly-written blog system to the point where I think I can get away with running it on the internets. Welcome to the all new minus zero blog. I fully intend to maintain a regular flow of updates, although I can't promise any of them will be worth reading. :)

There are a few missing features that I'm still working on - namely, comments on posts, an archive page, and some form of search functionality. Stay tuned!

You'll notice the shiny new design is a lot nicer than the old one - see the main page for an explanation of where it came from.

That's all for now! I'd love to hear any comments, thoughts, or suggestions you might have - email me!

date: Mon Dec 4 23:23:23 2006 | permalink | tags: python blog

Apache 2.2 and mod_python on OS X

While working on a forthcoming project (watch this space...), I decided it'd be a lot easier to test the code on my local machine rather than SUCS's server.

Tiger (yes, I'm a Mac user these days) comes with Apache 1.3, which is rather outdated, so I looked into updating to a more recent release. Fink has Apache 2.0, but I decided to go all-out and try and get Apache 2.2 running. It turned out to be relatively easy.

Here's my setup:

First of all, we need to get Apache compiled and installed.

$ wget http://www.mirror.ac.uk/mirror/ftp.apache.org/httpd/httpd-2.2.3.tar.gz
$ tar zxf httpd-2.2.3.tar.gz
$ cd httpd-2.2.3
$ ./configure --with-mpm=worker --enable-so
$ make
$ sudo make install

That should install Apache into /usr/local/apache2.

Next, download and compile mod_python:

$ wget http://www.mirrorservice.org/sites/ftp.apache.org/httpd/modpython/mod_python-3.2.10.tgz
$ tar zxf mod_python-3.2.10.tgz
$ cd mod_python-3.2.10
$ ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-python=/usr/local/bin/python
$ make
$ sudo make install

That'll build mod_python and put the appropriate files in /usr/local/apache2/modules.

Configuring our newly-compiled Apache to replace OS X's default one is easy enough - a few changes to /usr/local/apache2/conf/httpd.conf and extra/httpd-userdir.conf is all it takes. Download an archive with all the necessary patch files here. Note - these configuration changes don't cause Apache 2 to behave exactly like Tiger's Apache 1.3, and there may be parts I've overlooked that could be exploited.

To apply the patches, run the following as root (from the directory with the extracted contents of the archive):

# patch /usr/local/apache2/conf/httpd.conf httpd.conf.patch
# cp httpd-userdir.conf /usr/local/apache2/conf/extra/.

By now, you should have a working Apache 2 setup on your Mac, but how can we make it start at boot? This is relatively easy - we can use /Library/StartupItems to accomplish this. The zip file contains the files you need to put in this directory to automate Apache's startup.

Unzip the archive and then cp -r Apache2 /Library/StartupItems/. as root.

That's it! To get the server started, you can run sudo /sbin/SystemStarter start "Web Server" and then browse to http://localhost/ to test your new Apache installation! And then, of course, you can dive into the world of Python.

Update - 26th Jan '07: I had cause to reinstall Apache on a new machine, and the above instructions work perfectly with Apache 2.2.4, mod_python 3.3.0b and Python 2.5. The only change required, apart from the differences in filenames, is to change /usr/local/bin/python to /usr/local/bin/python2.5 on the configure line of the mod_python build stage.

date: Wed Aug 16 22:00:52 2006 | permalink | tags: osx python howto

pyClick

Announcing my latest product of procrastination - pyClick 0.1

pyClick is a pseudo-driver for the Griffin AirClick USB for Linux. It's written in Python, and provides a mapping between keys on the AirClick remote and running user-configurable commands on the PC. By default, it is set up to control a media player such as Rhythmbox or Banshee by simulating X keypresses.

Get it now!

date: Sun Apr 23 10:29:24 2006 | permalink | tags: linux python

Python makes work for idle hands...

I've become something of a man of leisure since my return from the holiday. It's rather nice to not have to worry about deadlines, going to work and other such things. I should be a slacker more often :)

I've been able to indulge in some pet projects - the current focus of attention is an AJAX webmail client. At the moment I'm doing it the hard (easy?) way - Python CGI. No doubt this isn't the most efficient or sensible way of doing it, but it's a scratch for an itch. Redeveloping the system using a framework like Django or mod_python (ok, not a framework per se) would probably be a simple task because there's not a lot of code written yet.

minus-zero.org finally has some kind of coherent design and content, although there's not an awful lot to see yet. The pages are static HTML, generated from a template by a simple script. This could be interesting when the site expands, we'll see.

In other news, I'm heading back to Swansea on Sunday. The Great Job Hunt will then begin, as I attempt to find some form of income to offset the new house's huge rent costs. Hopefully having my CV (which I've yet to write...) bolstered by having 'Google paid me money!' splashed across it will help. Though having said that, I doubt if the average shopkeeper gives a monkey's. :)

date: Fri Sep 9 08:54:33 2005 | permalink | tags: python soc hog

pyBackPack 0.4

My holiday and the Google Summer of Code both ended on the 1st of September, and they were great fun.

I put together the final (as far as being accepted for my SoC submission) release of pyBackPack and it's the best yet.

Screenshots

Changes

  • SSH Backups and restores
  • When performing a backup, a progress indicator is shown.
  • Increments on the restore page are listed most recent first.

Download

Update - The RPMs were re-rerolled with fixed dependencies, they should work OK now.

Bugs
If you come across any bugs or problems don't hesitate to get in touch, either by leaving a comment here, e-mailing me, or using the bug tracking system at http://sucs.org/~davea/trac

Thanks
I'd like to say a huge thanks to Elliot Lee (my mentor from Red Hat) for all his help, guidance and invaluable advice.
Also to Graham Cole (chckens) and Jeremy Katz for bug spotting, and pointing out some of my slightly weird interface design choices. :)
I almost forgot! My eternal gratitude goes to Jen for letting me take her laptop on holiday so I could work and for putting up with my hacking instead of relaxing by the pool. :D

Of course, it's not finished yet, and all you hundreds of faithful readers will be pleased to know that the future releases of pyBackPack will be documented right here. ;)

date: Sun Sep 4 12:42:24 2005 | permalink | tags: linux python pybackpack soc

pyBackPack 0.3

Here's the latest batch of updates, nothing too major - a more streamlined interface, better checks on overwriting files, etc.

Download
.tar.gz: pybackpack-0.3.tar.gz
SRPM: pybackpack-0.3-1.src.rpm
RPM: again, still on holiday so no RPM. Sorry!

Let me know how you like it :)

date: Fri Aug 26 08:31:49 2005 | permalink | tags: linux python pybackpack soc

pyBackPack 0.2.999

Fresh from the shores of Lesvos, I bring you pyBackPack 0.2.999.

No screen shots this time (I don't think my wallet could handle the GPRS bill :)), but here's what's new:

  • Editable backup sets
  • Nicer interface for including and excluding files/folders in a backup set
  • pyBackPack now uses nautilusburn to provide a much nicer way of writing CDs
  • Single-click backup of your home directory to a CD from the main pyBackPack window

Download
.tar.gz: pybackpack-0.2.999.tar.gz
SRPM: pybackpack-0.2.999-1.src.rpm
RPM: I forgot to install the right packages on the laptop before I left, so no RPM this time unless someone else is able to build one... :)

Bugs
I've run into a frustrating bug with rdiff-backup - namely that it doesn't like restoring from directories with a '.' character in their name. It throws an AssertionError. This bug seems intermittent, so any feedback you can offer would be greatly appreciated.

Update - The problem disappeared when using pyBackPack on a different machine, so perhaps I screwed up rdiff-backup on the laptop. Ho hum.

date: Tue Aug 23 10:09:19 2005 | permalink | tags: linux python pybackpack soc

pyBackPack 0.2

The latest and greatest...

Screen shots

Changes

  • User interface looks nicer and works a little more intuitively
  • Can now restore from any increment, allowing the user to rollback to any point in time where a backup was made.
  • Output logs now report something more meaningful
  • CD backups/restores are now possible - This in particular needs lots of testing to see how it copes with different hardware combinations.
  • It's now possible to do multiple backups/restores in the same instance of pybackpack.
  • lots of other small improvements
  • nb. Network (SSH) code is not yet active, should be done for 0.3

Download
tar.gz: pybackpack-0.2.tar.gz
RPM: pybackpack-0.2-1.i386.rpm
SRPM: pybackpack-0.2-1.src.rpm

As ever, if you've got any comments/questions/suggestions, don't hesitate to get in touch and let me know what you think about the tool. :)

date: Wed Aug 17 01:12:16 2005 | permalink | tags: linux python pybackpack soc

pyBackPack 0.1 released

pyBackPack is a user-level GUI tool to back up files.

It is written in Python, uses libglade and GTK+, and interfaces with rdiff-backup.

This is the first release so it's going to have at least 1 bug - your task is to help me find it. ;) I don't think it will chew up your home directory and trash everything, but if it does - sorry!

A few screen shots to whet your appetite:

screenshot screenshot screenshot

Download: pybackpack-0.1.tar.gz

If you have any feedback/bug reports, you can either e-mail me or leave a comment here.

Enjoy :)

date: Sun Aug 14 14:27:54 2005 | permalink | tags: linux python pybackpack soc

Bug hunting

I just discovered a minor bug in pyBackPack (as it's now called):

  • A user wants to backup her Firefox settings - so creates a backup set that just contains ~/.mozilla, and does a backup.
  • Something screws up Firefox's settings, so the user restores her latest .mozilla backup to her home directory.
  • The user then wonders where the hell the entire contents of her home directory have gone, and why only ~/.mozilla is left.
Whoops. Might need to fix that one before I release ;)
date: Sat Aug 13 13:26:44 2005 | permalink | tags: linux python pybackpack soc funny

Status Update

The Summer of Code is turning out to be pretty exciting stuff, and my project is progressing rather nicely. So far I've got a nice GUI written that can actually perform backups although there are a few major bugs that need fixing before I do a release (not to mention that being able to restore data might be nice ;)).

Integrating with rdiff-backup has been easier than I'd imagined, however its tendency to spew a fatal error and shutdown Python rather than raise an exception is frustrating.

date: Tue Aug 2 10:18:02 2005 | permalink | tags: linux python pybackpack sucs