Monday, January 18, 2010

Annular Solar Eclipse 2010

9 shots of the eclipse, starting around 1230 to 1500 hrs IST, Bangalore.


Wednesday, October 21, 2009

Is Windows really easier to use?

A recent experience left me wondering whether the oft-repeated statement that "Windows is much easier to use than Linux" really holds good any more. The other day I connected a data cable from my cell phone to my recently installed Linux Mint 7 laptop to transfer some files. The files didn't get transferred until much later - not because of any hitch, but because the system gave me a most pleasant surprise that left me playing with a new toy! My Linux system detected the USB device (a mobile broadband device), popped up a window showing me the region I was connecting from and allowed me to select my service provider from a list of operators in the region. Seconds later, I had established a connection through the cell phone and was browsing the Internet. Talk about simple!


Saturday, October 10, 2009

Nobel Peace Prize 2009

And the loser is...the Nobel committee, for abrogating its responsibility and settling for a politically safe decision. It's hard to believe that there were no better options - why, a second award for a group like MSF would have been so much better. To honour the leader of a nation that has always been interfering in the internal affairs of countries across the world is rather sad, to say the least - especially when his achievements are all still in rhetoric. And make no mistake, Obama's great intentions will only last as long as they are convenient to the USA. This year's award has set an unfortunate precedent - one that the Nobel committee itself will find hard to justify and sustain in future.

Monday, July 27, 2009

Compiz, the cube, wallpapers, and desktop icons...

As of now, compiz doesn't get along too well with Gnome or XFCE desktops as far as wallpapers are concerned. The wallpaper plugin to compiz allows one to set different backgrounds for each virtual desktop, but those backgrounds are obscured by Nautilus in Gnome and xfdesktop in XFCE.

One way to to get back the compiz wallpapers is to disable the desktop drawing by Nautilus and xfdesktop. This has the unfortunate side-effect of removing all desktop icons as well. Under Gnome, it also disables auto-mount of removable drives. Sadly, one has to live with this trade-off until someone fixes the whole thing.

With Gnome, there is another option that works most of the time.
1. Turn on desktop drawing by Nautilus.
2. Enable compiz and the desktop cube.
3. In CCSM, under General Options -> Desktop Size, set the sliders to 4-1-2.
4. Check that rotate cube works across the 4 virtual desktops.
5. Check the pager in the bottom panel - it should show 2 desktops.
6. Click on the second desktop - you should see the wallpapers set up in the wallpaper plugin of compiz, and you should be able to rotate through the 4 virtual desktops on this (second) cube.
7. If the Gnome panels don't appear, open a terminal (it's a good idea to set up a shortcut key to launch the terminal, otherwise you may get stuck on the second desktop without the panels), and killall gnome-panel. The panels should reappear.

If all went OK, the 4 virtual desktops on the first desktop should show the same (Gnome) wallpaper as well as the desktop icons. The 4 virtual desktops of the second desktop should show the compiz wallpapers, *without* any desktop icons. If both sets of virtual desktops show the same (Gnome) wallpaper, try logging out and back in - it worked for me most of the time!


Wednesday, February 11, 2009

Canon FS10 recordings and Linux

I've been playing around with my new Canon FS10 digital camcorder (and having fun). The digital 2000x zoom sounds good but is not worth much in practice. The rest of the package is pretty good.

The recordings are saved as 2 files - a .MOD file (which is actually an MPEG-2 interlaced video file), and a corresponding .MOI file. The MOI file apparently contains information about the MOD file including date and time of the recording, duration and aspect ratio. Since I work on a Linux laptop most of the time, I was curious to see how easy it would be to transcode the MOD file into a smaller (e.g. DivX/XviD file), and also retain some of the information like the date and time of the recording. With a little help from Google, here's what I came up with, wrapped into a bash script:
  • pick up a .MOD file
  • read the corresponding .MOI file and extract the fields of interest (year, month, day, hour and minute of the recording, in my case). This page gives the structure of the .MOI file.
  • construct a human-readable string of the date and time
  • use FFMPEG to transcode the .MOD to an AVI using mpeg4 video and libmp3lame audio codecs, and also overlay the date and time string on the output using the drawtext.so vhook filter feature of FFMPEG
  • finally, use cfourcc to change the FourCC code as required.
Works like a charm, gets me good quality videos in half (or less) the original size, along with the date and time information embedded in the video. The complete script looks like this:

#!/bin/bash

### Convert .MOD files (from Canon FS10 digital camcorder) into AVI files.
### Source (.MOD) is MPEG-2 video sequence @ 9600 kbps, with AC3 audio @256 kbps,
### destination is .AVI with MPEG4 video @ 4800 kbps and MP3 audio @128 kbps.
### First pick the date/time of the recording from the .MOI file,
### then encode movie and overlay date/time info. using vhook of ffmpeg

months=(none Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)

for f in *.MOD
do
   bname=`basename $f .MOD`

   params=(`od -t x1 -j 6 -N 6 $bname.MOI | head -1`)
   yr=$((0x${params[1]}${params[2]}))
   mon=$((0x${params[3]}))
   day=$((0x${params[4]}))
   hr=$((0x${params[5]}))
   min=$((0x${params[6]}))

   if [ $hr -lt 10 ]
   then
      hr="0$hr"
   fi
   if [ $min -lt 10 ]
   then
      min="0$min"
   fi
   dtstr="$day ${months[$mon]} $yr, $hr:$min hrs"
   echo $dtstr > /tmp/mod.txt

   ffmpeg -i $f -deinterlace -vcodec mpeg4 -b 4800k -acodec libmp3lame -ab 128k -vhook '/usr/lib/vhook/drawtext.so -f /home/user/.fonts/Vera.ttf -s 14 -t mod.txt -T /tmp/mod.txt' $bname.avi

   cfourcc -u XVID $bname.avi

   rm /tmp/mod.txt
done

### end of script


Tuesday, October 21, 2008

Good to see India beat Australia with a complete team effort!

One of the best team jobs till date, it was a pleasure to see bowlers, batsmen and fielders all pitch in and win so comprehensively against Australia, of all teams! Australia, of course, is bound to come back very strongly in the remaining matches. As Dhoni rightly said, this was probably close to the best position to be in and it will be tough to stay at this level. Consistency is what counts, and one hopes the Indian team will be able to maintain this tempo through the rest of the series and beyond.


Wednesday, September 24, 2008

Intrepid Ibex Alpha 6

I decided to take the plunge and upgraded my regular laptop to Intrepid's Alpha 6 release. I must say I am not in the least disappointed, nor do I have any regrets so far. Apart from a few quirks and the odd random crash (usually in some obscure service that doesn't directly affect my work), it has been a pleasure to work with.

The upgrade was smooth and neat. Since I had already customized my session with Hardy, there was no noticeable difference on the desktop after the upgrade - all my Compiz, Emerald and other settings had been retained. Most packages had been cleanly upgraded, too. VirtualBox gave me a little trouble, with the kernel module refusing to build. However, a day later all was well - apparently one of the packages had not been updated from the repos.

The suspend and hibernate work pretty well out of the box. I use a Dell Vostro 1500 with an Nvidia 8400M GS card (with the -177 driver). I was pleasantly surprised to see that the sleep function worked without a hitch on the first attempt when I closed the lid - with absolutely no tweaking of any configuration anywhere. Ditto for the hibernate function.

The other thing I really liked in this version is the network manager applet. Switching between office and home networks has been an issue for me (I generally don't use DHCP). I had a couple of scripts on Hardy and earlier to help me switch quickly, but it was still an exercise. Intrepid has made this much easier, and the switchover is really fast.

While there was some talk on the forums about improved startup speed, I must say I can't see all that much difference from earlier versions. The shutdown, though, certainly seems faster.

Overall, Intrepid is looking good. If Alpha 6 is this usable, I'm sure the final release should be a hit with most users.