Archive for the ‘Linux’ Category
Setting up a quick and easy virtual web server
I did a fair bit of work on this about a year ago, and then never got round to writing it up. What I was trying to achieve was to have a minimal virtual server running in VirtualBox, which could been seen from the outside world and would appear to all extent and purposes to be a real physical machine.
Start off by creating a new VM. I went with a totally stripped down installation of Ubuntu (from the alternative CD), adding just openssh-server and apache2 to the default install. I called it Ubuntu Minimal (the name will become important later).
Boot up the new VM, and then on the host machine enter the following commands (replacing the name of the VM with what you decided to call yours):
VBoxManage setextradata "Ubuntu Minimal" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
VBoxManage setextradata "Ubuntu Minimal" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata "Ubuntu Minimal" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
VBoxManage setextradata "Ubuntu Minimal" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache2/HostPort" 8008
VBoxManage setextradata "Ubuntu Minimal" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache2/GuestPort" 80
VBoxManage setextradata "Ubuntu Minimal" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache2/Protocol" TCP
Power down the VM, start it up again, and then you should be able to ssh into it on port 2222 and pull up apache’s “it works!” page by browsing to http://localhost:8008. At that point you can install web apps and do whatever else you want with the server.
It doesn’t take up a great deal of memory, so you could probably have a couple of these running on most computers without any obvious performance degradation.
A brief life update
This week I’ve largely been:
- Listening to the new albums by The Flaming Lips, Atlas Sound, Charlotte Hatherley and Broadcast (all of which I’m really enjoying)
- Updating my main workstation to Ubuntu 9.10
- Learning about Google Wave
- Trying to juggle various work tasks (and not dropping anything hopefully).
Oh, and I still hate this time of year. Even though we had no annoying begging children this year, there is still the firework-hating dog to deal with.
Sensible window sizes on Dell’s version of Ubuntu
I love my Dell Mini, but there are a couple of “features” added by Dell that drive me mad. One of these is called Maximus. It’s an application that tells any window that opens on the desktop to open full-screen. It’s particularly annoying with applications I’ve added myself (like Empathy), as the default applications seem preconfigured to ignore it. I’ve had a poke around in gconf-editor (install it with sudo apt-get install gconf-editor if it doesn’t exist already), and the key that needs editing is called /apps/maximus/exclude_class (see below for details):

It’s basically a list of applications that open with the same window size they closed with rather than open in full-screen.
Double click on the key, and you should get the following dialogue:

Click on the plus button, and add whatever applications you need as shown below:

Then click on OK. Next time you open the applications in question they should honour your desired window size.
Exploring Suse Studio
I’ve had an account on http://susestudio.com/ for a few weeks now, but have only really had a couple of chances to play with it. The basic idea behind the site is that anyone should be able to create a customised Linux distribution that perfectly suits their needs (providing those needs involve openSUSE 11.1 or SUSE Linux Enterprise 10 or 11). Normally I do this sort of work on Ubuntu, using Ubuntu Customisation Kit, as detailed in a previous post. This suits me, because I use Ubuntu in a production environment and it makes things easy. But I was interested in how this new software would work for someone who had never used openSUSE for more than a few minutes.
Ubuntu Customisation Kit does everything on the host machine, and only uses the Internet to pull new/updated packages in. This is light on bandwidth for tweaks, but heavier if you’re making major changes. Suse Studio does things the opposite way round, in that all the building and updating is done on the web, and you then download the finished .iso image. It’s slightly heavier on bandwidth overall, but did allow me to do a lot of the build work from my netbook in the foyer of a hotel in London, as all you need is a web browser and a net connection.
I ended up building three different versions of openSUSE, to suit three specific needs I occasionally have:
- Gnome, with a web browser (firefox), a terminal (gnome-terminal), dropbox preinstalled, and a couple of work-specific scripts for mounting drives and backing up data. This is a configuration we use at work for data recovery (currently based on Ubuntu 8.04). This was painless to set up, came in at 348Mb, and worked well.
- A showcase for KDE4. I’m not a big fan of KDE, but it’s always useful to have a VM kicking around to show people what it is like. This was on the same level of detail as the Gnome one, and came in at 350mb. I think I might actually be able to use this to get things done, as it takes away a lot of the un-instinctive KDE apps whilst leaving the very pretty and functional base.
- An image containing the applications I use every day, which would act as a basis for reinstalling my home or work laptop (both currently running Ubuntu 9.04). This contains Firefox, Thunderbird, OpenOffice.org, Empathy, Rhythmbox, Gedit and gnome-terminal, and was still only 484mb (300Mb less than the version of Ubuntu I install from usually).
So yes, all three experiments worked, and while I’ve not tried to use them to get things done yet, I have successfully installed all three as virtual machines and they seem to work as expected.
I think most people could use Suse Studio, and it acts as a good way to learn the basics of how a distribution is put together. I very much expect to see the code base from this project move in interesting directions in the next few months, and I’d be surprised if we don’t see similar projects getting off the ground soon.
Suse Studio
I’ve been trying out Suse Studio over the last couple of days. It’s a build service for livecds and software appliances, and it really is so easy to use that I think most non-technical users could get to grips with it. It’s invite only at present, but I got an invite just by asking (and I’m not exactly known for my love of the distro).
I’ve built a 300mb livecd with a very minimalistic Gnome install plus Dropbox, and it seems to do everything I want it to do. And it only took about 20 minutes in total to do.
I think this is something I will play with some more when I’m on holiday.
Upgrading Ubuntu 8.04 to OpenOffice.org 3.1
This guide has all the required info, and worked like a charm on my netbook running 8.04 and my laptop running 9.04 (although it was simpler than the guide suggests in both cases). I’ll hopefully write a more comprehensive guide at some point soon, because I think 3.1 is something that people should consider upgrading to.
I’m really not noticing the fact that I’m running 8.04 on my Dell Mini, largely because I’ve upgraded most of what I use regularly to later versions.
Project media server
As I’ve often said, “Ubuntu on the desktop, Debian on the server” is the way to go. That said, I’ve mixed and matched the two a fair bit over the past couple of years, and would now say that as Ubuntu is ready for the server, so Debian is a damn fine desktop distro which is also surprisingly easy to set up to play every possible kind of media file I can throw at it.
So yes, I went with Debian (stable) because the computer I’m using was already running it. I’ve set the machine up, copied all the music, movies and TV shows across, and now have a very pretty and totally functional media machine. So far I’ve played some music, watched a documentary about T.S. Eliot (who still to this day inspires me more to write than any other person living or dead), and have some live footage of Leonard Cohen to look forward to at some point this week. I’ve also got it on our wireless network, so I can dump media onto it from anywhere (anywhere being largely my main laptop which lives upstairs).
It currently looks something like this:

Default Debian desktop
I’m using Rhythmbox for music, Totem for video, and have installed very little extra apart from the required media codecs (I seem to have a mix of pretty much every type of media file for some reason). I can’t say I really came across any problems, and Debian did a great job of being able to find and install whatever was needed to make each file type work (although I’m systematically converting everything to .ogv and .ogg so a lot of this won’t be required soon).
So far so good.
Review – Mandriva 2009.1 (KDE edition)
I’ve finally got round to installing the KDE version of Mandriva 2009.1 in a VM on my laptop. I’d been holding off, because I don’t really use KDE, and I wasn’t too impressed with how the other major distributions had implemented KDE4 (which is basically a total revision of every aspect). Happily, I can easily say that this is the most usable implementation of KDE4 I’ve ever come across, and it does a very good job of not getting in my way whilst still enabling me to be productive.
The desktop has seen some major customisations, as is usual with Mandriva (see http://www2.mandriva.com/ for a screen shot), and it actually looks and feels like a more polished version of KDE 3.5 (the last version of KDE I used for more than a couple of hours). There are sensible defaults, and I think the only application I would want to add is Thunderbird, because I still really don’t like Kmail.
But could I use it full time? Almost certainly yes, and if I wasn’t very tied to Gnome and the Gnome libraries and applications then I’d consider making the switch. As it is, I’ll happily keep it as a VM, which gives me the option to have a play with KDE4 every now and again without having to make any major life changes.
Converting Quicktime movies using Linux
Another “so I don’t forget it” post.
Converting Quicktime (.mov) files to Ogg Theora (.ogv) is now rather simple (although takes a while).
Firstly, install ffmpeg2theora (it should be available for most distros).
Then just launch it from the command line. The syntax is:
ffmpeg2theora name_of_file.mov
Or to do a whole directory:
ffmpeg2theora *.mov
Easy.
Changing hostname in Mandriva
I’ve been doing a bit of work on Mandriva recently, and I always forget that there are two places you need to change the host name before it “takes”.
in /etc/sysconfig/network add the following line:
HOSTNAME=hostname
Where hostname is whatever you want the computer to be called.
Then in /etc/hosts just add the hostname after localhost on the first (and probably only) line in the file. It should look something like:
127.0.0.1 hostname localhost
Where again hostname is the name of the computer.
Do this, reboot, and all should be well.