Wednesday, July 18, 2007

Using a Macintosh with a Timex Data Recorder 2

I was given a Timex Data Recorder 2 with a Timex GPS/watch/heartrate setup as a gift. I only use Macs at home, so I needed a way to make this work. Fortunately, there's software called LoadMyTracks that can download the data from the recorder to my Mac. It seems to crash if I try to use KML, but I can get GPX out of it, and then have a website translate that to KML if that's what I want. And I can upload to Google Earth or MapMyRun.

The one problem I had was that without the Timex PC software, there was no way to clear the recorder. But a helpful guy at Timex tech support passed on the way to do this with just the recorder itself, so I'm posting it here in that hopes that if you need the info, Google will bring you to it.

From Timex Tech Support:

Clearing the Memory Manually
NOTE: The following procedure should only be performed if you are
absolutely sure that you don't want to keep any of the workouts that are
stored in the Data Recorder. If there is any data that you wish to keep,
make sure that it is transferred to the PC BEFORE you clear the memory.
Start with the Data Recorder powered off. Then, press and hold the push
button for 5 seconds. When the LED flashes amber, release the push
button and then quickly press and release the button again while the LED
is flashing. If you did it correctly, the LED will change to a solid
green color for a moment, then go out to indicate that the memory has
been cleared. You can now turn the Data Recorder on normally and use it
to record the data from your workout.

Thursday, July 12, 2007

One more thing I needed to do with my Spamassassin, amavisd-new, clamav setup was to clear out the quarantine folder on a regular basis.

So I made a script to do this:

rm /var/virusmails/*.gz

and set it as a cron job.
Spamassassin, amavisd-new, clamav - all with Postfix for Mac OS X 10.4

It took me forever to get this configuration running, but then once I did, I needed to get it set as a startup item so that amavisd would launch at boot after postfix. Eventually I figured out what to do, I think, and I'm posting it here.

Note: I'm not a big OS X programmer, so if this is unkosher, I take no responsibility. But it works for me. And if/when I forget what I did, I'll have this as a reference.

First, I made a folder in /Library/StartupItems called spam. You'll need to have root access enabled and the password for this:

sudo mkdir /Library/StartupItems/spam

Then, in spam, I made two files. One is called spam. Make it like this:

cd spam

sudo vi spam

then press "a" to get into the insert mode and paste this:


# amavsid-new

. /etc/rc.common

StartService ()
echo "Starting amavisd"
/usr/bin/amavisd start &
/usr/bin/postfix reload

StopService ()
echo "Stopping amavisd"
/usr/bin/amavisd stop

RestartService ()
echo "Restarting Amavisd"
/usr/bin/amavisd reload &
/usr/bin/postfix reload

RunService "$1"

Then press "esc" then ":w" then ":q" to save and quit.

Next, you need the StartupParameters.plist file:

sudo vi StartupParameters.plist

then press "a" to get into the insert mode and paste this:

Description = "amavisd";
Provides = ("amavisd");
Requires = ("Network");
OrderPreference = "Late";
Messages = {
start = "Starting amavisd and reloading postfix";
stop = "Stopping amavisd";

Then press "esc" then ":w" then ":q" to save and quit.

Now reboot the machine. You'll get a message that your privileges are wrong, and an offer to fix them. That's the easiest way to get them right. Fix them, and reboot again. Then check your system log to see that all went OK:

tail -100 /var/log/system.log