Wednesday
23
Apr 2003

Apache 2

(3:18 pm) Tags: [Site]

Just spent 5 hours wrangling Apache, PHP, APR, APR-Util, neon, and subversion into the same box. Finally looks like it is going to work. As of today, I had to drop back from httpd HEAD to 2.0.45, tried PHP 4.3.2RC1 and failed, jumping back to 4.3.0, with neon 0.23.9, apr HEAD, apr-util HEAD, and subversion HEAD.

Popularity: 10%

Comments: Comments Off
Tuesday
22
Apr 2003

Tasks b2 post does (not) work in Mozilla nightly

(3:19 pm) Tags: [General]

Just noticed that the b2 post from tasks did NOT work from the Mozilla nightly. I had to use IE on my home desktop.

It worked great from the Mozilla 1.3 install on the laptop, but the nightly just makes me login. I thought it was because I hadn’t logged in before, but I was logged in. And even after I went through the login page, it brings up the blog editor with an empty a tag in it, not the task that was intended to be posted.

Strange. Perhaps I will look into it on the next post :)

And now it just did work. Piece of shit. Nevermind, Alex.

Popularity: 10%

Comments: Comments Off

Vacation Day 1 & 2

(3:12 pm) Tags: [General]

First day of the vacation, woke up late after some relatively good sleep (the dog was pissing me off). Set up Amanda’s email on dotnot infrastructure so that she can also benefit from the spam setup. Reading the blogs, drinking my coffee, staring at the wall…

Ended up driving around the Auburn/Grass Valley/Nevada City area for some relaxation. Came back and did a little more sysadmin cleanup on dotnot.

Day 2: Woke up a little late, went to the basketball playoff game (we lost), then came back home and made some lunch. Now I am starting work on notlaunch.

This vacation stuff is very nice :)

Popularity: 10%

Comments: Comments Off
Monday
21
Apr 2003

Tasks 1.5rc1

(11:02 am) Tags: [General]

Downloaded tasks 1.5rc1, installed on dotnot.org.

The Good: the files are now readable on my unix box. With the exception of LICENSE.txt and README.txt, which is still in the Mac line ending style.

The Bad: the directory is named the same as the last tasks install I did, so I have to jump through hoops to unpack it. I would prefer that the directory be tasks_1.5rc1 (ie the filename is the root directory name), so that I can just unpack it and then symlink it. On one side of the argument, that is the Unixy way. On the other side of the argument, I understand that Alex is trying to target the sysadmin challenged types, so a little pain for me is probably alright.

This will also be my first b2 post from tasks to b2. Way to go Alex!

Popularity: 10%

Comments: Comments Off
Sunday
20
Apr 2003

Vacation at last!

(5:10 pm) Tags: [General]

So I am finally, officially on vacation. So I can now focus my time on recharging. 2 weeks until recharging complete.

Dropped Jason and Michelle off at the airport on their way to New Zealand for a week. That means Alex gets to hold down the fort until we get back. Thanks Alex.

Popularity: 10%

Comments: Comments Off
Thursday
3
Apr 2003

LaunchBar and .NET

(11:19 pm) Tags: [General]

In attempting to keep the skills sharp, I am writing a program in .NET to emulate the functionality of LaunchBar for Mac OS X.

In doing so, I have found that I still have to delve into the Win32 API to get some work done. In that respect, there is still a ways to go. An example is mapping a hotkey to your application. Since Alex gets the pleasure of working on both Windows and Mac, I wanted to make my launcher as much like LaunchBar as possible. The first step is the way you launch it. On the Mac, you press Command + Space, so I need to do the same on Windows with WindowsKey + Space. So I dig into finding out how to do this. After a few hours of Googling around, I come up with the proper sequence:

  1. Call the GlobalAddAtom() function, to get a quasi-unique integer for yourself.
  2. Call the RegisterHotKey() function, passing your form’s handle (so that Windows will activate your app if it is not currently active), this integer from the previous call, what key you would like to register, and the modifiers on it.

Then, when your application is about to exit, you need to clean these up:

  1. Call the UnregisterHotKey() function
  2. Call the GlobalDeleteAtom(), releasing your integer back to the OS

What this maps to in .NET:

//Register the functions that you want to use
	
[DllImport(”kernel32″)]
private static extern int GlobalAddAtom(String atomString);
	
[DllImport(”kernel32″)]
private static extern int GlobalDeleteAtom(int atom);
	
[DllImport(”user32″)]
private static extern int RegisterHotKey(int hWnd, int id, uint modifiers, uint vk);
	
[DllImport(”user32″)]
private static extern int UnregisterHotKey(int hWnd, int id);
	
//Then call the functions to register the hot key
int atom = GlobalAddAtom(”WIN+SPACE”);
//0×8 is the flag for the Windows Key modifier, and 0×20 is the space key
int result = RegisterHotKey(Form.Handle.ToInt32(), atom, 0×8, 0×20);
	
//Then call the functions to un-register the hot key when you are about to shut down.
UnregisterHotKey(Form.Handle.ToInt32(), atom);
GlobalDeleteAtom(atom);
	

Popularity: 10%

Comments: Comments Off
Tuesday
1
Apr 2003

Spam Handling

(8:39 am) Tags: [General]

I mentioned that I am using Bayespam. I installed this after reading Paul Graham’s A Plan for Spam.

The reason I have installed and configured in the way descbribed is to provide spam filtering at the server level, since I check email from a myriad of places. I also wanted to be able to teach the spam filter from the email client, and have the server learn. All of this without accessing the commandline, since I am going to attempt to provide the same functionality to friends and family.

Basically, I have set up my Maildir to have a subfolder named spam. This is where spam-looking emails are sent. Note that they are NOT rejected, because how would we teach ourselves in the future, and avoid false positives. This way each person can teach the system what is spam to them, and the server will continue to learn on a daily basis. CPU hungry? YES. Effective? YES!

After setting up the Maildir, I then wrote a simple little python script to run under cron every night, deleting the old spam index, and recreating it, including all folders in the Maildir, so that subfolders are not excluded.

The current script looks something like:

#!/usr/bin/python
	
import os, glob, string
	
#remove the existing spam database
os.system(\"rm -f .spam.db\")
	
#build up the command line to create the spam vs ham index using bayespam
cmdline = \"bayes_process_email.pl --spam Maildir/.spam/cur --good Maildir/cur\"
for x in glob.glob(\"Maildir/.*/cur\"):
        if string.find(x, \".spam\") == -1 and string.find(x, \".Trash\") == -1 and string.find(x, \".Sent\") == -1 :
                cmdline += \" --good \"\" + x + \"\"\"
	
cmdline += \" -o .spam.db\"
	
#print out the cmdline, so that it shows in the cron email
print cmdline
	
os.system(cmdline)

Then, I set up a .qmail file that looks something like:

| /usr/bin/bayes_spam_check.pl -r /home/ssanders/.spam.db spam; if [ $? -ne 0 ]; then /var/qmail/bin/condredirect ssanders-spam@dotn
ot.org true; fi
./Maildir/

Then, one last thing, a -spam alias to deliver spam directly to the spam subfolder:

./Maildir/.spam/

The next thing on the agenda is to use the bayesian spam filter to automatically send email to sub folders ;)

Popularity: 10%

Comments: Comments Off