SPF Records & DNS

I’m using Gmail for Business to handle email for a custom domain, which periodically sends email. I use Gmail’s SMTP servers.

I’m using AWS Route 53 to handle the DNS for this domain.

Emails started being rejected by grumpy MTAs between me and my users, so I decided to create an SPF record for that domain.

There’s the rub.

Route 53 allows you to create a specific record of type SPF, but not all MTAs use that record type. Some look for a TXT record with SPF information inside.

So, the best thing to do is create both the SPF and TXT record types, and provide the same information (enclosed in double quotes) for each.

Namazu Tips

This is a place to store tips on using/configuring the namazu file system search engine (on Linux).

To get namazu to index hidden files:
1. Copy the sample config file somewhere.
2. Uncomment & change the line:
$DENY_FILE = “.*\\.(gif|png|jpg|jpeg)|.*\\.tar\\.gz|core|.*\\.bak|.*~|\\..*|\x23.*”;
… to:
$DENY_FILE = “.*\\.(gif|png|jpg|jpeg)|.*\\.tar\\.gz|core|.*\\.bak|.*~|\x23.*”;
… i.e., remove the |\\..* part.
3. When you run mknmz, make sure to tell it to use your new config file. I.e., ... -f /path/to/namazu.conf

remember to include that semicolon after your $DENY_FILE or $ALLOW_FILE pattern declarations. Without it, shit won’t work properly.

when programatically calling mknmz to create the index or namazu to perform a search, be sure to use /full/path/from/root as well as enclosing your query in “quotes”.

Data Matrix Library


libdmtx is a library for generating Data Matrix images.

Steps require to install the libdmtx package and python wrapper on CentOS 5.2

yum install ImageMagick
yum install ImageMagick-devel
yum install python-imaging

Untar source, enter libdmtx-x.x.x directory.
(as root) make install

cd wrapper/python/
python setup.py install
/sbin/ldconfig /usr/local/lib
python test.py


OS X 10.6 Terminal Crash on Launch

Boss at work reports Terminal.app is crashing upon launch. He can’t use the email batch exporter I wrote; this is chapping his ass.

I launch it from his Dock… crash log reports BAD_ACCESS_something-or-other. No help there.
I try trashing his terminal preferences; no dice.
I downloaded iTerm2, as suggested by Adam, and bring that up on his Mac. It works.

So without thinking, I type: open /Applications/Terminal.app [Enter] into iTerm2, and it crashes as it has been.

Wait a minute.

open /Applications/Utilities/Terminal.app [Enter] … Success.

Somehow, Terminal.app got copied into /Applications (mistakenly), and that’s what his Dock shortcut was calling. Kill that copy, kill the shortcut, drag to Dock from /Applications/Utilities, and all is well.

I have no idea why having the app exist in a different place would cause this behavior… some mysterious callback shit, no doubt.

Webware for Python + Apache 2 on CentOS… Inside a VM

This post is a codicil to these instructions when attempting to replicate the described setup in a VM, specifically in VMware Fusion on OS X.

Following standard operating procedure results in:
Error: Can not listen for Adapter on (‘localhost’, 8086)

Make sure to disable or otherwise adjust SELinux and firewall settings to allow connections on port 80 and 8086.

Inside the WebKit-related <Location > directive of the Apache configuration file, use “” instead of “localhost”.

Inside your WebKit working directory, find the Configs directory, and edit AppServer.config. Change the line:
Host = “localhost”
… to…
Host = “”
… for listening on all interfaces, as the file describes.

Bounce both servers; experience victory.

AFP Weirdness Appears to be Perms Mystery

Problem: User connects his Mac (running Snow Leopard 10.6.x) to Apple Xserve (running OS X Server 10.6.x) over AFP, authenticates successfully, yet cannot view contents of a particular folder.

Investigation: SSH into Xserve, verify permissions of folder, its contents and its parents, ownerships, group memberships, etc. Everything appears to be in order. What could be the problem?

Solution: Remove trailing space in folder name. Instead of “Software_DD-MM-YYYY”, creator of folder has named it “Software_DD-MM-YYYY ” with a space character at the end. Removal of space at the end = contents viewable.

Stupid computers.

OS X (Snow Leopard) Terminal Wish-List

Answers may exist for these questions, but I don’t know them.

I wish I did, and my google-fu is weak.

1. How can I get Terminal.app to preserve the highlighted state of previously-selected text when I paste into that window? E.g., I often need to copy & paste the same “put” command in an sftp session. In Tiger’s (10.4.x) Terminal.app, I could simply click once on the appropriate Terminal window, the text would remain highlighted, copy, paste & be on my way. Since the upgrade to 10.6.x, however, the paste action causes the previously-dragged text selection highlight to disappear; after pasting, nothing is selected. Now I must re-drag to select, copy and paste every time.

2. Why doesn’t the up arrow work in sftp? On the command line and in an ssh session, you can press the up arrow to scroll through the list of previously-issued commands. Not so in the sftp client on OS X. Why not? Is there something I can configure on the client or server side to make this work properly?

I tried using iTerm instead of Terminal.app. Text remains highlighted after pasting, but iTerm doesn’t highlight or select end-of-line characters. I have to press the return key manually each time to enter the command. And the up arrow doesn’t work either. X11’s xterm is a piece of shit.

So what fixes or options exist to circumvent this behavior?