[philiptellis] /bb|[^b]{2}/
Never stop Grokking


Friday, November 14, 2003

Self extracting tarball

install_tar.sh:
   #!/bin/bash

   skip=9
   # blah blah blah
   tail -n +$skip $0 | tar jxvf - | (while read a; do echo -n "."; done; echo;)

   exit
   __LINE_8_END_OF_CODE__

and then cat whatever.tar.bz2 >> install_tar.sh

voila, you have a self extracting tarball. Don't forget the exit just before the __LINE_8_END_OF_CODE__, and make sure that that *is* the last line of your shell code.

set skip to the line where your tar.bz2 data starts.

Wednesday, November 12, 2003

Thoughts on MovableType

[cloned from my livejournal]

So, after having used MT for a while, and reading everyone's blogs, and listening to cribs, I'm finally ready to write something on it. Here goes.

On the whole, it's a nice tool, and yes, it does cut down on the work required to publish sites. Once mastered, MT can prove to be a very useful CMS... but... I think it's too cumbersome to customise. Anyone who's tried editing their templates will concur.

So, what do I like and what do I not like.

I like the fact that MT, and most CMSes for that matter, take away the need to write a lot of HTML. A poster can concentrate on content, and forget about presentation. Anyone not familiar with HTML will love this. The new entry screen is quite simple and straightforward, and has a help button associated with every field. I think that's a good idea, but then I did do the same for the reviewer interface in the conference management system :)

Another thing I like is the ability to save an entry without publishing it yet. One is well aware of how many times one has lost a long post because `the browser just closed'. Well, whatever the reason for the browser closing, the Save button down there ensures that we don't have to redo too much work.

Hmm, what else do I like? Trackback is a nice feature, but I haven't used it too much. I guess it isn't too useful when I'm doing TBs on myself. Then there's the look and feel of the management interface, yeah, nice, docs are nice too...

Now, my cribs.

Where the hell is the Access Control? Vivek Nallur has a post on his private blog that shows how to edit another author's permissions. I don't know about others, but if I were deploying MT in a multi-author environment, I'd like some kind of access and work-flow control. Working on trust alone may be fine for the authoring process, but it just does not work at the admin level (think CVS).

Then there's the oh-so-cumbersome template editors. When I said the new entry interface was easy to use without knowing HTML, I meant exactly that. It's easy to use if you don't know HTML, and only if you don't know, or at least don't need to use, HTML.

The moment you need to edit code of any kind, HTML text boxes are a pain. Editing code requires a code editor. Even if it's just notepad, the fact that a TAB inserts a TAB rather than taking one to the next field makes a huge difference. Then, there's search and replace, and of course, a nice large code editing window. Ok, I'm cribbing. In reality, you can link the template to a local file, and edit that instead... but then file permissions come into play, and that's another headache that I won't go into just yet.

Ok, so you're done with editing code, now you need to rebuild the pages. That pops up a new window, from which you select which pages to rebuild. This is fine if you're just doing it once a week, or even once a day, but try doing it once a minute and you'll know what a pain it is. Frankly, I like to be able to just edit my stylesheet and hit refresh on the browser to see what it looks like.

So, finally, I come to file permissions. When creating a new blog, MT requires the new blog's directory to already exist. So, just create a directory under your web path, and tell MT about it right? Wrong. Since MT needs to write to that directory, it needs to either be owned by MT, or in the same group as MT, with group write permissions, or world writable. The first case is not possible unless you are the MT user or root - these are the only two users who can create directories owned by MT. To enable the second option, you must be in the MT group... and so must all other authors... which leads to the same problem that we have with world writable directories.

Agreed, this isn't such a big problem, as these folders only contain generated files. The real data is stored in a database owned by MT and writable only by MT. Still, I'd like to see MT be able to create blog subdirectories on its own, and provide a sensible default for a new blog path.

Yes, I do have a small wishlish, and I might at some point fix some of these issues with MT - if time and licences permit. MT is not distributed under a Libre licence, so any changes I make will remain in house only, or sent back to MT. Right now I don't think I should even look at the code, because if it does in any way influence future code that I write, there could be problems.

...===...