<?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>Adrian's Thoughts &#187; Tech</title>
	<atom:link href="http://blog.frith.co.za/category/technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.frith.co.za</link>
	<description>Ramblings about life, university, mathematics, computing, Linux, open source, etc.</description>
	<lastBuildDate>Thu, 19 Mar 2009 10:23:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ubuntu on an HP Compaq dx2300 Microtower</title>
		<link>http://blog.frith.co.za/2009/03/19/ubuntu-on-an-hp-compaq-dx2300-microtower/</link>
		<comments>http://blog.frith.co.za/2009/03/19/ubuntu-on-an-hp-compaq-dx2300-microtower/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 10:23:21 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[Compaq]]></category>
		<category><![CDATA[dx2300]]></category>
		<category><![CDATA[HP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microtower]]></category>
		<category><![CDATA[soundcard]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/?p=77</guid>
		<description><![CDATA[My new desktop at varsity is, as described in the title, an HP Compaq dx2300 Microtower. First thing I did when I got access to it was, of course, to install Linux &#8211; Ubuntu 8.10 in this case. It&#8217;s a pretty nice machine (although not particularly high-spec) and pretty much everything worked straight away from [...]]]></description>
			<content:encoded><![CDATA[<p>My new desktop at varsity is, as described in the title, an HP Compaq dx2300 Microtower. First thing I did when I got access to it was, of course, to install Linux &#8211; Ubuntu 8.10 in this case. It&#8217;s a pretty nice machine (although not particularly high-spec) and pretty much everything worked straight away from install. The graphics card is Intel, so I&#8217;m not going to be doing any serious gameplaying (<em>this is a work computer, anyway</em>) but it runs Compiz pretty well. Being a desktop, suspend and hibernate aren&#8217;t terribly important, but as it happens they work fine.</p>
<p>The only problem &#8211; and this is the main point of this post &#8211; was with the soundcard (an Intel HDA). The box has three audio outputs: headphone plugs front and back, and a tinny built-in speaker. Under Ubuntu all three outputs were switched on all the time, and it wasn&#8217;t possible to adjust them separately. The purpose of headphones in a shared lab environment is entirely defeated if the built-in speaker is always on! I tried fiddling with all of the multitude of ALSA settings, but nothing worked. It couldn&#8217;t have been a hardware problem, because it did the right thing under Windows.</p>
<p>So, the problem was narrowed down to the audio driver, <code>snd-hda-intel</code> to be specific. Some googling established that changing the <code>model</code> parameter to the module might have some effect on the output selection behaviour. Further searching established that the possible values are listed in <code><a href="http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt">Documentation/sound/alsa/HD-Audio-Models.txt</a></code> in the kernel source.</p>
<p>To find out what the possible values are, you have to know which codec your card uses. This you can do by running </p>
<blockquote><p><code>cat /proc/asound/card0/codec#0 | grep Codec</code></p></blockquote>
<p>For the dx2300 the result was <code>Realtek ALC888</code>. Indeed, under the list of models for the ALC888, there is one called &#8220;<code>3stack-hp</code>&#8221; for &#8220;HP machines with 3stack&#8221;. Guessing that this was the correct one, I added to <code>/etc/modprobe.d/alsa-base</code> the line </p>
<blockquote><p><code>options snd-hda-intel model=3stack-hp</code></p></blockquote>
<p> and rebooted. Hey presto, suddenly the internal speaker switches off when headphones are plugged in.</p>
<p>tl;dr summary: If you have a dx2300 and you&#8217;re having problems with the audio under Linux, then add the line <code>options snd-hda-intel model=3stack-hp</code> to the file <code>/etc/modprobe.d/alsa-base</code> (at least in Ubuntu; your distro might put module options in a different file).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2009/03/19/ubuntu-on-an-hp-compaq-dx2300-microtower/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Whois-related irritation</title>
		<link>http://blog.frith.co.za/2009/01/13/whois-related-irritation/</link>
		<comments>http://blog.frith.co.za/2009/01/13/whois-related-irritation/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 21:56:05 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/?p=66</guid>
		<description><![CDATA[Responsibility for the African IP ranges was transferred to AfriNIC what, four years ago, right? So why is it that some services that use the whois data still ignore the AfricNIC whois data? The result of this is that they believe that all African IP addresses are in Mauritius. If you&#8217;re on a South African [...]]]></description>
			<content:encoded><![CDATA[<p>Responsibility for the African IP ranges was transferred to AfriNIC what, four years ago, right? So why is it that some services that use the whois data still ignore the AfricNIC whois data? The result of this is that they believe that all African IP addresses are in Mauritius. If you&#8217;re on a South African IP, you can see this with, for example, the WhatsMyIP.org service by going to <a href="http://www.whatsmyip.org/more/">http://www.whatsmyip.org/more/</a> and looking at the &#8220;Whois Lookup&#8221; information.</p>
<p>Also, Netcraft should really know better. Check out <a href="http://toolbar.netcraft.com/site_report?url=http://www.uct.ac.za">the Netcraft information for the UCT website</a>. It&#8217;s not like this information hasn&#8217;t been around for a while; all the open-source <code>whois</code> tools started using the AfriNIC server long ago. (I myself submitted the <a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=80421&#038;cat=">bug and patch for FreeBSD</a>.) So really, they need to get with the program.</p>
<p><em><strong>Update:</strong> I may have maligned Netcraft unfairly. Although they get the UCT information wrong, most SA sites do show up correctly. <a href="http://toolbar.netcraft.com/site_report?url=http://www.saix.net">SAIX, for example.</a> I&#8217;ve sent them a bug report.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2009/01/13/whois-related-irritation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HSDPA modem and custom routing</title>
		<link>http://blog.frith.co.za/2009/01/13/hsdpa-modem-and-custom-routing/</link>
		<comments>http://blog.frith.co.za/2009/01/13/hsdpa-modem-and-custom-routing/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 21:40:24 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[hsdpa]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[UCT]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/?p=58</guid>
		<description><![CDATA[So, for my Christmas present to myself I got a Huawei E220 HSDPA modem &#8211; it&#8217;s one of the Vodafone-branded ones, but I reflashed it with the generic firmware. Anyway, it&#8217;s an awesome thing to have for a geek like me &#8211; I can be connected to the Internet at broadband speeds almost anywhere in [...]]]></description>
			<content:encoded><![CDATA[<p>So, for my Christmas present to myself I got a <a href="http://en.wikipedia.org/wiki/Huawei_E220">Huawei E220</a> HSDPA modem &#8211; it&#8217;s one of the Vodafone-branded ones, but I reflashed it with the generic firmware. Anyway, it&#8217;s an awesome thing to have for a geek like me &#8211; I can be connected to the Internet at broadband speeds almost anywhere in the city. It&#8217;s particularly useful when i&#8217;m on campus, so I can avoid the dog-slow UCT internet connection.</p>
<p>Problem is, I&#8217;d like to stay connected to the UCT network as well so that I don&#8217;t use up my precious* data bundle for UCT services, and this requires a bit of custom routing magic. So I have a script:</p>
<p><code>#!/bin/sh<br />
GATEWAY=137.158.32.97<br />
route add -net 137.158.0.0/16 gw $GATEWAY<br />
route add -net 192.48.253.0/24 gw $GATEWAY<br />
route del default<br />
route add default ppp0</code></p>
<p>137.158.0.0/16 and 192.48.253.0/24 are the UCT netblocks, and 137.158.32.97 is the router on the subnet that I&#8217;m mostly using at the moment. ppp0 is, of course, the name of the interface associated with the HSDPA connection.</p>
<p>The problems with this script currently are that I have to edit it to change the gateway for each subnet that I&#8217;m on, that I have to run it manually each time I connect, and that it doesn&#8217;t restore the original routing when I disconnect. The first and third problems should be reasonably easy to solve, but the second will probably require that I dig into the mysterious world of NetworkManager. <em>(Cue dramatic music.)</em></p>
<p><small>*It&#8217;s ourssss, my preciousss&#8230; they wants to take it from us, the nasssty Vodacom&#8230;</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2009/01/13/hsdpa-modem-and-custom-routing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Blog resurrection</title>
		<link>http://blog.frith.co.za/2008/12/09/blog-resurrection/</link>
		<comments>http://blog.frith.co.za/2008/12/09/blog-resurrection/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 11:46:23 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/?p=39</guid>
		<description><![CDATA[OK, so I&#8217;ve rather neglected this blog for the last few months. In my defense, I can offer that I was finishing my Honours degree, including the notoriously timeconsuming major project. But that is now over (thank heavens) and I am free at last. (Shout it from the rooftops!) So hopefully I will have a [...]]]></description>
			<content:encoded><![CDATA[<p>OK, so I&#8217;ve rather neglected this blog for the last few months. In my defense, I can offer that I was finishing my Honours degree, including the notoriously timeconsuming major project. But that is now over (thank heavens) and I am free at last. (Shout it from the rooftops!) So hopefully I will have a little more time to spend on leisure activities like blogging.</p>
<p>I&#8217;ve also found the time to finally upgrade the Wordpress install that runs this blog. (It was still at 2.3.3, and the current is 2.6.5!) As you will notice, I&#8217;ve also returned to the default Wordpress theme. I know it&#8217;s boring, but it actually looks fine and it works well enough.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2008/12/09/blog-resurrection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressed with Telkom</title>
		<link>http://blog.frith.co.za/2008/07/08/impressed-with-telkom/</link>
		<comments>http://blog.frith.co.za/2008/07/08/impressed-with-telkom/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 14:34:49 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[Telkom]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/2008/07/08/impressed-with-telkom/</guid>
		<description><![CDATA[We South Africans complain frequently about Telkom and the level of service it provides; and mostly the complaints are justified. But it is only fair that, when Telkom provides good service, we should also take note of it.
My phone and DSL line started having issues about a week ago, and it was becoming progressively worse: [...]]]></description>
			<content:encoded><![CDATA[<p>We South Africans complain frequently about Telkom and the level of service it provides; and mostly the complaints are justified. But it is only fair that, when Telkom provides good service, we should also take note of it.</p>
<p>My phone and DSL line started having issues about a week ago, and it was becoming progressively worse: there was heavy crackle on the voice circuit, and the DSL line was showing about 20% packet loss. On Thursday evening I reported the problem through the <a href="https://secure1.telkom.co.za/cabletheft/">fault reporting website</a>.</p>
<p>Early this morning they phoned me and informed me that the technician would be able to visit later today, and he did indeed arrive at about 11. Because of the nature of the problem &#8211; an issue with the lines between my building and the distribution box &#8211; he had to travel back and forth a few times between my flat and the box on Main Road, so the process did take a while. Nonetheless, throughout the experience he was friendly, efficient, and competent.</p>
<p>I should mention in particular that at no point did I have to deal with the notorious callcenters and the interminable on-hold music. I didn&#8217;t have to spend any of my cell-phone minutes waiting for someone to take note of my problem. All I had to do was fill out the form on the website, and wait for them to get back to me &#8211; which only took two working days.</p>
<p>This is a marked contrast from my experience two years ago with my parents&#8217; broken phone line, where it took five days and many hours on the phone to get the DSL and line repairs departments to agree on who was responsible for fixing the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2008/07/08/impressed-with-telkom/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Load shedding bot FAQs</title>
		<link>http://blog.frith.co.za/2008/04/17/load-shedding-bot-faqs/</link>
		<comments>http://blog.frith.co.za/2008/04/17/load-shedding-bot-faqs/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 18:58:28 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[load shedding]]></category>
		<category><![CDATA[loadshed]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/2008/04/17/load-shedding-bot-faqs/</guid>
		<description><![CDATA[Since posting about my Jabber load shedding warnings bot I&#8217;ve had a couple of questions asked about it. So here are the answers:
Where does the data come from?
The City of Cape Town has posted on the web the load shedding timetable as an Excel spreadsheet. I do a bit of manual manipulation on the spreadsheet [...]]]></description>
			<content:encoded><![CDATA[<p>Since posting about <a href="http://blog.frith.co.za/2008/04/12/get-load-shedding-warnings-via-jabber/">my Jabber load shedding warnings bot</a> I&#8217;ve had a couple of questions asked about it. So here are the answers:</p>
<p><strong>Where does the data come from?</strong><br />
The City of Cape Town has posted on the web the <a href="http://web.capetown.gov.za/eDocuments/Load_shedding_Apr_08_schedule_1442008113213_.xls">load shedding timetable as an Excel spreadsheet</a>. I do a bit of manual manipulation on the spreadsheet before dumping it to a CSV file. Then I have a script which parses the CSV file and generates a SQLite database.</p>
<p><strong>What&#8217;s the bot coded in?</strong><br />
Python. (<a href="http://www.xkcd.com/353/">Of course.</a>) It uses the <a href="http://xmpppy.sourceforge.net/">xmpppy</a> module to do the Jabber communication, and <a href="http://www.sqlobject.org/">SQLObject</a> for the database.</p>
<p><strong>How does it work?</strong><br />
The bot is actually made up of two separate components. There is a control daemon that is always available on Jabber, which accepts subscriptions and responds to your commands. Then there is a queuerunner fired by <code>cron</code> at the appropriate times, which sends the warning messages; it uses a negative Jabber priority, so your messages to the control daemon will never go to the queuerunner by accident.</p>
<p><strong>How many users do you have?</strong><br />
As of 18 April, there are 20 users. The average user subscribes to warnings for two different locations.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2008/04/17/load-shedding-bot-faqs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get load shedding warnings via Jabber</title>
		<link>http://blog.frith.co.za/2008/04/12/get-load-shedding-warnings-via-jabber/</link>
		<comments>http://blog.frith.co.za/2008/04/12/get-load-shedding-warnings-via-jabber/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 17:49:27 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[Jabber]]></category>
		<category><![CDATA[load shedding]]></category>
		<category><![CDATA[loadshed]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/2008/04/12/get-load-shedding-warnings-via-jabber/</guid>
		<description><![CDATA[Tired of having the power go out without warning? Now you can get warnings about predictable load-shedding sent to the Jabber account of your choice &#8211; including Google Talk accounts. Unfortunately, at the moment the warnings are for the City of Cape Town supply area only.
To set it up, ask your Jabber client to subscribe [...]]]></description>
			<content:encoded><![CDATA[<p>Tired of having the power go out without warning? Now you can get warnings about predictable load-shedding sent to the Jabber account of your choice &#8211; including Google Talk accounts. Unfortunately, at the moment the warnings are for the City of Cape Town supply area only.</p>
<p>To set it up, ask your Jabber client to subscribe to <code>loadshed@frith.co.za</code> &#8211; in Pidgin that&#8217;s the &#8220;Add Buddy&#8221; command, in GMail it&#8217;s &#8220;Invite to chat&#8221;. The loadshed bot will accept your subscription, and reciprocate with a subscription request to you. When you accept it, the bot will send you instructions about how to proceed.</p>
<p>You can search the list of suburbs by sending the message &#8220;search [text]&#8220;, which will give you a list of suburbs in the City Council&#8217;s list with a name matching &#8220;[text]&#8220;. Then you can subscribe to warnings for a suburb with &#8220;subscribe [number]&#8220;, where [number] is the number that was listed next to the suburb in the search results. There&#8217;s also a &#8220;list&#8221; command which shows what susburbs you&#8217;re subscribed to; and &#8220;unsubscribe [number]&#8221; which works in the same way as &#8220;subscribe&#8221;.</p>
<p>The bot will send you warnings 15, 10, 5, and 2 minutes before the load shedding period is scheduled to start. A planned future development is to make the warning times configurable.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2008/04/12/get-load-shedding-warnings-via-jabber/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>XRandR &#8211; finally, simple monitor configuration for Linux</title>
		<link>http://blog.frith.co.za/2007/12/06/xrandr-finally-simple-monitor-configuration-for-linux/</link>
		<comments>http://blog.frith.co.za/2007/12/06/xrandr-finally-simple-monitor-configuration-for-linux/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 00:05:00 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[X]]></category>
		<category><![CDATA[xrandr]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/2007/12/06/xrandr-finally-simple-monitor-configuration-for-linux/</guid>
		<description><![CDATA[The most recent Linux distribution releases &#8211; Ubuntu 7.10, Fedora 8 and so on &#8211; are now shipping with version 1.2 of the XRandR extension for the X server. This allows the user to dynamically change resolutions, refresh rates, and &#8211; this is the really impressive thing &#8211; switch monitors on and off on the [...]]]></description>
			<content:encoded><![CDATA[<p>The most recent Linux distribution releases &#8211; Ubuntu 7.10, Fedora 8 and so on &#8211; are now shipping with version 1.2 of <a href="http://www.x.org/wiki/Projects/XRandR">the XRandR extension</a> for the X server. This allows the user to dynamically change resolutions, refresh rates, and &#8211; this is the really impressive thing &#8211; switch monitors on and off on the fly. All of this, without ever having to edit <code>xorg.conf</code>, or restart the X server, or reboot. This was one of the major things that the Linux desktop lacked compared to other major operating systems.</p>
<p>Until very recently, using my external monitor with my laptop required several irritating customisations &#8211; you can see the details in <a href="http://blog.frith.co.za/2006/12/17/ubuntu-widescreen-monitor-radeon-aiglx-beryl/">my earlier post</a>:</p>
<ol>
<li>To have it switch on, and run in Xinerama mode along with my laptop panel, required fiddling with MetaModes and other fiddly settings of the <code>radeon</code> driver.</li>
<li>To drive it at its native resoution (1440&#215;900) i had to add a custom modeline to <code>xorg.conf</code> (except on Fedora, for some reason).</li>
<li>If the X server originally started without the external monitor attached, then it would have to be restarted to detect the monitor once it was attached. And restarting X means having to log out and lose all my application state.</li>
</ol>
<p>XRandR 1.2 has removed all three of these irritations. It requires (almost) no preconfiguration, autodetects all resolutions correctly, and detects monitors when they are plugged in without a restart.</p>
<p>Let&#8217;s take a brief look at some of what XRandR can do: this is basically what I do with it daily. Note that at the moment graphical tools to control XRandR are still under development and none are really at a releaseable state (in my opinion); but now that the infrastructure exists in the X server and the drivers, tools to control it will come soon. What I use here is the command-line tool, sensibly named <code>xrandr</code>.<span id="more-25"></span></p>
<p>Let&#8217;s say I boot the computer without the external monitor plugged in. As you would expect, my desktop is automatically set to the native resolution of the laptop panel (in my case, 1024&#215;768). I can see what resolutions and refresh rates are available:</p>
<blockquote><p><code>$ <em>xrandr -q</em><br />
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2464 x 1024<br />
VGA-0 disconnected (normal left inverted right x axis y axis)<br />
DVI-0 disconnected (normal left inverted right x axis y axis)<br />
LVDS connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm<br />
&nbsp;&nbsp;&nbsp;1024x768       60.0*+   60.0<br />
&nbsp;&nbsp;&nbsp;800x600        60.3<br />
&nbsp;&nbsp;&nbsp;640x480        59.9<br />
S-video disconnected (normal left inverted right x axis y axis)</code></p></blockquote>
<p>This tells me that the only attached monitor is the laptop panel (called LVDS); that it can run at the three different resolutions listed, and at the refresh rates listed next to the resolutions. The &#8220;<code>*</code>&#8221; indicates the mode that is currently in use, and the &#8220;<code>+</code>&#8221; indicates which mode is preferred by the monitor.</p>
<p>If i wanted to, I could switch to some other resolution:</p>
<blockquote><p><code>$ <em>xrandr --output LVDS --mode 800x600</em></code></p></blockquote>
<p>But that looks horrible, so I switch back to the preferred resolution:</p>
<blockquote><p><code>$ <em>xrandr --output LVDS --auto</em></code></p></blockquote>
<p>Now everything&#8217;s back to normal. There are various rotation and reflection options as well, but I won&#8217;t discuss them because (a) they&#8217;re silly, and (b) you can look them up in the man page if you need them.</p>
<p>Here comes the interesting part. Now I plug in my external monitor. Nothing happens immediately; but if I run the query command, there&#8217;s some new information:</p>
<blockquote><p><code>$ <em>xrandr -q</em><br />
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2464 x 1024<br />
VGA-0 connected (normal left inverted right x axis y axis)<br />
&nbsp;&nbsp;&nbsp;1440x900       59.9 +   75.0     59.9<br />
&nbsp;&nbsp;&nbsp;1280x1024      75.0     59.9<br />
&nbsp;&nbsp;&nbsp;1280x960       74.9<br />
&nbsp;&nbsp;&nbsp;1360x765       59.8<br />
&nbsp;&nbsp;&nbsp;1152x864       74.8     60.0<br />
&nbsp;&nbsp;&nbsp;1024x768       75.1     70.1     65.7     60.0<br />
&nbsp;&nbsp;&nbsp;832x624        74.6<br />
&nbsp;&nbsp;&nbsp;800x600        72.2     75.0     60.3     56.2<br />
&nbsp;&nbsp;&nbsp;640x480        75.0     72.8     66.7     60.0<br />
&nbsp;&nbsp;&nbsp;720x400        70.1<br />
DVI-0 disconnected (normal left inverted right x axis y axis)<br />
LVDS connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm<br />
&nbsp;&nbsp;&nbsp;1024x768       60.0*+   60.0<br />
&nbsp;&nbsp;&nbsp;800x600        60.3<br />
&nbsp;&nbsp;&nbsp;640x480        59.9<br />
S-video disconnected (normal left inverted right x axis y axis)</code></p></blockquote>
<p>So I can now see all the modes supported by the external monitor (called VGA-0). I switch the monitor on:</p>
<blockquote><p><code>$ <em>xrandr --output VGA-0 --auto</em></code></p></blockquote>
<p>This switches on the monitor in a sort-of clone mode: the output from the laptop panel is duplicated on the external monitor; but because the external monitor is larger, it appears in the top left, and the desktop size expands to the size of the external monitor. (At the moment, GNOME doesn&#8217;t handle this too well, and the GNOME panel stays in the same place, meaning that it&#8217;s in the middle of what&#8217;s visible on the external monitor.) So now I can switch off the laptop panel:</p>
<blockquote><p><code>$ <em>xrandr --output LVDS --off</em></code></p></blockquote>
<p>(GNOME handles this correctly and moves the panel.)</p>
<p>Now, if you look at the query output above, you&#8217;ll see that the monitor claims that its preferred mode has a refresh rate of 59.9Hz, although it also supports a 75Hz mode at the same resolution. I find the latter mode more friendly on my eyes, so I switch to it:</p>
<blockquote><p><code>$ <em>xrandr --output VGA-0 --mode 1440x900 --rate 75.0</em></code></p></blockquote>
<p>I want to use the extra desktop space available on my laptop panel; but by default it would just be cloning the output of the external monitor, which wouldn&#8217;t help. So I use another option to position the outputs:</p>
<blockquote><p><code>$ <em>xrandr --output LVDS --auto --left-of VGA-0</em></code></p></blockquote>
<p>This places the panel to the left of the external monitor. There are corresponding <code>--right-of</code>, <code>--above</code> and <code>--below</code> options.</p>
<p>Finally, I want to switch off the external monitor so that I can take my laptop away from the desk:</p>
<blockquote><p><code>$ <em>xrandr --output VGA-0 --off</em></code></p></blockquote>
<p>Now I&#8217;m back where I started.</p>
<p>This is all very cool, but there are a couple of cautionary notes. The necessary drivers are only included in very recent distro releases (Ubuntu 7.10 and Fedora 8 in particular). Currently only the open-source Intel, Radeon and NV drivers support XRandR 1.2; neither the ATi nor the NVIDIA proprietary drivers support it. For now, you pretty much have to use the command-line tool &#8211; though that will change quickly. Finally, you sometimes have to set the <code>Virtual</code> option in <code>xorg.conf</code> to indicate the largest possible size of your desktop &#8211; but this is a one-off setting, and I hope that distros will start setting it to a sensible default automatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2007/12/06/xrandr-finally-simple-monitor-configuration-for-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Blog revamp</title>
		<link>http://blog.frith.co.za/2007/11/26/blog-revamp/</link>
		<comments>http://blog.frith.co.za/2007/11/26/blog-revamp/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 11:23:14 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/?p=24</guid>
		<description><![CDATA[I&#8217;ve upgraded the blog to the latest version of wordpress (2.3.1, I think) and changed the theme. I&#8217;ve also added the WP-OpenID plugin so you can now provide an OpenID identity while commenting, or associate an OpenID identity with your account and use it to log on. Also, the theme has changed.
In the process I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve upgraded the blog to the latest version of wordpress (2.3.1, I think) and changed the theme. I&#8217;ve also added the WP-OpenID plugin so you can now provide an <a href="http://openid.net/">OpenID</a> identity while commenting, or associate an OpenID identity with your account and use it to log on. Also, the theme has changed.</p>
<p>In the process I (through my own stupidity) lost the images that should appear in some of the posts. I think I have a backup at home, so they may or may not reappear later.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2007/11/26/blog-revamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCO is bankrupt</title>
		<link>http://blog.frith.co.za/2007/09/17/sco-is-bankrupt/</link>
		<comments>http://blog.frith.co.za/2007/09/17/sco-is-bankrupt/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 14:30:14 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[bankrupt]]></category>
		<category><![CDATA[Law]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SCO]]></category>

		<guid isPermaLink="false">http://blog.frith.co.za/?p=23</guid>
		<description><![CDATA[Well, not quite. Remember what I (along with half of the world &#8211; I&#8217;m not claiming any particular brilliance on my part) predicted a month ago? That SCO would file for Chapter 11 bankruptcy protection? Well, it&#8217;s happened. Hopefully we will soon be seeing the last gasps of SCO.
In other news: Microsoft loses anti-trust appeal. [...]]]></description>
			<content:encoded><![CDATA[<p>Well, not quite. Remember what I (along with half of the world &#8211; I&#8217;m not claiming any particular brilliance on my part) <a href="http://blog.frith.co.za/?p=22">predicted a month ago</a>? That SCO would file for Chapter 11 bankruptcy protection? Well, <a href="http://www.groklaw.net/article.php?story=20070914152904577">it&#8217;s happened</a>. Hopefully we will soon be seeing the last gasps of SCO.</p>
<p>In other news: <a href="http://news.bbc.co.uk/2/hi/business/6998272.stm">Microsoft loses anti-trust appeal</a>. All in all, a bad day for IP trolls and monopolists.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frith.co.za/2007/09/17/sco-is-bankrupt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
