2010-07-13

Rate limiting stats

Filed under: Geekiness — iain @ 13:03:48

My experiment with rate limiting downloads seems to be largely successful, modulo a few typos and omissions. I accidentally set the HTTP class as a match-all rule rather than a match-any rule, meaning it would always fail to match as traffic cannot be both HTTP and HTTPS traffic simultaneously. I also forgot to add SSH to a policy class. As a result both these protocols ended up being the default (slow) group. Everything else is working well so far.

(more…)

2010-07-11

Cisco 877 download rate limiting

Filed under: Geekiness — iain @ 16:37:16

I’m in the process of migrating to a different ISP. Whereas until now I have been on a flat rate for download usage, the new provider charges significantly more for downloads between 0900 and 1800 on weekdays.

As I have a Cisco 877 router I should be able to throttle downloads during peak times and save myself money compared to the plan I’ve been using.

(more…)

2010-05-12

Automount trickery, submounts, cross-platform stuff etc

Filed under: Geekiness — iain @ 21:48:23

Hands up if your home directory is full of crap. Mine is. It has junk going back to 1999. As a measure of just how much junk I have let me tell you that at time of writing my home directory is 20Gb in size. In addition to having eleven years’ worth of files that I never got round to deleting, a large chunk of that disk usage comes from my Mac in the form of the Library subdirectory which contains pretty much everything Macs need in a user account as well as my Firefox and Thunderbird profiles. Needless to say these are huge.

In fact my home directory is only as small as it is because I moved a wodge of files to a separate storage area. The Documents directory, in which my Mac wants to save … pretty much anything … is actually a symlink to /files/iain/Documents which is automounted from somewhere else. And since my documents are the kind of things which I like to have available all over the place, that same directory is also shared by Samba and my Windows roaming profile knows to go there when I try to open (My) Documents. Some other directories are similarly shared across operating systems, including Desktop, Pictures and Movies.

I’d been thinking for a while that it might be better to move these well-known file stores into their own separate ZFS filesystems on my fileserver. Things came to a head this very evening when I downloaded Steam for Mac only to have it refuse to install because Library/Application Support/Steam wasn’t on a case-insensitive filesystem. It occurred to me that if Library were its own filesystem as I’d been considering, I could make it case-insensitive and trim the size of my home directory by a considerable margin. Although I wouldn’t advocate actually doing it in so crude a way, I believe that a home directory should be small enough that if you were given a UNIX account on a new system you should be able to get yourself up to speed by quickly transferring your entire home area from another environment. A home directory should be for dotfiles, SSH keys and the like. Everything else (real documents) should go Somewhere Else.

Since I use the automounter for everything I figured this would be pretty simple. As it turns out it actually is. The syntax works with Mac, Solaris and Linux as is documented to a greater or lesser extent in each system’s AutoFS manpages. The only potential stumbling block was getting it to work with LDAP but ended up being just as simple as you might hope.

The syntax to have the automounter mount a subdirectory of a configured mount is as follows, in auto.home for instance:

    * / files:/export/home/& /Library files:/export/library/&

So for all x /home/x will be mounted from fileserver:/export/home/x and /home/x/Library will be mounted from fileserver:/export/library/x.

On Linux I found I didn’t need the initial / by itself but both Mac and Solaris didn’t work without it. Another gotcha was that the Library directory had to actually exist in the original directory for it to be mounted from the specified location. In other words it wasn’t sufficient to export /export/home/iain and /export/library/iain from my file server. I also needed to create /export/home/iain/Library for it to be mounted.

In LDAP speak my auto.home became:

    dn: cn=/,ou=auto.home,ou=mounts,dc=iain,dc=cx
    objectClass: automount
    cn: /
    automountInformation: -fstype=nfs,tcp,rw,intr / files:/export/home/&
     /Library files:/export/library/&

To automount more subdirectories it suffices to add more bits to the automount entry.

    dn: cn=/,ou=auto.home,ou=mounts,dc=iain,dc=cx
    objectClass: automount
    cn: /
    automountInformation: -fstype=nfs,tcp,rw,intr / files:/export/home/&
     /Library files:/export/library/& /Documents files:/export/documents/&

And by redirecting my Windows shell folders to point to these filesystems in their CIFS form I can share them between operating systems.

2010-05-01

Oops

Filed under: Uncategorized — iain @ 08:19:07

Looks like I managed to kill my blog for a while. I’m not entirely sure how it happened; probably something to do with the fact that my WordPress installation is stored in a GIt submodule underneath my main web tree. Somehow I ended up blowing it away. That happened yesterday and unfortunately I didn’t notice until today. Luckily with Git managing the files on disk, the files being backed up daily and Git being backed up too, I was spoilt for choice regarding the method of repairing the damage.

2010-04-21

NSSM 2.3

Filed under: Geekiness — iain @ 23:15:42

I’m running final tests on, and will soon release, NSSM 2.3. NSSM – the Non-Sucking Service Manager – was originally written as a replacement for the venerable srvany, a tool which allows you to install any application as a Windows NT service.

(more…)

2010-04-19

xorg-x11-drv-wacom deferred pain

Filed under: Geekiness — iain @ 18:44:36

Some weeks ago Fedora 12 obsoleted linuxwacom and replaced it with xorg-x11-drv-wacom which apparently is a brand new XInput-based driver for Wacom tablets.

Immediately this caused me great pain and suffering as TPCButton mode, ie the thing where you hold a side button a tap the pen to do a click, stopped working and my side buttons were swapped round.

Rather than take the time to figure out what had happened I simply removed the xorg-x11-drv-wacom RPM and force installed the old linuxwacom to restore the status quo.

Last week, however, I forgot to exclude xorg-x11-drv-wacom from the list of packages NOT to be updated by YUM and lo and behold the RPM was installed again. This time I decided to get it working properly by reading the documentation about the transition.

Ha! Only kidding. There isn’t any documentation. So by trial and error – which is usually how these thing work – I managed to figure out what was going on.

With the old driver you added InputDevice sections to xorg.conf to declare the tablet devices and map them to /dev/input entries in the filesystem. You could then add options to these sections or use xsetwacom to set them on the fly.

Turns out you can still use xsetwacom. It’s just that the device names in your xorg.conf aren’t used any longer. I used xinput --list to enumerate the XInput devices on my display and found that four Wacom devices were present of which the most important was Wacom Intuos3 6×11. Since xsetwacom still works I was able to get my button swapping back by doing

    xsetwacom --set 'Wacom Intuos3 6x11' Button2 3
    xsetwacom --set 'Wacom Intuos3 6x11' Button3 2

The "correct" way to do so, however, is to run xinput --get-button-map 'Wacom Intuos3 6x11' and note that the buttons are interpreted as 1 2 3 4 5 6 7 and, since I wanted to swap 2 and 3, do

    xinput --set-button-map 'Wacom Intuos3 6x11' 1 3 2

TPCButton mode was previously set by doing xsetwacom --set <device> TPCButton on and at first I thought this was broken as I ran xsetwacom --set 'Wacom Intuos3 6x11' TPCButton on and nothing happened. A bit more digging (with xinput --list-props 'Wacom Intuos3 6x11') revealed why: the property has been renamed Wacom Hover Click and defaults to on. In other words when hover click is on you don’t need to tap in order to do a click with the side buttons. So to get the mode I wanted I could do either of the following:

    xsetwacom --set 'Wacom Intuos3 6x11' TPCButton off
    xinput --set-prop 'Wacom Intuos3 6x11' 'Wacom Hover Click' 0

Running xinput --list-props 'Wacom Intuos3 6x11' reveals the other editable properties, some of which have also been renamed.

If you’re following along from home remember that your device won’t be called Wacom Intuos3 6×11 unless it is, in fact, a Wacom Intuos3 6×11 (and maybe not even then).

Happy tabletting.

2010-03-01

Another failed swag run

Filed under: Work — iain @ 17:46:09

Though I’ve travelled a lot on my own dime and previous employers have occasionally sent me on business trips, CSR are the first to send me to visit the offices of companies they’ve acquired. I’ve made it something of a habit to try to pick up some kind of memorabilia while visiting these acquisitions. I’ve made it another habit to fail badly in this task.

(more…)

2010-02-24

Xiao Ningbo Seafood City

Filed under: Restaurants — iain @ 16:35:18

I’ve been in Shanghai for three days now and a combination of tiredness (on Monday) and laziness (yesterday) has led to the wholly unacceptable situation whereby I have eaten dinner exclusively at the hotel. If this were not bad enough, the hotel restaurant leaves much to be desired. Things had to change.

So it was that I strode out of the lobby and resolved to keep on going until I found a place I wanted to eat at, which in this thoroughly depressing foreigner ghetto part of Pudong wasn’t necessarily going to be easy.

(more…)

2010-01-13

On the wearing of baseball caps

Filed under: US tour 2009 — iain @ 16:37:18

I’ve always believed that I was physically incapable of wearing a baseball cap. I was never really sure why but I knew that somehow, somewhere, something was preventing me from donning that particular type of headgear.

Maybe it was because my head was the wrong shape. Maybe it was because I wasn’t American. Maybe it was because deep down I believed that baseball caps weren’t real hats. Maybe it was solar flares. Whatever the reason, I could never get one of the accursed things to fit properly.

(more…)

2009-11-09

Wrapping up the tour

Filed under: US tour 2009 — iain @ 23:37:07

The next stage of my tour was … the 1970s. Or so it appeared as I landed at Houston’s William P. Hobby Airport, the airport that took a raincheck on the last thirty years.

(more…)

Next Page »

Powered by WordPress