Skip to content

scselect FTW!

Having a portable computing device, I tend to switch network locations fairly often. While the configuration of these locations is really comfortable and easy (YMMV), switching between different locations is a real clickfest. Sure, there's a tool called NetworkLocation, where you can switch locations and even more, but installing yet another application just to switch network locations? I wish Apple had thought of this. Well, they did - kinda, for the geeks, at least:
$ scselect
   5BD6CDE3-1F56-15D5-B0EE-38D661618EDD (foo)
 * D193EEBE-7E81-1173-9E0B-D9EDE1331D39 (bar)
   111891B8-8CE1-1EBC-B15E-36F01689DD77 (Automatic)
There's also an AppleScript helper app for all you mouse people. Hey!


Am 27. Dezember 2009 hat die deutschsprachige Wikipedia die Eine-Million-Artikel-Marke überschritten. Na dann, Relevanzdiskussion my ass, wuerde ich meinen :-)

oh, FAIL, aber sowas von: der Artikel wurde zur Loeschung vorgeschlagen. Die Diskussion geht auch noch munter weiter, aus der Zeichenanzahl & der Zeit, die diese Diskussion bisher aufgetuermt hat, haette man bestimmt schon 3 weitere Artikel schreiben koennen :-)

umask & symbolic links

Oh, this is fun - not: apparently ln behaves quite differently on Linux and on MacOSX (using stock Darwin/ln or ln from GNU/coreutils):
$ uname -s && ln --version | head -1
Linux 2.6.33-rc1
ln (GNU coreutils) 6.10

$ umask 0022
$ mkdir test
$ umask 0066
$ ln -s test a

$ ls -ldog test a
lrwxrwxrwx 1    4 2009-12-25 13:01 a -> test
drwxr-xr-x 2 4096 2009-12-25 13:00 test
and on the Darwin side:
$ uname -sr
Darwin 10.2.0

$ umask 0022
$ mkdir test
$ umask 0066
$ ln -s test a

$ ls -ldog test a
lrwx--x--x  1    4 Dec 25 13:02 a -> test
drwxr-xr-x  2   68 Dec 25 13:02 test

$ /opt/local/bin/gln --version | head -1
ln (GNU coreutils) 7.6
$ /opt/local/bin/gln -s test b

$ ls -ldog b
lrwx--x--x  1   4 Dec 25 13:12 b -> test
So, who's right?

Grrr, s9y mag kein HTML in Kommentaren, dann muss ich das hier loswerden: Danke fuer das Feedback, gnarf, trotzdem ist das inkonsistent:

$ umask 0666
$ ln -s test a
$ touch b

$ ls -ldog test a b
ls: a: Permission denied
l--x--x--x  1    4 Dec 25 15:01 a
----------  1    0 Dec 25 15:01 b
drwxr-xr-x  2   68 Dec 25 14:58 test

$ rm a b
override ---------  christian/staff for b? y
....but rm doesn't ask for permission to remove "a". I'm looking up symlinks in die POSIX documents, but so far no word on messing around with umasks. And why should they, given that permission checks are done on the target anyway. When using creating a file in Linux, strace(1) shows:
while creating a symlink simply does
  symlink("test", "b")                    = 0
And the symlink() part looks pretty much the same as the POSIX reference.

bonnie++ and the -n switch

Maybe I'm st00pid, but the -n switch in bonnie++ always confused me. While other switches like -s or -r expect "megabyte", -n is a bit different:
# bonnie++ -d /mnt/disk -s 128 -b -n 8:1048576:1024:1 -m `uname -n`
Apparently the -s 128(MB) is only used for I/O performance. I/O as in throughput only. It has nothing to do with the file creation tests, that's what -n is for:
-n 8       - multiples of 1024, we'll create 8192 files here 
   1048576 - max filesize in bytes - 1MiB here
   1024    - min filesize in bytes - 1KiB here
   1       - spread files evenly across that many subdirectories
So, in our case, bonnie++ would create 8192 files à 1MiB (max) files in one directory, which sums up to 8 GiB. Gotta remember that now. Grrr.

kexec rocks!

I've almost forgotten about kexec, but it really comes in handy as this beast takes an awful lot of time to boot. Not so with kexec:
$ uname -a
Linux v40z1 2.6.33-rc1 #1 SMP Sat Dec 19 02:25:22 PST 2009 x86_64 GNU/Linux
$ kexec -l /boot/2.6/bzImage.old --append="root=/dev/sda2"
$ date
Sat Dec 19 02:35:30 PST 2009
$ kexec -e
I'm in purgatory

Ubuntu 9.10 v40z1 ttyS0
v40z1 login: root

$ date
Sat Dec 19 02:35:47 PST 2009
$ uname -a
Linux v40z1 2.6.32 #1 SMP Mon Dec 14 05:26:12 PST 2009 x86_64 GNU/Linux

I'm super cereal!

While the title of this entry is just a play on words, this is really about serial consoles:

  • Since Ubuntu 9.10 has moved to upstart, there's no /etc/inittab any more:
    $ grep -v ^\# /etc/init/ttyS0.conf
    start on stopped rc RUNLEVEL=[2345]
    stop on runlevel [!2345]
    exec /sbin/getty -L 115200 ttyS0 vt102
    $ sudo start ttyS0
  • For Solaris10, we'd do:
    $ pfexec eeprom console=ttya ttya-mode="115200,8,n,1,-"
    $ egrep '^console:' /etc/ttydefs
    console:115200 hupcl opost onlcr:115200::console
    $ pfexec svcadm restart console-login
  • Be sure to set your terminal to the right baudrate. For a v40z, login to the service processor and do:
    > platform set console --noprune --speed 115200
    > platform get console
    Rear Panel Console Redirection Speed  Pruning Log Trigger
    SP Console Enabled             115200 No      244 KB

    Comcast sucks.

    Yes, I knew this day would come that I too have my own rant about this ISP. For the record, I wasn't really able to choose a different ISP, as I they don't serve ADSL in this area and Comcast seems to be the only cable provider around. There's Roadrunner Internet and they have the cooler logo but they just offered a Comcast resale package, which is not really what I was looking for. And for another record I have to say that Comcast is pretty stable, I only have to reset the modem every other month or so - which is totally acceptable for a low-cost homeuser contract, IMHO.

    That being said, I'm not too happy with Comcast's approach to net neutrality or just content mangling in general. IOW: Keep your hands off my traffic! Two major annoyances so far and the reason for this blogentry:

  • The so-called Domain Helper Service one has to opt-out to get useful DNS error messages

  • Apparently Comcast is blocking port 25. Of course, no one would ever send email from a MUA these days, with all the webmailers out there, right? One has to use port 587 to do SMTP via MSA. They even have a support page for this one (which can only be accessed when you turn off (!) JavaScript in your non-InternetExplorer browser). Maybe I should open a ticket with them and see if they can unblock ports on a per-customer basis. Hah!

  • I found the FAQ entry on which ports they're blocking, saying:

  • Ports 68, 135-139, 445, 520, 1080 are blocked by default.

  • Port 25 is not blocked by default but on-demand: "When spam from a compromised computer is detected, Comcast’s anti-spam systems automatically apply a sending block and send an email notification to the affected subscriber’s email address." I don't remember any notification mail though....
  • gdb & system.privilege.taskport.debug

    When using gdb in Snow Leopard, they system asked me to
    Type the name and password of a user in the 'Developer Tools'
    group to allow Developer Tools Access to make changes
    Huh? I don't want to "make changes", I just want to debug a process. Turns out that monitoring/inspecting a process has been changed in Tiger and again in Leopard so that only members of the 'Developer Tools' group are allowed to debug. (Wow, I have never used gdb on Darwin before?). The right thing to do here is:
    sudo dscl . append /Groups/_developer GroupMembership username
    ...and get on with our actual debugging.

    Scribus: You cannot use EPS images or Print Preview

    When I wanted to play around with Scribus, the following error message greeted me on the first start:
    The following programs are missing:
    Ghostscript: You cannot use EPS images or Print Preview 
    Luckily this entry explained how to fix this, but instead of installing the whole foomatic package, I just used the MacPorts equivalent:
    $ port install espgs -x11
    Now /opt/local/bin/gs should be in place and Scribus should even find it by itself.