Archives / Search ›

Repurposing the 3G iPod dock

Since I got a 2G iPod touch, my 30 GB 3G iPod—now on its third battery and with the hard drive replaced with a 4 GB CF card and adapter—has been sitting forlornly in its dock on the desk next to me.
DSC_0698.jpg

Tonight, I was removing the iPod and other unused bits of hardware from my desk when I noticed a replacement “10/15 GB” dock cover in the iPod dock’s box. It’s been so long since I bought it, I had completely forgotten the predecessor to today’s Universal Dock adapters. The cover is plastic, held on by four snaps. When removed, it reveals a metal and plastic frame.

DSC_0705.jpg

The dock that came with the 3G iPod is on the left; the standalone dock is on the right. While the covers are identical save a taped-on “30 GB” label, one looks quite a bit better “naked.”

DSC_0706.jpg

Having not bought a dock for my iPod touch yet, I tried placing it (in a Griffin Reflect case) in the naked 3G dock, and it fit perfectly side-to-side.

DSC_0707.jpg
DSC_0709.jpg

So, while my 3G iPod ambles off into retirement, its docks will see continued use.

NCIDpop 0.9.14

The OS X version of the NCIDpop network caller ID client, originally written by Alexei Kosut, has not seen much development in a while, and had fallen behind the Windows version. In August I added a call history window, network change robustness, localized date formatting and reverse lookup support. NCID’s maintainer has been pretty busy, but he’s now integrated the changes in the official release.

NCIDpop history

And if you’re wondering “why use NCID when I already have caller ID?” If you have SIP service (e.g., Vonage) at home, NCID gives you caller ID on the first ring on every computer display in the place. Since I get pretty frequent calls from people I don’t want to talk to, such as Spanish-speaking bill collectors who won’t take no for an answer, it’s been a great help in reducing my stress when the phone rings.

Building 32-bit OpenJDK on 64-bit Red Hat Enterprise Linux 5.2

In the next few weeks, I’ll be posting some shorter, more technical entries like this one—more related to Linux/Java/Python stuff rather than the Mac, as I’m spending most of my time in that world. As I’ll soon be embarking on dissertation writing, I can use the practice.

Our research machines were recently updated to 64-bit Red Hat Enterprise Linux 5.2. I used this opportunity to get rid of a bunch of locally built software sitting in my home directory, though I still must install my own Python, Emacs and (32-bit) Java.

On the day of the upgrade, everything moved over smoothly, to my surprise. Several weeks passed. Then a few days ago I promptly crashed the machine with OpenJDK on it by trying to reboot it in uniprocessor mode. Nobody’s around to poke the power button and I’m not back for a few weeks, so I have to rebuild all of OpenJDK, not just HotSpot, on another machine. This, like previous adventures building OpenJDK, has not exactly been fun.

Now, OpenJDK doesn’t really do cross-compilation—at least, it’s not well-tested. The best reference I found online was this message from last December, which provides a bizarrely formatted patch (what kind of pathname style is that?). Some files have moved around since then and some newer pieces of OpenJDK doesn’t seem to reference any of the variables set by it. I therefore used a combination of an updated patch and some brute force workarounds to get OpenJDK built.

The following packages provide libraries OpenJDK links against:

glibc-devel.i386
libstdc++-devel.i386
alsa-lib-devel.i386
libXi-devel.i386

You’ll also need a 32-bit bootstrap JDK; I used Sun Java 6 Update 11 installed with JPackage (which required hacking the spec file because the RPM version on RHEL5 doesn’t support architecture specification…).

Finally, I needed to build a 32-bit FreeType 2.3.x, which was a simple

CC="gcc -m32" ./configure --prefix=../freetype; make install

away.

Since I build OpenJDK somewhat often, I defined a shell alias which sets up all the necessary variables:

  njobs=$(( 3 * $(grep -c processor /proc/cpuinfo) / 2 ))
  alias ojmake='LANG=C JAVA_HOME= LD_LIBRARY_PATH= CPPFLAGS= LDFLAGS= '\
'ALT_FREETYPE_LIB_PATH='$SCRATCH'/openjdk/freetype/lib '\
'ALT_FREETYPE_HEADERS_PATH='$SCRATCH'/openjdk/freetype/include '\
'make DEV_ONLY=true BUILD_DEPLOY=false '\
'ALT_PARALLEL_COMPILE_JOBS='$njobs' HOTSPOT_BUILD_JOBS='$njobs

Note I’m mostly sanitizing my environment there so it doesn’t try to link against software installed in my home directory. You’ll need to substitute the paths to the FreeType version you built.

OpenJDK then compiles with this patch and ojmake ARCH_DATA_MODEL=32 CC="gcc -m32" CXX="g++ -m32". The latter two variables should not be necessary, but certain bits of OpenJDK (such as the new FreeType-based font renderer) don’t seem to listen to ARCH_DATA_MODEL=32.

If you get a message such as:

ERROR: FreeType version  2.3.0  or higher is required.
 make[2]: Entering directory `.../openjdk/jdk7/jdk/make/tools/freetypecheck'
Required version of freetype: 2.3.0
Detected freetype headers: 2.3.7
Detected freetype library: 2.2.1
Failed: too old library.

despite the fact that you do have these versions installed, you need to make clean (make sure to do so with the right flags otherwise it’ll just clean the 64-bit object dir!). Otherwise, freetype_versioncheck won’t be rebuilt, instead reporting the same wrong answer.

Bonus: the zsh function I used to generate the patch above from a Mercurial forest.

fdiff() {
  local -a trees
  trees=($(hg ftrees))
  local prefix=${trees[0]}
  for i ("" ${trees/$prefix}) ( # substitution collapses empty items
    cd $prefix/$i
    hg di --no-color | perl -pe 's|( [ab])/|$1'$i'/|g if /^(diff|---|\+\+\+)/'
  )
}

Goodbye, arnold

19:00 = sabi [nicholas@arnold.sabi.net] quit (Quit: goodbye, arnold old friend.)
[...]
overlord% console arnold
Enter njriley@console's password:
[Enter `^Ec?' for help]

arnold console login: nicholas
Password: 
Last login: Sat May 17 22:24:06 from [...]
{nicholas#console@arnold:1025} ~%sudo /usr/sbin/shutdown -i6 -g0 -y      7:21PM

Shutdown started.    Sun May 18 19:21:17 CDT 2008

Changing to init state 6 - please wait
Broadcast Message from root (console) on arnold Sun May 18 19:21:18...
THE SYSTEM arnold IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged

{nicholas#console@arnold:1026} ~%                                        7:21PM
INIT: New run level: 6
The system is coming down.  Please wait.
System services are now being stopped.
Killing: 103
Stopping baculafd.
Stopping openvpn.
May 18 19:21:28 arnold openvpn[302]: event_wait : Interrupted system call (code=4)
Waiting for PIDS: 302.
postfix/postfix-script: stopping the Postfix mail system
No screen session found.
May 18 19:21:31 arnold syslogd: going down on signal 15
The system is down.
syncing file systems... done

Today I shut down arnold.sabi.net for good.1 It’s just a computer, but I’m strangely emotional about it.

I first wrote in March 2003 about buying arnold on eBay. A generous friend has been hosting arnold for free at his residence since then—first about a mile away in Champaign, then moving in July 2003 to Virginia where it’s been ever since. It’s served me well with no hardware failures until some ECC errors prodded me into moving the last service (dynamic DNS) off it yesterday.

As I mentioned back in September, I’ve been working on reducing my administrative load. I’m now nearly finished migrating services, but two aging machines—calamity and shrug—remain to be decommissioned.

I’ve mentioned calamity a few times over the years; it predates arnold by a couple of years, having ably served as my parents’ DNS, email, Web, VPN and monitoring server. There’ve been no hardware failures, though I’ve upgraded the hard drives and SCSI card once and switched the backup medium from xfsdump on an external MO drive to the network via Bacula. I moved the email and Web services off a few months ago; when I swap the Mac mini for my old G4 in a few months, I’ll have a slightly newer machine to host its remaining services. (You can see calamity on the right in this photo from May 2006, to the left of hamton, a hand-me-down PC which died before it could be put to any use.)

shrug (which is not a Tiny Toon Adventures character; blame doomsey) is a P3/700 still running FreeBSD 4.11. It hosts my primary email environment, which has had a long and varied history.

In the 90s, I read mail in a bunch of places—some via Eudora and POP, some via Unix mailreaders including pine, mutt and (ex)mh. My accounts included tiac.net, netcom.com, macirc.com, three Brandeis accounts, online service Internet gateways (CompuServe, AOL, eWorld, BIX and Delphi at various times) and some others I’d rather not mention. Over time, I reduced the number of accounts I checked to three, for personal, school and work use. My “forever” personal email address was nriley@shore.net, served by a small ISP in Massachusetts. Mail for school lived on students.uiuc.edu until November 1999, then griffin.canis.uiuc.edu until January 2001.

sabi.net was served starting in mid-1999 by alexandria.invantage.com, an old 486DX2/66 in the corner at my then-employer. (My old reliable USR Courier in that picture was a fallback for our flaky RADSL connection.) At the time I didn’t use sabi.net much for email; my sabi.net mail, what little of it there was, forwarded to my shore.net account. Eventually, Shore.Net got bought and destroyed; I learned the lesson that I should never rely on someone else’s domain name for my email. (Update, July 2009: there’s a happy ending, Shore.Net is back, albeit as a shadow of itself).

Since I was switching labs at the time I didn’t have a server at school to use, but luckily I could borrow Invantage’s new colocated server for a few months. chronos.invantage.com thus became sabi.net’s MX in January 2001. chronos also hosted my first truly consolidated email setup, with procmail and Mutt folder-hooks configured to deliver mail from three accounts into separate inboxes: invantage.com (the mailspool, i.e., !), uiuc.edu (=INBOX) and sabi.net (=+/INBOX). I dumped my Shore.Net account in March and switched sabi.net’s MX to pair.com in August 2001, where it remains. pair is still around, still independent, still conservative and reliable; its CEO still posts in the newsgroups. I plan to keep my account there for the foreseeable future.

With sabi.net’s MX switched, I could finally migrate my email setup from chronos, moving it to theremin.cs.uiuc.edu and finally to shrug.csl.uiuc.edu (later shrug.acm.uiuc.edu) in September 2003. On shrug I added an IMAP server and several generations of spam and virus filtering. I’ll be moving off shrug over the next few weeks to a similar setup where I won’t be the machine’s primary administrator. (shrug was originally like that, too, but its owner graduated and left maintenance to me.)

Planning and executing these migrations is tedious and mind-numbing, so I’m glad they’re coming to a close along with graduate school; I’ll have more time in future to focus on things I really care about. Another good thing about getting rid of machines is that I don’t need to come up with a new naming scheme as I thought I would. My laptops since then have all been named Shirley; my Intel iMac is Mary.

1Actually, runlevel 6 reboots; I’ve still got to wipe the disks.

AntiRSI 1.4njr4

Since releasing AntiRSI 1.4njr2 I’ve made a couple more minor releases.

1.4njr3, released on November 5, fixes some graphical rounding issues reported by Andy Reitz; the times were displayed as 3:01, 2:00, 2:59, etc. I was really surprised I never noticed this myself.

1.4njr4 shows the break window in all Spaces on Leopard; of course you could do this with the Spaces preference pane, but doing so by default makes sense. It also stops AntiRSI from getting focus when you hit the “Postpone” button (Cocoa’s API for this is…interesting). Or, if you have AntiRSI set to force itself to the front during breaks, it’ll bring your previous app to the front when the break is finished so you can resume work.

I’ve made some Spaces-related changes for Pester, too, and will try to get beta 8 released one of these days. Happily, my research is going really well at the moment and I don’t want to disturb my focus.

Download AntiRSI 1.4njr4 here, or just use the “Check for Updates…” item in the AntiRSI menu if you’ve already got my version of AntiRSI installed.

‹ Newer Posts  •  Older Posts ›