Thoughts on Rails

Riding the Train of Thought

Archive for March 2007

Visiting Allahabad

leave a comment »

I am leaving for Allahabad in a few hours. Shall be back in town by 26th March 2007.

Going for some work related stuff, but photography will not be left behind!

There’s a good chance that I’ll be able to get online before I come back, so do watch this place for posts and the photos section for well, photos.


Written by hiway

March 18, 2007 at 7:48 pm

Posted in travel

Mute Master Volume – Script for FreeBSD/PCBSD

with one comment

For the FreeBSD users, there’s a bit of a problem when using laptops –
the special volume buttons are usually not automatically recognized.
The following page helps in configuring that:

For configuring the keypress/command association, we use the following port:


You might want to install the following port for making configuring
xbindkeys easier:


Now, there’s only one issue – the volume cannot be muted and unmuted
to its original setting automatically, here’s a small shell
script that resets volume to 60

I wrote a python script that uses commands from above file and
adds persistence of volume setting while automatically muting or
unmuting each time the script is called, also it relies heavily on
UNIX commands – since this script is necessary only on UNIX/FreeBSD.
It will not work under windows.

It also has a nice feature – soft fade-in / fade-out (configurable via script). Especially useful when you mute at high volume and forget it… then play some loud music and unmute – if done using this script, it might not shock with you with sudden loudness. πŸ™‚

All configuration is kept inside the script to keep usage of the script as easy as possible – just a call:


Hope it is useful to anyone looking to solve this or similar issue…

Here’s the file:

Written by hiway

March 5, 2007 at 6:53 pm

BSNL Broadband Slow Like Hell

with 54 comments

It is 3:43 am, when most other users are offline, I am trying to download KDE 3.5.5 source packages for my newly installed FreeBSD 6.2 on AMD64 machine – I am using a 256 Kbps BSNL DataOne Broadband connection. On January 2007, BSNL announced that it has upgraded all users for speeds upto 2 Mbps. Yes, I enjoy the speed – and I am thankful to BSNL. However, as I watch the progress of my downloads, there’s nothing else than “SHOCK” that awaits me.

Here’s a sampler from my Python download session:

Python-2.4.3.tgz                                5% of 9129 kB 3775  Bps 39m04s

3775Bps, around 3 KBps which comes around to 3*8 = 24 Kbps. Am I being served 10 times slower internet or what?

This is not just for one or two downloads. I tried reconnecting, hoping vainly that things might magically sort themselves out. I tried to check my DNS settings (Regular and OpenDNS both) both resolve fine. This is not the first time this has happened. It’s becoming a regular P.I.T.A., and I’m very much frustrated with it. If BSNL decides to make the 2 AM to 8 AM block free for all users (no charges for downloads) then they should at least give the minimum promised 256 Kbps speed!!! 24 kbps is just #$%@#$% #%$@@.

Written by hiway

March 5, 2007 at 3:55 am

Posted in BSNL, computers, Internet

Panther going to the vet…

leave a comment »

That’s jungle code for “my machine is going to be upgraded now.”

Hopefully, I have all the backups in a good shape. I’ve just made sure – but with machines, you never can be really sure. Have the AMD64 version of FreeBSD ready to leave its mark on my system. I’m loving PCBSD, but it is 32bit only, my machine sports a AMD Turion 64 processor – better use the power!

Will try to set things up as they are (or at least very close to as) inΒ  PCBSD 3.3. If I’m able to do that in the next few hours/days/weeks/months/who knows when, I’ll be a happier man! No, I’m not planning on PBI support, I like ports tree more – and I just realized, The FreeBSD Foundation has Java binaries available for most of our systems… great! Because I hate compiling java by hand (those who have tried it, know what I mean πŸ˜‰

Here’s the link.

I’ll be gone, not for long – cause I do have 3 other machines (actually, with friend’s machines lying here… those can be 5 spare machines) to come online if I mess this up! So no worries mates! I’ll just be busy, living on pure caffeine and rock music for the next few hours/days/… whatever πŸ™‚

Written by hiway

March 4, 2007 at 4:55 am

Digikam Albums on Network Filesystem

with 4 comments

Digikam has issues with albums on a network share. It uses sqlite database, and it seems that the database file cannot be stored on a share.

Click here for the bug report…

Now, I was stumped when Digikam refused to work the first time, I thought it was because of the overwhelming number of photographs that I threw at it – 30GB, over network. So I reduced it to 12MB… nothing happened. That’s when I sensed that something is wrong.

The above bug report almost washed away all hopes of having my files on a central fileserver and accessing them from the various machines around me. I went to sleep at 6 am, thinking about this… woke up for lunch, and woke up with an idea – I mounted the share on a directory which is outside the path of Digikam’s library, then I symlinked the directory into the library. So now basically, the sqlite database sits on my local harddisk, but the files are accessed from the server – problem solved!

Library: /home/harshad/images/

Share mounted on: /home/harshad/shared/

Actual photos on: /home/harshad/shared/photos/2007/


ln -s /home/harshad/shared/photos/2007 /home/harshad/images/shared

I should mention that it works fine when I have the sample images amounting upto 12MB… when I gave it the whole library, it loaded the information into the database, but after showing no further progress for more than 30 minutes, I terminated it.

I think I’ll have to have various symlinks for smaller sections of my library and have shell scripts to create / delete these symlinks before loading digikam to make it lighter on the software and network!

Hope this issue is solved and we don’t need this workaround.

Note: Edited on 5 March 2007 for some typos.

Written by hiway

March 3, 2007 at 3:32 am

Mounting samba share with write permissions for regular users

with 4 comments

I have tried looking for this information on the Internet but have successfully managed to make myself look dumb. I found nothing for three consecutive days (nights, actually – mostly I sleep in the day, work at night!) I proudly say this – “I may not know everything, but I know where to find it.” But these three days left me increasingly frustrated at the inability to solve a simple problem. Recent trends are showing that I am finding less and less relevant information in my searches. I’m afraid… am I losing the search-fu skillz?

So anyway, rants aside – this is what I was facing:

I have set up samba on my computer named Jaguar, it runs PCBSD 3.3, I wish to access the samba share from Panther, which also runs PCBSD 3.3. I can simply point Konqueror to “smb://” (the IP address belongs to Jaguar) and I am able to read and write to the share.

Trouble begins when I try to mount the share using mount_smbfs command. I have configured the share to be public, writable and also allowed guests – also, security is on share basis – so no passwords are required. I add the “-N” switch to my mount_smbfs command to disable password prompt.

mount_smbfs -N -I //guest@ /home/harshad/shared

It mounts the samba share, I am able to read the files… but I cannot write to them. And trying to solve this problem took a good amount of time. I know – it should be simple. And trust me – it is simple. You only have to know how to use two simple switches – “-g” and “-u”.

They tell mount what should be the group id and user id for the mounted filesystem. So, go ahead, look up your user id (uid) from /etc/passwd and group id (gid)for whichever group you wish to allow write access to and substitute in the following command:

mount_smbfs -N -u 1002 -g 10 -I //guest@ /home/harshad/shared

That sure fixed my problem – and I hope it can help you too.

Thanks to: ##FreeBSD channel on (IRC)

Written by hiway

March 2, 2007 at 5:24 am