Archive for March, 2008

How to unbury your postfix mail queue from a mail bomb

At work, our little old mail server was getting buried by some frigtard sending thousands of messages to an unused alias. Here’s how we extracted the bad messages and freed up the mail queue.

First, see where all the mail is coming from:

# postqueue -p

Now, loop over those messages, looking for that person’s mail:

foreach mid (`postqueue -p | grep frigtard@frigtards.com | gawk '{print $1}'`)
  postsuper -d "$mid"
end

Yeah, I use csh. So what?

Pardon the grumpy tone of this post. But I’m grumpy, if you can imagine why.

Add your own boot command script to Mac OS X

If you have some things you want to start when your mac boots, here is how to do it. I use mine to start up an SSH keychain, start a mysql server and a memcached.

First, you’ll need to be root:

sudo tcsh

Now, make a directory for your stuff. Suppose your name is “Buffy.”

mkdir /Library/StartupItems/buffy
chown root /Library/StartupItems/buffy
chmod 755 /Library/StartupItems/buffy

You need to put two files in this directory. The first one is called StartupParameters.plist and should look like this:

{
Description = "buffy";
Provides = ("buffy");
Requires = ("Network");
OrderPreference = "Late";
Messages = {
start = "Starting buffy";
stop = "Stopping buffy";
};
}

If you were some kind of Darwin super guru, you could set all kinds of other options in here, but let’s pretend for now that you just want to save yourself remembering to type extra stuff after you reboot your mac. Crap that sentence was ugly. Sorry.

OK, now you need to write the actual script to start things. name that file buffy

Here is an example:

#!/bin/sh

##
# buffy local stuff
##

. /etc/rc.common

StartService ()
{
    ConsoleMessage "buffy startup"
    # start postfix mail server
    postfix start
    # this is some weird stuff that only i'm interested in
    # but I'm sure  you have similar weird stuff
    /r9/mysql1/bin/r9mysqld start
    export EVENT_NOKQUEUE=1
    # note the 'su' things so these process run as the 'buffy' user
    su buffy -c '/usr/local/bin/memcached -d -m 128 -p 11211'
    su buffy -c 'sh /Users/billo/bin/keychain'
}

StopService ()
{
    ConsoleMessage "buffy shutdown"
    /r9/mysql1/bin/r9mysqld stop
}

RestartService ()
{
    StopService
    StartService
}

RunService "$1"

Make sure the files you create are owned by ‘root’ otherwise OS X will ignore them.

Spammers having a nice chat.

A snapshot of my spam folder:

spammers having a nice little chat

I’m happy for them, that they give each other positive, nurturing feedback.

Harsh Site Requirements

I started using FireFox 3. It’s pretty stable. I went to some random web pages and got this:

screenshot_162.jpg

Yikes. I’m banned. Bad, bad me.

FireFox 3 Upgrade Notes

Plugin update check doesn’t work for a number of plugins (in particular: FireBug and Web Developer.)

You can get FireBug to work by visiting getfirebug.com and downloading the 1.1 beta.

Get Web Developer to work by visiting the web developer plugin page. While, you’re doing that, visit Chris Pederick’s home page and click on an ad. It’s the least you can do.

My first impression of the latest beta (b4) is that it seems very fast page rendering. Maybe as fast as Safari.

How to Change the Default Background Image in Leopard

no-stars-dammit

I really don’t like the astronomy picture as a default background. I think I’ve gone through all the stages of personal computer decorative design, including crazy transparent terminals, shifting slideshow backgrounds, etc. I’m now at the stage where I want my visual environment to be boring, austere. I always choose a solid, medium-grey background. I turn off all visual transition effect i possibly can. I really just want to see the programs I’m working with. Anything else is more than my tiny brain can handle comfortably.

So, in Leopard, to get rid of space-the-final-frontier or whatever it’s called, do this:

First, make a screenshot of a piece of gray background, call it boring.jpg. Then:


sudo tcsh
cd /System/Library/CoreServices
mv DefaultDesktop.jpg DefaultDesktop_leopard.jpg
cp ~/boring.jpg DefaultDesktop.jpg

Review of Apple TV

I’ve been kicking around the idea of getting an Apple TV for a while. I have a Tivo, and it supposedly can do things like show my digital photos and home on TV. But I’ve tried to set it up a few times, and various things either don’t work at all, or are torture to configure. Part of the problem is that I have a Mac at home, and although Tivo does claim to support Mac, it doesn’t actually seem like they do. (I even bought Roxio Toast so I could copy shows from Tivo and burn DVDs or save them to an iPod. That actually works, but it’s something I rarely care about doing.)

I have over 10,000 digital photos, almost all family stuff going back to 1999. But I also have a few thousand family film/slide pictures I’ve scanned in going back to 1962. It’s fun to look at them, but it’s more fun to look at them with the whole family. This is the thing that was interesting to me. If my photo library was just a click away on the TV remote, it would be a lot more likely that we would site with the kids and look at them.

The same applies to our home videos, but they are mostly still sitting on digital tape, waiting to be imported and cleaned up. Until very recently, I didn’t have anywhere near the disk space to hold all those hours of kids birthday parties and family trips. But I recently got a home network storage device, so maybe I’ll decide to get organized and get that stuff online finally.

I was in the Apple store today, getting a video out cable for my ipod nano, and I started playing with the Apple TV they had there. I’ve been putting a some of my DVDs on my ipod, so I can have a library of things to watch on plane trips. (The video cable was so that I could put some kids shows on the ipod, and take it with us on our upcoming winter vacation. It’s easier than bringing a pile of DVDs, and eliminates the risk of them getting scratched up. That’s the theory anyway; I still have to choose about 12 hours of programming to load onto the ipod, and then put it on there.)

The new user interface on the Apple TV is really nice. It’s very simple, very clean. I like that it is white text on black background, instead of the shifting blue/green/red hazy loop that plays in the background on Tivo. So I decided to buy it on semi-impulse. If thinking about something for 6 months and reading about it before you buy it is impulse.

It was pretty easy to set up. I plugged the component video into my TV (my TV only has one HDMI input, and that’s used by the DVD player.) I plugged an ethernet cable from my network in, power it up and it came right up. I had to type a 7-digit code into my iTunes on my home computer, and then the Apple TV started getting music, movies and photos from my iTunes library. It was at this point that it really hit me how freaking cool this thing was. Right on the TV, I could see all those movies I had set up for my ipod. “Wow, I could just totally watch Star Wars right now, without going into the closet, finding the DVD, and opening the DVD player.”

I know, “opening the DVD player.” How impatient can I be, right? But seriously. Have you opened a DVD player lately? You press the button to eject the disc drawer. Then you wait there for 57 million centuries while the thing decides if it should open. You’re not sure if you pressed the button all the way, so you push it again, but OH! it started to open, so now you just closed it again. HA! How hard is it to open a drawer? This is why consumer electronics suck in general, and this is why Apple (or anybody who tries a little bit to put themselves in the shoes of the consumer) is going to eat (or is now eating, I suppose) Sony’s lunch. It seems like a very tiny minority of consumer electronics pay any attention at all to the user experience.

I feel like this is really the inflection point, where digital audio was about 8 years ago, when your music suddenly was at your fingertips instead of on a shelf in the living room. It’s taken a while for video to get to that point; mostly I think it’s just a function of how cheap storage has to be. Terabyte storage is now affordable to have at home. Certainly portable media players, like the ones from Creative, have been around for years. But until you have enough reliable disk space, you’re not going to make a serious effort to encode your whole movie collection.

So I’ve been burning a lot of CPU time encoding my personal movie collection onto the Apple TV. Gosh, now I wish I had an 8-core machine instead of a little 2-core! Here’s something that’s going to drive Intel chip sales: all those millions of movies people are going to be encoding for their iPods, Apple TVs or other media players. Encoding a 2-hour movie takes an hour on my two-core machine; it would take 15 minutes on an eight-core Mac Pro.

Regarding the movie rentals on Apple TV, I was initially annoyed at the 24-hour time limit on watching a movie. But in practice, it hasn’t been bad. I just don’t start a movie unless I know I’ll be able to watch it right through. For me, that means late at night, after the kids are all asleep. It is definitely true for me, though, that I would rent more and watch more if I could watch a movie in 2 or 3 chunks over the course of 4-5 days.