Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

2 Sept 2012

Inspecting 302 HTTP headers

Let’s say you want to inspect the response header for an HTTP request.  But the response is a 302, so your browser immediately navigates to the new location and you never get to see the 302 response (and the headers).

One way to solve this problem would be to install a browser extension that would keep the headers for you even after the redirect has happened.  But I’m not a big fan of installing browser extensions for functionality that I very rarely need.  So I use the wget command instead:
wget -S -O/dev/null --max-redirect=0 'http://www.google.com/'
-S flag tells wget to print the headers to stderr
-O/dev/null discards the response body (by writing it to the null device)
--max-redirect=0 tells wget to not follow any redirects.

This is the 302 redirect google.com sends for redirecting users to country-specific Google domain:
--2012-09-02 09:54:33--  http://www.google.com/
Resolving www.google.com (www.google.com)... 74.125.237.50, 74.125.237.48, 74.125.237.52, ...
Connecting to www.google.com (www.google.com)|74.125.237.50|:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 302 Found
  Location: http://www.google.com.au/
  Cache-Control: private
  Content-Type: text/html; charset=UTF-8
  [...snip...]
  Date: Sat, 01 Sep 2012 23:54:33 GMT
Location: http://www.google.com.au/ [following]
0 redirections exceeded.

4 Feb 2012

Moving Eclipse installation to a different location

I recently changed my username on my laptop from manki to m.  I just had to rename /home/manki directory to /home/m and everything worked just fine, except one program: Eclipse.  For whatever reason, Eclipse writes absolute pathnames like /home/manki/whatever in its configuration files and when /home/manki disappeared, Eclipse could’t figure out what to do about it.

One nice thing about Eclipse is that, like all Unix programs, it keeps all its data in plain text files.  I just had to look for files that contained the string /home/manki and replace those strings with /home/m instead.  The directories I had to scan were:
  • workspace-root/.metadata
  • ~/.eclipse
I used this command to get a list of files that matched:
find ~/.eclipse ~/prog/eclipse-workspace-android \
    -type f \
    -exec grep -l '/home/manki/' {} \;
Once I had the list of files, an easy search-and-replace across all those files did the job.  Eclipse opened with no issues, and it was able to find all the plugins and such.  I think doing the same would be sufficient to move an Eclipse installation from one location to another.

7 Nov 2011

Borderless Chrome windows in Linux

Chrome on Linux lets you use Gnome or KDE’s default window borders if you don’t like Chrome’s minimalistic window borders.

I prefer to use KDE’s window borders for two reasons:
  • I have customised my window title bar to add an “Always on top” button to it.  It’s handy once in a while.
  • When using system window border, I can see the full title of the current tab.  This particularly useful when there is a nontrivial number of tabs open—which is like always.
What’s annoying is if you toggle this option from ‘don’t use system borders’ to ‘use system borders’, KDE would render all existing Chrome windows without any border, like this:

Chrome windows that are opened after the change, however, are rendered correctly with border, title, minimise/maximise/close buttons, etc.  If you are stuck with a few ‘naked’ windows like this, you can force KDE to draw borders by closing and recreating those windows.  To avoid losing state in the process, use Chrome’s “undo close tab” feature.

Press Alt+F4 and close a whole window—close all tabs in that window at one go.  (You cannot close that window otherwise because it doesn’t have a close button.)  Now, from a different Chrome window press Ctrl+Shift+T for Undo Close Tab.  This will restore the window you just closed with all tabs that were present in it.  Since it’s a newly created window, KDE would paint all borders correctly.

14 May 2011

If it's too hard you're doing it wrong

Let's say you're a Linux user with an iPod that has a partially corrupt hard drive.  How would you take your music out of it and move them to a different player?  This post is how I handled the same situation.

First, I moved the entire iPod_Control directory from the iPod to a different, healthy hard disk to minimise data loss due to hardware failure.  Easiest thing to do is use gtkpod to export all the songs out of the iPod.  I added the copied iPod_Control directory as a new iPod to gtkpod and tried exporting the whole library.

For a number of reasons my iPod's music library was a little corrupted: (i) the library had been mutated by several different programs over years, and (ii) because the disk was damaged, some files were truncated.  gtkpod wasn't able to handle files that had issues.  It simply crashed when it encountered those files.

If you have ever looked at an iPod's iPod_Control directory, you will know that the file organisation is cryptic.  Unless you read the iTunes library file -- which is in a proprietary format -- you cannot make out what those files are.  gtkpod was reading the contents of my playlists from the iTunes library and copied the associated MP3s to the location I specified.  In the process it also renamed the MP3s so that it's easy for me to see which songs are where.

gtkpod was able to parse the library alright; it showed all my playlists and the songs in them.  So one solution could be, I figured, that I shouldn't let gtkpod do the renaming.  I exported my playlists as m3u files.  Now for each playlist I have a simple file with just a list of file paths.  I copied all the files into a directory using a shell for loop:

for f in $(grep -v '^#' /tmp/playlist.m3u); do
  # /path/to/ipod/iPod_Control/Music/Fxx/xyxy.mp3 -> Fxx-xyxy.mp3
  target=$(echo $f | sed 's#^\(.*\)/\([^/]*\)/\([^/]*\)$#\2-\3#')

  if [[ -f $target ]]; then
    echo >&2 "\nNot overwriting $f"
  else
    cp $f ./$target
    echo >&2 -n '.'
  fi
done

Then I used EasyTag to do the file renaming.  (EasyTag was good at handling corrupt MP3 files.)  After doing this all, only when I write this post, I realise there's an easier way: I can simply ask gtkpod to not rename files!  (In the file name format box, I would enter %o to prevent file renaming.)  Ah well, that's okay... writing that zsh script was fun!

8 May 2011

Why I am not moving away from Linux any time soon

  • KDE is freakin' awesome.  In addition to making all sorts of customization possible, it gives me tons of tools to make my life easier.  I cannot possibly list everything I like about KDE, so here's a tiny list:
    • Klipper remembers n recent clipboard contents, so I don't accidentally lose some text I copied.
    • KDE's Run Program dialogue lets me do things like doing simple math, doing a Google search, switching to a different app, etc.  This is the kind of convenience that doesn't sound like a big deal first, but you miss it when you don't have it.
  • Extremely powerful, customisable command line shells.  I am a keyboard junkie.  I do most of my work on the command line.  I play my music and movies, browse through my files, etc. from the command line.  And I can automate any random chore by writing shell scripts.
  • It has awesome media players.  Mplayer is my favourite.  It plays any random codec you throw at it, out of the box.  Oh, and it has configurable keyboard controls for everything.
  • Ease of migration.  A few days back I wiped my hard disk and upgraded to 64-bit version of Kubuntu.  I was able to export the list of programs I had installed before wiping and reinstall all those apps with 2 simple commands.  All programs keep their configuration under home directory, so I didn't have to reconfigure any program.  I cannot imagine such an easy migration on Windows or OS X.
  • Most, if not all, browsers natively support playing Windows media format.  I just found this online Tamil radio and it Just Works on Chrome, out of the box.  (I don't think it would work on OS X.)
  • Efficient use of resources.  My netbook really would suck when running Windows 7 merely because the hardware is cheap.  But it easily handles Kubuntu.  The OS and apps are not memory hogs.
  • The Unix culture has a good taste in user interface.
    • Apps don't show you useless notifications.  I had booted into Windows 7 for a while last week.  My machine's audio driver showed me a popup notification every time I plugged in or removed headphones!  I can't imagine a Unix program daring to do anything dumb like that.
    • No frequent reboots required like Windows.  (I admit that it's been a long time since I have used Windows; they might have reduced the frequency of reboots now.)
  • Vastly secure than Windows and OS X.  No viruses.  No OS design flaws that make the system terribly insecure.

7 May 2011

Firefox missing icons


I recently upgraded to 64-bit version of Kubuntu and since then Firefox lost most of its icons.  From the screenshot you can see that some of the menu icons are gone, Firefox window doesn't have an icon, tabs have no icon for close button, new tab button doesn't have its icon.  Obviously, it wasn't a great experience using the browser in this state.

Turned out it was because I was running an incompatible version of Firefox on my machine.  I always download Firefox from Mozilla's site as a tarball and run it from the command line.  (I do that because Ubuntu historically has been very slow in updating the officially supported Firefox version.)  The Firefox tarball I had was a 32-bit version.

The solution?  Upgrading to 64-bit Firefox, obviously.  But Mozilla, for some reason, doesn't distribute 64-bit version of its browser.  I have started using the Ubuntu-supplied Firefox now and everything is back to normal.

20 Feb 2011

Controlling screen brightness in Linux

3 years ago, I had a Lenovo laptop whose screen brightness keys didn't work on an old version of Ubuntu.  I wrote a blog post on how I worked around the limitation.  Now I have a Samsung N450 laptop running the most recent version of Ubuntu (10.10) and the screen brightness keys don't work again.  Like the last time, I am going to document how I am changing screen brightness on my laptop now.

I learned this from a comment Goksu left on an Ubuntu bug report.  The command that changes screen brightness is:
sudo setpci -s 00:02.0 f4.b=90

The 90 in this command is the brightness value in hexadecimal.  Valid range for this value is hexadecimal values between 0 and ff inclusive.  For instance, to set brightness to 75% replace "90" in the command with "bd" (i.e. sudo setpci -s 00:02.0 f4.b=bd).  Likewise use "7f" for 50%, and "3f" for 25% brightness.  Never set this value to 0 though, because that turns the display completely off and resetting the brightness can be hard.  (If you manage to accidentally set this to 0, reboot the machine, before you load Linux, i.e. while on the boot menu use brightness hot keys to set brightness back to normal.)

You may want to look at my old blog post to see how to avoid having to enter your password every time you change the brightness and to bind a shortcut key to adjust brightness.

Now, some details on how this works so you can adjust the command arguments to suit your computer.  Using setpci command, we are directly setting the brightness configuration on the graphics card.  -s flag says which device to control.  Running lspci shows all devices connected to the system via PCI.  On my machine this is what lspci prints:
% lspci | head -3
00:00.0 Host bridge: Intel Corporation N10 Family DMI Bridge
00:02.0 VGA compatible controller: Intel Corporation N10 Family Integrated Graphics Controller
00:02.1 Display controller: Intel Corporation N10 Family Integrated Graphics Controller
As you can see "00:02.0" is the identifier for the display controller.  Brightness is controlled by the number in f register of the VGA controller.  This register is 8 bits long and hence the range 0 to ff.  With the setpci command we change the value of the f register and that results in the brightness change.

Update (Oct 2, 2011): I have written a Go program to change the brightness from command line.  I have uploaded a 32-bit compiled binary as well, if you don't want to compile it yourself.  You can install this program to /usr/local/bin with setuid bit set so that you won't need to 'sudo' every time you run it.  (Search for "chmod" in my previous post for detailed installation instruction.)

18 Jan 2011

Running a filter on text in clipboard

The power (or beauty, if you want to call it that way) of Unix command-line interface is not only because of the available commands, but also because of the way we can combine simple commands to do complex things.  Filters are a great example.  In the Unix world we can find many powerful commands that expose functionality that is available only to programs via APIs.  xsel is a great example.  With xsel command, we can inspect and manipulate the contents of clipboard from the command line.

I often have some text -- maybe in a simple text editor (like Kate or GEdit) or in the browser.  I want to use that text in a different program, but with some modifications applied to it.  For example I might want to convert all tab characters in that text to 2 spaces.  Today I wrote a one-line shell script (called run-on-clipboard) that would let me run any filter on the text in clipboard.  Here's the script:
#!/bin/sh
#
# Runs a "filter" on clipboard contents.  Can be used to make arbitrary changes
# to the text in clipboard.  For example, to convert all tabs in the clipboard
# text to two spaces, you can run:
#    run-on-clipboard sed 's/\t/  /g'

xsel -b | "$@" | xsel -bi
To convert tabs to spaces, I would copy the original text into clipboard and run the following command from a terminal:
  run-on-clipboard sed 's/\t/  /g'
This would change the clipboard contents, so pressing Ctrl+V in any program now will paste the text with tabs replaced with spaces.

9 Jan 2011

Note to self: Don't fall for aesthetics again

It looks I will have to get a replacement laptop in a month or two, and every now and then I think of getting a MacBook.  Could be because of unintentional peer pressure.  Almost everyone in my company carries a MacBook around, so it won't be surprising if a part of mine is sold on the beauty of the machine.

Here I am going to enumerate the reasons why I should stick to a Linux machine -- or rather my past (bad) experiences with the Apple machine.  Just so that I don't fall for aesthetics again ;-)
  • MacBooks do not have Home, End, Page Up, and Page Down keys.  Command+arrows work in some programs, but not all.  Some programs might respond to Ctrl+arrows.  Bottom line is that no key combination can be programmed into my muscle memory, and I would be frustrated by the lack of productivity.
  • Apple believes that people run several different apps simultaneously, and that it's not common for a single app to have several open windows.  You'd press Command+Tab to switch between apps and after switching to the app you want to, you press Command+` to cycle between the windows of that app.  But I do pretty much everything on the browser, so technically I have only one app open with a dozen windows.  Suddenly, all I have is sequential access to my windows!
  • This might have improved by now, but when I used a MacBook about two years ago, the UI was mostly mouse-centric.  Some dialog boxes just cannot be closed with the keyboard, for example.  I am a keyboard warrior and I go out of my way to avoid using the mouse.
  • They still have the freezing problems.*  Not more than two weeks ago I saw a colleague trying super hard to bring his MacBook back to life after it got stuck somewhere.  The laptop would go to sleep, wake up, and do all that, but just won't let him do any work.  He had to power down the machine to get it back to working.  If they haven't fixed that problem in the past two years, I don't think they will fix it in the next few months.  No matter how brilliant the sleep indicator is, if the machine would lose my work I don't want it.
  • Mac OS has only one clipboard, which means I will have to explicitly copy stuff before I can paste.  I know there are people who get confused by X's primary selection and clipboard, but I am not one of them.  In fact, I love them.
  • I know there's a Mac App Store that may make it easy for me to find and install apps.  But hey, apt-get is a hundred times easier and it costs no money :-)
* I came up with this a few weeks ago: MacBooks are like ice cream.  Pleasant to look at and use, but frozen most of the times.

20 Oct 2009

Smooth volume change in KDE

Of late, I am annoyed by my ThinkPad laptop's volume controls increasing and decreasing volume in steps of 19 (so practically I get only 5 different volume levels).  Today I decided to write a shell script to control volume, rather using the volume buttons on the laptop.  Since I use KDE, making the script talk to KMix using DCOP would be easy and portable (as in, the script will work on any machine running KDE).

KMix's DCOP interface is documented in its manual.  Here is the shell script in its entirety.  It's also available as a downloadable file to save you some typing.

#!/bin/bash
#
# Adjusts speaker volume in KDE.  Does so by sending DCOP commands to KMix.

set -e

function get_volume {
    dcop kmix Mixer0 masterVolume
}

function set_volume {
    dcop kmix Mixer0 setMasterVolume "$1"
}

if [[ "$1" == "" ]]; then
    get_volume
    exit 0
fi

old_volume=$(get_volume)

operator="$1"
shift

case "$operator" in
+)
    set_volume $(expr $(get_volume) + 5)
    ;;
-)
    set_volume $(expr $(get_volume) - 3)
    ;;
*)
    echo >&2 Unrecognized operator "$operator".  Use + to increase and - to decrease volume.
    exit 1
esac

I have saved this file with the name speaker-volume.  When this script is run without any arguments, it prints the current volume level.  When passed "+" as the argument it increases the volume by a small amount, and decreases it when "-" is passed as the argument.

$ ./speaker-volume
58
$ ./speaker-volume +
$ ./speaker-volume
61
$ ./speaker-volume -
$ ./speaker-volume
57

(You may notice that the increase and decrease in the volume is not accurate; I don't know why it is so.  +5 and -3 work reasonably well on my T60p laptop running Kubuntu Hardy.  You may have to tweak these numbers to suit your computer/taste.)

Tip: To make it easy to adjust volume, you can define global shortcut keys as described in my post about adjusting screen brightness.

8 Sept 2009

Chrome apps on Linux

Update: As of version 4.0.213.1, Chrome on Linux supports applications shortcuts.  (However, it uses Chrome's icon for shortcuts instead of the website's icon.)

If you are running the pre-release dev version of Chrome on Linux, you probably know that the Application Shortcuts feature of Chrome is not functional yet.  If that is one of your favourite features, you don't have to wait till the Chrome team implements it; if you are willing to create the shortcuts manually, you can get that feature right now.

Here is how you'd create an application shortcut for Gmail (in KDE):
  1. Right click on desktop, select Create New > Link to Application...
  2. Download Gmail logo from http://mail.google.com/mail/images/2/gmail_icon_32.png and save it somewhere.
  3. Click on the icon near the app name to change the icon.  This brings the Select Icon window.  Choose Other icons options.  Click on Browse... button and choose the icon you saved in the previous step.


  4. Type Gmail for the name of the application.
  5. Switch to Application tab.  Type /usr/bin/google-chrome --app=http://mail.google.com/ --enable-plugins for Command.
  6. Press OK button to save the shortcut.
That's all you have to do.  You can now click on the Gmail shortcut from your desktop and it opens Gmail in its own window.  As you might have observed, you only have to change the URL in the command line and the icon to create shortcuts for other web apps.

Compiz and Docking Windows

OpenOffice is one among many programs that lets us dock small tool windows to the main application window instead of keeping them as floating tool windows.  OpenOffice blog explains how this is done.

If you have Compiz running on your machine, you might find that docking doesn't work anymore.  Moving the tool window near the application window won't show any sign of docking at all.  You need to disable a certain Compiz setting for this to work.  Here's how you would do it:
  1. Open Compiz Settings Manager.  You can do it by running ccsm command, or choosing Advanced Desktop Effects Settings from K Menu > Settings on KDE.
  2. Click on Move Window item from the right-hand side pane.  (Not on the checkbox; click on the icon or the text "Move Window" itself.  That opens the options window for this item.)
  3. Uncheck Lazy Positioning option, if it's checked.

That's it.  Now you should be able to dock your tool windows.

29 Jun 2009

How I use Gajim for Google Talk

Edit: If Gajim doesn't connect to Google Talk, check if you're using talk.google.com:5223 as the host and port to connect to.  Here's a screenshot of the configuration window for reference.  (Click on the image to see a larger version.)


Original post:
Several times in the past I have tried to use a native IM client like Pidgin or Psi or Gajim for Google Talk (since there is no Linux version of official Google Talk client).  I tried about half a dozen different clients and liked Gajim the most.  However, there was something that stopped me from using it as my Google Talk client.

You might have noticed that if you change your status message from Google Talk (stand-alone application), your chat status in Gmail will be automatically updated to whatever your new status on Google Talk is.  And vice versa: change your status in Gmail and your status in Google Talk changes too.  This is a cool feature that's been implemented by Google Talk.  But XMMP, the protocol used by Google Talk allows users to use different status messages on different chat clients simultaneously.  Third party chat clients will not copy your status message from Gmail (or vice versa).

So what would happen if I am logged into Gajim and Gmail Chat simultaneously?  My friends would see the status message I set in Gajim and Gmail randomly* at different times.  Because of this I didn't use Gajim, although I disliked the slowness of Firefox.  Recently I found out how to use Gajim and "hide" the status message I set in Gajim from my friends.

Here's how I did it: In Gajim's account configuration settings dialog, I unchecked "Adjust to status" checkbox and specified a low priority.  I used priority 5; but any number less than 10 would do, I guess.  (When this checkbox is checked, Gajim sets the priority to 50 when I'm actively using the compuer, while Google Talk and Gmail sets the priority to 24).  My friends' IM clients, including Google Talk, would use the status from the client that has the highest priority.  Using a low priority ensures that my friends see the status message I set in Gmail.



But when Gmail chat goes "idle", it sets the client priority to 0.  That means my status specified in Gajim takes precedence since its priority is set to 5.  To prevent this, I always choose "Not Available" as my status in Gajim.  This way, when I go idle on Gmail, my friends still see the status message I set in Gmail.


PS: It might be possible that changing the priority is not required at all; but this is how I have set up my account.

* This is not really random; but I don't feel like going into the details.  If you read the whole post there's a pretty good chance that you will understand the "randomness" too.

25 Jun 2009

Disabling NetworkManager balloons

One of the reasons I hate Windows for is the frequent useless info balloons it shows.  Some people seem to like such balloons, including those who maintain NetworkManager applet.  Recently, we started using NetworkManager to manage the wireless network adapter, and I hated the frequent balloons that said "you are connected to so-and-so network".  Turns out that disabling those notifications is not very obvious (at least with version 0.7.0.99).  Here's what you do to get rid of those annoying balloons:
  • Enter gconf-editor in command line to open GConf editor.
  • Navigate to /apps/nm-appletr in the editor.
  • Add a new key of Boolean type with the name disable-connected-notifications and the value True.

From next time, you won't see those annoying balloons when NetworkManager connects to a new network.

30 May 2009

Compiz, don't steal my KDE shortcut keys!

The super-cool animations and glossy looks of Compiz does sure make it more fun to use my computer.  But I had my own set of complaints about it.  Until now.

I run KDE and despise Gnome for its too simplistic UI.  When I start Compiz it replaces the window title bar with its own version.  I customize my title bar in KDE by adding an "always on top" button to it.  It can be quite handy at times.  Compiz by default removes all my customizations to the title bar.  The solution is to use KDE-specific extensions for Compiz and use KDE-Compiz's window decorator instead of the stock one.  These commands do it:

sudo apt-get install compiz-kde
kde-window-decorator --replace &

I love Katapult.  Katapult is activated by default using Alt+Space global shortcut key.  Compiz binds the same shortcut key to window menu.  This can be changed in CompizConfig Settings Manager (invoked by ccsm command).  This configuration is under General Options > Key bindings > Window Menu.  I changed the shortcut key to Alt+F3, which is the default in KDE.

Another thing I learned today is how to configure Katapult.  Pressing Ctrl+C when Katapult is waiting for your input shows you configuration menu.  You can change the shortcut key that invokes Katapult, add a system tray icon for Katapult, etc.  Did I tell you I love KDE for its practically endless ways of customization? :)

22 Mar 2009

MP3s with incorrect track length

An MP3 file may be broken for many reasons.  A very common error in MP3 files is incorrect track length.  Some CD ripping software, maybe due to a bug, occasionally produce MP3 files with incorrect length.  Such a file would show as having, say 2:35 as its length when opened in a media player.  But the actual length of the track might be more, say 3:15 or something.  Most modern media players like iTunes, WinAmp, Amarok, etc. handle such tracks gracefully.  However, my iPod seems to have trouble playing such files.

A quick Google search for fixing this problem doesn't show any Linux-based tool.  But the good news is that we don't need any special software for fixing this problem!  Any sound converting software would do the job.

I used soundKonverter for this.  I added the files that had this problem and converted them to same MP3 format with same bit-rate.  This forces the converting software to fully re-read the track and freshly write one.  That solves the track length issue.

If you know how audio encoding/decoding works, you might think now that this is not the correct solution for this problem.  You're right.  We might lose some audio clarity in the decoding/encoding.  If we only measure the length and fix the existing MP3 file itself it will be a lot faster.  But I don't know of any tool that does exactly this.  My approach seems to work anyway, I don't care much as long as the work is being done :)

PS: A friend suggested using a hex editor and manually writing the track length in the file.  While the idea is really interesting, I'm not doing it right now, mainly because I have several such corrupt files and I don't have the patience to fix them all by hand.

4 Jun 2008

Turning off display in KDE

Kubuntu Gutsy has a bug that prevents screensaver from starting automatically in KDE. It is supposed to be fixed in the next version (Hardy). However, I am still running Gutsy and I cannot upgrade until my employer officially supports Hardy. I never shut down my laptop. After I go to sleep it keeps running with its LCD turned on for the entire night. This wastes energy unnecessarily. With some reading here and there, I wrote a shell script that will do exactly what I want to do before I go to sleep: lock the screen and turn off the LCD display. The script itself is very simple:
#!/bin/sh
#
# Locks screen and turns off display power.
# CAVEAT: Works only with KDE.

sleep 1                         # Wait for a second to let the user
                                # takes hand off keyboard.
xset dpms force standby         # This switches off the display.
exec kdesktop_lock --forcelock  # This locks the screen.
Now I have bound script to Ctrl+Alt+L key, which by default locks the screen. Whenever I step away from the computer, I can press Ctrl+Alt+L and it will turn off the monitor in addition to locking the screen :) PS: For information on how to assign shortcut keys to arbitrary commands/scripts, see this old post of mine.

23 Mar 2008

FLV to MPEG conversion

Did you ever want to convert an .flv file to a more common format (.mpg, for example) but didn't find the correct tool to do that? Did you know that your friendly VLC Media Player can do this conversion?
  1. Start VLC Media Player.
  2. Select File > Open File menu option.
  3. Select the .flv file you want to convert. Select Stream/Save checkbox. Click on Settings button.
  4. Select MPEG 1 as Encapsulation Method and mp1v as Video codec[*].
  5. Select File checkbox and provide an output file name.
  6. Selecting OK will close the dialog box and start the conversion.
* You don't necessarily have to select exactly these options. Play around with different combinations. You may also want to try increasing/decreasing the bitrate.

24 Feb 2008

Rip DVDs

Ever wanted to rip video from DVDs and couldn't do it because you didn't find a good, free software that can do it for you? Try HandBrake. Of course, it's free (as in open source). The best part I like about this software is that it's available for Linux :-)

11 Feb 2008

Tamil FM Radios

Update: I don't think any of these links or scripts work anymore.  Maybe you can try out, if you are interested.  But isai.in sounds like a good place now.  They keep playing some song always.  Just leave the site open in a browser tab and do the work :)

Occasionally I listen to Aahaa FM. I started with Chinmayi's Aahaa Kaapi Klub, which is a good companion when I get ready to office. I use GNU/Linux on my computer for the love of command-line. I will show you how I play FM radios on my computer. As you have guessed, I play them from command line :)

This is the script for Aahaa FM:
#!/bin/sh
#
# Play Aahaa FM using Mplayer.

mplayer mms://74.54.85.4/AahaaFM "$@"
Update: This command doesn't work anymore because of the changes to Aahaa FM site. Now the users are required to log in to be able to listen. I use a ChickenFoot script to automate the login process.

This is the script for Nila FM:
#!/bin/sh
#
# Play Nila FM using Mplayer.

mplayer http://78.86.174.216:8000/ "$@"

This is the script for Shyam Radio:
#!/bin/sh
#
# Play Nila FM using Mplayer.

mplayer http://wm.chennaistream.net/shyamradio "$@"