Monthly Archive for April, 2008

Koha Sound Clip

Here is a small sound clip I recorded of the Koha bird. This time the bird was on time. The last few years it was a bit late.

If you don't understand what is going on, the Koha is a bird that sings around the time of the Sri Lankan new year.

[audio:koha.mp3]

koha - cuckoo Bird...(National Zoological Gardens of Sri Lanka -Dehiwala)

Download the mp3 or ogg file, set it as your ring tone or send it in a new year MMS greeting. :)

My Nokia N80 is proving quite resourceful previously capturing the Manga Tuk and being able to record this bird. I think custom software and being able to extend a phone's software is going to play a big role in future phones.

Technorati Tags: , ,

Some Changes Under The Hood

Being the cutting edge type. I upgraded to WordPress 2.5 almost the next day it was released. It was too easy. I have this site on Dreamhost 1 click install and upgrade.

I paid the price. My old theme (a slightly modified version of K2) broke the WordPress admin dashboard.

I should have tested it locally but I thought I'd be daring. Only today I found the time to test things locally and deploy a decent working theme. By the way the search was broken before, I hope no one noticed ;)

Here is what happend. K2 is a highly advanced theme with support for a lot of plugins and has its own sidebar manager. WordPess has its own sidebar manager. (Not as sleek as K2's)

When I upgraded to WordPress 2.5 my old theme (K2 Release Candidate 4) broke the WordPress dashboard. I looked around quickly and found that K2 had fixed this in the main development branch. So now I moved to the last nightly snapshot of K2. K2 RC5 will be compatible with WordPress 2.5. Waiting for that.

Technorati Tags: ,

Manga Tuk

Manga Tuk

There is never a dull day in Sri Lanka. In the middle of pre new year traffic I saw this guy.

Technorati Tags: , ,

Visiting Card 1.0

I haven't had a visiting card since I left Virtusa around 2005. I needed one when I was freelancing but never got around to it.

I got this done in a hurry, which is why there is a typo and the alignment could be a bit better. I've put in only the essentials here. I'm happy with it for now, until the next version. Any feedback would be appreciated.

Visiting card 1.0

Technorati Tags:

Sinhalen FOSS

Listening to Sinhalen FOSS. Sounds good! This is probably the first Sinhala podcast!

Some people couldn't read the Sinhala text. Get the fonts at www.fonts.lk. Kottu will also start to look better.

Technorati Tags:

Drupal db_query trimming leading 0

The Drupal db_query was killing my leading zeros. According to this post I added single quotes and it seems to work fine now. This is in MySql 5.x and Drupal 5.7.


$query = db_query("select active from {active} where name= %s", array($user->name));


$query = db_query("select active from {active} where name = '%s'", array($user->name));

I would have added single quotes anyway but the api doc said not to.

Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose in '') and %%.

Technorati Tags:

Save 50 bucks with Dialog TV Today!

Here is a good call by Dialog TV Forum.

For those who do not want "CiTi HiTz" - get it deactivated or pay

The tiny red text at the bottom of the Dialog TV Tariff page sayings something like this.

* CitiHitz is activated for a monthly rental of Rs. 50/-
* Channel C is offered to all packages Free of charge until 31 May 2008

I don't really care about 50 LKR but on principal its wrong to shove down a paid channel without asking. I noticed this CitiHitz crap while channel surfing, its not worth 50 cents.

Thanks again to Dialog TV Forum.

Update: I have personally opted out of Citi Hitz.

Speed Up Firefox With A New Profile

I was happy with Firefox Preloader only for a few days. Then it started hanging Firefox altogether and then crashing when I wanted to close it.

From what I can remember my current Firefox profile is at least an year old. I copy it from computer to computer. So I created new profile to see if it makes a difference. To get to the Firefox profile manager run Firefox like this.

firefox /profilemanager

I copied my signons2.txt and key3.db to migrate my passwords over.

Now Firefox starts up in a few seconds and runs well. Now I have to install my old extensions and it should be good to go.

You can find more about your Firefox profile folder here.

A better ssh-copy-id | smithii.com

I wanted to authorize my web host with my Cygwin shell to do some backups. I'm used to ssh-copy-id but Cygwin doesn't have it. I found this script that does the trick.

A better ssh-copy-id | smithii.com

I put this code in a ssh-copy-id.sh file.

#!/bin/sh
# $Id$

SSH="${HOME}/.ssh"

if [ ! -f "${SSH}/identity.pub" ]
then
PASSPHRASE=
read -p "Enter ssh passphrase for ${HOSTNAME}:" PASSPHRASE
ssh-keygen -t rsa1 -N "$PASSPHRASE" -f "${SSH}/identity"
ssh-keygen -t rsa -N "$PASSPHRASE" -f "${SSH}/id_rsa"
ssh-keygen -t dsa -N "$PASSPHRASE" -f "${SSH}/id_dsa"
chmod -f go-w "${SSH}" "${SSH}/authorized_keys*"
fi

cd "${SSH}" && \
tar -c id*.pub | \
ssh $* 'tar -x
SSH="${HOME}/.ssh"
if [ ! -f "${SSH}/identity.pub" ]
then
PASSPHRASE=
read -p "Enter ssh passphrase for ${HOSTNAME}:" PASSPHRASE
ssh-keygen -t rsa1 -N "$PASSPHRASE" -f "${SSH}/identity"
ssh-keygen -t rsa -N "$PASSPHRASE" -f "${SSH}/id_rsa"
ssh-keygen -t dsa -N "$PASSPHRASE" -f "${SSH}/id_dsa"
fi
cat identity.pub >>"${SSH}/authorized_keys"
cat id_dsa.pub id_rsa.pub >>"${SSH}/authorized_keys2"
chmod -f go-w "${SSH}" "${SSH}/authorized_keys*"
rm -f identity.pub id_dsa.pub id_rsa.pub
'

Linky Love