Monday, February 27, 2006

Ubuntizing my PC - Part 1

In my last post, I wrote about Ubuntu.

Why did I order free CDs from Ubuntu?

1. I like the concept,

2. I want to see for myself what it has to offer in addition what I could get from other distros,

3. I have an old PII 266 desktop PC running Windows 98 and pirated warez, infested with every freeware, virus and trojan out there. I want to clean it up, and make it usable without having to shell out truckloads of money (which I do not have) buying software for it.

4. I am just an amateur user of Linux, and I am strapped of time. So I want a Linux system that is easy to install and use, and will give me true GUI capability, while still permitting me to be adventurous in mucking around with it when I feel like it. Ubuntu seems to fit the bill pretty well.

So, I was pretty excited when I received my Ubuntu CDs, and I set about on ubuntizing my PC right away. Here is a poor log.

  1. Ubuntu comes in two CDs – one is the Live CD and the other is the Install CD. The Live CD permits one to run Ubuntu without installing it – just make the CDROM as the first boot device, insert the live CD and start the PC, Ubuntu loads right away. This permits you to see what Ubuntu has to offer before you actually install it.
  2. So I loaded the Live CD. It looks ages to load (I had expected it to be slow since it was running from the CD, but not this slow), and I ended up with the command prompt and some error messages (fatal server error: no screens found) that indicated that it was unable to find the right display driver though it had correctly identified the SiS card that I had.
  3. Some googling revealed that this could be solved by changing the display driver to a more generic one. This is done by editing the ‘Device’ section of /etc/X11/xorg.conf, and changing the ‘Driver’ entry to ‘vesa’. Type ‘startx&’, and I got the Gnome Desktop. It looks good with the default Ubuntu theme.
  4. Next surprise: my Logitech 3-button serial mouse is not working – the mouse cursor is stuck in the middle of the screen. Again, Google (how would I live without it?) tells me that there are ways to make a serial mouse work on Linux, but I have had enough with the Live CD by now, and I think it will take less time to go ahead and install Ubuntu and move back to Windows if it does not work.
  5. Ubuntu 5.10 (Breezy Badger) comes in two variants – one desktop installation and a server installation. A quick check of the system requirements tell me that 128 MB is minimum for a Desktop installation. I have just that much. There is a risk that it might turn out to be like one of those games which never really run on the minimum configuration, but I decide to go ahead anyway.
  6. I marshal all my good data into one folder, install the drivers for my Genelink USB host-host cable on the PC, connect my laptop with the PC using the USB cable. The folder has 11GB of data, so I issue a copy and goes down to have a tea. When I come back, I see that the copy has aborted with ‘Bulk write error’. My impatient mind assumes that the USB driver is unable to handle large amounts of data and curses it. So I take the HDD out, put it in a USB casing that I bought for the DVD writer, and connect it to my laptop. The Windows XP on the laptop detects it as a hard disk without my having to install any drivers – I like it. Then I issue the copy and sit to watch over it.
  7. The copy aborts – but this time, the cat is out of the bag. The folder contained some executables compiled from the source that I had written, and I included them assuming that they were virus free. But it seems that they are infested with the Spaces.1445 virus that appends itself to every executable that is invoked. My Symantec Antivirus was blocking the copy operation – and that is why it aborted.
  8. So I run the antivirus on all files the I want to back up – fortunately, there is nothing other than Spaces which is cleaned by Symantec AV. So I copy the files over to my laptop.
  9. Then I insert the install CD and boot the PC. After a couple of minutes, I land in the partition manager. The default values allocated by the partition manager do not fit me. After a couple of hiccups when I first forgot to create a root partition and then a swap partition, I get it right. The hard disks are erased and partitioned.
  10. The rest of the installation is uneventful – I just have to create a username and password. One thing that is quite different in Ubuntu from Slackware/Redhat/Cygwin distros that I have used is that the root user and password is not available. You log in with your username and use ‘sudo’ command to run tasks that need root permission (eg:- sudo vi /etc/X11/xorg.conf) – you would have to give your password every time for this. I am prone to the bad habit of logging in and working as a root on unix machines for the sake of having access to everything, and I have deleted valuable stuff inadvertently in the past, so this restriction fits me quite well.
  11. I have to re-boot once before the installation completes, and then I land into the command prompt because of the display issue that I saw the the Live CD. I change the driver to ‘vesa’ as above, and the Gnome desktop is working.
  12. To make the mouse work, I edit the InputDevice section of /etc/X11/xorg.conf, change the "Device" entry to /dev/ttys0 and the ‘Protocol’ entry to ‘Auto’. It does not work, and I find that it should be ‘/dev/ttyS0’. Still no luck, I check the COM ports, and find that the 9- pin port where the mouse is connected is on COM1. So I change the ‘Device’ entry to /dev/ttyS1’, and the mouse works now. Still, it takes some time for the mouse to start working after I get the Desktop, and when I exit X, I can see a message that it could not find the mouse protocol. So I change the ‘Protocol’ entry to ‘Microsoft’, and the delay is gone.
  13. Now, I have a good desktop OS running – Open Office, Evolution and Firefox are among the default applications. There are 4 workspaces, and the links are conveniently grouped into Applications, Places and System menus. The icons are placed conveniently, even a novice should be able to use it without much heartburn.
  14. There are some issues though. The application windows are always bigger my viewing area, and I have keep moving them around to get access to all parts. Need to check the desktop resolutions and fix this up. OpenOffice is slow, but usable – should be okay given that it is a 266MHz processor.
  15. I have only a PCI wireless LAN card for network connectivity – and it is not detected. I need to figure this out too.

I have come to the end of Part 1 and I now have an ubuntized PC with a nice GUI with X Windows, without network connectivity. In the next part, I will get the wireless up and get it to work with WEP on my home wireless network so that I can access Internet. Till then, good bye! :-)

The following links were very helpful to me:

  1. Ubuntu Wiki: https://wiki.ubuntu.com/
  2. On display driver issues on Ubuntu: http://ubuntuforums.org/archive/index.php/t-79827.html
  3. Getting a serial mouse to work: http://ubuntuforums.org/archive/index.php/t-23926.html

ubuntu

Ubuntu is the new Debian-derived Linux distro that focuses on making Linux usable for the average computer user. It aims at building and leveraging a strong user community that can then provide a good support system for users – for both personal and commercial use.

Ubuntu, founded by Mark Shuttleworth, ships free CDs to registered members of Lauchpad, and registration is free. If you like the concept of Ubuntu and want to pay for it, there are many ways of doing it – donate, contribute to the development of the project, or just make copies of your Ubuntu install CDs and pass them on to others who would like to use Ubuntu.

I just received by 5-CD pack from Ubuntu, and started playing with it. If you are in India and want a copy, drop a note in the comments, I will ship you one asap. I will give away the 4 spare CDs I have to start with, and then a couple CDs every month afterwards.

Monday, February 20, 2006

Added a hit counter to my blog

Site Meter is a free service that provides hit counters for your site. I gave the blogger username/password at the Site Meter website, and it logged in and added the hit counter code in my blog page. Pretty neat - but I do not like a website asking for my username and password for another site.

Sunday, February 19, 2006

From Maxthon to Firefox

After I got fed up with IE's terrible user interface and before Firefox became popular, I switched to Maxthon which provided an excellent UI on top of IE's browser engine. It supports full-fledged tabbed browsing, session saving/restore and excellent manageability of full-screen browsing. Features like 'auto-reload' which let me load my stock quotes page periodically were really useful.

Then, I moved to Firefox - even Maxthon could not address the ActiveX menace and related frequent crashes, and I was bowled over by the incredible lightness and extensibility of Firefox.

But I missed Maxthon - Tabbrowser Preferences extension was a poor substitute to Maxthon's tabbed browsing support, session management was not available and I was not able to auto-hide toolbars when browsing full-screen. Till I installed the great Tab Mix Plus and the cool Auto-Hide and ReloadEvery extensions to Firefox. Tab Mix Plus permits full-fledged tabbed browsing on Firefox. Auto-Hide hides toolbars during full-screen browsing so that I can maximize my browser display, while still keeping them accessible. ReloadEvery helps me reload my web pages every 'n' seconds.

It is this extensibility that makes Firefox the greatest browser around.

Finally, I no longer miss Maxthon.

I have a couple of gripes about Auto-Hide though - it does not show my tab bar if I position my tab bar at the bottom of the screen and move my mouse over it.

Friday, February 17, 2006

(mis)using open source free software

i was scouting around for a good open source image manipulation program when I stumbled on Gimp. It looked promising, and a google search for a Windows installer turned up www.wingimp.org as the first link.

All download links at this site point to an order form asking for money, and the fact that the Windows port of Gimp is freely available at www.gimp.org is not mentioned anywhere.

The tutorials on the site just provides links to images, and the FAQ does not work. Some assistance!

Charging for packaging, installation support and servicing of free software is fine. But pointing the download link to the order form for shipping CDs is plain cheating. Shame Shame!

greasemonkey

some bug report pages that I visit while on work nag me to madness with their inclusion of non-word-wrapped text within 'pre' tag.

Here is an example:
`Mine is a long and a sad tale!' said the Mouse, turning to Alice, and sighing. `It is a long tail, certainly,' said Alice, looking down with wonder at the Mouse's tail' `but why do you call it sad? And she kept on puzzling about it while the Mouse was speaking, so that her idea of the tale was something like this:
greasemonkey is perfect to take care of such irritating behavior. Armed with a decent javascript reference, an excellent greasemonkey tutorial, and plagiarized code from http://jsfromhell.com/string/wordwrap, I wrote my first piece of javascript code - which is also my first greasemonkey script.

Here it is:

// ==UserScript==
// @name Pre Remove
// @description Remove all Pre tags
// ==/UserScript==

//copied from http://jsfromhell.com/string/wordwrap
//m is the line number to wrap at, b is the line wrap char
//to insert, I don't know what c is.
String.prototype.wordWrap = function(m, b, c){
var i, j, s, r = this.split("\n");
if(m > 0) for(i in r){
for(s = r[i], r[i] = ""; s.length > m;
j = c ? m : (j = s.substr(0, m).match(/\S*$/)).input.length - j[0].length
|| j.input.length + (j = s.substr(m).match(/^\S*/)).input.length + j[0].length,
r[i] += s.substr(0, j) + ((s = s.substr(j)).length ? b : "")
);
r[i] += s;
}
return r.join("\n");
};

var allPre, thisPre;
allPre = document.getElementsByTagName('pre');
for (var i = 0; i < allPre.length; i++) {
thisPre = allPre[i];
preChildren = thisPre.childNodes;
for (var j = 0; j < preChildren.length; j++) {
preChildren[i].nodeValue = preChildren[i].nodeValue.wordWrap(72, "\n", false);
}
}