<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Square Goldfish &#187; Linux/Ubuntu</title>
	<atom:link href="http://www.squaregoldfish.co.uk/category/computing/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.squaregoldfish.co.uk</link>
	<description>The random jottings of a geometrically precise aquatic lifeform</description>
	<lastBuildDate>Wed, 25 Aug 2010 22:31:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Disabling GDM in Ubuntu</title>
		<link>http://www.squaregoldfish.co.uk/2010/05/16/disabling-gdm-in-ubuntu/</link>
		<comments>http://www.squaregoldfish.co.uk/2010/05/16/disabling-gdm-in-ubuntu/#comments</comments>
		<pubDate>Sun, 16 May 2010 09:31:39 +0000</pubDate>
		<dc:creator>squaregoldfish</dc:creator>
				<category><![CDATA[Linux/Ubuntu]]></category>

		<guid isPermaLink="false">http://www.squaregoldfish.co.uk/?p=305</guid>
		<description><![CDATA[There are various reasons for installing a full Ubuntu desktop, but wanting to run the system in text-only mode by default. Perhaps your machine is a server, and you want as much RAM available as possible for its server activities. Maybe it&#8217;s an LTSP server, which needs all the nice GUI stuff for its clients, [...]]]></description>
			<content:encoded><![CDATA[<p>There are various reasons for installing a full Ubuntu desktop, but wanting to run the system in text-only mode by default. Perhaps your machine is a server, and you want as much RAM available as possible for its server activities. Maybe it&#8217;s an LTSP server, which needs all the nice GUI stuff for its clients, but doesn&#8217;t need them itself. Or perhaps you just did a standard install and don&#8217;t need a GUI that often. Whatever the reason, your goal is to disable GDM, the graphical login manager. Fortunately, this is simplicity itself.</p>
<p>GDM&#8217;s configuration is in the file /etc/init/gdm.conf. At the top of this file are two commands that specify when GDM starts, and when it stops. In Lucid Lynx (10.04), these lines look like this:</p>
<pre>
start on (filesystem
          and started dbus
          and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1
               or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
               or stopped udevtrigger))
stop on runlevel [016]
</pre>
<p>All we need to do, then, is to alter the start criteria. The easiest way is to replace the multi-line start command with this:</p>
<pre>
start on runlevel []
</pre>
<p>The runlevel approach tells GDM to start or stop when a given runlevel is entered. And if we give it an empty list on runlevels, it never starts. Simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.squaregoldfish.co.uk/2010/05/16/disabling-gdm-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A wireless, headless Linux box</title>
		<link>http://www.squaregoldfish.co.uk/2010/03/11/a-wireless-headless-linux-box/</link>
		<comments>http://www.squaregoldfish.co.uk/2010/03/11/a-wireless-headless-linux-box/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 19:57:07 +0000</pubDate>
		<dc:creator>squaregoldfish</dc:creator>
				<category><![CDATA[Linux/Ubuntu]]></category>

		<guid isPermaLink="false">http://www.squaregoldfish.co.uk/?p=281</guid>
		<description><![CDATA[If you&#8217;re using wireless networking in Ubuntu (or, presumably, most flavours of Linux), you may have noticed that your network doesn&#8217;t connect until you&#8217;ve logged in and the NetworkManager&#8217;s applet has done its thing. This doesn&#8217;t happen for wired networks, where you get a connection as soon as the machine has booted. This is all [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using wireless networking in Ubuntu (or, presumably, most flavours of Linux), you may have noticed that your network doesn&#8217;t connect until you&#8217;ve logged in and the NetworkManager&#8217;s applet has done its thing. This doesn&#8217;t happen for wired networks, where you get a connection as soon as the machine has booted. This is all to do with the extra security requirements of wireless networks, where the user has to select which of the visible networks to connect to, and enter any required passwords. Obviously this can&#8217;t be done before the user has logged in to enter these details.</p>
<p>For the most part this isn&#8217;t a problem, apart from an occasionally annoying delay while the networking is sorted out before you can get down to some serious work avoidance on the Internet. However, if you want to have a headless computer on your wireless network, for use as a server, MythTV box, or a grunt for distributed rendering, you don&#8217;t want to be logging into this machine to get the network going whenever you switch it on. Fortunately, it is possible to get your machine to connect to a wireless network on boot without having to log in. Note that you&#8217;ll have to hard-code which wireless network you&#8217;re connecting to, but since this is a headless server and presumably somewhere in a dusty corner, that shouldn&#8217;t be a problem. So how&#8217;s it done? Well, here goes&#8230;</p>
<p>Before we start, I&#8217;ve made a number of assumptions on your setup, so if your system isn&#8217;t covered here, you may need to do a little more research elsewhere. Sorry, about that, but I can only advise on what I&#8217;ve done with my system.</p>
<ul>
<li>You&#8217;ve already got a working wireless network card in your machine. If you need help setting up drivers for it, I&#8217;m afraid this isn&#8217;t the place. I used the stuff on <a href="http://www.linuxquestions.org/questions/linux-wireless-networking-41/success-netgear-wg311v3-400257/">this page</a> to get my Netgear WG311v3 working.</li>
<li>You&#8217;re using WPA security on your wireless network. I&#8217;m not getting into the arguments here.</li>
</ul>
<p>First off, make sure you have the wpasupplicant package installed, which will handle the security side of the wireless networking for us. (You are using WPA security, right?) It&#8217;s almost certain that this is installed, but we&#8217;d better check now before we cut the machine off from the Internet.</p>
<pre>sudo apt-get install wpasupplicant</pre>
<p>Now, as I&#8217;ve already mentioned all network connections are handled by the NetworkManager, so if we want to do our own thing we need to get rid of it. Note that once we&#8217;ve done this your machine won&#8217;t have any network access, so make sure you&#8217;ve got another machine close by in case of need. You can do this in two ways – either disable NetworkManager (something of an arcane process), or more simply (and the way I did it) remove the relevant packages:</p>
<p>sudo apt-get remove network-manager network-manager-gnome</p>
<p>OK, so now you have a machine with no networking capability at all. Never fear, though: your machine will soon be out of solitary confinement. Using your favourite text editor in sudo mode, edit the file /etc/network/interfaces and set it up as follows:</p>
<pre>
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp

wpa-ap-scan 1
pre-up sudo /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -Dwext -B
pre-up sleep 5
post-down sudo killall -q wpa_supplicant
</pre>
<p>So, what has this done? Well, the first couple of lines set up the loopback network device, which is used for all sorts of things in Linux. Don&#8217;t ever get rid of this unless you like a lot of pain in your life. </p>
<p>The second two lines tell the system that we want the wlan0 interface (that&#8217;s the wireless one) to start get going automatically, and acquire and IP address through DHCP. The final chunk tells the system how to go about setting up the connection:</p>
<pre>wpa-ap-scan 1
</pre>
<p>This setting means that the ESSID of your wireless network is publicly visible. If your router hides the ESSID, set this to 2.</p>
<pre>
pre-up sudo /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -Dwext -B
pre-up sleep 5
</pre>
<p>This specifies the command to be used to set up the wireless connection. -i is the name of the interface, -c specifies the location of the configuration file (more on this in a moment), and -B runs wpa_supplicant in the background (very important!). The -D option sets the type of driver to be used. The wext driver is fine in most cases, even if you&#8217;ve set up your network card&#8217;s drivers through ndiswrapper.</p>
<p>The final stage is to configure wpa_supplicant so it knows about your wireless network. In the interfaces file, we specified that the configuration file is located at /etc/wpa_supplicant.conf, so edit that file. The contents of the configuration file should be as follows:</p>
<pre>
ctrl_interface=/var/run/wpa_supplicant

network={
        ssid="&lt;your SSID&gt;"
        psk="&lt;your wireless network's password&gt;"
        proto=RSN WPA
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
}
</pre>
<p>The ctrl_interface line tells wpa_supplicant where to dump any information it needs while it&#8217;s running. The setting here is the default, and I see no reason to change it. Below that is simply the details of your wireless network. Note that the ssid and  psk value must be in quotes. The other values seem to work well for most wireless network situations.</p>
<p>That should be all you need to do. To see if it&#8217;s worked, reboot the machine. If you&#8217;ve set up an SSH server, you should be able to log in remotely straight away. Or, take a look at the list of devices connected to your wireless router, and you should see that it&#8217;s connected itself without your intervention. Now you can stick the machine in its dusty corner and let it do its thing.</p>
<p>The wireless network card in my machine unfortunately doesn&#8217;t support Wake-On-LAN. If it did, I could stick my server in the attic and never look at it again. Maybe I&#8217;ll try that one day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.squaregoldfish.co.uk/2010/03/11/a-wireless-headless-linux-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DVDs that won&#8217;t play in Linux, and how to make them behave</title>
		<link>http://www.squaregoldfish.co.uk/2010/01/08/dvds-that-wont-play-in-linux-and-how-to-make-them-behave/</link>
		<comments>http://www.squaregoldfish.co.uk/2010/01/08/dvds-that-wont-play-in-linux-and-how-to-make-them-behave/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 21:16:21 +0000</pubDate>
		<dc:creator>squaregoldfish</dc:creator>
				<category><![CDATA[Linux/Ubuntu]]></category>

		<guid isPermaLink="false">http://www.squaregoldfish.co.uk/?p=201</guid>
		<description><![CDATA[Playing DVDs in Linux is generally a pretty painless process. The libdvdcss library does a sterling job of allowing us to watch our DVDs on legitimate hardware using the operating system of our choice, legal machinations notwithstanding. It also manages to circumvent the region encoding of the DVD (an abitrary and legally dubious restriction), allowing [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_218" class="wp-caption alignright" style="width: 170px"><img src="http://www.squaregoldfish.co.uk/wp-content/uploads/2010/01/PeopleLikeUs.png" alt="People Like Us DVD" title="People Like Us DVD" width="160" height="225" class="size-full wp-image-218" /><p class="wp-caption-text">People Like Us. Except when we can't see them.</p></div><br />
Playing DVDs in Linux is generally a pretty painless process. The libdvdcss library does a sterling job of allowing us to watch our DVDs on legitimate hardware using the operating system of our choice, legal machinations notwithstanding. It also manages to circumvent the region encoding of the DVD (an abitrary and legally dubious restriction), allowing you to play DVDs from any region in your player without intervention. At least, most of the time it does; there are a few DVDs in the wild that libdvdcss can&#8217;t access unless the drive is set to the correct region.</p>
<p>I came across one example of this recently, when I bought People Like Us Season 2. It seems that this was only ever released in Australia, and as such is a region 4 disc. I&#8217;m in the UK, and so have (I assumed &#8211; more on this shortly) a region 2 DVD drive in my machine. Most of the time this isn&#8217;t a problem &#8211; I have DVDs from most regions in my collection, and so far they&#8217;ve all played just fine. This one, however, wouldn&#8217;t play ball. When I tried to play the DVD, mplayer took ten minutes to do anything, and then it couldn&#8217;t play all the tracks. A quick look at the libdvdread activity revealed the problem:</p>
<pre>
libdvdread: Using libdvdcss version 1.2.10 for DVD access
There are 8 titles on this DVD.
There are 1 angles in this DVD title.

libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient

libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000152
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x000001c2
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x0000ac4a
libdvdread: Elapsed time 1
libdvdread: Get key for /VIDEO_TS/VTS_02_0.VOB at 0x0000dd3b
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_1.VOB at 0x0000dd92
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_0.VOB at 0x0000f04c
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_1.VOB at 0x0000f0a3
libdvdread: Elapsed time 46
libdvdread: Get key for /VIDEO_TS/VTS_04_0.VOB at 0x000a7da2
libdvdread: Elapsed time 1
libdvdread: Get key for /VIDEO_TS/VTS_04_1.VOB at 0x000a7df9
libdvdread: Error cracking CSS key for /VIDEO_TS/VTS_04_1.VOB (0x000a7df9)!!
libdvdread: Elapsed time 303
libdvdread: Get key for /VIDEO_TS/VTS_05_0.VOB at 0x001416de
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_05_1.VOB at 0x00141735
libdvdread: Error cracking CSS key for /VIDEO_TS/VTS_05_1.VOB (0x00141735)!!
libdvdread: Elapsed time 249
libdvdread: Get key for /VIDEO_TS/VTS_06_0.VOB at 0x001d8a51
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_06_1.VOB at 0x001d8aa8
libdvdread: Error cracking CSS key for /VIDEO_TS/VTS_06_1.VOB (0x001d8aa8)!!
libdvdread: Elapsed time 259
libdvdread: Get key for /VIDEO_TS/VTS_07_0.VOB at 0x002754ed
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_07_1.VOB at 0x00275544
libdvdread: Elapsed time 18
libdvdread: Get key for /VIDEO_TS/VTS_08_0.VOB at 0x0030a0a4
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_08_1.VOB at 0x0030a0fb
libdvdread: Elapsed time 1
libdvdread: Found 8 VTS's
libdvdread: Elapsed time 878
</pre>
<p>The CSS tracks for three of the titles on the disc couldn&#8217;t be extracted, and those titles wouldn&#8217;t play. This left me with a problem &#8211; a DVD that I couldn&#8217;t watch. Since I knew that I could watch all my other DVDs, I set about finding out how to change my DVD drive to region 4; I could then play my new Australian DVD, and still be able to play my current collection. This is important &#8211; most drives will only allow you to change the region a set number of times (usually five), so I couldn&#8217;t afford to keep chopping and changing the region.</p>
<p>The Linux utility regionset (available in the Universe repository in Ubuntu) allows you to view and change the region code of your DVD drive. Having installed regionset, I ran to it change my region:</p>
<pre>
$ regionset
regionset version 0.1 -- reads/sets region code on DVD drives
Current Region Code settings:
RPC Phase: II
type: NONE
vendor resets available: 4
user controlled changes resets available: 5
drive plays discs from region(s):, mask=0xFF

Would you like to change the region setting of your drive? [y/n]:
</pre>
<p>This is an interesting result &#8211; it seems that my DVD drive had no region set at all. I would have thought a drive sold in the UK would be pre-set to region 2, but perhaps the region is left to be set the first time you play a DVD. Who knows? For our purposes, it doesn&#8217;t matter. I decided that I would like to change my DVD&#8217;s region:</p>
<pre>
Would you like to change the region setting of your drive? [y/n]:y
Enter the new region number for your drive [1..8]:4
</pre>
<p>Once I&#8217;d entered that, my DVD region was changed:</p>
<pre>
$ regionset
regionset version 0.1 -- reads/sets region code on DVD drives
Current Region Code settings:
RPC Phase: II
type: SET
vendor resets available: 4
user controlled changes resets available: 3
drive plays discs from region(s): 4, mask=0xF7
</pre>
<p>So I now have an Australian DVD drive, which can play my Australian DVD. (My reset count has dropped by two because of my inability to type the number 4 on the first attempt.) I tried a few of my DVDs from other regions, and they still played just fine, so all is well. Or is it? As well as my main desktop machine, I sometimes watch DVDs on my laptop, as well as my work laptop when I&#8217;m travelling. Do I have to go through all this to play People Like Us on those machines too?</p>
<p>From previous encounters with libdvdcss, I knew that it kept its decrypted DVD keys cached in my home directory, ~/.dvdcss. I wondered if I could simply copy the cached key for the People Like Us DVD onto my other machines. I had a look in the cache directory, and found the sub-directory for People Like Us. Luckily, most DVDs are easily identifiable:</p>
<pre>
...
MY_NAME_IS_EARL_S1_DISC_4-2006090710551600-1bf2fbef18
MY_NAME_IS_EARL_SEASON2_DISC3
MY_NAME_IS_EARL_SEASON2_DISC4
PEOPLE_LIKE_US_SERIES2-2007081517503500-19deac38e6
PHOENIX_NIGHTS
POLICE_SQUAD
PORRIDGE
...
</pre>
<p>I copied the PEOPLE_LIKE_US directory to a thumb drive, and took it to my laptop. Having confirmed that this machine couldn&#8217;t play the DVD either, I installed the copied keys into the ~/.dvdcss directory and tried again. Voilà! Instant entertainment from Australia, and I still have all my region changes intact.</p>
<p>In summary, then: if you find a DVD that takes ages to start playing, and doesn&#8217;t fully work, the chances are that your DVD is set to the wrong (or no) region. Use the regionset tool to set your DVD drive&#8217;s region, or find someone who&#8217;s already watched the DVD, and ask them for a copy of the decryption keys.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.squaregoldfish.co.uk/2010/01/08/dvds-that-wont-play-in-linux-and-how-to-make-them-behave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting your numpad working again</title>
		<link>http://www.squaregoldfish.co.uk/2009/12/29/getting-your-numpad-working-again/</link>
		<comments>http://www.squaregoldfish.co.uk/2009/12/29/getting-your-numpad-working-again/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 13:41:40 +0000</pubDate>
		<dc:creator>squaregoldfish</dc:creator>
				<category><![CDATA[Linux/Ubuntu]]></category>

		<guid isPermaLink="false">http://squaregoldfishlocal/?p=11</guid>
		<description><![CDATA[Recently, I discovered that the number pad wasn&#8217;t working on my keyboard. No matter what I tried, I couldn&#8217;t get any of the keys to work &#8211; the Num Lock key changed nothing. Having freaked out for a while (had I poured a pint of water into the number pad without noticing?), I started searching [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I discovered that the number pad wasn&#8217;t working on my keyboard. No matter what I tried, I couldn&#8217;t get any of the keys to work &#8211; the Num Lock key changed nothing. Having freaked out for a while (had I poured a pint of water into the number pad without noticing?), I started searching through the control panel for things that may be relevant.</p>
<p>It turns out that Ubuntu had got itself into Mouse Keys mode, whereby the numpad keys can be used to move the mouse pointer. This handy accessibility option is activated by pressing Shift+NumLock, and it seems I inadvertently pressed it at some point. It&#8217;s a simple toggle, so pressing Shift+NumLock got me my number pad back again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.squaregoldfish.co.uk/2009/12/29/getting-your-numpad-working-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
