Monthly Archives: June 2002

New Gallery

The version of the gallery software I’m using has been updated to v1.3

I’ve not had chance to merge back in my own EXIF preserving changes, so rotations are still decidedly dodgy, but the upgrade was as easy as suggested in the text file, although I do wonder what sort of slideshow is on offer when the default timeout is set to 3 seconds… The sub-album listing is well worth the update though, even if I decide to move onto a less CPU intensive system (still testing the various options).

Share

Still here (honest)

Nearly ready with the b2 version, but I got distracted.

Most of the SSI code has now made its way into php so that the it integrates tightly with b2. Some b2 code has been butchered to fit into my design, but most of it will stand (the automatic conversion of gm entries worked a treat). I did, however, get totally distracted by my new toy (early b’day present !) – a Sharp MD-MT88 portable Minidisc recorder. It was an absolute steal at nearly half the RRP, and I’ve been spening a lot of time trying to decide if the LP4 mode is actually terrible or great, or if I’ve simply gone deaf…

Share

mod_include

What does this mod_include offer ?

Post-processing of variables contained within a variable.

Doesn’t sound too helpful ? Well, maybe not, but I found that during construction of this site that I was frequently replicating 5 lines of text with only a single word altered (the left menu). This was both inefficient and awkward to debug, and didn’t lend itself to keeping a common look and feel for the site as a whole. This extension allows large blocks of text to be stored as a variable, and for the small changable part to be altered just before the result is displayed.

What’s wrong with set anyway ?

When a variable is used in the value entry of a set command the system searches for the current value of the variable and substitutes it immediately. This fixes the value of the variable created so that it never changes, which is good for some applications, but lousy for dynamic content.

Usage

This module is an extension of the normal Apache behaviour, and should be read as an addendum to the basic mod_include commands.

define
This command sets up a variable in the same way as the set directive, except that any variable names used are not parsed at this time, but stored as names until displayed with the macro directive.

var
The name of the variable (macro) to define.
value
The value of the variable (macro).
macro
This command will expand a previously defined variable and replace any instances of the variable named in var in the variable def with the value given in value. Note that like other mod_include commands, the order of the variables is important, and should be declared in the sequence shown below:

var
The name of the variable to replace inside the macro.
value
The value to replace the variable with.
def
The previously defined macro to seach through.

Examples

Change the font for a single phrase:
<!--#define var="FONT_FACE" value="<FONT FACE="Times">$TEXT</FONT>" -->
<!--#macro var="TEXT" value="Hello" def="FONT_FACE" -->
Output:
<FONT FACE="Times">Hello</FONT>
Add a hyperlink:
<!--#define var="LINK" value="<A HREF="$URI">$TEXT</A>" -->
<!--#set var="TEXT" value="Home" -->
<!--#macro var="URI" value="http://minimal.cx/" def="LINK" -->
Output:
<A HREF="http://minimal.cx">Home</A>

Impact

I do have more than just mod_include compiled into Apache, but the difference between the basic version and mine is 5136 bytes in the httpd executable. I don’t think that the time for standard mod_include calls would be adversely effected, as there are only two extra tests for the new words, and performance of those words is not comparable to the old system.

Licen[c|s]e

I’m not interested in making things any more difficult than they already are in this area, so this patch is distributed under the Apache Licence.

Download

Choose from a diff for Apache 1.3.24/1.3.26, or simply grab the entire mod_include.c file. For the merely curious, there is also an online version.

Improvements

The element order checking is not robust for #macro.

Feedback / Bugs / Feature Requests

Just send it to me and I’ll see what I can do to help out. Bear in mind that I’m doing this primarily for myself, so porting to various other versions of Apache is only likely to happen when I need it, but I’m more than happy to help out if required.

Share

More Greymatter screwiness

The archives are hosed :(

The link has been removed from the homepage, but of course clicking on ‘more’ for any extended entry will bring it right back up again (obvious if you’ve configed GM, otherwise trust me – you don’t need to know). This isn’t great news, as I’m only up to 26 items or so, and coupled with the fact that I still can’t get the older January 1999 page to build, I’ve decided to dump gm. I’ve looked on the forums, and there are people there who have both of my problems, but the answer isn’t obvious. I’ve tried perl -w, and that does show that the code dies in an infinite loop, plus the dates are lost for all older entries, and most of all I simply don’t need comment posting or karma – this site is pretty much a backwater, so all I want to do is provide some info.

Looking around, b2 looks pretty interesting (PHP/MySQL) so I’ll see if that does what I want. There’s no need to use plaintext and perl as I do control the server, and it does make more sense to put daat into a database…

Share

PostgreSQL 7.2.1 working on NetBSD/cobalt

Ok, I’ve got a patch for the build process, and it compiles and installs. Not tried any sort of performance or stability testing yet.

It’s a fairly simple fix to the src/template/netbsd file, with an extra three lines added in order to specify -mips2 to the gcc CFLAGS when the machine is running the cobalt port. I hope that there won’t be any non mips2 capable machines doing that, but then they won’t be able to compile the program anyway, as it requires mips2 opcodes in the s_lock.c file. I’ll be sending the patch to the PostgeSQL developers, but if you’re in the mood for an experiment, then try adding these three lines:

case $host_cpu in
  cobalt*)   CFLAGS="$CFLAGS -mips2";;
esac
Share

NetBSD

Well, things are working on the new URL, but NetBSD just doesn’t seem right for me just yet (sob).

The change over from blog.minimal.cx to [www.]minimal.cx went ok with just the expected config edits plus a cname for my local dns. The testing of NetBSD was a little more fraught (check the uptime log), but it all boiled down to using a too recent version of Linux to format the ext2 partition…

The 500MB drive I started with was already formatted, and hence worked just fine – the 13GB one was built from scratch, and eventually I bodged two drives onto the Qube and hoped the psu didn’t overload. I then used the 500MB to boot into NetBSD, and then use the ext2tools (can’t recall the proper name of the pkg) to format the boot partition without any extra flags (all linked to from the cobalt faq page).

All went swimmingly, and the system was behaving very well indeed, until I tried to find a database – MySQL isn’t fully supported due to the MIT threads package not working, and PostgreSQL doesn’t build as the locking appears to be broken – unfortunately I can’t tell if it’s due to the version of the CPU I have not supporting the instruction, or of the compiler isn’t happy…

Until I learn more about MIPS (and so try to fix things), I can’t really go for NetBSD, as 1.6 is getting closer, and this load isn’t totally broken yet.

Share
Page 1 of 11