My Hackergotchi

Updated: Never — Philip's Blog

Now featuring regular updates!

Thu, 25 Feb 2010

12:52 – Pairing Bluetooth headset

I am the proud owner of a Bluetooth headset. My laptop also speaks Bluetooth. Getting the two of them to talk to each other is less than obvious though. There seems to be plenty of documentation for ancient BlueZ versions, but none for more recent ones.

For future reference.

  • First put the device in pairing mode

  • Now use a cleverly hidden Python script (which depends on dbus and gobject, of all things) to do the pairing. I have no idea how I stumbled into this, and the only way to figure out what it does was reading it through. Highly intuitive!

    # python /usr/share/doc/bluez/examples/simple-agent hci0 XX:XX:XX:XX:XX:XX

  • The good news is, once the thing has been paired, it Just Works[tm]:

    # mplayer -ao alsa:device=bluetooth foo.ogg

I have Opinions on dbus.

Sat, 25 Apr 2009

22:18 – Making projectors work in the Magic Era

After last week's minor catastrophe I discovered that while I have all my data nicely backed up, I was missing backups of some useful configuration files.

As many things now work basically "by magic" provided you don't need them to work properly I didn't notice until this afternoon that my beam and unbeam scripts had stopped working.

The scrips are very simple, beam basically does:

xrandr --output VGA $mode --right-of LVDS

Where $mode is --preferred unless I give something else as a parameter.

unbeam simply does:

xrandr --output VGA --off

They also disable minor annoyances like power saving and the screensaver and make some symlinks to start terminals with larger fonts. Nothing particularly exciting.

Turns out I had somehow forgotten to back up my xorg.conf file and that recent versions of X11 fail to scream about that by mostly "just working". Until you need to do something special. Like project.

I then discovered that anything I put in xorg.conf these days will basically be used against me. Grr. Only very bare bones files seems to be acceptable. Who knows where the rest of my configuration is. Probably in fancy XML files or binary formats which are quietly corrupting themselves in the background. sigh

This xorg.conf works on my ThinkPad X60s:

#
# newage xorg.conf -- anything you say will be used against you!
#
Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "keyboard"
        Option          "CoreKeyboard"
EndSection
Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
EndSection

Section "Device"
    Identifier      "Integrated Controller"
    Driver          "intel"
    BusID           "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier      "Default Screen"
    Device          "Integrated Controller"
    DefaultDepth    24
    SubSection "Display"
        Depth           24
        Virtual         2304 1792
    EndSubSection
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Default Screen"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
EndSection

Note the absence of any settings to make the trackpoint work. For some reason which is entirely beyond me, I now need to configure something called hal to make that work. In XML, with the usual 3 bytes of overhead per byte of data. mumble

In /etc/hal/fdi/policy/mouse-wheel.fdi:

<match key="info.product" string="TPPS/2 IBM TrackPoint">
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
</match>

The userfriendly police strikes again!

Wed, 30 Jul 2008

10:10 – The price of the bleeding edge

Lionel reports that his fancy Ubuntu toy is starting to suck more and more. It won't surprise anyone that the words I told you so are on my lips.

As I've blogged before (at length!) Ubuntu is not a very good operating system. It completely ignores decades of proven Unixy technology (like the command line and the toolbox approach) and presents users with complicated experimental solutions to simple problems which have already been adequately fixed ages ago.

The predictable result is that in an overwhelming number of use-cases Ubuntu simply does not work. The only way to get it to do anything at all, is to forget everything you know about computers and to perform a lot of counterintuitive jumping-through-hoops. Hours of frustrating mouse-clicking and trying to figure out what fuzzy (friendly) messages and prompts actually mean.

Engineers have a very good description for software like this: the bleeding edge.

The price of the bleeding edge is blood. Engineers know this. They also know that if bleeding edge software breaks and extracts blood, they get to keep the pieces and they're on their own for restoring their blood volume.

Not-very-amusingly, Ubuntu targets their bleeding edge software to novice users. Weren't novices in particular best served with tried and trusted technology? Nobody in their right mind would throw bleeding edge software at novices!

I guess this says something about the Ubuntu mindset. Do they realize that the more they diverge from the path of tried and trusted technology, the more blood they will extract? I expect to see many more blogs like Lionel's in the coming months.

Play with fire. Get burnt.

The sad thing, of course, is that innocent novices who have been told that Ubuntu is Linux, will now blame Linux for all the suckage.

Wed, 23 Apr 2008

14:44 – gpm considered harmful

Today I finally figured out why on my RedHat box at work applications like vim and w3m sometimes hang on startup for no particular reason.

It turns out that autocrap causes these applications to link with libgpm if that happens to exist on the system. Why autocrap believes that the presence of a library on the system in any way implies that I'd like to link with it is entirely beyond me.

The linking in itself is not the problem though.

gpm communicates with clients using pipes. When you stick an application in the background for a long time (I sometimes have vim or w3m instances sitting in the background for days at a time), its pipe will fill up. When one pipe fills up, all applications hang.

Two bugs: autocrap causes unrequested linkage and gpm allows random applications linked with it to cause other applications to hang by simply sitting in the background for a while.

This sucks.

Sat, 19 Apr 2008

21:49 – Playing with OpenWRT

Pending my purchase of a FON gadget or the installation of a new wireless card in my Soekris, I today installed OpenWRT on an aging Asus WL300G access point. This went surprisingly well, following the documentation.

For some obscure reason, the "sensible defaults" were not very sensible. This was easily fixed, however:

nvram set wan0_proto=none

mv /etc/init.d/S50httpd /etc/init.d/off.S50httpd
mv /etc/init.d/S50telnetd /etc/init.d/off.S50telnetd
mv /etc/init.d/S60cron /etc/init.d/off.S60cron
mv /etc/init.d/S60dnsmasq /etc/init.d/off.S60dnsmasq

Rationale: the thing has only one 802.3 Ethernet interface, which is bridged to the 802.11 interface - there is no point in running a DHCP client (started together with dnsmasq). After setting a root password, it's no longer possible to log in using telnet - so why have a telnetd suck resources? I'm not going to run any cronjobs on my access point, so disabling cron is obvious. And I'm allergic to web "applications", as everyone knows.

The thing runs very well. No complaints. I recommend it very highly over the default firmware.

Sun, 24 Feb 2008

11:44 – Fuck Ubuntu!

How the fucking hell do people put up with the kind of fucking bullshit that this fucking piece of crap excuse for a linux distribution contains?

You can't even print something without it trying to be friendly to you. I don't want friendly, I want it to work, dammit! I'm a big boy, I can use keyboards. I don't want handholding.

Bloody hell.

Pissed off

Chances of me ever running crap like this: zero.

Sun, 23 Dec 2007

16:31 – Slackware 12

Work is "closed for business" this week. I don't quite understand why -- something to do with newtonmas and planetary laps around the sun, I'm told, but those hardly qualify as reasons to me. Must be something else. Or I'm just a workaholic?

Because I have nothing better to do, I decided to upgrade my laptop to Slackware 12. This went very well. Slackware remains the only Linux distribution maintaining BSD-like consistency and ease-of-use.

Since Slackware now (finally!) moved to Linux 2.6.x, the intrd image has at last become a cpio file instead of an ext2 filesystem image. This means I do not need to find another Linux machine to stick the network modules in it for PXE-booting (I don't trust FreeBSD's ext2 support for writing yet).

While I was at it, I decided to also upgrade to modular X.org by building it from pkgsrc instead of taking it from Slackware. This worked very well. I only had to set X11_TYPE=modular in my mk.conf and install the modular-xorg-apps and modular-xorg-server packages and the fonts and drivers I needed. Went very smoothly.

If you're still running older versions of Slackware, I recommend upgrading. :-) It's worth the (small) effort.