Sunday 25 May 2008

Getting a Huawei HSDPA modem working with Ubuntu

Here in the UK, mobile broadband has started to become more prominent in the last few months, with mobile phone providers offering HSDPA modems at rates comparable to landlines. I daresay the same is probably happening elsewhere in the world, so no doubt many users of Ubuntu and Ubuntu-derived distros are thinking about getting one. I actually tried Vodafone's Mobile Broadband myself but was disappointed with the speed I could get (the mobile networks aren't great in rural Norfolk) so I wound up taking it back. However, I'm assured that in other parts of the country it's fast enough to compete with a DSL line.
So, one question many people will want to know is "Will it work with Ubuntu?". It depends on the device. The Huawei E220 is currently being offered by Vodafone, 3 and T-Mobile in the UK, and apparently support for it was added in the 2.6.20 Linux kernel. Therefore it should work out of the box with any Ubuntu version from Feisty Fawn onwards (I think it should also work with the default OS on the Asus Eee as if I remember right that uses the 2.6.21 kernel). Also, this is a USB device so is easy to get working. Overall, this is probably the safest choice.
The one I opted for was the Huawei E620 PCMCIA card. This was somewhat more troublesome. Fortunately, Vodafone have developed the Vodafone Mobile Connect card driver for Linux for this device which will apparently also work for other carriers as long as they are using a compatible device. It's available from this link. Unfortunately, the comments seem to imply that the beta version doesn't yet work well with Hardy, but I can personally vouch for the stable version working well in Gutsy. I'd therefore expect that once the beta reaches a stable version it will work OK, and it may be that one of the older versions works fine in Hardy.
However, this does have a LOT of dependencies, so to get it working with Ubuntu, you'll need an alternative way to access the Internet. If you install the package as normal and use apt-get -f install to resolve the dependencies, it should be nearly ready to go.
If you then start the application from the menu, you'll be prompted to enter the APN, user name and password. For Vodafone in the UK, this forum post gives you the details you need. For those of you outside the UK or connecting via other providers, you'll need to do a bit of Googling to get the correct settings. I also recommend using Open DNS instead of your provider's own DNS servers for better performance.
If you have trouble with the E220, the Vodafone Mobile Connect card driver might also be helpful in respect of that device.
Overall, the Huawei HSDPA modems are surprisingly easy to get working in Linux with just a few Google searches - I was able to get it working fine within a short period of time. So if you're running Ubuntu or a derivative on your laptop and are considering getting mobile broadband, but were concerned about whether it would work OK, then go ahead - these devices are quite Linux-friendly.

Saturday 24 May 2008

Using apt-get to compile from source

Compiling from source is something that strikes terror into the heart of every Linux newbie - it seems like such a black art. The usual trinity of /.configure, make and make install is something barely comprehensible if you're new to Linux. But you can relax - you almost never have to compile from source in Ubuntu as the repositories are very comprehensive.
Nonetheless, compiling from source has a place in every good Linux user's toolkit. It can result in better performance if you compile a CPU-intensive app from source. Distros like Gentoo enable you to get an entire system that's compiled specifically to get the absolute best out of your hardware.
The Debian package manager used by Ubuntu offers an interesting compromise that allows you to easily compile apps from source. It doesn't get you the kudos that compiling from source will normally give you, but it's easy to use and is well within the capability of a relative newbie. It also creates a .deb package so it's easy to uninstall if necessary.
We'll compile the Dillo web browser in this example. The process is different to how you'd install software using apt-get normally. Before anything else, make sure you open Synaptic (or Adept if you're using Kubuntu) and check the box to include the source code repositories.
Once that's done, we can get on with the installation. First, you have to install the dependencies:
sudo apt-get build-dep dillo

This installs all the dependencies needed to compile Dillo. Next, you need to tell apt-get to download and compile the source code:
sudo apt-get -b source dillo

Once it's downloaded and compiled the code, you'll be left with a .deb package in your /home directory, which you can install in the usual way. If you later need to remove it, you can use apt-get remove as normal.
There, that wasn't hard, was it? Ubuntu has several options available if you want to compile an application from source, and this is the easiest. I have to admit I don't use this much, but it can be worthwhile.

Sunday 18 May 2008

Installing the Kubuntu KDE4 desktop

If you like the look of the KDE4 version of Kubuntu, it's easy to add it to your existing Ubuntu, Kubuntu or Xubuntu session. Just enter the following in the terminal:
sudo apt-get install kubuntu-kde4-desktop

Now log out and use Change Session to switch to KDE4. Then log back in to your new KDE4 desktop!

Saturday 10 May 2008

Closing applications that have hung

As you may know, if anything hangs in Windows, you can open the Task Manager and use that to close the misbehaving program. You may be missing similar functionality in Linux. Well, it's there, so here's how to use it!

First of all, let's cover command line applications. Say, for instance, that you try and install something using apt-get install, but your Internet connection is playing up, so you decide to stop it and try again later. How do you cancel what you're doing? Simple - just make sure your shell session is selected, press Ctrl and C, and it will stop dead.

This is very useful, but most people still use graphical applications for most things. How do you stop these? Again, there's an easy way to do it. Just open the command line and type the following:
xkill

Now, the cursor will change to an X. Just click on whatever you want to stop and it will be shut down.

Monday 5 May 2008

Customising your Ubuntu desktop

While Linux doesn't have a reputation for eye candy, you can nonetheless get a great desktop with a little bit of work. Compiz will normally be working by default, so with a little effort you can use this to really make your desktop into something special!

If you want to get more out of Compiz, then you need to install the package compizconfig-settings-manager. This gives you an easy-to-use menu which allows you to set your preferences for Compiz, so you can get the famous cube effect going.

For a more attractive desktop, you can install Emerald. This is a theme manager for Compiz, allowing you to use loads of great themes to make it look even nicer.

And finally, if you want an OS X-style dock bar, install the avant-window-navigator and awn-manager packages from the Hardy repositories. With these, you can set up a dock bar and customise it to your heart's content!

It's staggering to see how great some people have made their Ubuntu desktops! If you need more resources, check out Gnome-Look.

Xubuntu will also happily run Compiz, Emerald and Avant Window Navigator, however Kubuntu is a bit less well served. It's possible to get things like Compiz and Emerald working, but it's a bit more of a struggle. But KDE4 has eye candy aplenty, so if you're using that you're OK!

Friday 2 May 2008

Graphics cards

Graphics cards can be troublesome in Linux. Integrated graphics cards such as those made by Intel are usually OK nowadays, but the kind of cards seen on more high-end machines can be more troublesome.
Fortunately, there's a great tool to help with ATI and Nvidia cards, called Envy. This is a set of scripts designed to detect your graphics card, install the correct driver for you and configure the X window server for you. So, if you have any problems with a graphics card from either of those two manufacturers, Envy should be your first port of call (if not, the Ubuntu Forums are your best bet). For those of you running Linux Mint, Envy is preinstalled.
There may still be cards that people can't get working, but Envy goes a long way in making it easier to get your card working right.