Checking if your laptop hard drive is being killed – Fujitsu MHW1200BH

Some laptop hard drives have very aggressive power saving measures programmed into them. As a result, Windows ignores these settings and overwrites it with its own. On Ubuntu though, when you’re in Laptop Mode, the default settings are used unless you actually set it to not park the drive heads, and then there’s the possibility you’ll get a couple of bad sectors if you drop your laptop. Of course, if you’re capable of being careful of your things then you don’t have to worry about dropping your laptop. If your hard-drive is S.M.A.R.T capable then you can use monitoring tools to get the data you need, stored in Load_Cycle_Count. First you have to install smartmontools:
sudo apt-get install smartmontools or select it from Synaptic using the administrator.
Now, check if you have SMART enabled.
sudo smartctl -d ata -i /dev/sda
The output will tell you quite clearly if you have SMART enabled and the model of your drive. Mine, for instance, is:
smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION ===
Device Model: FUJITSU MHW2100BH
Serial Number: NZ1CT732784D
Firmware Version: 8918
User Capacity: 100,030,242,816 bytes
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 7
ATA Standard is: ATA/ATAPI-7 T13 1532D revision 4a
Local Time is: Wed Nov 7 20:35:38 2007 IST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


If support is Available, but not Enabled, you may have to wade into your BIOS to change things.
Anyway, then you check your drive health. You can grep for 193 to get Load_Cycle_Count
sudo smartctl -d ata -A /dev/sda
This will give you a list of stuff like this.

Most drive manufacturers say that their drives can handle 600,000 cycles. My Fujitsu MHW2100BH is one of those drives. Considering I’ve had this laptop for atleast 4 months (I can’t remember how long exactly) , 19172 load cycles means I have (600,000 / 19172) × 4 months of stable use left, that’s around 10 years. Works for me :)

And just to see how fast this is increasing, I have a loop running on a terminal that checks the value every 5 minutes (This dude’s idea) and for the past hour it hasn’t changed. That’s made me rather happy. Here’s the loop I use:
while(true); do smartctl -d ata -A /dev/sda | grep 193 >> smart.log; sleep 300; done Naturally, you have to be root. I think the sudo will time out after 15 minutes anyway, that’s why I didn’t use it.

Related bug report.
Prominent page on this topic.

Drivel – A blog editor.

Drivel’s a blog/journal editor on Linux. It has a simple interface and is very easy to handle. It can do blogs on all the popular blogging websites as well as on WordPress based sites (I haven’t tested WordPress MU). To getDrivel it to work on wordpress though, you need to select “MovableType” as the blog type and type in the address to your blog followed by xmlrpc.php. For example I would have:

http://blog.arjie.com/xmlrpc.php

That’s a rather funny thing but it’s a one-time inconvenience. It’s fast, handles past posts properly and looks neat and orderly.

Pros:
1. Offline blogging, text is saved as drafts and then uploaded when done.
2. Integration with desktop. If you’re using a custom theme like the one in my dark-on-light posts, this is a good idea.
3. One interface to many blogs if you have more than one.

Cons:
1. You can only add one category.
2. You can’t directly upload images, you can only link to them.
3. If Drivel can’t contact Technorati (when the Notify Technorati option is on) it saves the post as a draft on wordpress and waits for a nearly infinite amount of time trying to notify technorati.

Remember, the “Insert Poll” option only works on LiveJournal.

White on Black, or Black on white?

I’ve noticed that most interfaces on computers A screenshot of my desktop (excepting some terminal emulators and consoles) have a black on white (or dark on light) scheme for no particular reason at all. Having heard that light on dark schemes are easier on the eyes I decided to give the whole thing a whirl. I like my dark-themed desktop and think it looks beautiful, but there is one problem.

It’s a pain to browse. Most webpages are still dark on light and it’s really hard on the eyes to have your browser in black and your page in white. This is one of those times I’m really happy I have firefox ( actually Swiftfox ). Out comes Stylish, an extension for Firefox that lets you set different CSS styles for sites you visit, over-riding their defaults.

My favourite two styles are by Valacar, a Dark Blue Google redesign and a Dark Grey Youtube redesign.
Youtube with the Dark CSS
The rest of my desktop is:

  • The Neutronium High theme for Gnome with the Human theme window border and Tango icon theme.
  • The default Ubuntu background (warty-lagoon) colourised to Blue
  • The Firefox Gnome support package

Little games I play with via graphics on linux

Some months ago I figured out just why I couldn’t get direct rendering in Ubuntu despite all the xorg settings being what other people had claimed worked. The big difference was that I was using too high a color depth and resolution and reducing that brought me into magic DR world again. So now I can finally play a couple of games on linux (the VRAM isn’t enough for too much, so only some simple 3d), and there’ve been so many in the repositories that’ve been fun.

Still, despite the low VRAM, there’ve been quite a lot I can play at the moment.

  • Unreal TournamentUnreal Tournament – Old favourite of mine, pulled out the CD, a little hop over to Loki Installers for Linux Games and the installation went smoothly and the game runs wonderfully. I’ve done the installation before on Red Hat 9, (I remember having to boot into Linux to play the game, Windows 98 only used to let me use UT Safe Mode whatever the settings), so maybe that’s why I didn’t have any hitches. The game runs really well, and is fun for a couple of matches now and then.

    My brother’s really taken to it, and lately I don’t hear as many snide comments from him about how ‘linux is useless’.

  • Neverball and Neverputt – These two come together in the neverball package in the repos, and frankly I liked Neverputt more than Neverball, though having your ball bounce all the way to the bottom from right near the goal hole was really annoying, though there is consolation in watching your little brother replicate that.

  • X Moto – Haha, this game is hilarious, and really lots of fun…until you get stuck at some level or the other. You control a guy (who exhibits weird ragdoll physics) on a little motocross bike and try to collect strawberries (waypoints sort of) and then get to a flower (the end mark). The funniest part is the way the guy works, leaning in front just when you don’t want him to, bouncing his head into the wall just when you think you’ve cleared and other crazy stuff.

  • Cannon Smash – A pong game. No, real pong, ping pong, table tennis. Pretty cool, interesting way of playing the game. It’s fun, hard in the beginning, but the default difficulty is pretty easy soon after you figure out how to play the game. Switching the player style means you have to relearn how to play though, because each style uses different ways of scoring.

  • Scorched 3d – Back in the day, there was Scorch (Scorched Earth), and we used to use a complex sequence of methods to get the triple-turreted tank. Scorched 3d is the 3d version of that classic tank game. It looks pretty good, and plays well, but aiming can get tough at certain angles …and where’s my ‘lazy boy’ targeting?

  • Chromium – Chromium B.S.U Ah Chromium, the first game I ever played on Linux, back in the day when I still used the old Red Hat 8, ah, good times. This one is good, very professional looking at all stages. I just wish it had a little more variation. That’s the only thing missing, after a couple of months of playing it whenever you need a little break you get bored of it. There’s not much variation in enemies or weapons, but it looks good and the only reason you would want to play it is because you wanted a short break from working on whatever you’re doing. I start it up sometimes, but it gets rarer and rarer every day.

  • Frozen Bubble – Remake of that classic game where you shoot coloured bubbles at an array of other coloured bubbles and your objective is to make them drop by sticking 3 of the same colour together. Gets really hectic playing with another player and with ‘chain reaction’ on.

That’s as much as I can remember off the top of my head. I’ll add in some screenshots later.

Oh, and for those who came here for Via. Direct Rendering was supported out of the box in Dapper for me, but if you use too high bpp and resolution it’ll get turned off. Mine works fine at 1024*768 and 16 or 24 bpp and it’s a VT8378 Unichrome.

Windows, Ubuntu and a USB flash drive.

So a couple of days, I came into possession of a small USB drive. It’s one of those small things that can hold something like 125MB, and be carried around. I’m planning on putting Damn Small Linux on it and scaring a couple of my friends with a “Oh my god! I accidentally installed Linux on your computer and wiped out your Windows!” .So anyway, I wanted to try it out. On Ubuntu this is quite simple:

  • ls /dev/sd*
    That bit was because I’d also tried out a digital camera that day, and so I didn’t want to mount the wrong drive (obviously!)
  • sudo mount /dev/sda1 /drives/usb
    Since that was the only one there, it had to be my USB drive. I’d already made that folder there and a link to it from my home directory.

That was it. After that worked, I added it to my gkrellm drives krell and now it’s a one-touch mount/unmount. I still have to enter the sudo password, but I consider that a feature and I’m told I can remove it if I wanted.

On Windows 98SE, this was a little harder, in fact, had I not had Ubuntu, it would have been impossible. As soon as I plugged it in I got a message saying a new piece of hardware had been detected and that the computer was going to install drivers. The USB stick came with a little (literally, half the diameter of a normal disc) CD which was marked USB Flash Disk Driver. “Alright, this should be straightforward.”, I said to myself. I was wrong. When I went through the whole search routine (with both that Internet and the CD option enabled) Windows gave me a “couldn’t find the driver” dialog.

Fine, I may not know the intricacies of the system, but I know of the magical “Have Disk…” option hidden away somewhere. So I got there, and when I tried to open the relevant folder on the disc, I got a “Folder doesn’t exist” message. This was ridiculous! I couldn’t open anything on that little disc. I did the standard reboot, no help. The eject CD, adjust position, reinsert didn’t work either.

Now, a little annoyed, I rebooted to Ubuntu, and opened the CD, and strangely enough, I could see every folder. So I copied the contents onto my hard disc, then onto my FAT partition, then rebooted to Windows, and used the drivers. Finally, I was done. I could use it!

PS: Windows still doesn’t open the Driver CD, Ubuntu still does.

Installing Epson Stylus C45 on Ubuntu

Sometimes I hate google for showing up all outdated mailing-lists as an answer to something that was quite easy to fix (with the help of slimdog360 here). Anyway, this problem is highly unlikely to occur and I’m just posting this hoping that Google will catch it, and maybe serve it up as a result to some other fellow in my situation.

Frankly, once I had recreated the normal conditions (my confused and crazy upgrade of Breezy to Dapper resulted in breaking more than I knew about) the installation time for the printer was 20 seconds or less. Awesome, I wish I could’ve taken advantage of that. Next time I swear I’m making a clean install.

Google Earth and Madras Christian College


Google Earth is beautiful! And it works perfectly on Linux! What does this mean? It means I can finally use it to have a nice look at everything through some nameless eye-in-the-sky. It means I can finally see which route is actually shorter. It means I can stare at the heads of nameless people at Trafalgar square! Lovely!

Well it’s fun, but unless there’s something I can download or look at to get the road names overlaid onto my maps of Madras, I sure am not going to be using GE for anything serious. It’s pretty much useless for all that unless you’ve got super-perception that allows you to discern extremely tiny details that aren’t there.

The picture in the post is a GE image of my college.

Also, I’ve noticed that Google Earth does not have a proxy setting inbuilt in the Beta for Linux. But it does use the environmental settings to access the proxy. In my Dapper build, there seems to be the little trouble of the proxy setting not using the authentication details. You will have to enter the details in the “System >> Preferences >> Network Proxy” dialog in the form:
username:password@proxyaddress and then the port
My proxy for example is set as:
srdmorhper:password@10.5.2.46:80 Port: 80
If you want to see if your proxy is set properly, type
echo $http_proxy
in the terminal.
In my case, the above command displays:

http://srdmorhper:password@10.5.2.46:80/

Upgrading Ubuntu Breezy to Dapper using Alternate CD and jigdo on a Via system

I recently managed to upgrade from Breezy to Dapper, versions 5.10 and 6.06 respectively for you number nuts, and I got to keep all my files and settings, well, nearly all. So anyway, I just decided to put this here before I forget exactly what I did.

Don’t take this as a literal guide, I’m just saying what I did to get it working. Don’t even hold me liable if it doesn’t work. Skip the next two paragraphs if you’re uninterested in my self-centered rambling.

The reason I used the CD to upgrade instead of the internet is my connection is erratic. It’s fast enough, typical downloads from the repos go at 18-50kB/s but it keeps going down, and hence it’s not very nice keeping it on all night and finding only half done in the morning.

So, I downloaded the ISO. Again, there was trouble, the ISO is a file that’s so large that my proxy cache doesn’t permit it. The company that my dad works for gives us free internet with these restrictions, and once (if) I get my more liberal broadband connection later I’ll be very happy, but for now I have to live with it. So how do you handle this problem? One word: Jigdo! jigdo’s useful for those people who have to keep stopping and resuming too, because there’s less chance of corruption.
First, if you have a proxy, read this . Just follow the instructions for wget and apt-get, though apt-get isn’t really necessary here.

Jigdo

Jigdo is quite easy to work, and you’ll need 3 things.

  1. A working internet connection.
  2. The jigdo tools
  3. The jigdo file for Dapper Drake : You don’t need to download this, just copy the link.

Now, extract the jigdo tools somewhere and run jigdo-lite in a terminal window, then paste in the URL to the jigdo file (Ctrl-Shift-V does the trick in the Ubuntu terminal).
To choose a mirror in the screen that comes up, just type in your country code (e.g. us for the United States, in for India) and see what turns up. Try a couple of the mirrors and if they work, then hurrah, if they don’t, you’ll usually get an Error 404 on the first file.
Copy paste that filename into google and then look for: (you can use the “only pages from if you want)
“index of”
and you’ll get a couple of links to directory listings of a couple of sites with that file. Now take the url Google gives you and strip it of everything after ubuntu/pool/….
For e.g. If you have http://archive.ubuntu.com/ubuntu/pool/main/x/xserver-xorg-input-elographics/
you enter

http://archive.ubuntu.com/ubuntu/

into that mirrors list. After this everything is pretty much automatic, no trouble.

The Real Action

Upgrade problems:

  1. Open-office dissappeared, but was easily reinstalled from the CD itself.
  2. My proxy setting no longer sets username and password well, easily remedied.
  3. Nautilus Actions for Nautilus no longer works, though the menu entries are still there, easily remedied.
  4. Banshee no longer works. Haven’t downloaded the latest from the repos, so I can’t say if it can be fixed.
  5. Xserver broke after installation but was okay after installing the via
  6. gnome-cups-manager dissappears after upgrade, easily remedied by reinstall

So if you’re willing to go through that, then proceed.

  1. Burn the ISO you have to a CD, you can install it off the ISO itself but it’s generally a nice idea to have the CD lying around.
  2. Insert and mount the CD after booting Ubuntu.
  3. System >> Administration >> Synaptic >> Edit >> Add CDROM… and add your Alternate CD.
  4. Now go to a terminal prompt and type in "sudo cp /etc/apt/sources.list /etc/apt/sources.list.breezy"
  5. Then, “sudo gedit sources.list” and then put a # in front of all the lines that start with deb-src. Leave the “deb cdrom” alone.
  6. Now, press Ctrl+Alt+F1 and you should be at a console.
  7. Type in, “sudo apt-get update && apt-get dist-upgrade
  8. Let it upgrade and remove stuff as it sees fit.
  9. There shouldn’t be much trouble at this stage. Once it’s done restart the computer with “sudo reboot” . I couldn’t get gdm to start again straight from there.
  10. Once it reboots you should be in Dapper. You may have trouble with your via driver (I did!), in that case, get back to console mode and type in “sudo apt-get install xserver-xorg-driver-via
  11. Now reboot and it should all be fine. (you could try running /etc/init.d/gdm , but I just couldn’t get it running that way)

Now, go back to console, and type “sudo gedit /etc/apt/sources.list” and uncomment everything that you commented. Then change every occurrence of “breezy” in the file to “dapper”. The replace tool comes in handy :)
That’s all, you have Dapper Drake, and it’ll update from the repos if you let it.
Now the fixes.

Fixes:

  1. Open-office: sudo apt-get install open-office* and you have everything back.
  2. Network Proxy: System >> Preferences >> Network Proxy. Now here replace every instance of “http://proxy:port/” with “http://username:password@proxy:port/
  3. Nautilus Actions: In console, type “sudo apt-get install nautilus-actions
  4. Gnome-Cups-Manager: In console, type “sudo apt-get install gnome-cups-manager

That’s all I did, and now I have everything I had before working on Dapper.

DISCLAIMER: This is no guide, I’m just outlining what I did, even if my language seems to imply that I’m requesting you to do something. It worked for me, I hope it works for you, but I’m not responsible if your hard-drive turns into smouldering junk after you do what I did.