loading twitter...

Color Picker

I got a little fed up using some other app to open up a color picker, so I threw together an app that just gives you a color well.

I’m 90% certain that if you don’t use it on my computer, it will throw some bullshit exception about color spaces. Anyway. It’s neat that you can write OS X applications in Python now.

Uncategorized

Comments (0)

Permalink

Fixing screen on Mac OS X Leopard

screen is a wildly useful little utility that lets you “multiplex” a terminal window: that is, you can have multiple shells open in a single Terminal window.

(I hear you about to say “tabs,” but please, STFU. screen is better.)

The problem with screen on Mac OS X Leopard is that it breaks a whole hell of a lot of things, notably it clobbers your PATH variable, and it makes things like TextMate’s mate command not work (you just get the error mate: failed to establish connection with TextMate.). Part of the issue seems to be one of the patches apple makes to screen, in particular:

--- screen.c.orig 2007-03-15 14:42:59.000000000 -0700
+++ screen.c 2007-03-15 14:42:10.000000000 -0700
@@ -101,6 +101,11 @@
 
 #include "logfile.h" /* islogfile, logfflush */
 
+#ifdef __APPLE__
+#include <vproc.h>
+#include <vproc_priv.h>
+#endif
+
 #ifdef DEBUG
 FILE *dfp;
 #endif
@@ -1211,6 +1216,11 @@
   freopen("/dev/null", "w", stderr);
   debug("-- screen.back debug started\n");
 
+#ifdef __APPLE__
+       if (_vprocmgr_move_subset_to_user(real_uid, "Background") != NULL)
+               errx(1, "can't migrate to background session");
+#endif
+
   /*
    * This guarantees that the session owner is listed, even when we
    * start detached. From now on we should not refer to 'LoginName'

I reverted this patch (some googling seemed to show that this secret-sauce function _vprocmgr_move_subset_to_user is the problem) from Apple’s screen sources and recompiled it, and now mate -w works as EDITOR!

There is still some weirdness going on with the shells that screen starts, since the bash PS1 variable isn’t getting set, but that’s no big deal.

I’ve made a package out of this, which will overwrite /usr/bin/screen with the unpatched version, and will move the original binary to /usr/bin/screen.orig:

(I also hear you about to say “Fink” or “MacPorts.” Once again, STFU.)

Uncategorized

Comments (2)

Permalink

git package 1.5.4.3 for OS X

Updated universal git package for Mac OS X:

(I made the mpkg on Leopard, but compiled the code on Tiger. This should work on both, but I haven’t tried the installer on Tiger. I’ve also tried to include libexpat, and thus git-http-push support. Let me know if there are any issues)

Update: I’ve rebuilt the package, which should install all the git builtin programs (which are exactly the same as the main git binary, but with a different name) as hard links, not as independent programs. This will take up less space on your hard disk, but the installer is the same size (!). If this doesn’t work for you, use the non-hard-linky installer.

Edit: this page will hold further updates for this package.

Uncategorized

Comments (19)

Permalink

ditto –fail

This test script will fail about half the time on Mac OS X, both 10.5.1 and 10.4.11. Note that the second test (the “FAIL2″) never seems to fail.

#!/bin/bash

mkdir test
dd if=/dev/random of=test/file1.txt bs=1024 count=5 > /dev/null 2> /dev/null
cp test/file1.txt test/file2.txt
cp test/file1.txt test/file3.txt
cp test/file1.txt test/file4.txt
cp test/file1.txt test/file5.txt
cp test/file1.txt test/file6.txt
cp test/file1.txt test/file7.txt
mkdir test/subdir
cp test/file*txt test/subdir

zip -0 -q -r - test > f1
cat f1 | ditto -xk - .1

zip -0 -q -r - test | cat > f2
cat f2 | ditto -xk - .2

diff -r .1 .2 > /dev/null
if test $? != "0"; then echo "FAIL"; fi

ditto -xk f2 .3
diff -r .1 .3
if test $? != "0"; then echo "FAIL2"; fi

rm -rf f1 f2 .1 .2 .3 test

I’m not such which sucks worse: the fact that ditto can’t handle what is apparently a perfectly valid zip file, or that zip writes something different to stdout, depending on whether or not it is a pipe or a file.

Uncategorized

Comments (0)

Permalink

Virtua Fighter

Virtual memory sizes, Leopard

I’m impressed overall with Leopard, not the least of which the fact that it seems extremely snappy, even though for me it gets a heretofore unthinkable VM Size: 73.75 GB virtual memory size. The graphics card in my iMac still hangs every once in a while.

Uncategorized

Comments (2)

Permalink