Operational Dynamics
Research and Development   |   Projects   |   Blogs   |   Source Code   |   Linux
October
Mon Tue Wed Thu Fri Sat Sun
   
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

hackergotchi
This section:

Blog postings by Andrew Cowie about Open Source and Software Development

The syndication links at top left will give you a feed for the blog as a whole. If you'd like a feed specific to this sub-category, see bottom of page.

RSS 2.0 Atom 0.3 blogs > andrew > software > gentoo-linux

Sun, 05 Oct 2008

Wine your own business

The things that drive you crazy…

There’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 use Windows. Yuk. And worst of all to have to keep switching in and out of it. Bah.

Life would be far better if we could run it on Linux under Wine — then it’d just be another app on running on the GNOME desktop and under the control of the window manager. We’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.

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

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’d checked that, and tried various combinations. Nothing seemed to work.

I mostly run in en_CA, ie:

$ echo $LANG
en_CA.UTF-8
$

the impact of which you can see by running the locale command:

$ 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=
$

all as one would expect And yet it had no impact on running the program running under Wine [Setting LC_TIME to en_DK is an old trick for people in en locales to get proper 24-hour time formatting; yes, I tried unsetting LC_TIME; I tried dropping the UTF-8 settings; I tried LANG=en_AU. Nothing made any difference].

After a lot more frustration searching around, I finally came across a support article on CodeWeaver’s website that mentioned setting the locale environment variables. Yes yes, I thought, but then I looked more closely. They were setting LC_ALL. Wait a minute. LC_ALL is a special variable that “if set to a non-empty string value, override the values of all the other internationalization variables.” You’re not supposed to set that… certainly one doesn’t set that at login — that’s what LANG is for. I didn’t really expect anything to come of it, but I tried it anyway:

$ env LC_ALL=en_CA.UTF-8 WINEPREFIX="/home/andrew/.wine" wine "C:\Premier12\Myobp.exe"

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

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

But talk about bitterness. I’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 “how can I get the date format to behave under Wine” that I thought I should write about the workaround that did it for us.

AfC

Thu, 11 Sep 2008

Desktop beautification: fix your fonts

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’t as good as they could be or are too generic.

I was pairing with a colleague the other day and they were impressed with how I had things set up — and more to the point my rationales for having done so — and they encouraged me to write about it.

I don’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’ll be a nice contribution to show others what we’re using and how we got things that way. If you think you know what you’re doing, then I encourage you to write about your customizations — and why you made them. People using commercial distros like Ubuntu and Fedora will justly be able to say “it already looks good” and so if you’re happy you can ignore this, but even in such environments we still often tighten things up to individual taste and so I’m sure you have something to offer.

Anyway, thus begins an occasional series about things I’ve done to beautify my GNOME Desktop on our Gentoo Linux systems.

A few years back I was enjoying a drink with Carl Worth and Keith Packard (free desktop graphics hackers extraordinaire, for those who haven’t met them). Later in the evening Keith leaned over, saw my laptop’s screen, and starting swearing at me: “You need to fix your fonts!” (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 :).

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 comfortable. 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 “Gawd that’s ugly!”

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 ‘°’ + ‘C’ to unicode character 0x2103, the symbol for degrees Celsius. I was getting a weird fall back to some horrible looking old bit-mapped font. Yikes (if °C and don’t look about the same then you’ll see what I mean). No big deal, but it was annoying me.

So I was checking around again to see if there was a different font family I should be using, when I came across the DejaVu. 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 #gnome-hackers, the answer was “hell yes you should be using it.” Huh. So I switched!

The DejaVu fonts are available on Gentoo in the media-fonts/dejavu package.

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

Appearance Preferences

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!

With gnome-font-viewer,

DejaVu Sans Mono, Book DejaVu Serif, Italic

Making screenshots of what they look like on my screen is a bit silly because they won’t necessarily look the same on your screen. But hey. We do our best.

Open Source is about choice, and so I cannot talk about fonts without also mentioning the Liberation 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’t look quite right on my screen (there are red and green hinting glitches around the glyphs; something is obviously misconfigured somewhere) but it’s a different free font that has been generously made available to the community. They’re available on Gentoo in the media-fonts/liberation-fonts-ttf package.

AfC

Update:

  1. So it turns out that DejaVu is set to be the default on Gentoo, but they’ve got a bug whereby they’ve got their ordering wrong: if you also have Bitstream Vera installed it gets picked up for Sans in preference. The folks in #gentoo-desktop say they’re going to fix that. (This is only relevant if you have the x11-base/xorg-x11 meta package installed; it pulls in media-fonts/ttf-bitstream-vera. If you only have the lower level x11-base/xorg-server package installed you can manually install media-fonts/dejavu [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.

Fri, 04 Apr 2008

Upgraded!

GNOME logo   Gentoo logo
#gnome-hackers   #gentoo-desktop

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

AfC

Mon, 16 Jul 2007

Bootstrapping Gentoo Linux on a new laptop with a LiveUSB key … with an ext2 filesystem!

Been looking for a new laptop for a while now, and I found what appears to be a good one from ASUS (an “A8S”; 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 n?) 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 London, would you believe?). Sweet!

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

I do have a small 256 MB usb key with me, though. So on a whim, I thought I’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.

More than possible: it didn’t take me very long to come across an unofficial page in the online Gentoo documentation about boostrapping a Gentoo install from a LiveUSB. Sweet!

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

The workaround is to use a much older release, but the point was to verify that the laptop I’d just bought would actually work with Linux, and that sorta implied using a really current kernel etc.

So me being stubborn, I tried it anyway.

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

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

What I needed, obviously, was a bootloader that would work for a USB key with an ext2 filesystem. I did a brief search, and suddenly came across something rather new called extlinux, from the same person who (it turns out) does all the *linux bootloaders.

extlinux? That sounds promising… and ta-da, it worked!

    livecd ~ #

Awesome!

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

AfC


RSS 2.0 Atom 0.3 Category Specific Feeds. Use these links for an RSS or ATOM feed limited to this category and its descendants. Technorati Profile


Material on this site copyright © 2005-2008 Operational Dynamics Consulting Pty Ltd, unless otherwise noted. All rights reserved. Not for redistribution or attribution without permission in writing.

We make this service available to our staff in order to promote the discourse of ideas especially as relates to the development of Open Source worldwide. Blog entries on this site, however, are the musings of the authors as individuals and do not represent the views of Operational Dynamics. All times UTC.