Sunday, December 30, 2007

Shellscript to save power

Even though I run a Desktop, I do whatever I can to save electricity. Turning off the monitor helps a great deal. Then there's CPU frequency scaling. But when I set my machine to "ondemand", I noticed a marginal drop in performance, especially when playing a game or something. So I kept my machine on "performance", and set it to "ondemand" only when I had to leave the PC unattended for a while. Needless to say, it was quite a pain in the butt. So I made a shellscript to automate the process. Whenever my screen is locked, the script will turn CPU frequency governor to "ondemand"



#!/bin/bash
#Script to put the cpu in "ondemand" if the screen is locked

check=`pidof kdesktop_lock`
if [[ -n $check ]] ; then
/usr/bin/cpufreq-set -g ondemand
else
/usr/bin/cpufreq-set -g performance
fi

exit 0




Then I added a task to my root crontab:

0,10,20,30,40,50 * * * * root /usr/bin/freqmod.sh


where /usr/bin/freqmod.sh is the path to the script.

This is my first "real" bash script, so suggestions are welcome :)

Sunday, December 16, 2007

Wednesday, November 07, 2007

Dolphin

Dolphin is a new File Manager for KDE, which I encountered when I upgraded to Kubuntu Gutsy. It's supposed to be lightweight with the sole purpose of being a file manager, unlike Konqueror, which is a complete web browser.

There has been some talk about adding tabs to Dolphin. I missed the tab feature initially, being used to konqueror and firefox. But I realized that I don't really need tabs, except when copying files from one location to another. And for that, there is something called "Split View" in Dolphin. I find this better than tabs actually...


Wednesday, August 22, 2007

Linux to the rescue

I haven't posted anything on this blog since ages. Thats mostly because I haven't come across any more problems using linux. The nvidia kernel module problem mentioned in the previous post was sorted out thanks to another update by the cool ubuntu guys.

I've been really pissed off with windows. The computers in my college are quite slow, and they run windows XP. Opening a damn window takes ages. I opened about 5 windows of Internet Explorer today, simply because windows didn't provide any feedback (not even the mouse-cursor-timer...). Then then killing the windows takes another 10 minutes. And then the great explorer.exe decides to crash...

I had to make copies of a few VCDs of some dance performance for my cousin. No big deal right? Well, apparently windows can't even handle a couple of corrupt VCDs. Explorer.exe, as usual hangs like crazy, and lets not talk about Nero. I wonder why people pay money for that piece of shit?! Even VLC couldn't play the VCDs. Killing a process is practically impossible. Windows keeps reading the CD even when I tell it to stop....

In linux, copying the VCDs was a breeze. Mplayer and K3b are everything you need. For the corrupt VCDs, I could just use mplayer -streamdump, and a Clone Copy in K3b for the ones that worked. Nothing hung, it didn't even slow down the machine. Now that's the way it should be!

Tuesday, June 26, 2007

The kernel upgrade - Nvidia

There was a kernel upgrade a couple of weeks ago, and the sda/hda thing was sorted out. But the nvidia modules weren't loading and X didn't start. As usual, I posted a thread on Ubuntuforums.

For now, I don't want to install the nvidia drivers manually. So I'm sticking to the older kernel.

Wednesday, May 30, 2007

Issues with the new kernel: 2.6.20-16-generic

Adept-notifier showed me new kernel updates, and I installed these, only to find that I was greeted by a whole bunch of problems.

During the upgrade process, Adept seemed to have hung at 100%, (yes 100%). It showed dpkg-run finished in the terminal. I had to close the window, but just to be on the safe side, I opened a terminal, and ran sudo apt-get upgrade again. There was an unmet dependency, and I sorted this out. All seemed to be OK, and I rebooted the machine.

I had played with my partitions a bit, and all the /dev/sda* entries in the partitions wouldn't be mounted. Also, a new partition that I had created showed some superblock error. I just rebooted the machine, using the old kernel, and none of these problems showed up.

As usual I checked on UbuntuForums, and it seems the new kernel has a whole load of issues:
http://ubuntuforums.org/showthread.php?p=2733874
http://ubuntuforums.org/showthread.php?t=456662

Lets wait and see if the issues are sorted out. It seems all /dev/sda* has been made into /dev/hda* again
neutral

Saturday, May 05, 2007

Edgy to Feisty

I upgraded to Feisty Fawn a few days ago. It was quite a smooth process as compared to the previous release. The upgrade tool on the DVD was crashing, so I used the commandline instead.

Apart from Samba breaking, (which I managed to fix in a few hours), everything went quite well. My thanks to the Ubuntu team for a nice release.
biggrin

Downloading the DVD was quite a waste. Inspite of spending a week downloading 4.3 GB, I still had to download another 400MB. Next time, I'm sticking to solely to apt-get.

Tuesday, April 24, 2007

Monday, April 23, 2007

Saturday, April 21, 2007

Feisty Fawn

Ubuntu Feisty Fawn was released on the 19th. I've been trying to read the wiki pages for upgrading, but the servers are so slow I can barely open a page. I'll have to wait a bit for my upgrade. But till then, I'll download the alternate CD (using bittorrent)
smile

Sunday, April 15, 2007

PhotoRec


I had made a post some months ago, on how to recover accidentally deleted data. I never had to use it, but today, I accidentally deleted an important spreadsheet file, while cleaning up some older files.

PhotoRec came to the rescue. Its fairly simple to use, and within a matter of 20 minutes it searched for over 170 old, deleted files. I easily found the one I was looking for. I think everyone should have a copy of PhotoRec, just in case...

Tip: Don't recover all the files, (I ran out of disk space). Go to "FileOpt" and just select the filetypes you are looking for.

Friday, April 13, 2007

Dvdisaster

Dvdisaster home

Have you ever faced a situation when your important backup DVD is corrupt? I have, and it can be quite frustrating. Strictly speaking, optical media is not good is backups and archiving. But if I were to buy a 100GB hard-disk every 3 months, my dad would freak out
razz

So it would seem that DVDs are the way to go for the time being. And I found a good piece of software that would help me restore my DVDs if they ever got corrupt. Its called Dvdisaster.

The process of creating the error codes is a bit tedious, but it would help with important data.

Saturday, March 10, 2007

Additional Plugins required ?

How many times have you seen the "Additional plugins are required" message in firefox? I found a neat workaround. There's an extension called "Unplug" that allows you to download media directly from a page. Then you can watch it in your favorite media player. (Might not work with Flash though. I'm not sure...)

Monday, February 05, 2007

Saturday, February 03, 2007

Modifying keys with xmodmap

I have fat fingers, and my backspace ans insert keys are quite close to each other. And accidently pressing the insert key instead of backspace can be really annoying....All of a sudden you notice
your text is getting overwritten.

So, is there any way of getting rid of my insert key? Or better yet, can I replace Insert with Backspace? The answer: xmodmap

Here's what I did:

  1. xmodmap -pke > ~/.xmodmap.myown (This created my own xmodmap file)
  2. Open it in a text editor. Find where Insert is. (Keycode 106 in my case)
  3. Find the line with Backspace, and replace the insert value with backspace. In the end, it will look something like this: keycode 106 = BackSpace Terminate_Server


And incase you can't find which keycode is what, then you can run xev in a terminal. Press a key, and its info will be displayed on the terminal.

To use this new configuration, I ran the command: xmodmap ~/.xmodmap.myown

And so that I don't have to run it everytime, I put this command in my KDE autostart directory in a shellscript.

Pretty neat eh?

Monday, January 15, 2007

The DMA toggle

I had to burn a lot of anime for a friend who was visiting after a long time. The first few DVDs burned fine. Then my data transfer rate dropped from 8 to 10 MBps to a mere 2 MBps. I don't know why this happened.

My system started acting odd, there was a lot of CPU usage, and I could barely move my mouse. First thing I did was checked whether DMA was enabled. Yes, it was. Next, I did a google search, and found a forum post somewhere.

The post was about windows users encountering a similar problem, and all they did to solve it was to disable DMA, and then enable it again.

I remembered that there was a problem reading one of my old DVDs. So maybe there were a few CRC (cyclic redundancy check) errors, that caused my system to stop using DMA, just like windows.

Ergo, I decided to "toggle" DMA, turned it off, and turned it back on again. And tada!! All is back to normal. I'm burning as I type!

------------
Edit: 21 March 2007:

Today, the same thing happened, and I now have definite evidence of the fact that DMA was disabled by the kernel:

Mar 21 15:54:36 ranjan404 kernel: [17197775.652000] hdd: DMA disabled

Sure enough, CD burning was slow and crappy, and the mouse went nuts:
Mar 21 16:13:34 ranjan404 kernel: [17198913.988000] psmouse.c: Wheel Mouse at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away.