Select Page

Persistant port compile options

A while ago I was again frustrated by the limitations in FreeBSD ports. I did a few portupgrade’s on some software only to discover later on that I did not specify the same environment variables as last time I did it, the result was a bunch of badly behaving ports.
After some discussion on IRC we all agreed it would be pretty simply to just store a per-directory environment somewhere. I mentioned this to Neil who pointed me at penv.

penv is a utility which helps manage persistent per-directory environment settings. In other words, it saves you the trouble of setting or specifying the same environment variables over and over again when executing programs in a specific directory. The main reason for the initial development of penv was its use with the FreeBSD Ports Collection , but it may be used for other day-to-day tasks, too.

While this sounds very nice, it has some issues, if you install port a which required port b something has to run penv when building port b else it won’t work. The penv author has a patch to make which works very nice but is a bit drastic to my liking.
Some reading of the portupgrade man page got me to the -M command line option which the man page is something to prepend to the commandline of make. Did not sound right at the beginning but eventually this turned out to be just the ticket.
In my /usr/local/etc/pkgtools.conf file I put the following:

PORTUPGRADE_ARGS = ENV[‘PORTUPGRADE’] || ‘-M penv’

and now for each port that I have specific build requirements I simply do:

# cd /usr/ports/net/centericq/
# penv -c mkdir
# penv -S WITH_MSN=1
# penv -L
WITH_MSN=1

And any further portinstall or portupgrade operations on the centericq port will always build it with MSN support.

Worldwide localised RSS feeds

While looking for a replacement for the dodgy moreover.com RSS feeds I came across http://www.local-news.net/ a nifty site that provides web based and RSS based news feeds based on a large database of syndicated content.
It is a frontend to Any RSS that provides complete term based search on their database while local-news.net will use some kind of location aware lookup to find out where you are and then show the news nearest to you based on your IP address, you can also search and browse for other locations if its not 100% accurate. Will try this for a while and see how it works.

moreover.com RSS ads

moreover.com has RSS feeds that is based on searches through their big database of syndicated content, I have been reading their London News feed for ages but they have recently started introducing ads into their feeds. I do not have a problem with ads in RSS feeds but I think people need to think how they do it a bit more.
The moreover feeds insert the ad into the feed with a time stamp of the request time. So each time you load the feed you get a new news item for the ad. My RSS aggregator now has about 50 entries advertising travel to Ibiza. This is very annoying and I am forced to unsubscribe from this feed now, I wonder how long it is going to be before aggregators start supporting filtering duplicate entries or entries matching filter strings.

SMTP Auth with Exim and Courier authdaemon

UPDATE: There is now an Official Exim FAQ Entry for this, You should use this for best results as the method below does not work on all versions of authdaemon. If you were having issues with Debian and the solution below, look at the comments section for an update from Debian.
I have been meaning to get SMTP AUTH going on my server for a while, there are a few samples I saw that was looking very nasty for getting authdaemon and exim to talk to each other. Eventually Leon got one of my machines to work in a way that I quite liked, this is my current setup in exim 4. All it requires is that the user that exim runs as can read and write to the courier authdaemon socket.

# Unix clients
plain:
driver = plaintext
public_name = PLAIN
server_condition = \
${if eq {${readsocket{/usr/local/var/authdaemon/socket}\
{AUTH ${strlen:exim\nlogin\n$2\n$3\n}\nexim\nlogin\n$2\n$3\n}}}{FAIL\n} {no}{yes}}
server_set_id = $2
# Windows clients
login:
driver = plaintext
public_name = LOGIN
server_prompts = Username:: : Password::
server_condition = ${if eq {${readsocket{/usr/local/var/authdaemon/socket} \
{AUTH ${strlen:exim\nlogin\n$1\n$2\n}\nexim\nlogin\n$1\n$2\n}}}{FAIL\n} {no}{yes}}
server_set_id = $1

Very nice and simple, now I can SMTP auth against my SQL and PAM based auth that is in use on my machines. Works well with Outlook and Evolution.

The Regex Coach

I am writing a lot of regex these days for a spam plugin I wrote and it seems I am a bit rusty or simply just blind. Remembered Barry mentioned some tool ages ago that visually test them a little bit of Googling on his site found it.
I can also recommend this as a very good tool for debugging complex regular expressions.