Essential plugins for Trac

I’ve been setting up several Trac installations recently, and while Trac by itself is already pretty awesome (I love it’s simplicity and functionality that doesn’t get in the way), I was pretty dismayed to discover that administration isn’t that great. Configuring Trac is a matter of (more) hacking at the command line with the trac-admin script, and user administration is managed with htpasswd or whatever authentication scheme that you choose (point being, you can’t manage users via Trac itself).

Thankfully, there are some plugins that you can install to alleviate the situation. Trac itself publishes the WebAdmin plugin, which is slated for inclusion in Trac in Trac 0.11. This adds a web interface to trac-admin and it’s pretty darned useful when used with two other plugins: Account Manager plugin and WebAdmin Users plugin.

Account Manager plugin adds HTML form-based login instead of the default HTTP authentication with plain olde Trac (plus user registration and changing of passwords). I’ll let you in on a secret - I never managed to configure my Trac installs properly to use HTTP auth, but with this plugin it just worked.

The WebAdmin Users plugin let’s you add/remove users via WebAdmin plugin.

Managing user account with Trac WebAdmin Users


By the way, if anyone has got a Linux binary for mod_dav_svn.so for Apache 2.2, let me know - I’m too lazy to go through the whole trouble of compiling it.

This blog is related to “Cartoon Porn”

Got this in my email recently:

Respected Webmaster,

I found your page on Yahoo! when I was searching for Free Cartoon Porn (this topic is related to my site). You are running a great website and I would be happy to place your link on my site. If you would like to exchange text links with me, please submit your website on deleted link

I’m sure you know that links exchange will help both of us to get better positions on search engines and have more visitors to our websites.

I went to Yahoo! and searched for “free cartoon porn redemption” and sure enough, that link was up there. A bunch of comment spam qualified my site for a link exchange, yippee! I was pretty amused.

Beware of form parameters named ’submit’

Well, that is if you are ever going to be submitting the form via Javascript. We had to generate forms on the fly and POST them behind the scenes (i.e. in hidden <iframe>s), and got a decent script going, until a particular case failed for no apparent reason. I finally found that the problem was due to a form parameter named “submit” that overwrote the submit() function of the <form>. That’s, of course, after looking at all the wrong places.

So this doesn’t work:

<form id="ninjaForm" action="/come/get/some" method="post">
  <input id="someParam" name="someParam"
    type="hidden" value="Some value" />
  <input id="submit" name="submit"
    type="hidden" value="Start search" />
</form>
<script type="text/javascript">
  setTimeout("document.ninjaForm.submit()", 200);
</script>

When the browser tries to execute “document.ninjaForm.submit()”, it sees the “submit” form field (which overwrote the submit() function) instead and complains that “submit is not a function”.

Do this instead:

<form id="ninjaForm" action="/come/get/some" method="post">
  <script type="text/javascript">
    // Alias the submit function in case there is a 'submit' param.
    ninjaForm = document.getElementById('ninjaForm');
    ninjaForm.__submit = ninjaForm.submit;
  </script>
  <input id="someParam" name="someParam"
    type="hidden" value="Some value" />
  <input id="submit" name="submit"
    type="hidden" value="Start search" />
</form>
<script type="text/javascript">
  setTimeout("ninjaForm.__submit();", 200);
</script>

That’s one way to workaround, of course, and we can get away with the “ninjaForm” global in this case.

Application error (Rails) on Google search results

I did a search on Google for “Rimuhosting” today, some time after I signed up with them, and hey, there’s my blog in 3rd spot - is that some mad SEO skillz or what. And then “oooh, there’s an ‘Application error (Rails)’ result coming out, that’s not good”.

'Application error (Rails)' on Google


I thought it was amusing - Google must have crawled my site just as I had deployment troubles (yeah it was a smart move leaving MySQL to it’s default settings and using the InnoDB storage engine on a memory-starved VPS). All seems fine now though I’m still somewhat amazed at the hungry Mongrels (at 25-40MB per Mongrel process, these things run more like St. Bernards). (A shout out to Ryan Daigle who has been giving me some Rails deployment advice.)

By the way, the “mad SEO skillz” comment was a joke, I wasn’t at all surprised to be honest, Google just loves blogs (and they still do, after all this time of I’ve been not blogging).

Ruby on Rails satire blog

Javac programmers are Very Slow and he is Agile

My Rails Blob pokes fun at the cult of Ruby on Rails via satire. Recommended blog posts: Rubby Links on the W.W. w. and Upgradeing Rails: Securiety through Obscenity [sic]. I’ve subscribed to the RSS feed.

NO! - Bad User!!!

The Daily WTF has this monthly collection of hilarious pop-up error blunders, and as usual this month’s a gem: Pop-up Potpourri: Announced By God. Must read.

Developers would find this particularly funny (I did):

Bad user!


And this one’s for my boss, Gary (remember the ‘Abort/Retry/Ignore’ you saw at the MRT station?)

Next stop: null