Phillip Pearson - web + electronics notes

tech notes and web hackery from a new zealander who was vaguely useful on the web back in 2002 (see: python community server, the blogging ecosystem, the new zealand coffee review, the internet topic exchange).

2009-1-23

Small-scale revision control

Here's something I'd like: revision control that stores *ALL* its (required) working-directory metadata inside the actual files.

This would be a godsend for when you have to work with people who don't grok the revision control religion and like to do things like copy scripts around the place and make many small untracked modifications. The idea would be to have a comment somewhere in the file pointing to the repository, path, and version. The RCS could have a temp folder somewhere else on the system to cache revisions for fast local access.

Then, wherever you are, you could run $RCS <status|commit|update> on any file containing a magic metadata block connecting it to the repository. I guess you could write this as a frontend to any current revision control system; the metadata block could refer to a Subversion or Git repository path, and operations on it would set up a working directory with just that file and the appropriate metadata, then act as usual.

Locking down a MediaWiki

I know, it's a crime against wiki nature, but sometimes you want to lock down a MediaWiki install so only certain people can edit it. To do so, put this in LocalSettings.php:

  $wgGroupPermissions['*']['edit'] = false;
  $wgShowIPinHeader = false;
$wgGroupPermissions['*']['createaccount'] = false;

Then, to create someone an account, you have to log in, then return to the login page and click 'Create account'. The flow is a bit weird; the best I can recommend is to bookmark the 'Create account' page, which will be something like this for a wiki on http://example.com/:

  http://example.com/Special:UserLogin?type=signup