Diary of a geek

September 2004
Mon Tue Wed Thu Fri Sat Sun

Andrew Pollock


Other people's blogs


RSS feed

Contact me

JavaScript required

Tuesday, 21 September 2004

Running multiple instances of Gallery

Gallery rocks, 'nuff said.

I only became aware of Gallery at LCA '04, when Rasmus mentioned it in his PHP tutorial. I immediately chucked it on my webserver and threw out the dodgey thumbnailing-on-the-fly PHP code I'd written, and I've never looked back.

A little while before I reinstalled daedalus in the June holidays, my friend Alison, who is over in the UK at the moment, asked me for recommendations on online photo gallery websites. I told her she could use my Gallery after I'd reinstalled daedalus, but what I wanted to do was rather than have all her photos lumped in with mine, was to have a separate instance of Gallery with individual albums for all my friends, similar to what I'd seen done elsewhere.

Now I'd looked into running multiple instances a few times (I really didn't want to copy the static Gallery code to a second directory, because that would remove the benefits of security updates and whatnot, and was generally not the elegant solution I desired), but the FAQ didn't mention it, and Googling for such a generic term wasn't turning up much either.

So tonight I finally sat down and looked at the code, and it was remarkably simple. The way I wanted to do it was define an environment variable on a per virtual host basis, which specified where to look for the config.php file. I added an SetEnv directive to the vhost for the new Gallery instance, and only had to patch one file to add some additional logic. If I can get the Gallery upstream to accept the patch, it'll all be good. At the moment, a new Gallery package would clobber everything, which is exactly what I'm trying to avoid.

It's still not ideal though, as when you first rock up to the new instance, it creates a default user database, with no users, and I've got no idea how to add new users. I ended up copying the user database from my other instance to bootstrap things.

[04:09] [tech] [permalink]

m4d l33t meeting scheduler

It's been ages since I've set myself a little coding project, but recently when Michael asked if I wanted to take over organising CLUG meetings I immediately saw the potential for yet another automated system.

So I knocked up a very simple PostgreSQL database, a spanky looking PHP front-end (which I should probably apply some access controls to) and wrote a whiz bang Perl script to query the database and send emails (can you tell that I'm a bit chuffed with this thing yet?).

I'm coordinating speakers for the monthly CLUG (fourth Thursday) and CLUG Programmers' Special Interest Group (PSIG) (second Thursday) meetings, and so my funky Perl script checks the database on a Monday to see if there's anyone talking on that Thursday's meeting, and if there isn't, mails the CLUG list asking if anyone would like to talk. On a Tuesday, it announces that week's meeting, with details from the database if there are any.

Noteworthy Perl modules that have to get a mention are Date::Manip, which does so much cool, er well date manipulation, and a new one I found to add to my toolkit, Text::Template.

[00:40] [code] [permalink]