Interesting wxpython case study

I have been busy in the last few days migrating my mind from web based apps to native apps. Currently, I am reading about wxpython as a possible answer.

Here is an interesting post on the wxpython mailing list on how to use python + wxPython + Twisted + zope + XSLT.

Also some discussion on the problems on using wxpython and twisted together because of threading conflicts.

WordPress XML-RPC bug and 1.5.1.3 Upgrade patch

A Serious XML-RPC bug has been discovered in PHP XML-RPC applications. Upgrade your PEAR library. WordPress has come out with a new version fixing the problem. Unfortunately, they still don’t provide an easy way to upgrade. Here is the patch file to upgrade your WordPress installation

**How to upgrade WordPress in one step**

  1. Download the patch file somewhere in your server.
  2. Change your current directory to your wordpress installation.
  3. Verify that your installation will get patched cleanly.

    patch -p1 --dry-run < /path/to/patchfile

  4. If no error reported in last step, finally patch the file.

    patch -p1 < /path/to/patchfile

Yeah, I know. That seems to be more than one step. But technically, step 4 is the only one touching your wordpress installation. ;)

WordPress tinyurl plugin

I was in a quandary. I wanted the long permalinks for my blog posts,which made links self-describing and also search engine friendly. And I also wanted short URLs that I could pass on in emails. I share [the sentiments of Andy Wibbels][1] regarding [TinyURL][2]. Nothing against TinyURL personally, just that when you have your own domain name for your blog, wouldn’t you prefer using tiny urls using your own domain name?

So I extended the [one liner][1] by Andy Wibbels and created a real small plugin, to display the “tiny url” in your post.

[1]: http://easybakeweblogs.com/2005/01/20/i-hate-tinyurl/
[2]: http://www.tinyurl.com/

To use it:

1. Download it from [here][3].
2. Rename it to `wptinyurl.php`.
3. Copy it into the `wp-content/plugins` directory in your WP root.
4. Activate the plugin in your WP admin section.
5. Then use the function `wptinyurl()` in your template files, wherever you want the tinyurl of the post to be displayed.

[3]: http://www.sandipb.net/downloads/wptinyurl.txt

In my case, to display the tiny urls in my posts, I have added the following line just before `edit_post_link()` in the `single.php` file in the theme directory. The relevant section of the file in my case now looks like this:

By default, the code uses the prefix `/bl/` for generating your tinyurls. So your typical tinyurls will be `http://yourdomain/bl/nn`, where nn is your post id.

To customize, edit the `wptinyurl.php` file, and change the variables as commented.

1. Change `$prefix` from `/bl/` to any other that you want. Just remember to keep the slashes at the beginning and the end of the string.
2. Change `$text` to whichever template you want to use to print your tiny url. Just remember, to use `%s` wherever you want the tiny url to be substituted. If you use `%s` more or less than twice, remember to change the first `printf` function in the code accordingly.
3. As an added feature, if you set the variable `$print_rule` to `True` in the code, the code will also provide you with the `.htaccess` rule that you require to make the tinyurl work. The rule will be inside an HTML comment. You can simply copy-paste from the HTML source of the page and add it at the end of the `.htaccess` file in your domain web root. You can set this variable to false after you have configured your `.htaccess` file.

That’s it.

Using svnreplicate

[Here is an article that I have just written][doc] on using [`svnreplicate`][svnr] to replicate [subversion][svn] repositories. `svnreplicate` allows you to have a single master repository, and multiple slave repositories.

The document uses a walkthrough approach to explain how to configure `svnreplicate`. I must warn though that it only demonstrates the concept using master and slave repositories present in the *same* system(reachable using `file:///` URLs).

While I am sure that this should work over multiple hosts too, Yashpal Nagar, a friend of mine, is trying to get it to work over multiple hosts with `svnserve`. I will add that to the document when he succeeds.

[Markdown source][docsrc] of the article.

My repository containing the latest version of the article:

* URL:
* Document under: `sandip@lug-delhi.org/floss-docs–main–1.0`
* Article location: `subversion/svnreplicate/`

Yes, I do understand the possible irony of using a [bazaar][baz] repo to keep a [subversion][svn] doc, but I don’t see any problems myself. I have been using subversion for over an year now for all my projects, and I find it quite simple to use for my needs.

Ofcourse, I like bazaar(and [arch][arch]‘s) distributed features, dumb read-only repo mirrors, etc., and therefore use it for needs which are not met by subversion. Over time though, I hope to migrate completely to bazaar, ofcourse, depending on when I manage to understand fully how it works. ;)

[docsrc]: http://www.lug-delhi.org/downloads/subversion/testsvnreplicate.mkd
[doc]: http://www.lug-delhi.org/downloads/subversion/testsvnreplicate.html
[svnr]: https://open.datacore.ch/DCwiki.open/Wiki.jsp?page=SVNreplicate
[baz]: http://bazaar.canonical.com/
[svn]: http://subversion.tigris.org/
[arch]: http://www.gnuarch.org/

Reformatted Bazaar docs

I have been converting the present [Bazaar documentation][1] to [texinfo][2]. At present I have converted two documents – Building Baz and Following Tux.

The source is available at my Bazaar repository at . Under sandip@lug-delhi.org/bazaar-docs--devo--1.4

Generated PDF and HTML files are as follows:

1. Building Baz: [HTML][bbhtml] [PDF][bbpdf]
2. Following Tux: [HTML][fthtml] [PDF][ftpdf]
3. Bazaar howto: [HTML][hthtml] [PDF][htpdf]

Update:

* June 8, 7:30 IST: I have converted all the present Bazaar docs. However, I have made one major change – I have kept _FollowingTux_ as an independent document, and merged all the rest into a single document – the _Bazaar Howto_. My understanding was that it would make more sense for people to read mini-howtos bundled together. The source files for the articles are themselves separate, and it is much easier now to edit and create new ones like them.

[1]: http://bazaar.canonical.com/doc/ “Bazaar documentation”
[2]: http://www.gnu.org/software/texinfo/ “Texinfo home page”
[bbhtml]: http://www.lug-delhi.org/downloads/bazaar/docs/BuildingBaz.html “HTML version”
[bbpdf]: http://www.lug-delhi.org/downloads/bazaar/docs/BuildingBaz.pdf “PDF version”
[fthtml]: http://www.lug-delhi.org/downloads/bazaar/docs/FollowingTux.html “HTML version”
[ftpdf]: http://www.lug-delhi.org/downloads/bazaar/docs/FollowingTux.pdf “PDF version”
[hthtml]: http://www.lug-delhi.org/downloads/bazaar/docs/bazaar-howto.html
[htpdf]: http://www.lug-delhi.org/downloads/bazaar/docs/bazaar-howto.pdf

Patching up Worpress 1.5.1 to fix feeds

So WordPress just released [1.5.1.1][1] to fix the [RSS problem][2] which has bitten me badly too. The trouble is that I am getting sick of their manual [upgrade][3] steps – backup, overwrite, restore, etc. etc. when the only changes have been to the core files!

I wonder why they can’t release very minor releases (e.g. 1.5.1.1) as *patches*. Even minor releases (e.g. 1.5.1) can be released as patches – the database changes can be handled using the upgrade script which can itself be available as a patch.

Granted that patch is available only on Unix systems and that also on systems where you have shell access. But again, the general release is always available as a full download anyway, right?

Take this bugfix release for example. [Here is the patch file][4] I created for the 1.5.1.1 release. To upgrade all you have to do is to change directory to the wordpress root, and run `patch -p1 < wordpress-1.5.1.1.patch`. That is it! You have upgraded!

[1]: http://wordpress.org/development/2005/05/one-five-one/
[2]: http://fernando.dubtribe.com/archives/2005/05/10/solution-to-wp151-rss-errors/
[3]: http://codex.wordpress.org/Upgrading_WordPress
[4]: http://www.sandipb.net/downloads/wordpress-1.5.1.1.patch

Greasemonkey – shaking up the web

[Greasemonkey][gr] is currently not only just the hottest Firefox extension (or plugin) in town, it is also the most disruptive of all browser plugins. It beats me how nobody had thought of such a browser add-on before.

Greasemonkey allows the user to change their experience on _any_ website, on their own, without the help of the website developers themselves. It does this by modifying the website behavior using custom javascript that is added on top of the browser pages.

For example, I am currently using the [Degradr][deg] Greasemonkey script to replace the annoying flash images in the Flickr photo pages with static images. Before this I was literally begging that the Flickr staff would add this feature somtime soon. Now with Greasemonkey, _I_ have this power to change my experience on my own, _right now_. Heck, there is even a [script][toiscript] for cleaning up clutter in the [Time of India][toi] site.

This is disruptive because website owners now no longer have complete control over how users use their website. This is disruptive because it brings across a new paradigm into play – that website content is a mere resource that users may use in whatever manner possible. Let me repeat, this is disruptive because website owners no longer have _control_.

And ofcourse, not everybody likes change. Take a look at [this post by nivi][nivi], and you can see why. You would now be able to lookup an Amazon page, and have an automatic popup giving you the prices of the product you are viewing in other shops.

Then take a look at the exhaustive and growing [list of Greasemonkey scripts][list] which can change the way you look at websites for ever.

[gr]: http://greasemonkey.mozdev.org/
[deg]: http://www.randomchaos.com/software/firefox/greasemonkey/degradr/
[nivi]: http://www.nivi.com/blog/article/greasemonkey-and-business-models/
[list]: http://dunck.us/collab/GreaseMonkeyUserScripts
[toiscript]: http://overstimulate.com/userscripts/indiantimes.user.js
[toi]: http://timesofindia.indiatimes.com/

Nice short intro to Bazaar

Edd Dumbill has written a real nice [short intro][bazintro] to the [Bazaar][baz] – a reimplementation of [GNU Arch][arch] revision control system. I have been getting tired of keeping up with new [Subversion][svn] revisions and the `mod_dav`/`mod_dav_svn` module that I need to keep updating. By contrast Arch allows read only archives using plain HTTP. Most importantly it supports distributed repositories – this allows me to maintain a repository of system config in the servers that I manage, and sync them when I want with my home machine. Since Subversion maintains the [CVS][cvs] tradition of centralized repositories, it was impossible to maintain two different revisions on the client machines before syncing them in one go with my backup server.

[bazintro]: http://usefulinc.com/edd/blog/contents/2005/05/04-bazaar/read
[baz]: http://bazaar.canonical.com/
[arch]: http://www.gnuarch.org/
[svn]: http://subversion.tigris.org/
[cvs]: https://www.cvshome.org/

Bitkeeper plays spoil-sport. Linux looking for a new SCM

Amidst controversy over work done by Samba developer Andrew Tridgell, Linux is (about time) moving out of Bitkeeper, and looking for a new SCM.

The short story is this.
Background: For some time, Linux has been using the controversial Bitkeeper SCM tool for managing its source code. This was a completely closed source product, which was trying to bypass FLOSS arguments by offering a free hosted solution. For all this while, the proprietary Bitkeeper hosting the source code of the most popular FLOSS operating system – Linux, has been the biggest ironies of our times. This was made possible till now because Linus Torvalds has a very different take on FLOSS related philosophies than most people.

The controversy: Andrew Tridgell of Samba fame started reverse engineering the proprietary Bitkeeper protocol and started working on a free Open source tools which could work with the Linux source code running on the Bitkeeper hosted repositories. Larry Mc Voy, the Bitkeeper honcho took an exception to this and complained to Linus. Linux tried to talk to both Larry and Andrew, and failing a resolution decided to move Linux elsewhere.

Read the article for Larry and Linus’ take on the matter.

I just cant help shouting out at Larry, as to how he expected this story to end otherwise? Open source movement came about to stop monopolizing of essential computing from the common man. Why is it ok to reverse-engineer the Windows SMB/CIFS protocol and make Samba, or to reverse engineer Microsoft Office file formats and make OpenOffice, and at the same time it is not ok to reverse engineer Bitkeeper? Why did Bitkeeper have to go through the exercise of giving free hosting to Linux (a publicity gimmick gone bad), making it so indispensable to the world that a reverse-engineered tool was inevitable? This only shows how clueless the Bitkeeper management has been about what it is getting into.

I for one am thankful that such a gross philosphical crime (using Linux over Bitkeeper) is coming to an end. If Linux places his faith on an Open source SCM now – Subversion or GNU Arch, it is only going to make these software better. Also, one again, students and enthusiasts can start using free tools for accessing the source of a free OS.


Update: Some interesting links:

  1. Kerneltrap has a detailed feature on this matter. (http://kerneltrap.org/node/4966). I wouldn’t call this balanced though. How about asking somebody other than Larry about how good or bad bitkeeper is for the FLOSS community?
  2. Richard Stallman’s view on Linux and Bitkeeper. (http://kerneltrap.org/node/204). I particularly liked this part:

    Linux, the kernel, is often thought of as the flagship of free software, yet its current version is partially non-free. How did this happen? This problem, like the decision to use Bitkeeper, reflects the attitude of the original developer of Linux, a person who thinks that “technically better” is more important than freedom.

    Value your freedom, or you will lose it, teaches history. “Don’t bother us with politics,” respond those who don’t want to learn.

  3. How Bitkeeper refused a license to a company because one of its developers had hinted about reverse engineering the protocol. (http://lwn.net/Articles/103727/)
  4. Larry Mc Voy’s opinion on people using Subversion and his no-competing-product-sage policy. (http://www.uwsg.iu.edu/hypermail/linux/kernel/0210.0/1725.html).

    The Subversion folks would like nothing better than to displace BK. That’s fine, but they don’t get to use BK to do it. You’re absolutely correct that you could use BK to make Subversion better.
    It is not our job to help you make Subversion better and we’ve made that clear for a long time.

    We’re a business. We’re a business which happens to be committed to helping the kernel team because we think that the kernel is vital to the world at large. Helping the kernel absolutely does not translate to helping people who happen to be our competitors. By your own description and by our experience with you, you would be a competitor.

    A further explanation by Larry Mc Voy on the same thread (http://www.uwsg.iu.edu/hypermail/linux/kernel/0210.0/1735.html)


Update #2:

  1. Subversion puts out an announcement to its fans to Please Stop Bugging Linus Torvalds About Subversion.
  2. Subversion page debunking Bitkeeper claims against it.
  3. Message to debian-devel-: Warning to Debian Developers regarding BitKeeper
  4. Two papers by the Better SCM Initiative on Bitkeeper: The Suitability of BitKeeper and bkbits.net for Free Software Projects and Changing the BitKeeper License and Why it is Needed.