Older blog entries for richdawe (starting at number 142)

File::ExtAttr 1.09

AKA the "reduce the CPAN Testers FAIL results" release.

I also fixed a minor bug on Solaris, and documented a difference in the handling of empty attribute values on Mac OS X 10.4 vs. 10.5. See File::ExtAttr on CPAN soon.


1.09 2009-03-07

    - (richdawe) Add note to README about needing to install
                 package that provides the headers <attr/attributes.h>
                 and <attr/xattr.h>.

    - (richdawe) Fix RT #31970: "OS X: setfattr fails to set empty value".
                 According to the CPAN Testers results, this works
                 on Mac OS X 10.5.

                 Skip the "empty" tests on Mac OS X 10.4 and earlier.
                 Document issue.

    - (richdawe) Fix #34394: "Test suite should skip on filesystems
                 with no xattr support when run non-interactively"
                 on Linux.

                 When run interactively, it will suggest what you need
                 to do, to get the test suite to pass.

    - (richdawe) Fix RT #37889: "Crash when operating on a closed file handle
                 on Solaris". This was due to using an uninitialised
                 directory handle.

Syndicated 2009-03-07 10:42:32 from richdawe

Fedora 9 vs. VMware-server 1.0.8

VMware-server 1.0.8 seems to barf on the GTK+ theme files shipped with Fedora 9. I'm using Clearlooks. You can force VMware-server to use the system GTK+ libraries:

vmware &

On my F9 x86_64 install, I needed to install a few i386 packages first, before VMware start. VMware-server is an i386 program, so you need these i386 packages to be installed for it to be able to use the system GTK+ libraries:

yum -y install glib2.i386 gtk2.i386

Syndicated 2009-03-03 08:39:29 from richdawe

Linksys wireless gear vs. Xbox 360

I've been trying recently to connect a wired LAN printer and my Xbox 360 to the wireless LAN in our house. This proved trickier than I expected.

First off I wanted to connect my old Linksys WRT54GS v2 wireless access point to the existing wireless network, so that I could hook my printer up to it. The wireless network is using WPA-PSK authentication. I reflash the WRT54GS with OpenWrt, version 8.09 RC1. I didn't find OpenWrt very friendly, but I managed to get it to join the wireless network. Unfortunately there seemed to be some problem with bridging -- the wired and wireless networks were not connected.

Eventually I gave up and switched to DD-WRT, which worked much better. I set it up into Client Bridged mode, and it just worked.

The next task was to connect my Xbox 360 to the wireless network. I bought the wireless adapter, but I found it would not connect to my wireless router, a Linksys WAG325N. Apparently this is a known issue. The recommended fix is to downgrade to version 1.00.06 of the firmware, which unfortunately did not work for me. I upgraded the router to the latest firmware, v1.00.12, and made sure my Xbox had the latest updates. Still no joy.

I read reports that the Xbox 360 worked fine with the WRT54GS, so I wondered if I could create a second wireless network just for my Xbox. Fortunately I discovered that DD-WRT has a repeater mode and a repeater bridge mode. In repeater bridge mode, you create a virtual wireless network with a new SSID, and then traffic is bridged between the real wireless network and your new "virtual" wireless network. The virtual wireless network is a real wireless network to all intents and purposes.

After some poking around the DD-WRT GUI, I had it all configured and it works! (Note: I skipped the nvram set wl_ssid="" step -- you don't need that for Repeater Bridged mode.) The path for traffic from my Xbox to the internet is now something like this:

Xbox <--> WLAN 2 <--> WRT54GS Access-Point <--> WLAN 1 <--> WAG325N router <--> internet

DD-WRT is pretty sweet. I've only scratched the surface of its features.

Syndicated 2009-02-18 11:27:46 from richdawe

Thanks to Linux desktop developers

I've just caught up with 2 years' worth of Linux desktop developments (NetworkManager works, user switching, built-in volume controls working on my laptop). I like. Thanks for all the hard work, Linux desktop developers!

PS: Turning on "subpixel aliasing" has made text much more readable.

Syndicated 2009-01-31 18:06:01 from richdawe

Occasional lock-ups due to Parallels & FileVault?

I've been running a Windows VM under Parallels on my work Mac. I have my home directory encrypted using FileVault. I've had ~5 lock-ups in the past 6 months where my Mac has just locked hard. It always seems to happen when I'm using a Windows VM. I've allocated 768 MB of RAM to the Windows VM. The Mac has 2 GB of physical RAM. The disk image is pre-allocated, to avoid performance problems with it being resized on the encrypted volume.

I've wondered if the box has locked up because FileVault cannot allocate memory for some reason. This doesn't seem to happen in normal usage. Maybe the Windows VM is pushing memory usage over the edge.

Today I've switched to hosting the Windows VM disk outside the encrypted partition, and using NTFS encryption for the data I need to protect. Hopefully that will work better.

Syndicated 2009-01-09 19:42:20 from richdawe

Interesting essay on "Misunderstandings of Privacy"

I found the article "'I've Got Nothing to Hide' and Other Misunderstandings of Privacy " by Daniel J. Solove interesting. Specifically how he tried to categorise privacy into different categories based on the kinds of problems encountered, and his discussions on privacy and the relationships between individuals and society.

Syndicated 2008-12-31 14:13:46 from richdawe

3 mobile broadband on Mac

I got some mobile broadband from 3 to cope with a two-week gap in my wired broadband provision. I had some pain getting it to work on my work Macbook Pro (which is a US one) running Mac OS X Tiger (10.4.x).

The software gave me an obscure error -- "internal error 5370" or similar -- when running the 3 Connection Manager software. According to a techie in the 3 store I went to, I needed to download the latest drivers from the 3 website. That was pretty hard to find. It turned out to be on the support page for the Huawei E160G on Mac OS X 10.4. (I don't recall how I found that page.)

I uninstalled the old software, deleted the "3Connect" folder from applications, installed the new software and fired up the "MobileConnect" application. That detected the 3 network, but crashed when I tried to connect. This thread on the Huawei forum suggested that I could create a profile in the Network panel of the computer settings:

Firstly, run the “Mobile Connect” Make sure under “settings” there is a profile: I called mine “3 USB Modem”, with Access Point name of 3internet and Telephone number of *99#. You only need to do this once.

Secondly, go into System Preferences. In the Network pane, select the HUAWEI mobile device in the left pane. Now, in the right pane, under Configuration, select “Add Configuration”. I caled mine “Three”. Add *99# as the telephone number, make sure “Show modem status in menu bar” is ticked (for convenience) and you’re all set.

I had to enable a profile called "HuaweiMOBILE" first. Once I edited that as instructed above, I found that the MobileConnect application could connect.

Actually, it failed to connect the first time due to some authentication error. But it's worked every time since. Perhaps the auth error was a signal strength issue.

Syndicated 2008-11-10 20:14:26 from richdawe

Knowing what rpms you've just built

One idiom I've found myself repeating in various projects is a build-all script that builds multiple rpm packages in a certain order. This isn't very sophisticated -- each time I've ordered the packages being built manually.

But how do you know what rpms you will get, when you run rpmbuild? You need to know this, so you can install the rpms. Here is a solution:


RPMDIR=$(rpm --eval '%{_rpmdir}')

# What format does rpm use for built binary rpms?
BUILD_NAME_FMT=`rpm --eval '%{_build_name_fmt}'`

rpms=$(rpm -q --specfile $specfile --queryformat "$BUILD_NAME_FMT ")

pushd $RPMDIR
rpm -ivh $rpms

This works as follows: get the rpm root directory into $RPMDIR; find the format rpmbuild uses for built binary rpms; query the rpm specfile for packages and format the results using the build rpm filename format; finally, go into the rpm root and install all the binary rpms.

Syndicated 2008-10-03 08:45:23 from richdawe

File::ExtAttr 1.08, (Open)Solaris and 2 xattr schemes

I released File::ExtAttr 1.08, which has some changes to make it report errors more consistently ($! should always contain the value of errno now). It also has some build changes, which will hopefully avoid all the CPAN Testers FAIL reports on platforms that don't have the development packages installed for using xattrs (libattr-devel rpm on Linux).

I development this release on various platforms, but the most exciting one was OpenSolaris 2008.05 (AKA Project Indiana). This is so much easier to install and use than Solaris 10. It's much more like using a Linux distro. The OpenSolaris LiveCD is very easy to install, and things just seem to work. It took about 6 steps to get a fully functional development environment for File::ExtAttr.

While developing 1.08 on OpenSolaris, I discovered that it has two separate ways of storing extended metadata: extended file attributes, and extensible system attributes. The extensible system attributes were added as part of supporting CIFS on ZFS. It's still unclear to me why the existing metadata scheme wasn't good enough -- maybe the semantics of the original xattr interface weren't compatible with the use cases?

(The original xattr scheme is that you open the file as though it were a directory, and then the xattrs can be accessed through directory entries. This is clever, but different to the way Linux, *BSD and Mac OS X implement xattrs.)

I'm now not sure which xattr API I should be exposing through File::ExtAttr. I guess it comes down to which one will be more portable across platforms. I think that will be determined by which xattrs are preserved by tar, etc.

Anyow, here's the change log for File::ExtAttr 1.08:

1.08 2008-08-19

     - (richdawe) Add a typemap for usage of "const char *" in the XS.
                  This may help fix the build with Perl 5.6.x or earlier.

     - (richdawe) Remove NetBSD 3.x from list of supported OSes,
                  since File::ExtAttr's test suite will never pass on it.

     - (richdawe) Update Makefile.PL to fail more gracefully when the build
                  pre-requisites are not present. On Linux use
                  Devel::CheckLib to check for libattr. Also exit
                  more gracefully if libattr's headers are not present.

     - (richdawe) OpenBSD isn't supported, so bail gracefully
                  in Makefile.PL on that platform.

     - (richdawe) Make sure that the errno value from any failed
                  system calls is propagated into $! (#32679, #32680).

     - (richdawe) File::ExtAttr no longer generate noisy warnings
                  when an xattr system call fails. All error reporting
                  is now via the function return values and $!.

     - (richdawe) Operations with non-default or non-"user" namespaces
                  will now fail with EOPNOTSUPP instead of ENOATTR
                  on Mac OS X, *BSD and Solaris. This behaviour
                  matches the behaviour on Linux.

     - (richdawe) Added a note to the documentation about Solaris
                  extensible system attributes, which are different
                  to extended file attributes.

Syndicated 2008-07-19 11:29:32 from richdawe

19 Mar 2008 (updated 7 Jun 2008 at 10:28 UTC) »

rpm: Filtering dependencies differently for different subpackages

Recently I was trying to work out how to filter rpm Requires/Provides dependencies differently for different subpackages. I was trying to produce a subpackage that was the same as another subpackage, but stripping out some library dependencies. Call the one subpackage foo and the other foo-nodeps. (Don't ask why I was trying to do this.)

rpm has a way of hooking the dependency generation, as described in FilteringAutomaticDependencies at the Fedora wiki. This is pretty magical. You disable rpm's internal dependency generation. You can then override the default external dependency generation scripts (if you want). Normally rpm uses find-requires and find-provides in /usr/lib/rpm, or /usr/lib/rpm/redhat on some Red Hat or Red Hat-derived systems. If you do override the scripts, it's likely you'll want to call them and filter their output.

When you define your own dependency generation scripts, they are applied to all subpackages. There is no information passed to the script to indicate which package/subpackage it is being call for. You can pass arbitrary parameters to your custom find-requires/find-provides scripts. But there are no macros that you can use to pass that in as a parameter (%name is always the main package's name -- there's no %subpackage macro AFACIS).

A solution was to pass that information in via the filesystem. In the %install script I'd create a file per package. Something like this:

mkdir -p %{buildroot}/NOTINSTALLED
touch %{buildroot}/NOTINSTALLED/foo.ghost
touch %{buildroot}/NOTINSTALLED/foo-nodeps.ghost

Then in each package's file list I'd put the appropriate file:

%ghost /NOTINSTALLED/foo.ghost

%files nodeps
%ghost /NOTINSTALLED/foo-nodeps.ghost

The %ghost ensures that the file isn't installed, but is still passed to the find-requires/find-provides scripts. A custom find-requires script can then find out which subpackage it's being called for. Something like this:

cat > .files
if (grep -q -E '^/NOTINSTALLED/foo-nodeps.ghost$' 2>/dev/null); then
  # Filter out dependencies on libfoo
  /usr/lib/rpm/find-requires | grep -v -E '^libfoo.so'

Syndicated 2008-03-19 22:38:52 (Updated 2008-06-07 09:50:56) from richdawe

133 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!