Linux


The eee now spends most of its time being used as a convenient way to play music through the stereo. This means it needs to mount the shared directory on the server downstairs that contains all the music. This caused a few problems initially because Amarok doesn’t seem to like Samba shares and it just wouldn’t build the collection even though I could access the tracks by simply browsing the file system. It took me some expert help and a few goes to get the syntax of the mount command right, and what I ended up with was rather a mouthful:

sudo mount -t cifs //silver/music /home/user/silvermusic -o username=samba_username,password=samba_password,iocharset=utf8,
file_mode=0777,dir_mode=0777

Thank goodness you can use the up-arrow to recall terminal commands! But it does work, and Amarok can build the collection correctly. Helpful Mike S explained to me how to set up fstab to load it automatically:

The following line would do it:

//silver/music /home/user/silvermusic cifs username=samba_username,password=samba_password,iocharset=utf8,
file_mode=0777,dir_mode=0777 0 0

But it would be better to not put the login details in fstab, so you should create a credentials file to hold the username and password:
sudo nano /root/.sambacred

Then add the following to it:

username=samba_username
password=samba_password

Then make it read/writeable only by root in order to keep other people out of it:
sudo chmod 600 /root/.sambacred

Then use the following line in fstab:

//silver/music /home/user/silvermusic cifs credentials=root/.sambacred,iocharset=utf8,
file_mode=0777,dir_mode=0777 0 0

Note: I have introduced line breaks for formatting here, but it’s very important to avoid extraneous spaces in these lines :-) After cifs there should be no spaces. Unfortunately in my case it doesn’t work, I think because the wireless interface doesn’t come up until after fstab has been read, in fact it isn’t activated until after the GUI has loaded. So I ended up just putting the original unwieldy line in a shell script called loadmusic.sh so I can easily run it from the shell prompt. I imagine Mike’s way would work if I was using a wired connection.

On a trip to the UK just after Christmas I succumbed to temptation and paid a visit to Toys R Us. Minutes later I walked out with this:

The eee PC

Then I headed straight for my hotel, and once in my room I could barely wait to unpack it. I’d heard it was small, but I was still staggered at just how small and light it is. I switched it on, and it booted in 15 seconds, as advertised. I ran the “First run wizard” and once that was done I clicked on “Wireless networks” and without further ado it picked up the hotel’s WiFi hotspot. Unbelievably simple; I hot-footed it to reception for a card, and within minutes was checking my email.

This is a tiny, cheap sub-notebook that runs Linux and does everything I’m likely to want to do on the move: web, email, word-processing, seamless networking. The interface is a bit Playschool, but that is clearly a deliberate choice; the machine is aimed at the educational market as a cheap, easy-to-use laptop that children can carry around with them. In any case, a browse around one of the burgeoning eee fansites quickly revealed a simple fix to enable “Advanced desktop” mode, which turns out to be exactly the same as my Xandros desktop, so no complaints there. Having said that, 90% of the time I use it in “Easy” mode.

In practice of course, many buyers seem to be geeks delighted to find a cool device that runs Linux and can be hacked to do all sorts of useful things. The result is an increasing number of sites dedicated to the eee and detailing various hacks and improvements. Always a good sign when a community builds up round something like this.

Edit: interestingly, the Xandros website states:

The Eee PC is an ASUS product and is solely supported by them, including Operating system issues. The Operating System on the Eee PC is not a Xandros Product. While Xandros may have aided in the development of the Eee PC OS, it is owned and supported by ASUS.

… but the Advanced Destop mode looks indistinguishable from Xandros.

This device really suggests that the operating system is becoming an irrelevance as long as you have network connectivity. Many users of the eee PC will not know or care what the operating system is; they’ll just use it to accomplish tasks. Microsoft must be a wee bit worried, because the eee has just launched in Japan with Windows XP pre-installed (the original model comes with instructions for installing XP, but you need a valid installation disk and another PC with a CD drive to do so). I don’t really understand why anyone would want to; as delivered the machine only has 512Mb of RAM, and runs very nicely with Linux, whereas if you want anything like acceptable performance with XP you are going to have to void the warranty by installing more memory.

But some people seem to think they should be able to do everything they could do on a heavy, bulky, 15″ notebook PC on this. It’s only got a 7″ screen for heaven’s sake; what on earth is the point of trying to run Photoshop on it? For me its role is definitely that of a supplementary PC, not a desktop replacement. It’s a huge improvement on the slow, clunky Dell laptop we lug around whenever we travel. The 15-second boot time is particularly appreciated; it means you can quickly switch it on to check something, then switch it off again to conserve the battery (battery life without wifi switched on is about three hours; slightly disappointing but over twice as long as the Dell manages). Resuming from sleep mode is even faster. Plenty of thought has been put into keeping the weight down; it also has a relatively small power adapter, similar to a mobile phone one, not the “brick” you usually get with laptops. And it’s surprisingly robust; you’d expect something as cheap as this to feel flimsy, but it doesn’t.

The one thing I don’t like about it is the small trackpad and very stiff mouse button. I don’t like trackpads much anyway, and even increasing the sensitivity doesn’t seem to help. It feels as if it’s going to be the first thing to break. Using a mouse or trackball that weighs half as much as the PC doesn’t seem to make sense, so I’ve ordered a dinky little Targus mouse for it.

The scenario: a mixed network of Windows and Linux PCs (2 Windows XP, one Xandros, one SimplyMEPIS) which need access to edit files in a directory on one of the Linux servers. Here’s what I did: I’m not sure all the steps were necessary, but none of them is sufficient on its own!

It is taken as read that the PCs are all in the same workgroup, and Samba is installed and running on the Linux PC with the files to be shared.

1. Create users with the same name and password on all the PCs. Create a group on the Linux PCs and add the users to it (in this example the group is called editors). Note, the numeric user and group ids on the Linux boxes must be the same. If you are using a GUI interface to create users and groups, check the numbers they end up with. If they are not the same you need to use e.g.
groupmod -g 1002 editors
to change one of them to match the other. This might invalidate the group of any files belonging to users in that group, so check and reset the group if necessary, using chgrp:
chgrp -R editors www

You can make editors the default group for the users if you like, but it’s not necessary.

2. Create the directory to be shared (www in this example); it should be owned by one of the users created earlier and have the group set to editors. Use chmod to make it writable by owner and group. Now, set the sticky bit to force files to inherit the group permissions:
chmod g+s www

3. You can edit /etc/profile.d/profile (as root; the exact path of this file may vary) and change the umask line to read
umask 002

This globally forces new files to be created with group write permissions.

The steps so far have ensured that users in the editors group on the Linux box can edit files in the www directory and its subdirectories. Now you need to share the directory using Samba. Use a GUI tool if you like to set up the share (SimplyMEPIS has a nice one). But ultimately you will need to edit /etc/samba/smb.conf (as root of course) to make sure it’s set up correctly. This file is not difficult to understand, but make a backup copy first in case you trash anything. The minimum needed is the following:

4. In the [global] section, under authentication, set
security = share
This is not the most secure way, but it’s OK on a suitably small and private network. I tried using security = users, but the Xandros PC didn’t seem to like this at all; the file manager hung on opening when any of the shares were mounted.

5. In the section for the www share, force the user to be one of the users you set up earlier:

[www]
public=yes
browseable=yes
path=/opt/www
writeable=yes
force user=veronica

You might have other stuff in there, but I think this is the minimum (it was the “force user” that finally got it to work for me). If you want you can restrict access by IP address to make it more secure, e.g.:
hosts allow = 192.168.1.0/24

Don’t forget to stop and restart Samba if you have edited the smb.conf file! As root:
/etc/init.d/samba restart

6. Test by mounting the share on another PC and creating, editing, or deleting a file on the share.

I have been looking for a while for a tool to create Entity Relationship Diagrams (ERDs) on Linux. On Windows I used Dezign for Databases, an excellent tool which I would still be using if it was available for Linux. Linux tools that do as much as it does are few and far between. DBDesigner4 is open-source but wouldn’t run at all on my system and doesn’t seem to have any visible means of support. After much searching I ended up evaluating a commercial (i.e. non-free) product, Data Architect, from theKompany. After a few false starts trying to install the demo from an RPM, I managed to get it to work by the simple expedient of downloading and unzipping the tar archive. I had to edit the shell script to replace ksh with bash, but then it worked.

However, it requires ODBC to talk to databases (not an essential feature if you are just doing design amd then generating the necessary SQL scripts, but definitely nice to have). Being a Microsoft invention, ODBC is not that easy to get working on Linux. It took me all morning, but I succeeded in the end. So here’s how to do it on Xandros Home Premium:

1) Use Xandros Networks to search for and install unixODBC, the package that provides ODBC support (or use apt-get, or whatever package manager you use, or download direct from unixodbc.org).
2) As far as I could tell this did not install the GUI front-end that allows you to manage ODBC data sources in a similar way to the ODBC manager on Windows. This is not essential because you can simply edit the relevant configuration files if you know what you are doing. Not knowing this, I visited unixodbc.org and downloaded unixODBC-gui-qt-2.2.11-1.i386.rpm, which I then installed using Xandros networks.
3) Great, ODBC support is now available and the GUI works! However, I don’t have any drivers. I want to use it with MySQL, so it’s off to MySQL to download the necessary driver. Again I downloaded an RPM and installed using Xandros networks. I quickly found that this didn’t work with Xandros. So a quick Google sent me off here for a Debian package. Goodness knows why MySQL don’t provide a Debian version.
4) Now I again ran the GUI front end installed in step 2, and hey presto, the driver was there. The bad news: when I tried to set up and connect to a data source I got a message saying that the driver couldn’t find /var/mysqld/mysqld.sock. Not surprising, since this file did not exist. More googling and a poke around my file system established that the file was actually at /opt/lampp/var/mysql/mysql.sock. 5) So I needed to edit the odbc.ini file to tell it where to find the socket:

[MySQL-test]
Description = MySQL database test
Driver = MySQL
Server = localhost
Database = test
Port = 3306
Socket = /opt/lampp/var/mysql/mysql.sock
Option =
Stmt =

Progress! Now I can connect, but when I try to authenticate with a username and password, “Client does not support authentication protocol requested by server; consider upgrading MySQL client.” Aha, I’ve encountered this before; it’s to do with the password hashing in newer versions of MySQL being incompatible with clients expecting older version. So, simple solution:
6) Set up a user for ODBC purposes, with the appropriate privileges, and issue the command:

SET PASSWORD FOR odbcuser@localhost = OLD_PASSWORD('mypassword');

7) Try again, and yes, I can browse the databases and tables now! Nice added bonus: ODBC is also available in OpenOffice, so I can access my databases from there too. Let’s just hope that DataArchitect does the job …

When I used Windows I had a host of small, unobtrusive utilities that made my life easier. I’m sorry to say that in most cases I haven’t found Linux replacements which work as well. But they might work for you, so here they are:

Time tracking

Even if you don’t bill by the hour, if you are selling your services you need to keep track of billable hours to make sure you are estimating/charging appropriately. I like to use a stopwatch-style time tracker that simply runs in the background. On Windows, I used an excellent little utility called Allnetic Time Tracker. It sat discreetly in the system tray and with a right-click I could quickly start, stop, and switch tasks. The program has configurable idle-time detection, so if you forget to stop it and go away, you’ll be greeted on your return with a dialog box asking whether you want to discard the idle time or log it (the latter being useful if the reason you went away was to go to a meeting or do some non-computer-based task that still needs logging).

You can set up projects with tasks and sub-tasks, and everything is displayed in a neat three-paned window, making it easy to get an overview of total time at project and task level. Each logged time period can have a note attached to it, useful for detailing what you did. Allnetic also has very comprehensive reporting options — you could theoretically generate invoices directly, although I never did this.

Well, there’s nothing like this for Linux as far as I can tell. I tried a few applications and ended up with the default KDE tool, KArm. It does basically the same thing as Allnetic Time Tracker, but in a less sophisticated way; all projects are displayed in a single long list, which makes it rather unwieldy if you have a lot of tasks. It too sits in the system tray, but to start, stop or switch tasks you need to restore the window rather than being able to do everything with a right-click. It only keeps totals of hours for each day, not the actual times that you worked, and reporting is very limited; all you can do is copy either the totals or history between two dates to the clipboard, in text format (which is not suitable for loading into a spreadsheet for further manipulation). Still, it does the basic job that I need.

To-Do list

I don’t like bloated Personal Information Manager software — all I want is something that will let me keep an easily-accessible list of to-dos (including recurring ones), with due dates, priorities, and configurable reminders, and Quick To-Do Pro did it for me. I think it’s expensive for what it does (I see it’s now $39.95) but it fitted my needs so perfectly that I grudgingly paid up. Again I couldn’t find anything that worked that well for Linux — so I ended up using KDE’s Personal Information Manager. It’s full of other stuff I don’t want, and the To-Do list is basic, but it’s better than nothing.

Clipboard enhancement

Who can live with a clipboard that only stores the last item you copied? I can’t, and a lot of people obviously feel the same, because there are loads of clipboard enhancers for Windows, most of them suffering from feature bloat. I used a small, free utility called CLCL. The usual cut/copy/paste shortcuts work as expected, but a simple Alt-C in any application pops up a menu of all the items on the clipboard (not just text, but images and objects as well), so you can select the one you want, and you can also set up permanent entries for frequently-used text.

There isn’t so much choice on Linux, but KDE comes with its own utility, Klipper, so that’s what I ended up with. It works, but the clipboard doesn’t always contain what I expect, and there’s no facility for permanent items.

Accented characters

Not essential for everyone, but I do enough typing in French on an English keyboard for it to be an issue for me — there’s no way I want to type some convoluted code or use Windows’ character map every time I want to type a word with an accent in it. At last, this is something that Linux does better than Windows: you can configure a trigger key that works the way the Compose key on old DEC terminals did — press the selected key (e.g. Alt), then type a two-key mnemonic, e.g. typing , and c will give you รง. It’s simple to guess what the mnemonic will be, even for rarely used characters.

Windows doesn’t have anything like this built in, but we have used the free utility Allchars for years — it implements the Compose key functionality, but it also supports macros so you can set up mnemonics for longer pieces of text or key sequences (if you’re not already using CLCL for that …).

Every January, assorted pundits claim, “This is the year Linux will conquer the desktop!” Every year, they are proved wrong, and Windows continues to power 95% of desktop PCs (web servers are another matter; a very sizable majority of those run some flavour of Unix).

Well, my experience so far suggests that Linux is ready for the desktop — kind of. Using Xandros for everyday tasks is barely distinguishable from using Windows, and many mainstream PC users would be quite happy with it. I had no trouble at all finding replacements for mainstream Windows applications; Xandros comes with pretty much everything you need out of the box. For someone who makes fairly basic use of an office suite, as I do, the free Open Office is a more than adequate replacement for Microsoft Office, and it will save in Microsoft formats, so you can continue to exchange documents with MS Office users.

As for web browsers, you are spoilt for choice — the only unavailable choice, of course, being Microsoft’s very own Internet Explorer! I carried on using Opera, just as I did on Windows, but I could have chosen Firefox or Konqueror. Email was slightly more difficult, since Eudora, the indispensable email client I’ve been using since 1996, is only available for Windows and Mac. I tried Thunderbird, the companion email program to Firefox, didn’t like it, and ended up using Opera’s built-in email facility. It’s idiosyncratic but it has some interesting features, including threading and excellent search and filtering capabilities. For those wedded to Outlook, Evolution is said to be a good alternative.

I’ve already covered text editors in a previous post — Quanta Plus is simply the best editor I’ve ever used, on any platform. Linux has a built-in firewall, and as for anti-virus — I don’t bother!

All of those cover about 90% of my daily work. But what I find I really miss from Windows is the selection of handy little utilities I’d accumulated over the years, that chugged unobtrusively away in the background, helping me manage my workload. It’s turned out to be very hard to find good open-source replacements for these. Of course I could run them using Windows emulation software, but this seems to me to defeat the object of switching. Coming up next: my review of utilities I’ve discovered so far.

A well-known fact about the history of the microcomputer is that it took a “killer application” to make it worth buying a PC: something so useful that it justified the cost of the computer. Back in the early 1980s, that killer app was Visicalc, the first-ever spreadsheet application, which had Apple II computers pouring off the shelves, snapped up by eager accountants.

In a similar way, my Xandros PC sat on the spare desk, providing a development web server and little else, until I found my very own killer app which justified moving that PC onto my desk and dumping the Windows PC on the spare one. The application that did this for me was Quanta Plus — a web editor.

A web editor? But there are dozens of great web editors for Windows! Surely you don’t need Linux just to run an editor? Well, it’s not quite as simple as that. I spend nearly all my working hours editing program code in a text editor — no fancy WYSIWYG tools for me. Since 1993 and Windows 3.1, that editor has been TextPad, which had got welded into the core of my being. I tried other, allegedly superior text editors from time to time but somehow I just couldn’t get along with them and always found myself back with simple, reliable, uncluttered TextPad. It wasn’t perfect, further development seemed to have ground to a halt, but I knew every quirk and feature and it was tuned for just one job — editing text files quickly and efficiently. In fact it was one reason the Linux box was still on the spare desk — I tried half a dozen Linux editors and didn’t like any of them.

Then in October a student on an Open University course I teach said that he couldn’t imagine creating web pages without Quanta. Out of curiosity I visited the site and thought it was worth a try.

I was just starting work on a large PHP website, so it seemed sensible to try Quanta for this. I started it up, had a quick scan through the help files, and set up my first project. Two hours later I was completely hooked. It was one of those rare occasions when you find an application that thinks exactly the way you do. It was the “tipping point” … and within days the Linux box was on my desk with Windows relegated to the outer darkness.

It is interesting to see how something you never knew you needed can prove itself indispensable!

I’ve had a spare computer by my side running Linux for a couple of years now. I started out with a very old, slow PC that struggled to run an ancient version of Red Hat Linux. It was unusable as a desktop machine, but did the job as a development web server for testing sites before unleashing them onto a live server.

When I upgraded my desktop PC (or rather Steve bought a new PC and I got his cast-off, the normal pattern in our office) I decided it was a good opportunity to try Linux on a more realistic platform: my discarded 733 MHz Pentium III. I didn’t want to spend days fiddling about trying to get things working though, so after due research online I plumped for recently-released Xandros, trumpeted as a newbie-friendly release.

It certainly did what it said on the box: I popped the Xandros CD into the drive, clicked a few buttons, and then left it to install. Within half an hour I had a working system — it was easier to install than Windows! I was favourably impressed by the fact that everything worked immediately: all devices recognised, Internet connection working, even file-sharing with the Windows PCs on the network was easily achieved. And it looked very nice too, with a desktop environment barely distinguishable from Windows.

After that, I installed XAMPP, a one-stop way of getting Apache, PHP and MySQL running so that I could continue to use the PC as a development server. That too went smoothly … it seemed Linux was truly “ready for the desktop” — but Xandros stayed on the spare desk and I continued to work on my trusty Windows 2000 PC.

Next instalment: the application that convinced me to push the Windows PC aside and put the Linux box on my desk!