Friday, September 03, 2010

Trouble with ejecting cd/dvd roms

Today, I got bored and so decided to watch some favorite movie on my dvd rom.(I use fedora/kde by the way x86). As usual when I popped in the dvd drive, I got the familiar prompt "So and so is mounted.. what do you want to do?". All I wanted was to watch a movie, relax, have a beer(just a figure of speech). To my horror, the dvd drive kept spinning and I never ended up watching the movie. Damn you dvd!
       After convincing myself that hulu will entertain me better, I decided to eject the dvd(It was making crazy amount of noise!). Pressing eject/right click->eject did not work.. linux kept ignoring me and continued to struggle with the drive.

Hmmm... I hate when these things happen and gives people the excuse to say "Oh! Linux? its not ready for desktop users.. try mac(pussies - NOTE: I'm not a sexist)". Okay, back to my conjecture...

I speculated, what if some process was using the dvd rom(must be my file manager-dolphin); what if I killed it? would eject succeed?

so pulled down my yakuake terminal and typed in the following hoping it would work.

ps -ef | grep sr0

Shows up hal-daemon and some other shit.. killed 'em all. Still eject button won't work! After googling around someone who suffered as much as I had suggested firing a bunch of eject commands quickly and seems that did the trick.

Closing my eyes, praying one final time hoping I don't have to reboot to take out the damn dvd.. I typed in the following


for i in `seq 1 20`; do sudo eject -v /dev/sr0 & done

and pressed Enter.....

A slew of outputs flew across the screen and finally success! dvdrom ejected.. I wish there was an option to just say 'shut the fuck up and get the dvd out'. Unfortunately no.

Saturday, August 28, 2010

I'm blogging again!

To my non-existent blog readers,
       Thank you for the support you have provided so far! I have decided to start blogging again. As you may have noticed, I have changed the layout of my blog(thanks to blogger for awesome templates). Stay tuned for more updates...

Sunday, January 17, 2010

Fixing Eclipse interaction with kde4.3

I love KDE(no secret!) and kde underwent a big review after Qt4 was introduced. KDE stopped being the environment I loved. So many bugs and it kept crashing all the time. I had to switch to Gnome. I started using Ubuntu(Ubuntu Linux Bible (versions 9.10 and 10.04)) for some time and it was fun for some time. But my longing for KDE just kept me troubling. I was waiting for a stable release and hoping that I get back to KDE. So KDE 4.3 came to my rescue; not only is it stable, its really really fun. 
      Probably I will reserve another post for all the things I love about KDE but for now lets get to the main issue. Lately I wanted to learn Android and start writing applications for the platform. I borrowed "Android Wireless Application Development" from my university's library and so far its just great! 
To develop android applications, I am using google's eclipse plugin. However, lately eclipse stopped working or rather its not working properly on distros with KDE 4.3. You cannot click buttons, only menus work and the eclipse wizards are a pain in the ass! You have to use combination of space bar, tab key and enter key to navigate. Very annoying indeed! Looks like the problem seems to be with the latest SWT framework which has made some kind of internal changes.     
After googling, the fix was very simple. I will describe what you need to do to solve this. It will work for any linux distro you are using. I am going to assume that you have eclipse installed under folder /opt/eclipse. Open your favorite editor(kate/kwrite/jedit whatever) and paste the following contents into the file.
#!/bin/sh
export GDK_NATIVE_WINDOWS=true
cd /opt/eclipse
./eclipse





Save the file under $HOME/bin/eclipse_launch. Next, press Alt+F2. This will bring your runner upfront. Type 'konsole'. After the konsole launches, navigate to your bin directory by typing

cd bin
chmod +x eclipse_launch
Thats it! You can create a shortcut on your desktop for the script or just click the script directly to launch eclipse. The weird problem is gone! Long live KDE :)