Archive for August, 2006

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

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

How to use an SSH tunnel chain to access a splunk server behind a double firewall.

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:  billo@example.com

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

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

http://www.centos.org/modules/tinycontent/index.php?id=22