Keyvan Minoukadeh

16 May 2008

Bazaar: push-and-update plugin with putty’s plink

Filed under: General — Keyvan @ 1:10 am

I recently came across the push-and-update plugin for Bazaar (a version control system). The plugin is useful for anyone pushing changes to a remote server and wanting to keep the remote working tree up to date as well.

According to Bazaar docs:

“When you push a branch to a remote system, a working tree will not be created. If one is already present the files will not be updated. The branch information will be updated and the working tree will be marked as out-of-date. Updating a working tree remotely is difficult, as there may be uncommitted changes or the update may cause content conflicts that are difficult to deal with remotely.”

The push-and-update plugin solves the problem by carrying out the push as normal but then SSHing into the account and carrying out the ‘bzr update’ command to update the working tree as well. The only problem with running this on Windows is that the plugin assumes you have the ssh command available. So if you’d like to use putty’s plink instead, open the push_and_update.py file and change this line:

cmd = ['ssh', user+host+port, remote_bzr, 'update', path]

to

cmd = ['c:\path\to\plink.exe', user+host+port, remote_bzr, 'update', path]

To avoid editing the file completely, you can download and rename plink.exe to ssh.exe and place it in one of the directories listed in your system PATH variable. (Note: the Bazaar client may throw errors if you leave plink.exe in a directory listed in your PATH variable - at least it did for me - so make sure it’s renamed if you experience a similar problem.)

This appears to be a known bug.

7 April 2008

Photography Exhibition

Filed under: General — Keyvan @ 2:45 am

The Collective 08
I’ll be exhibiting 3 images with friends in London next week. Our photos will be on display from 12 April to 9 May 2008 at the Islington Arts Factory. If you’re interested, find out more at the website: The Collective 08.

26 November 2007

Chris Morris on Martin Amis, Terrorism and Islam

Filed under: General — Keyvan @ 10:24 pm

“It goes roughly like this: 9/11 was horrific, its driving ideology was totalitarian, the totalitarians were Muslims, all Muslims follow a book they believe to be the immutable word of God, I don’t believe that, therefore all Muslims are idiots, and basically bastards. Idiot bastards moping around the Middle East in a paranoid funk just cos they lost their empire, and what a rubbish empire it was, too, by the way. Now, what is your balanced view of these primitive wife-beating idiotic bastards?”

Chris Morris, The absurd world of Martin Amis, 25 November 2007

28 July 2007

London Libraries Lookup

Filed under: General — Keyvan @ 5:14 am

I’ve been working on a small project to make public library lookups a little bit easier. I still have lots to do, but I’m slowly putting the various parts together.

The idea is to make it easy to:

  • find libraries in London (for now) and the rest of the UK (later)
  • find books in these libraries without dealing with difficult interfaces

Finding Libraries

I’ve started putting together a database of London libraries and their coordinates. You can see locations of almost 400 London libraries on librarylookup.org.uk.

You can also find libraries nearest to you by entering your postcode at the end of the URL — it can be the first part (outward code), but using a full postcode will give you more accurate results. E.g. http://www.librarylookup.org.uk/W6 0QL will show you the libraries closest to the Lyric Theatre in Hammersmith.

I still need to work on the interface. It’s using Google Maps at the moment, but I might consider alternatives. You won’t see much information about the libraries at the moment, but I’m going to include the full address and website address of each library.

Finding Books

The plan is to use existing book sites as the Web interface for book searches. I’m working on a Greasemonkey script that will, when complete, run on a number of book sites and the librarylookup website mentioned above. On the librarylookup website, the user selects his/her favourite/nearest libraries and the Greasemonkey script records it. Those preferences will then be used when browsing Amazon to query the library’s (or libraries) online catalog for the book being viewed. You will then be notified if the book is available/unavailable.

Library Lookup Web Service

So far I’ve written code that can check Hammersmith and Fulham, Bromley and Norfolk libraries. I plan on implementing the lookup process in Javascript (to lessen the load on the server) when the project is ready, but for the time being the Greasemonkey script sends its request to a PHP script that returns JSON formatted results:

Supported libraries:
librarylookup.org.uk/service/libraries/
ISBN lookup:
librarylookup.org.uk/service/libraries/hammersmith/0745324827
ISBN lookup:
librarylookup.org.uk/service/libraries/norfolk/0552773328

The code also uses the xISBN Web service when a library has no record of the requested ISBN. The xISBN service returns ISBNs associated with different editions of the same book, so if a library doesn’t have the exact one we’re looking at on Amazon, we’ll still be told if there are other editions that it does have.

Screencast: The Script in Action

This movie requires Flash Player 8

Credits

These sites/articles helped a lot:

12 January 2007

Paged Comments Bug Fix

Filed under: General — Keyvan @ 12:22 am

Anyone using version 2.5 of the Paged Comments plugin, please download the new version. You will only need to replace your paged-comments.php file with the updated one. You will not have to edit/replace your config file.

« Previous PageNext Page »