August 2006 Archives

Inscrutable Java Warning

In my eclipse environment, I get warning like this. I never remember the point of them, and whether I should worry:

Type safety: The cast from Object to ArrayList<String> is actually checking 
against the erased type ArrayList.

I found this nice, concise description here:

The compiler is warning you that the cast you are doing is only ensuring the Object is an ArrayList. It can't tell if it truly is an ArrayList<String>. If it isn't, on your head be it. If it is not really an ArrayList< String> expect a ClassCastException as soon as you do a get, even though there are no explicit casts near the get in your code. The problem in essense is that serialised objects contain no record of their generic type. Many think that design decision was a big mistake.

Ugh.

Using a bluetooth keyboard with a Treo 650

| 1 Comment

It apparently does not work, at least not easily. I tried this with my Apple wireless keyboard and my Treo 650, and the treo couldn't really understand the device. It finds it, and even tries to set up a confirmation password, but then it fails with a generic error message.

Parallels Desktop and Mac Pro

As I noted, Parallels panics my Mac Pro. Presumably it's some kind of 64-bit thing. Parallels has now officially acknowledged the problem, and it looks like a new build will be coming very soon.

Tips for installing Ruby mysql module in OS X Tiger

I got my new machine and my ruby installation was pretty broken. The ruby that comes with Mac OS X is hopelessly out-of-date, and I had forgotten the things to do to get it to work.

Hand-building ruby from source to get to 1.8.4 is the first thing to do. Then I move the /usr/bin/ruby that comes with mac out of the way and create a symlink to /usr/local/bin/ruby, and ditto for /usr/lib/ruby (symlink to /usr/local/lib/ruby). That way I'm not going to get confused and launch the wrong ruby.

Then, you need to install the Ruby mysql module. I guess I'm a mysql bigot, but don't most people use mysql? I know that there are lots of choices out there, but mysql is what most people use, just for fooling around with stuff at least. Seriously.

To build ruby mysql, follow the instructions at the tmtm.org. In particular, you want to make sure that the configurator can find your mysql includes and libs, e.g.:

% ruby extconf.rb --with-mysql-dir=/usr/local/mysql

If you have a server environment that is behind a "jump box," and you have some network services you want to access, you can use SSH tunneling to get to it. In this example, I have a splunk server inside the inner firewall, a jump server in the DMZ (but behind the outer firewall). To access my splunk web UI, I do this:

ssh -t -L 8000:localhost:8000 jumpbox.example.com 'ssh -L 8000:splunk.inside.example.com:8000 splunk01'

This forwards access to http://localhost:8000/ through the chain to my splunk server.

Note to self: think of a clever Chuck Norris parody.

This one is hilarious.

The java one is older, but quite amusing.

Going Private pwns

Going Private is one of my favorite blogs. It's half brilliant financial analysis, half brilliant satire. Figuring out which half is which is what makes it so much fun.

This article is a great example, especially for this nice payoff:

"I expect it is routine maintenance on the Exchange server," Todd stammers.

"You are using... Microsoft Exchange?" You would think Microsoft Exchange was illegal given her tone.

Enable Postfix mail on Mac OS X Tiger

I got my shiny new Mac Pro. It's wicked fast. But now I get to find all the obscure modifications I made to my old machine over the last 2.5 years, and figure out how to reapply them.

First, increase the stupidly low process limit.

Next, enable Postfix (thanks to Mac OS X Tiger for Unix Geeks):

Edit /etc/postfix/main.cf and set up these variables:

# my machine name is "buffy"
myhostname = buffy.example.com
mydomain = example.com
myorigin = $mydomain

If you want mail forwarded to yourself (if you have cron jobs that will send mail to your local account, for example), edit the aliases file:

# put your local aliases here 
billo:  [email protected]

Now you need to start postfix:

sudo postfix stop
sudo postfix start

Finally, you need to put postfix start in a startup script in /Library/StartupItems. Left as an exercise to the reader.

Ubuntu Linux on Powerbook G4

| 2 Comments

I got sick of how slow my old powerbook (800MHz) G4 was running Mac OS X (Tiger). I wiped out the disk and installed Ubuntu 6.06. It seems to be just working. Sound, graphics, battery management and wireless network all seem to work out of the box. Unfortunately, it doesn't come pre configured with essentials like emacs or tcsh, so I have to add those.

Seems to boot a lot faster, to start!

Update:

Some bad things: sleep/suspend don't seem to actually work; the fan is still going while it's "asleep."

WPA2 encryption is known not to work, apparently, a big/little endian thing in the base driver.

There is no nvidia driver for PPC, only i386.

I'll stick with it for a few weeks to see if the no sleep/no WPA are showstoppers.

note to self: how to become a CentOS mirror

set emacs coding system

| 1 Comment

Every now and then I try to create a new XML file in emacs. It's something I don't do that much, because I hate XML. Hate it. But that's a rant for another day.

The problem I run into is that when you make a new buffer in emacs, it sets the default encoding scheme to iso-latin-1. And, of course, XML is (by definition) utf-8. Emacs tries to be all helpful and says "hey billo you idiot, iso-latin-1 is wrong. change it." Naturally, it doesn't tell me how to change it. So I always waste time trying to remember how to fix the encoding. Since I can't remember anything, I'm writing this note so I can waste less time in the future. I hope I remember I wrote this note.

The solution is:

M-x set-buffer-file-coding-system

Answer: utf-8

Mac Pro

Oh baby.

Screenshot 44

Apple WWDC fanboy-dom

I'm all anxious about WWDC. I'm most interested in Leopard (OS X 10.5) announcements and the Mac Pro.

Leopard: I really hope they turn virtualization into an OS feature. How great would it be to be able to run a little Linux VM and one or two Windows applications right out of the box? Also, spotlight just blows. They should fix it or remove it. If they remove it, maybe google will finally release google desktop for OS X.

Mac Pro: the other nerds at work who run Intel workstations (Ubuntu) endlessly tease me about my slow G5. I've got no upgrade path to fight back until the Intel workstation is released. I hope the Mac Pro is fast.

Jon Gruber (Daring Fireball) has a bunch of WWDC predictions. I'm a big fan of his articles, and I agree with much of this one. However, he takes a little dig at the old "striped" interface decorations in OS 10.0 and 10.1 (X.0 and X.1?), calling them goofy and ugly. What about brushed metal? How can that possibly be considered any less goofy, ugly or childish? I'm hoping they make a universal control in Leopard to set the skin of applications. Let people with no taste make their UI look ugly if they want: let the rest of us have plain, elegant austere windows.

Regarding the Apple Phone: it would be really great if Apple brought focused design and simplicity to the wireless communication device. To me, that means making a phone that is great at making phone calls, and explicitly not an iPod. Adding a phone to an iPod or vice versa ruins the simplicity and elegance of both. (Not there there are any simple and elegant phones these days. How I miss my Nokia 8800!) What I would like to see from Apple in the wireless space:

- A dedicated push email device. Like a blackberry, but no phone BS. Think Nano form factor. But no iTunes.

- A dedicated phone: with big physical keys: 0-9, #, *. Maybe with push email. No iTunes. Please. Think nano form factor again, but maybe clamshell (fold nano in half.)