Archive for the ‘Computing’ Category.

Linux command line DVD ripping

Now I can put my DVD’s away and watch them with XBMC instead:

dvdbackup -Mo /tmp/rip && mkisofs -dvd-video -o /mnt/storage/Movies/newmovie.iso /tmp/rip/* && rm -rf /tmp/rip

Fresh Ubuntu installation

I took the plunge today and reinstalled Ubuntu from scratch. I thought it might be interesting to see what additional software I had to install:

  • NVidia driver + this xorg.conf fix
  • Packages vim and vim-gnome
  • Dropbox (from www.getdropbox.com )
  • Package nfs-common to access storage on my home NAS
  • Package smbfs to mount Windows shares at the command line (I find this preferable to the smb://server IO-helpers that Gnome and KDE have)
  • Package xchat-gnome for access to Mammoth’s IRC server
  • Package msttcorefonts for the freely available Windows fonts include Arial for compatibility with websites that assume everyone has Arial.
  • Thunderbird 3.0 from the Mozilla Daily PPA
  • Package screenlets – specifically, the Sidebar (with ‘Dock other screenlets’ disabled), three RingSensors, ClearCalendar, ClearWeather, Clock, and Slideshow screenlets all configured to ‘Stick to Desktop’.
  • The 64-bit Flash beta in Package flashplugin64-installer from this PPA
  • Package qmmp is a very basic MP3 player, similar to the old Winamp releases
  • Firefox plugins: Greasemonkey, Net Usage Item
  • Package virtualbox-ose for VirtualBox.
  • Package apache2 for development/testing.
  • Package meld is a great visual diff tool.

I will keep this updated over the next few weeks.

Accessing a partition that uses LVM-on-RAID from Ubuntu LiveCD

The Ubuntu Live CD does not come with LVM or the MD administration tools, so if your existing system uses LVM and/or MD (the linux software RAID functionality), the partitions are not visible by default within the LiveCD. To get access to your data, pull up a terminal (Applications menu →  Accessories → Terminal) and switch to root:

ubuntu@ubuntu:~$ sudo -i
root@ubuntu:~#

Start by installing the software needed (since its a live CD, this just installs to the temporary in-memory “RAM disk”):

root@ubuntu:~# apt-get install lvm2 mdadm

With that completed, you can assemble your existing array(s):

root@ubuntu:~# mdadm --assemble --scan
mdadm: /dev/md0 has been started with 2 drives.

Then scan for the LVM physical volumes:

root@ubuntu:~# pvscan
 PV /dev/md1   VG nathan   lvm2 [465.52 GB / 0    free]
 Total: 1 [465.52 GB] / in use: 1 [465.52 GB] / in no VG: 0 [0   ]

Activate the logical volumes contained within:

root@ubuntu:~# vgchange -a y
 3 logical volume(s) in volume group "nathan" now active

And finally, mount whichever partition you were interested in:

root@ubuntu:~# mount /dev/nathan/data /mnt

How to build a HTPC for AU$500

My latest in a very occasional series of articles was posted on AusGamers a few weeks back, detailing how to build a cheap HTPC with Ubuntu and XBMC. In the comments there was of course, the usual resistance to using Linux -  despite the simplicity of the guide.

Configure Static IP with Sysprep’s unattend.xml

Last week I had to build an unattend.xml script that among other things, set the system up with a static IP. This seems easy enough but I just couldnt get it to work until I found this blog post.

Yes, the position of <identifier> in respect to its sibling elements matters. I never would have thought of that in a million years, so much praise to Renaud Depagne !

How to enable Ctrl+Alt+Backspace in Ubuntu 9.04

This was the first relevant hit I received from Google, which mentions the handy fact that there’s an alternate key combination for the same effect: Alt+PrintScreen+K. Wikipedia has a nice list of the available system requests on linux, including the handy by verbose “REISUB” sequence for rebooting a frozen machine.

Guide to iPhone Jailbreaking

My guide to iPhone jailbreaking has been belatedly published on AusGamers. With firmware 3.0 out in the next few days interest will likely be pretty low, but it was still fun to do some writing in English for a change.

Using Ubuntu 9.04 as a Xen dom0 host with NVidia driver

I guess this is a somewhat unusual setup, but I wanted my desktop to be usable as a Xen dom0 for testing and I need the nvidia driver for Xorg.

There’s two core problems here:

  • While Ubuntu provides the Xen hypervisor and associated utilities (imported straight from Debian’s repository), Ubuntu does not provide a Xen-enabled kernel.
  • The NVidia kernel module is not supported on Xen-enabled kernels.

I’m using the x64 version of Ubuntu, I dont see why i386 wouldn’t work either. This text assumes you already have a working Ubuntu 9.04 desktop with the proprietry Nvidia driver installed from Ubuntu repository.

Step 1: Install Xen using Debian kernel. The easiest way to get a suitable kernel is to use the Debian Lenny kernel. This blog post neatly summarises the steps required: download linux-image and linux-modules from Debian and install, add ubuntu-xen-desktop package, remove network-manager package, and configure /etc/network/interfaces to use DHCP. I found that GRUB was setup correctly without needing any effort on my behalf.

Step 2: Remove repository-provided Nvidia module and install Kernel headers. The Nvidia kernel module as supplied by Ubuntu does not function correctly under a Xen dom0, if used a black screen is simply displayed and /var/log/X0rg.0.log will show that Xorg has frozen during startup. If you simply reboot into the new Debian kernel, you will not even get that far though, as the DKMS build step of the nvidia module will fail due to the missing headers. To get around the black screen problem you need to install Nvidia driver straight from their website, using a few flags to configure it to work on Xen.

Before getting that far though, you need to remove the Ubuntu-supplied NVidia driver and install Debian’s kernel header packages. I was using the “nvidia-glx-180″ package, so execute “apt-get remove nvidia-glx-180 nvidia-180-kernel-source”. Next, find the header packages from Debian corresponding to the linux image you downloaded in Step 1. In my case I am using “linux-image-2.6.26-2-xen-amd64″ and I needed three .deb’s: “linux-headers-2.6.26-2-common-xen”, “linux-headers-2.6.26-2-xen-amd64″ and “linux-kbuild-2.6.26″. You also need gcc-4.1 installed to build the module.

Step 3: Install the NVidia driver from their website. I downloaded NVIDIA-Linux-x86_64-180.60-pkg2.run , since that is basically the same version that Ubuntu supplies. This page on NVnews.net has the magic incantation required: as root, you need to run

IGNORE_XEN_PRESENCE=y CC="gcc -DNV_VMAP_4_PRESENT -DNV_SIGNAL_STRUCT_RLIM" ./NVIDIA-Linux-x86_64-###.##-pkg2.run

Now reboot into the Xen kernel and the Ubuntu desktop should appear as per normal.

Ubuntu 6.06 to 8.04 server upgrade

Back in 2005 I bought a large tower case and stuffed it full of hard drives to use as my home storage solution.  I’ve been running Ubuntu 6.06 on it since it was released, but figure its time to upgrade to 8.04 so I can use some of the newer packages that have come out in the last few years.

Ubuntu have a page describing the procedure:

  1. Enable the “dapper-updates” repository.
  2. Install the new “update-manager-core” package – dependencies include python-apt, python-gnupginterface and python2.4-apt.
  3. Run “sudo do-release-upgrade” in a terminal window.
  4. Follow the steps on the terminal window.

And that’s pretty much it. The only real flaw in the system is that any software configuration files that you have changed and Ubuntu have also changed, result in a prompt being shown asking how to resolve the conflict. This works pretty well with two minor flaws:

  • Compared to dealing with merges in say Subversion, its very basic since there’s no actual merge functionality at all. You are shown the differences between the two files, but aren’t offered the chance to accept all non-conflicting changes.
  • The upgrader does packages in a semi-random order which can take an hour or more; since the installer prompts you to resolve configuration conflicts during the installation of each package this happens at basically random points through the process. It would be more user friendly if it could group all packages with configuration conflicts together in time.

Fortunately though the upgrade has gone without a hitch and I can now have some fun trying out iSCSI.

Move Evolution data to new Ubuntu install

I’ve had to do this a few times, and always forget how so I’m noting it down here. With most linux applications, its simple to move to a new system: you copy the “dot” file or directory from the old system to the new home directory.

However, Evolution stores the account data in GConf which is slightly trickier to copy. This article explains the process, but it can boiled down to this:

  1. Copy the existing .evolution  to ~
  2. Run gconftool-2 –shutdown
  3. Copy the existing .gconf/apps/evolution to ~/.gconf/apps
  4. Start Evolution