<?xml version="1.0"?>

<rss version="2.0">
  <channel>
    <title>Andrew Cowie</title>
    <link>http://research.operationaldynamics.com/blogs/andrew/software/gentoo-linux/</link>
    <description>Blog postings by Andrew Cowie about Open Source and Software Development</description>
    <language>en</language>
    <copyright>Copyright (c) 2008 Operational Dynamics Consulting Pty Ltd. All rights reserved. Not for redistribution or attribution without permission in writing.</copyright>

    <image>
      <url>http://research.operationaldynamics.com/images/andrew_Hackergotchi.png</url>
      <title>Operational Dynamics Research</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/gentoo-linux/</link>
      <width>80</width>
      <height>86</height>
    </image>

    <lastBuildDate>Tue, 18 Nov 2008 01:36:00 GMT</lastBuildDate>

    <item>
      <title>Wine your own business</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/gentoo-linux/wine-locale.html</link>
      <description><![CDATA[<p>The things that drive you crazy&#8230;</p>

<p>There&#8217;s one (and only one) legacy Windows application that we have. We used to run it in VMware, which worked, but that was a pain, looked terrible, and of course was required us to have our copy of Windows 2000 installed there. Decrepit. But far worse, meant we had to <em>use</em> Windows. Yuk. And worst of all to have to keep switching in and out of it. Bah.</p>

<p>Life would be far better if we could run it on Linux under Wine &#8212; then it&#8217;d just be another app on running on the GNOME desktop and under the control of the window manager. We&#8217;d tried seeing if we could get this application to run in Wine a few times over the years; no joy. But somewhere along the line it started noticing list posts from other people reporting positive experiences. So {shrug} I gave it another try this month, and to my intense pleasure it installed cleanly and is running fine. Terrific! The people who hack on Wine are amazing.</p>

<p>So I started working away, only to suddenly realize that the dates were in American <code>mm/dd/yy</code> format. Gah. More searching, but none of the workarounds suggested (mostly to do with manually changing things with Wine&#8217;s <code>regedit</code>) seemed to work. Quote a pain.</p>

<p>I had come across a number of references saying that Wine and in turn the program in question would pick up the locale settings provided by your environment. I&#8217;d checked that, and tried various combinations. Nothing seemed to work.</p>

<p>I mostly run in <code>en_CA</code>, ie:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ echo $LANG
en_CA.UTF-8
$
</pre>

<p>the impact of which you can see by running the <code>locale</code> command:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ locale
LANG=en_CA.UTF-8
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME=en_DK.UTF-8
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER=en_AU.UTF-8
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=
$
</pre>

<p>all as one would expect And yet it had no impact on running the program running under Wine [Setting <code>LC_TIME</code> to <code>en_DK</code> is an old trick for people in <code>en</code> locales to get <a href="http://www.cl.cam.ac.uk/~mgk25/iso-time.html">proper</a> 24-hour time formatting; yes, I tried unsetting <code>LC_TIME</code>; I tried dropping the <code>UTF-8</code> settings; I tried <code>LANG=en_AU</code>. Nothing made any difference].</p>

<p>After a lot more frustration searching around, I finally came across a support <a href="http://www.codeweavers.com/support/tickets/browse/?ticket_id=99183;list=6;ticket_level=3;tscurPos=900">article</a> on CodeWeaver&#8217;s website that mentioned setting the locale environment variables. <em>Yes yes</em>, I thought, but then I looked more closely. They were setting <strong><code>LC_ALL</code></strong>. Wait a minute. <code>LC_ALL</code> is a special variable that &#8220;if  set  to a non-empty string value, override the values of all the other internationalization variables.&#8221; You&#8217;re not supposed to set that&#8230; certainly one doesn&#8217;t set that at login &#8212; that&#8217;s what <code>LANG</code> is for. I didn&#8217;t really expect anything to come of it, but I tried it anyway:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ env LC_ALL=en_CA.UTF-8 WINEPREFIX="/home/andrew/.wine" wine "C:\Premier12\Myobp.exe"
</pre>

<p>and <strong>ta-da</strong> everything worked: I had <code>dd/mm/yy</code> date formatting just like we wanted. Yeay!</p>

<p><em>I immediately closed everything down and went out for a beer. Sometimes we forget to celebrate those brief moments when things actually work.</em></p>

<p>But talk about bitterness. I&#8217;m not sure if this was a Wine behaviour, a Windows behaviour, or just nonsense code in MYOB. I suspect the latter. But either way, I saw so many posts asking &#8220;how can I get the date format to behave under Wine&#8221; that I thought I should write about the workaround that did it for us.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/gentoo-linux</category>
      <pubDate>Mon, 29 Sep 2008 05:24:00 GMT</pubDate>
      <guid isPermaLink="false">wine-locale</guid>
    </item>

    <item>
      <title>Desktop beautification: fix your fonts</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/gentoo-linux/desktop-fonts.html</link>
      <description><![CDATA[<p><em>One of the nice things about Gentoo Linux is that they tend to leave the upstream defaults alone. This applies to file system locations, build configurations, but also things like preferences across the GNOME Desktop. This is good, in that Gentoo users see the raw upstream, but not entirely optimal in cases where those defaults aren&#8217;t as good as they could be or are too generic.</em></p>

<p><em>I was pairing with a colleague the other day and they were impressed with how I had things set up &#8212; and more to the point my rationales for having done so &#8212; and they encouraged me to write about it.</em></p>

<p><em>I don&#8217;t particularly think I have anything original or novel to say, but in so far as some of us have built up configurations over the years that (for ourselves, at least) improve usability and which define our productivity, I think it&#8217;ll be a nice contribution to show others what we&#8217;re using and how we got things that way. If <strong>you</strong> think you know what you&#8217;re doing, then I encourage you to write about your customizations &#8212; and why you made them. People using commercial distros like Ubuntu and Fedora will justly be able to say &#8220;it already looks good&#8221; and so if you&#8217;re happy you can ignore this, but even in such environments we still often tighten things up to individual taste and so I&#8217;m sure you have something to offer.</em></p>

<p><em>Anyway, thus begins an occasional series about things I&#8217;ve done to beautify my GNOME Desktop on our Gentoo Linux systems.</em></p>

<p>A few years back I was enjoying a drink with Carl Worth and Keith Packard (free desktop graphics hackers extraordinaire, for those who haven&#8217;t met them). Later in the evening Keith leaned over, saw my laptop&#8217;s screen, and starting swearing at me: &#8220;You need to fix your fonts!&#8221; (I was using Luxi or something). So, ok, what do you want me to do? They told me to switch to the Bitstream Vera family as being well sculpted, highly professional, and optimized for screen display. Needless to say I take what these gentlemen say extremely seriously, so did what I was told <code>:)</code>.</p>

<p>Like any font or appearances change, for the first day or so it felt a bit odd, but then something shifted and it felt very <em>comfortable</em>. The real give-away that I was on the right track was a few days later when I tried switching back to the old font for the hell of it and recoiled in horror &#8220;Gawd that&#8217;s ugly!&#8221; </p>

<p>Bitstream Vera had done me well for quite some time, but recently I started running into some subtle bugs. One showed up with the weather applet; for whatever reason a few versions ago they changed the string from &#8216;&deg;&#8217; + &#8216;C&#8217; to unicode character <code>0x2103</code>, the symbol for degrees Celsius. I was getting a weird fall back to some horrible looking old bit-mapped font. Yikes (if &deg;C and <span style="font-family:'New Century Schoolbook','Courier 10'">&#8451;</span> don&#8217;t look about the same then you&#8217;ll see what I mean). No big deal, but it was annoying me.</p>

<p>So I was checking around again to see if there was a different font family I should be using, when I came across the <a href="http://dejavu.sourceforge.net/wiki/index.php/Main_Page">DejaVu</a>. It starts from Bitstream Vera (so the base ASCII characters are all the same and mostly untouched) but adds a ton of hinting corrections, bug fixes, and extensions up in the higher unicode sequences needed by European languages and scientific work. There are also a number of additional faces available. And regular releases (always a good sign). And a different name, per the Bitstream licence terms. When I asked about DejaVu in <code>#gnome-hackers</code>, the answer was &#8220;hell yes you should be using it.&#8221; Huh. So I switched!</p>

<p>The DejaVu fonts are available on Gentoo in the <code>media-fonts/dejavu</code> package.</p>

<p>The &#8220;right&#8221; way to change the font globally would be to change the &#8220;Sans&#8221; and &#8220;Serif&#8221; and &#8220;Monospace&#8221; aliases in the fontconfig setup in <code>/etc/fonts</code>. But I generally try to leave those files alone, so instead ran <code>gnome-appearance-properties</code> and from the Font tab changed the system fonts to be what I wanted.</p>

<p><img src="/blogs/andrew/software/gentoo-linux/AppearancePreferences.png" alt="Appearance Preferences" title=""/></p>

<p>Immediately it fixed my glitch with the weather applet (yeay), but I started to notice anything using the higher order mathematical symbols was likewise drastically improved. Hurrah!</p>

<p>With <code>gnome-font-viewer</code>,</p>

<p><img src="/blogs/andrew/software/gentoo-linux/FontViewer_DejaVuSansMono.png" alt="DejaVu Sans Mono, Book" title=""/>
<img src="/blogs/andrew/software/gentoo-linux/FontViewer_DejaVuSerifItalic.png" alt="DejaVu Serif, Italic" title=""/></p>

<p><em>Making screenshots of what they look like on my screen is a bit silly because they won&#8217;t necessarily look the same on your screen. But hey. We do our best.</em></p>

<p>Open Source is about choice, and so I cannot talk about fonts without also mentioning the <a href="https://www.redhat.com/promo/fonts/">Liberation</a> font family. These were obtained by Red Hat and intended as a drop-in replacement for the Microsoft core fonts (Courier New, Arial, etc) which are widely used but not libre. For whatever reason the Liberation fonts don&#8217;t look quite right on my screen (there are red and green hinting glitches around the glyphs; something is obviously misconfigured somewhere) but it&#8217;s a different free font that has been generously made available to the community. They&#8217;re available on Gentoo in the <code>media-fonts/liberation-fonts-ttf</code> package.</p>

<p>AfC</p>

<p>Update:</p>

<ol>
<li>So it turns out that DejaVu <em>is</em> set to be the default on Gentoo, but they&#8217;ve got a bug whereby they&#8217;ve got their ordering wrong: if you also have Bitstream Vera installed it gets picked up for Sans in preference. The folks in <code>#gentoo-desktop</code> say they&#8217;re going to fix that. (This is only relevant if you have the <code>x11-base/xorg-x11</code> meta package installed; it pulls in <code>media-fonts/ttf-bitstream-vera</code>. If you only have the lower level <code>x11-base/xorg-server</code> package installed you can manually install <code>media-fonts/dejavu</code> [only] and then the default aliases will be to DejaVu). Anyway, the real point of this article was about being aware that you can have control of your fonts, so all good.</li>
</ol>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/gentoo-linux</category>
      <pubDate>Thu, 11 Sep 2008 10:01:00 GMT</pubDate>
      <guid isPermaLink="false">desktop-fonts</guid>
    </item>

    <item>
      <title>Upgraded!</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/gentoo-linux/gnome-2.22-upgrade.html</link>
      <description><![CDATA[<p><center></p>

<table>
<tr>
<td style="text-align: center;">
<a href="http://www.gnome.org/"><img alt="GNOME logo" src="http://research.operationaldynamics.com/blogs/andrew/software/gnome-desktop/GNOME.png" width="140" height="149" border="0"/></a>
</td>
<td>&nbsp;</td>
<td style="text-align: center;">
<a href="http://www.gentoo.org/"><img alt="Gentoo logo" src="http://upload.wikimedia.org/wikipedia/en/a/a0/Glogo-small.png" width="140" height="149" border="0"/></a>
</td>
</tr>
<tr>
<td style="text-align: center; font-size: x-large; font-family: 'Bitstream Vera Sans Mono', monospaced;">
#gnome-hackers
</td>
<td style="width: 30px;">&nbsp;</td>
<td style="text-align: center; font-size: x-large; font-family: 'Bitstream Vera Sans Mono', monospaced;">
#gentoo-desktop
</td>
</table>

<p></center></p>

<p>The upgrade to GNOME 2.22 went <em>really</em> smoothly. Well done to the Gentoo Linux desktop team for their heroic efforts bumping so many <code>.ebuilds</code>, and congratulations to all the GNOME hackers, testers and translators around the world on what continues to be superb software!</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/gentoo-linux</category>
      <pubDate>Fri, 04 Apr 2008 11:12:00 GMT</pubDate>
      <guid isPermaLink="false">gnome-2.22-upgrade</guid>
    </item>

    <item>
      <title>Bootstrapping Gentoo Linux on a new laptop with a LiveUSB key &#8230; with an ext2 filesystem!</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/gentoo-linux/usb-bootstrap.html</link>
      <description><![CDATA[<p>Been looking for a new laptop for a while now, and I found what appears to be a good one from ASUS (an &#8220;A8S&#8221;; Core 2 Duo T7100 chip with nice new 800MHz front side bus, an NVidia 8400M G as the graphics chip, 802.11a,b,g,n (what the hell is <em>n</em>?) wireless and bluetooth, and a nice glosy 1280x800 WXGA screen). Not only are the specs nice, and I found it at an awesome price (in <em>London</em>, would you believe?). Sweet!</p>

<p>But as I wasn&#8217;t expecting to be buying a new laptop, I wasn&#8217;t carrying any install CDs &#8212; and being on the road have no way to burn one. I know I&#8217;ll be around lots of hackers this week at GUADEC, but when you&#8217;ve got a brand new laptop, who wants to be patient? <code>:)</code> </p>

<p>I do have a small 256 MB usb key with me, though. So on a whim, I thought I&#8217;d see if I could bootstrap the laptop that way. None of the guys at the Gentoo conference I was at Saturday had heard of anyone doing it, but we thought it might be possible.</p>

<p>More than possible: it didn&#8217;t take me very long to come across an unofficial page in the online Gentoo documentation about <a href="http://www.gentoo.org/doc/en/liveusb.xml">boostrapping a Gentoo install from a LiveUSB</a>. Sweet!</p>

<p>They talked about doing it from a CD sized image on the stick, but I didn&#8217;t have room for that. Gentoo also has a &#8220;minimal&#8221; install image which is only 57 MB or so (which you can use if you&#8217;ve got good net access); apparently the current release&#8217;s minimal installer is missing a needed kernel module for the root filesystem to mount &#8212; something to do with FAT codepages, whatever those are (and certainly no reason that Gentoo&#8217;s minimal bootstrap media would have it). Bummer. </p>

<p>The workaround is to use a much older release, but the point was to verify that the laptop I&#8217;d just bought would actually work with Linux, and that sorta implied using a really current kernel etc. </p>

<p>So me being stubborn, I tried it anyway.</p>

<p>Off I went following the brief LiveUSB instructions to put <code>install-x86-minimal-2007.0-r1.iso</code> onto my usbkey. You have to muck around for a minute or so to switch it from <code>isolinux</code> to <code>syslinux</code>, but no big deal. Then 2 seconds to fix the BIOS boot order, and wow! The <code>syslinux</code> bootloader came up. So cool. Predictably enough, however, I hit the bug and the root filesystem wouldn&#8217;t boot. Oh well.</p>

<p>Then I had a bit of a brainwave and thought, &#8220;well, if FAT16 is the problem, what about just using a real Linux filesystem instead?&#8221; So I went through the steps again, this time just whacking <code>ext2</code> onto the usbkey (as I normally have there). But when I went to run <code>syslinux</code> to install the bootloader onto the usb key, it failed saying that the target wasn&#8217;t a FAT filesystem. &#8220;Ah&#8221;, I say. So <em>that&#8217;s</em> what the difference between <code>isolinux</code> and <code>syslinux</code> is. Oh well.</p>

<p>What I needed, obviously, was a bootloader that would work for a USB key with an <code>ext2</code> filesystem. I did a brief search, and suddenly came across something rather new called <a href="http://syslinux.zytor.com/extlinux.php"><code>extlinux</code></a>, from the same person who (it turns out) does all the <code>*linux</code> bootloaders.</p>

<p><code>extlinux</code>? That sounds promising&#8230; and ta-da, it worked!</p>

<pre><code>    livecd ~ #
</code></pre>

<p>Awesome!</p>

<p>At the moment bootstrapping from USB is not supported by the Gentoo Release engineers, but maybe the fact that you don&#8217;t have to mess around with foreign filesystems will change their minds. A usbkey is, after all, a lot easier for users to &#8220;burn&#8221; than a CD is, and 1 GB usb devices are suprisingly affordable these days.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/gentoo-linux</category>
      <pubDate>Mon, 16 Jul 2007 09:44:00 GMT</pubDate>
      <guid isPermaLink="false">usb-bootstrap</guid>
    </item>


  </channel>
</rss>
