Tuesday 30 June 2009

Do you workrave??

Are you computoholic? Yep that's a word I just made up. Not present in any dictionary. Do you tend to get up from the seat in front of your computer at the evening with the sudden revelation that you didn't make it out of the room even two times within the day. Or are you suffering from eye problems due to excessive usage of computers. Then here is some thing that may worth checking out. Workrave is a small software which sits behind your back and says to you when to stop!. Yes you heard me. After certain interval it rings to you by giving visual indications that you should probably take some tea break or if not some exercises for your eye or your back. It plays you animations as well as how to do them. Pretty cool huh? The time intervals are configurable. So it is advisable to the set the break intervals that suites your work style. But don't cheat and set the interval to 4 hrs. You know what I mean. In Ubuntu you can install it by

$sudo apt-get install workrave

It is cross platform. Google workrave you will get many references.

Tuning the hard drive

Ever thought why your disk takes ages to move that all important film your private folder? May be Linux utility hdparm can help you. hdparm is a utility which allows you to view and change certain hard disk parameters whether it be SATA or PATA. Here are some useful commands which you can use to probe the status of your drive and find tune it.

Viewing hard drive information
* hdparm -I /dev/sda

Viewing hard drive performance
* hdparm -Tt /dev/sda

Syntax explanation
* Options
-T = Checks the how quickly data can be passed between the processor, memory, and disk cache
-t = Reads continuously from the hard disk without reading previously cached data. This gives an indication of the speed at which Linux can read sequential data from the disk

Tuning the drive
* hdparm -W1 /dev/sda (Turns write cache on. Use -W0 to set it to off)
* hdparm -A1 /dev/sda (Turns read ahead cache on. Use -A0 to set it to off)
* hdparm -a[n] /dev/sda (Turns read ahead cache on with n KB read ahead)
* hdparm -d1 [mode-option] /dev/sda (Turns DMA on with specified mode)

mode mode-option

pio0 -X08 Programmed I/O
pio1 -X09
pio2 -X10
pio3 -X11
pio4 -X12
mdma0 -X32 Multiword DMA
mdma1 -X33
mdma2 -X34
udma0 -X64 Ultra DMA
udma1 -X65
udma2 -X66
udma3 -X67
udma4 -X68
udma5 -X69
* hdparm -m[n] /dev/sda (Turns on mulisector I/O mode in which more than one sector can be transferred within one interrupt. n is the number of sectors. Typical 8,16 etc.)

Try experiment with these options and then measure disk performance with every change. You may be surprised with some improvements. But remember some setting may be too aggressive to your hard-drive. So think twice if you are setting too aggressive values to increase the performance.

Making things permanent

These changes will only be available in the current session. Modify /etc/hdparm.conf with these options to make the changes permanent across reboots.

Running Windows XP on Ubuntu with QEmu (QuickStart Guide)

Just for the fun of it I tried running XP on my Hardy box. Here are the quick start steps I used to make it work.

Step 1 - Making the file later used as the disk image.

dd if=/dev/zero of=win.iso bs=1M count=4300

This will make an 4GB .iso file on the current directory.


Step 2 - Installation

Insert the XP cd to your CD-ROM and execute the following in the terminal.

qemu -hda ./win.iso -cdrom /dev/cdrom -boot d -m 256 -localtime -usb


Syntax Explanation

-hda ./win.iso = This means win.iso is used as the hard disk 0 image.

-cdrom /dev/cdrom = Uses the CD-ROM image for the installation

-boot d = Boot on CD-ROM

-m 256 = Sets the virtual RAM size to 256MB

-localtime = Set the real time clock to local time

-usb = Enable the USB driver


Then the normal XP installation procedure begins and you can install it as you would normally do on a normal machine.

Step 3 - Running the installed image

To run the XP image at any time run the following.

qemu -hda ./win_dev.iso -boot c -m 256 -localtime -usb


Key Combinations

* Ctrl + Alt releases the cursor
* Ctrl + Alt + f toggles full screen