Tim Anderson’s ITWriting

Tech writing blog

April 24th, 2009

Ubuntu 9.04 not so jaunty

I still love Ubuntu, but it’s hard to find much to enthuse about in the latest release, 9.04 also known as Jaunty Jackalope. As this post observes, most of the changes are under the hood, so users will not notice much difference from the previous release, Intrepid Ibex or 8.10. Well, there’s faster start-up, and Open Office 3.0 – but then again, I installed Open Office 3.0 as soon as Intrepid came out, so this is not really exciting.

My own upgrade went better than the last one, but I’ve still had problems. Specifically:

  • I had to edit Grub’s menu.lst manually after the upgrade. I always have to do this, since it detects the hard drive configuration incorrectly.
  • My Adobe AIR installation was broken and had to be re-installed
  • I’ve lost hardware graphics acceleration and desktop effects. This is a laptop with embedded Intel graphics; apparently this is a common problem and Intel graphics support in Jaunty is work in progress. See here for more details an experimental suggested fix, which is not for the faint-hearted.

There are other updates, of course, and I was glad to see Mono 2.0.1 and MonoDevelop 2.0 available in the repository, for .NET development on Linux. If Jaunty is the same as before, but faster and more stable, that is no bad thing, though the shaky Intel graphics support undermines that argument.

My question: why is Canonical persevering with its policy of supposedly major releases every six months? This looks to me like a minor update; would it not be better presented as updates to 8.10, and focusing efforts on 9.10 in October? Six-monthly releases must be a heavy burden for the team.

I don’t mean to put you off Ubuntu. It is well worth trying either as a companion or alternative to Windows and Mac.

Update:

I have fixed my desktop effects. How? First, a little more about the problem. DRI (Direct Rendering Infrastructure) was not enabled. My graphics card (from lspci –nn | grep VGA) is:

Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller [8086:27a2] (rev 03)

The problem I had before was reported in Xorg.0.log as:

Xorg.0.log:(EE) intel(0): [dri] DRIScreenInit failed. Disabling DRI.

I also noticed that /dev/dri/card0 did not exist on my system.

Well, I tried the technique described here. That is, I booted into an older version of the kernel; the oldest available on my system being 2.6.22.14. DRI magically started working. Then I rebooted into the latest version of the kernel, 2.6.28.11. DRI still works. So I am sorted. I’d be interested to know why this works.

November 13th, 2008

Reasons to love Linux #1: package management

I posted recently about a difficult Ubuntu upgrade, drawing the comment “What do you prefer to do on Linux that you don’t on Windows?”

Today I patched the Debian server which runs this blog. APT upgraded the following applications:

MySQL 5

Apache 2.2

Clam AntiVirus

Time Zone data (tzdata)

Some of these involve several packages, so 16 packages were updated.

Bear in mind that this is a running system, and that MySQL and Apache are in constant heavy use, mostly by WordPress.

I logged on to the terminal and typed a single command:

apt-get upgrade

The package manager took less than a minute to upgrade all the packages, which had already been downloaded via a scheduled job. Services were stopped and started as needed. No reboot needed. Job done.

I guess a few people trying to access this site got a slow response, but that was all.

Now, how long would it take to upgrade IIS, SQL Server and some server anti-virus package on Windows? What are the odds of getting away without a restart?

Admittedly this is not risk-free. I’ve known package management to get messed up on Linux, and it can take many hours to resolve – but this usually happens on experimental systems. Web servers that stick to the official stable distribution rarely have problems in my experience.

I realise that the comment really referred to desktop Linux, not server, and here the picture is less rosy. In fact, this post was inspired by a difficult upgrade, though in this case it was the entire distribution being updated. Even on the desktop though, the user experience for installing updates and applications is generally much better.

Let’s say I’m looking for an image editor. I click on Add/Remove and type a search:

I like the way the apps show popularity. I’d like a few more things like ratings and comments; but it’s a start. Inkscape looks interesting, so I check it, click Apply Changes, and shortly after I get this dialog:

I double-click, and there it is:

I admit, I did take a few moments to download an example SVG file from the W3C, just to make the screen grab look better. But provided you have broadband, and the app you want is in the list, it is a great experience.

Windows Vista has had a go at this. From Control Panel – Programs and Features you can get to Windows Marketplace, where you might search and find something like The Gimp (free)  or Sketsa SVG Editor (costs). I tried The Gimp, to be more like-with-like. I had to sign in with a Live ID even though it is free. I went through several web dialogs and ended up with a download prompt for a zipped setup. That was it.

In other words, I went through all these steps, but I still do not have The Gimp. OK, I know I have to extract the ZIP and run the setup; but Ubuntu’s Add/Remove spares me all that complication; it is way ahead in usability.

App Store on the iPhone also has it right. For the user, that is. I detest the lock-in and the business model; but usability generally wins. The online stores on games consoles, like XBox Live Marketplace, are good as well. I guess one day we will install or buy most applications this way.

November 12th, 2008

Microsoft Office vs OpenOffice.org in UK education

Yesterday I took a seminar with a small number of people from schools and colleges in the UK, who had purchasing responsibility for software.

I talked about some of the history, differences between the products, the ISO standardisation wars, the ribbon, and the way Microsoft’s pricing escalates in order to charge the maximum to business users. I also mentioned online alternatives like Google docs and asked whether they could contemplate switching entirely to a web-based productivity suite.

It is always interesting talking to people with a real-world perspective, in contrast to the hothouse of Internet discussions and attempting to follow what is happening at the bleeding edge. What I found:

  • These folk knew about OpenOffice.org but none use it regularly themeselves; one had a reasonable number of students using it, but only because they were using netbooks running Linux. Not very encouraging for OpenOffice.org since the buzz is that netbooks are increasingly switching to Windows.
  • There was very little interest in ISO standards. On the other hand, there was real concern about interoperability, which is related. However, the best solution at the moment is to use Microsoft’s old binary formats throughout. Filters in MS office for OpenDocument, and in OpenOffice.org for Open XML, will be welcome.
    Incidentally, I used Office 2007 PowerPoint for the session. I tried to open the .pptx in OpenOffice.org 3.0; it worked, but there were extra borders round objects and some unwanted text. I saved from Office 2007 as .ppt, re-opened in OpenOffice.org. It was perfect.
  • Some had already rolled out Office 2007, and reported that the Ribbon UI was better for new users, but caused problems for some who were familiar with the old menus. Mainly a training issue.
  • Education gets generous pricing for MS Office. There was interest in saving money by using OpenOffice.org, but the sums involved are relatively small. We discussed the ethical issue – whether it is right to get young people hooked on a product that will cost them or their businesses dearly later on – but this particular group didn’t engage with this much. Little desire to change the world; focused on getting their work done.
  • I mentioned the negative Becta report on Vista and Office 2007, which I also looked at again in preparation. I was struck again by what a poor report it is, ducking important issues and giving a rose-tinted view of ODF, though I am in sympathy with Becta’s efforts to promote choice and open source in education. However, none of this group had read the report, or even heard of it. Becta is a government organization focused on technology in education.
  • There was little enthusiasm for web-based office suites. Interest perked up a little when I mentioned Google Gears and the possibility of seamless online/offline use. One person said his school was rural and could not get broadband at all.

My overall impression is that Microsoft Office remains dominant in the institutions represented by this group, and that seems unlikely to change soon. The web-based suites have more chance of breaking the habit, since they represent a more fundamental shift than simply moving from one fat desktop application to another.

I would likely have got a better attendance for a seminar on rolling out Office 2007.

October 31st, 2008

A painful upgrade to Ubuntu Intrepid Ibex

I’m writing a piece on Ubuntu – makes a change from all that Windows at Microsoft’s PDC. I wanted to be up-to-date, so I upgraded my laptop from Hardy Heron (8.4) to Intrepid Ibex (8.10), released just yesterday. I followed the officially recommended procedure. Currently I only have a wi-fi connection, which is not ideal, but I reckoned it might work. Before upgrading, I applied all available updates to the existing 8.04 installation.

The update manager started off confidently enough, though it sat for a long time on ldconfig deferred processing. Then it asked for a restart, and things started going wrong. Ubuntu could only boot to a terminal prompt, since it was missing packages needed for X, the graphical server, to start. I tried to fix this with apt-get; but I had another problem: the wifi connection was down. I managed to get this working with ifconfig and iwconfig, and repaired my system with apt-get update and apt-get dist-upgrade. This downloaded and installed some 340MB of packages, after which I could boot to the desktop.

I was not done yet. On startup, Ubuntu was pausing when configuring the network. When the desktop appeared, I had the problem usually expressed as nm-applet not appearing in the panel. This actually meant that the network manager had crashed. If I tried to restart it, it said ”no connections defined” and hung with some other errors. Once again, I could only restore wifi by fidding with console commands. I discovered I was not alone with the nm-applet problem. The fix that worked for me was to remove all references to network devices other than loopback in /etc/network/interfaces, as described here. Restarted, the network applet returned, and I could finally connect conveniently.

I got a surprise when I tried to browse the web. The upgrade had removed most of my applications, including FireFox and OpenOffice. I had to reinstall these using Add/Remove applications. I did find that FireFox had remembered my settings, once reinstalled, for which I was grateful.

Now that Intrepid Ibex is up and running, it will probably be as stable, fast and capable as Hardy Heron before it – really, it was. Linux is great, honest.

October 13th, 2008

Silverlight on Linux: Moonlight or moonshine?

Microsoft’s press release for Silverlight 2.0 says this:

Cross-platform and cross-browser support. This includes support for Mac, Windows and Linux in Firefox, Safari and Windows Internet Explorer.

The use of the present tense for Linux support is … misleading, to be generous. I tried visiting the official Silverlight site on Ubuntu. Here’s what I’m offered as downloads:

Hmmm. If I go to the official Moonlight site, I see this:

Note that not even Silverlight 1.0 is fully released; further, it says “no video or mp3 playback is enabled”. The installers are said to be incomplete.

I asked about this at the press conference; the answer was “we’re working on it” and “as soon as possible” and “Miguel is speaking at PDC”.

That’s fair enough and I understand that these things take time. But if you read the press release, you might suppose that a Linux user could use it now. Other than for geeky and experimental users, that is not the case.

August 2nd, 2008

Fixing wi-fi on Asus Eee PC 901 with Linux

I mentioned my annoyance that wi-fi with WPA encryption did not work on the Asus 901 Eee PC with Linux which I am reviewing. I later found that even a WEP connection, while it worked a bit, tended to drop out after few minutes. Worse still, the Asus repositories are messed up so getting updates is tricky.

I’ve managed to fix it. For the record, here’s what I did; though I can’t promise it will work for you; try it at your own risk. I should think there will be an easier way to install an updated driver soon.

One of the irritations about the repository problem is that attempted updates fill up your /dev/sda1. I wanted as much space as possible (without removing the recovery partition) so I reset the system with F9 on boot. Then I went into /etc/apt/sources.list and removed the default repositories, replacing them with these two:

deb http://xnv4.xandros.com/xs2.0/upkg-srv2 etch main contrib non-free

deb http://download.tuxfamily.org/eeepcrepos/ p701 main

(This is probably not a good arrangement long-term; but having the Asus repositories enabled right now makes it hard to install anything).

Then I did:

apt-get update

apt-get install build-essential

I also installed ksmserver and kicker to get access to the full desktop; but this wasn’t needed to get wi-fi working.

Next, I downloaded the latest driver source for the 901’s Ralink wi-fi card:

http://www.ralinktech.com.tw/data/drivers/2008_0708_RT2860_Linux_STA_v1.7.0.0.tar.bz2 (Update: don’t use this code – see Update 3 below).

Extracted it; then edited /os/linux/config.mk and changed:

HAS_WPA_SUPPLICANT=y

HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y – but see update 2 and update 3 below for the problems this caused.

I also removed –DDBG from WFLAGS

WFLAGS += –DCONFIG_STA_SUPPORT

In order to compile you need the kernel source. I adapted the instructions here. In essence, download the source from http://dlsvr01.asus.com/pub/ASUS/EeePC/701/Linux_Kernel_071127.rar, extract, install the deb, unpack the source in /usr/src, delete the .bz2 to save space, build the kernel with:

make oldconfig

make

(don’t actually install it), then create the following symbolic link:

ln -s /usr/src/linux-source-2.6.21.4-eeepc /lib/modules/2.6.21.4-eeepc/build

Now I was able to compile and install the ralink driver by switching to the RT2860 directory and typing:

make

make install

Wi-fi now worked with WPA; at least, it did on my second attempt after disabling native WPA supplicant support. I’ve also found it perfectly stable so far – much better.

Active wi-fi connection with WPA; a few numbers changed to reassure the paranoid

I’m happy now, but… what is Asus thinking?

I doubt the Eee brand would have ever taken off, except that the first 7xx releases made excellent use of Linux and open source applications to win people over; you did not even need to know that it was Linux.

Now we get this; the support for the 901 is dire; updates don’t work, the wi-fi doesn’t work properly, and the only fix I’ve found is a hack. Wi-fi is critical for a gadget like this, which is not much use without an Internet connection.

Together with short supply of the Linux version, this does suggest that Asus is keen to favour the Windows XP variant.

Update: I’ve made the binary (rt2860sta.ko) available for download here. Download includes RT2860STA.dat which goes in /etc/Wireless/RT2860STA. I guess we need an install script; I’ll have a go when I get a moment.

Update 2: Unfortunately I’m not quite there yet. If I compile with HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y then WEP works but WPA does not. If I compile with HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n then WPA works but (I now discover) WEP does not. Weird. I’m going to seek advice. If anyone wants the binary that works great with WEP but not WPA, let me know.

Update 3: Thanks to Ralink tech support I now have a fully working driver. I’ve updated the download above. The new code defines EEEPC_SPECIAL_SETTING and has some edits in common/mlme.c. It now works OK with HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y. Interesting point: the code is dated 15th July; which suggests that the problem was both known and fixed 2 and half weeks ago; it’s a shame nobody shared this with the community.

Update 4: I suggest you delete the old copy of rt2860sta.ko in /lib/modules/2.6.21.4-eeepc/rt2860 (if it exists).

PS: I’ve posted instructions for the binary install, with download links, here.

Technorati tags: , ,
July 30th, 2008

Eee 901 problems – does Asus still care about Linux?

I am reviewing the Asus Eee PC 901, the one with the Intel Atom processor. Of course I asked to see the Linux version. In my view Linux is better suited than Windows for a device with limited storage; and it is more interesting to me since the original Eee PC 701 was something of a breakthrough for desktop Linux.

No problem with the hardware; but the OS is a bit of a mess. The first problem is that the wireless card does not work properly for me. Asus have used a less common Ralink card – maybe it saved a few pennies over the Atheros it used to have – but out of the box it is not set up right. When I try to connect with WPA encryption I get:

Error for wireless request “Set Frequency” (8B04)
SET failed on device ra0; network is down
ioctl[SIOCSCIWAUTH]: Operation not supported

Looks like an update is needed. Here’s where the big problems start. With the 701 I had no problems updating, whether using the Synaptic GUI, or apt-get in a console. The new Eee currently offers me two updates in its “Updates and New Software” applet, one for “StarOffice Mime Types” which installs fine, and the other for “Webstorage Update”, which fails. Click Details and it is blank; no error message.

Trying apt-get instead is equally frustrating. Thanks to dependencies, updating almost any package results in a huge download – taking over an hour over broadband. Then the update fails because it runs out of disk space. That, and some packages are returning a 404; I also got size mismatch errors. Note: use apt-get clean after one of these exercises as that will free disk space.

The fact is, update is broken. One solution is not to update – though security is always a concern – but that still leaves the wireless problem unsolved.

This is careless of Asus. Part of the idea with the Eee is that it is an appliance, it just works, it hides all that Linux gunk. Except it is failing to do so, because of errors in the package management. Here’s what one user says:

This is sad. The thing that really helped launch the original 701 into reality is gone, and that’s Linux…I know my way around computers, and I know where to look to fix stuff, but this would leave a horrible taste in anyone’s mouth that wasn’t accustomed to finessing Linux (that’s the nice way of saying it)…I can’t say I see much of a future for Linux on the Eee.

It’s early days for the 901; maybe it will all be fixed soon. Still, at the very least it is being pushed out before the software is ready; which is a shame because there is a lot to like as well.

The best advice for those who don’t mind tweaking may be to install Ubuntu or some other distribution.

Update: I fixed the wi-fi issue eventually – see here.

Technorati tags: , ,
July 9th, 2008

Debugging PHP code to fix a WordPress problem

How do you debug a PHP application? Traditionally developers resort to outputting variable values to HTML, or peering through logs, but why not set breakpoints and step through code just as you would in C# or Java? Maybe because it can take some effort to set this up, as I was reminded today.

I was motivated by an annoying WordPress problem which I’ve blogged about before. For historical reasons, I have a lot of subscribers to an old RSS url which delivers the feed in the now deprecated RSS 0.92 format. I prefer to have a full text feed, and this used to work fine with WordPress, which placed the entire blog post in the element of the feed.

At some point this stopped working, and subscribers got a summary only. In fact, the feed broke completely for a while, after I switched to pretty permalinks; but even after fixing that, I still had the problem with summary items. I tried upping the length of the description, but it was delivered without any HTML formatting so that did not work.

Next I tried the WordPress support forums. There are lots of good folk there; but if you review the posts its clear that many queries go unanswered. That’s nobody’s fault; it is a community, and for whatever reason there seem to be more people seeking help than there are experts with the time to give free advice.

So how about debugging the PHP code and working out what was happening? It seemed a good opportunity to try the latest Eclipse Ganymede, released a couple of weeks ago, along with the PHP Development Tools (PDT). I also figured it would be easier to set this up on Linux, to match what I use on the web server. I used the same Ubuntu on VirtualBox setup that worked well for trying out SproutCore. It worked…

Debugging PHP with Eclipse Ganymede

…but I can’t pretend it was wholly straightforward. Here’s how it went. I installed the latest Ubuntu distro versions of Apache, MySql and PHP – easy. Ubuntu’s Eclipse is not the latest, so I downloaded it from the Eclipse site and used some tips to set it up tidily. Note: make sure Sun Java is installed; I set it as the default JVM. Adding the PHP development tools was more fiddly. I’d half expected this to be part of a standard Eclipse download by now, but it is not, and if you try to install it into Ganymede using the standard update site is does not work because of dependency issues (a big problem with Eclipse). You have to download a 2.0.0 build from here instead.

I’d decided to use the Zend debugger – that’s a separate Eclipse update too, as explained here. Note that even after updating Eclipse, you still have to install the separate Zend debugger server from here, if you want to debug real web applications. I had a few problems getting this working, mainly because of the zend_debugger.allow_hosts directive which you have to edit in php.ini, and which is not brilliantly documented.

I replicated my blog on the Ubuntu virtual box – easy. But how do you get your Eclipse PHP project pointing at this existing code? The method I settled on after a couple of experiments was to start a new PHP project, uncheck the Use default option for project contents, and select the blog directory in /var/www. You then get a scary dialog which observes that files already exist. You can either create your project as a subdirectory, in which case you cannot debug with the existing files, or else pass the scary warning:

Create project in /var/www/blog
(Deleting the project will delete the entire /var/www/blog folder)

I mis-read this at first, thinking it would delete all the files when creating the project. That’s not what it says. Everything was a backup anyway, so I took the plunge; it worked fine. In fact, if you look closely at the screenshot above (click for a full size image) you can see that it is nicely done. You can see the call stack at top left, current variable values, output as it is being generated, and the usual options to step into or over the code.

That said, I did have some problems with Step Into. Just when it was going to be most useful, it bombed out with a message that said Error. If you looked at the detail, that also just said Error. The only fix I found was to set breakpoints in the actual file I needed to debug.

Still, it worked. I found that by adding a single argument to a line in feed-rss.php I could get my full text feed back. I’ve duly reported this in the WordPress support forums.

A couple of observations.

First, I don’t much like the WordPress code. Sorry, because the product is marvelous, but the code seems like a typical PHP tangle. Using pretty permalinks, which I regret, makes it worse.

Second, are there not plenty of developers who use both Java and PHP and would like it to be a tiny bit easier to set up in Eclipse? I’m being a little unfair, since Ganymede is just out and I guess the PDT will integrate better with it soon. Even so, Eclipse is still not quite the smooth plug-in dream that I once hoped it would become.

Note that if you don’t mind paying, you can have Zend Studio which I should think makes life easier. Or perhaps Delphi for PHP.

July 2nd, 2008

What’s new in Subversion 1.5

The team behind the open source SCM (Software Configuration Management) tool Subversion released version 1.50 last month. Karl Fogel, president of the Subversion Corporation, says:

Measuring by new features alone, Subversion 1.5 is our biggest release since version 1.0 became available in February 2004.

I am a contented Subversion user, so took a look at the changes. Top of the list is “merge tracking”, though it is described as “foundational” which means that although the basic support is there, there is performance and feature work which remains to be done. From the user’s perspective, the difference is that branching and merging is just easier than before, as explained by Ben Sussman:

Notice how I never had to type a single revision number in my example: Subversion 1.5 knows when the branch was created, which changes need to be synced from branch to trunk, and which changes need to be merged back into the trunk when I’m done. It’s all magic now. This is how it should have been in the first place.

Other changes include sparse checkouts (when you only want to grab a small part of a repository), and changelists, a client feature which lets you tag a set of files under a changelist name and work on them as a group. There are also improvements aimed at making Subversion better suited to large-scale deployments using multiple servers. Subversion is still a centralized rather than a distributed SCM system, but 1.5 is better suited for use in a distributed manner. No doubt the Subversion team is aware of the increasing interest in Git, a distributed system. There are also numerous bug-fixes and performance tweaks. The changes are described here.

I want to move to Subversion 1.5 but it is not that easy. Compatibility is good, in that older clients work with 1.5 servers and vice versa, the main proviso being that you cannot mix several versions of the Subversion client with the same working copy. That is not likely to be a problem for most users.

The difficulty I encountered is that mainstream Linux distributions still have older versions of Subversion in their stable repositories. Ubuntu, for example, has version 1.4.4. My most-used Subversion repositories are on a Debian server, which also has an old version. I don’t want to switch the server to sid, Debian’s development distribution, and mixing packages is often problematic. I could do a manual installation I guess; but instead I will be patient.

I did install 1.50 on Windows, for an intranet repository. I used the Collabnet download. All I needed to do was to inform the installer of the location of my existing repository, and then copy a few lines from the old Apache 2.0 configuration file to the new Apache 2.2 configuration file. Everything works fine. I also updated TortoiseSVN on the Windows clients.

One of the advantages of Subversion (or any SCM) repositories over synched folders like those in Microsoft’s Live Mesh or Apple’s MobileMe (as I understand it) is that you get version history. I regard this as a key feature. The problem with synchronization is that you might overwrite a good copy with a bad one. It is easy to do; it might be caused by user error, or a bug in your word processor, or a failing hard drive. Automatic synch (un)helpfully replicates the bad copy all over. Versioning means you can just rollback to the good one.

June 29th, 2008

Canon’s bad dialog, weak Linux support

While installing Canon’s MX700 all-in-one printer on Windows, I spotted this for my collection of bad dialogs:

do you want to restart the system now?

Hint: if you ask the user a question, it’s good to allow for more than one answer. Even if you close the dialog by clicking the x at top right, it still reboots the system.

I was also interested to see whether the printer works with Linux. Canon doesn’t offer Linux drivers. Nor does it seem keen to hear from customers about this:

Linux printing for other printers

The CAPTCHA test always presents 8 zeroes, which it then rejects as invalid.

I haven’t quite given up.  There are Linux drivers for the Pixma MP520 which are rumoured to work somewhat. When I have a moment I’ll give it a try.

Technorati tags: , , ,