Jazz and the MediaWiki package

And rain, I mustn’t forget the rain. I’m worrying about the roof, although far less than I used to (it’s a different roof). The jazz is the radio; it’s on.

But the main point this morning is exploring the mediawiki-lts package maintained by Legoktm. I’ve been meaning to look at it for a while, and switch my (non-playground) wikis over to it, but there’s never enough time. Not that there’s enough time now, but I’m just trying to get it running locally for two wikis (yes, the smallest possible farm).

So, in simple steps, I first added the PPA:

sudo add-apt-repository ppa:legoktm/mediawiki-lts

This created /etc/apt/sources.list.d/legoktm-ubuntu-mediawiki-lts-xenial.list. Then I updated the package info:

sudo apt-get update

And installed the package:

sudo apt install mediawiki

At this point, the installation prompt for MediaWiki 1.27.3 was available at http://localhost/mediawiki/ (which luckily doesn’t conflict with anything I already had locally) and I stepped through the installer, creating a new database and DB user via phpMyAdmin as I went, and answering all the questions appropriately. (It’s actually been a while since I last saw the installer properly.) The only tricky thing I found was that it asks for the “Directory for deleted files” but not for the actual directory for all files — because I want the files to be stored in a particular place and not in /usr/share/mediawiki/images/, especially as I want there to be two different wikis that don’t share files.

I made a typo in my database username in the installation form, and got a “Access denied for user x to database y” error. I hit the browser’s back button, and then the installer’s back buttons, to go back to the relevant page in the installer, fixed the typo and proceeded. It remembered everything correctly, and this time installed the database tables, with only one error. This was “Notice: JobQueueGroup::__destruct: 1 buffered job(s) of type(s) RecentChangesUpdateJob never inserted. in /usr/share/mediawiki/includes/jobqueue/JobQueueGroup.php on line 447”. Didn’t seem to matter.

At the end of the installer, it prompted me to download LocalSettings.php and put it at /etc/mediawiki/LocalSettings.php which I did:

 sudo mv ~/LocalSettings.php /etc/mediawiki/.
 sudo chown root:root /etc/mediawiki/LocalSettings.php
 sudo chmod 644 /etc/mediawiki/LocalSettings.php

And then I had a working wiki at http://localhost/mediawiki/index.php!

Configuring

I wanted a different URL, so edited /etc/apache2/sites-available/000-default.conf (in order to not modify the package-provided /etc/mediawiki/mediawiki.conf) to add:

Alias /mywiki /var/lib/mediawiki

And changed the following in LocalSettings.php:

$wgScriptPath = "/mywiki";

The multiple wikis will have to wait until later, as will the backup regime.

Enable Left Win as the Compose Key on Ubuntu

It is very easy to type “special” characters on Linux (i.e. those that aren’t printed on the keyboard). It’s called the Compose or Multi Key, and it’s brilliant.

First, enable it in ‘Keyboard settings > Advanced > Position of Compose Key’. I’ve got it set to Left Win because I never use that for anything and it’s in a similar position to the key on Apple computers that serves a similar purpose (but whose name I cannot remember).

If the Left Win option is missing (as it seems to be on some Ubuntu installations), you just need to edit /etc/default/keyboard and set:

XKBOPTIONS="compose:lwin"

Then run:

sudo dpkg-reconfigure keyboard-configuration

Once it’s all working you just need to look up the characters you want (Tim Starling also has a good list).

My new Kobo Mini

Today I bought a Kobo Mini ereader. It’s lovely: small and simple, feeling light and nice to touch. It’s got an on button on the top edge, and a USB plug on the bottom; the rest is screen, bezel, and back (the latter two of a sort of micro-fluffy textured plastic). So far, so good.

I bought it because I want to read Wikisource texts offline and away from the computer, and I don’t like the idea of continuing to print them out. It’s nice to proofread on paper, perhaps, but then carrying A4 pages around in manilla folders isn’t very good (for reading on the bus and whatnot). I don’t think it’s too hard to make notes about corrections in my notepad, so long as I give a suitable amount of context.

Anyway, the second thing about the Mini, after it’s pleasing appearance: it won’t work until it’s been ‘activated’! What on earth’s the point of that, other than to attempt to force me into buying books from some particular company or other?! Ridiculous! However, do it I must, if I want to read anything else — so I registered, and stumbled around in the Kobo Desktop application…

At first it looked like it mightn’t actually be possible to just copy the files I wanted to the device (despite it most sensibly mounting as a little external storage thingo), but it turned out that one must first activate it and then copy files to it, in order for them to be recognised. The file I’d copied before activation was ignored, but then after copying another there it kicked it into action and both were listed in the main menu. A relief.

So: all working on Ubuntu now, and I’ll report back in a few weeks on the actual readish fun of the thing….


Update: I wrote some more about my Kobo in July.

Setting up USB drives for backup

I use USB hard drives for backing up one of my machines, swapping them regularly but leaving everything else up to the backup script that runs daily. This means that I want to mount them at the same place every time, regardless of which drive I plug in or what device it is registered as. This isn’t very difficult because fstab can use UUIDs or labels to identify disks:

UUID=6B70-A309    /media/sw_backup vfat user 0 0
LABEL="SW_BACKUP" /media/sw_backup vfat user 0 0

(Note: these backup drives are formatted with FAT filesystems so that I can if need be restore on any system if required.)

To avoid having to manually add the disk every time I put a new one into rotation, I go with the label method.

To use this, each disk must be given the same label (and then not plugged in at the same time!). To set the label, first find the device:

sw@swbackup:~/backups$ sudo blkid
/dev/sda3: UUID="f31d1291-9d6f-441d-9f8d-fa34e9f569d5" TYPE="swap"
/dev/sda4: UUID="8a0b99a2-8a2e-4eae-7666-d607fbc44de5" TYPE="ext4"
/dev/sdb1: LABEL="NONAME" UUID="4A39-C8E7" TYPE="vfat"

Then sudoedit /etc/mtools.conf to add the following, where the device name is the same as above:

mtools_skip_check=1
drive s: file="/dev/sdb1"

Now mtools can change the label:

sw@swbackup:~/backups$ sudo mlabel -s s:
 Volume label is NONAME
sw@swbackup:~/backups$ sudo mlabel s:SW_BACKUP
sw@swbackup:~/backups$ sudo mlabel -s s:
 Volume label is SW_BACKUP

Sorry, Apple Inc., I’ve met something I like more than you

I first used a Mac in about 1993 — a Quadra I think it might’ve been, or a Performa. I’d come from DOS and Amiga and didn’t really know anything about anything — I didn’t even know there was anything to be known. I remember hearing someone talking about Windows, and assuming they just meant those rectangles one could drag about on the screen. A computer to me was a fun sort of thing which could usually be made to do (boring… but strangely compelling) things with textual input and output, thanks to variants of a ‘basic‘ language (AmigaBasic, QBasic, etc.). When I found AppleScript — and when I started using it for CGI programs (don’t ask!) — it seemed that all that one needed was an idea and some time, and the machines could be made to do anything!

Anyway, it was on System 7 that I spent most of my time (and its successors), thanks to my stepfather’s loyalty to Apples — and I loved it. I loved the whole Apple thing, really — this odd feeling that somehow, just by choosing this particular OS, one could be calmer, more focussed, write better (code or prose), and still spend one’s spare time rock climbing (as I did). That couldn’t be the case with those horrid business machines running Windows, that was for sure! I even got a reply from Douglas Adams himself once (a Mac person, as if you didn’t know), to my pedantic email with the subject “Macs are PCs too, you know” (he said, no, they’re not, that argument has been won, and Macs are something more than Personal Computers). I remember sitting in a bookshop reading the Apple Human Interface Guidelines, and thinking how much amazingly careful thought had gone in to everything — the distance between buttons in a dialog window, for example, or the algorithm for changing the length of the ‘thumb’ in a scroll bar as the content length changed.

Why on Earth was there such an element of personal identification with these computers?! I was an ‘Apple person’; otherwise known these days, more appropriately, as a fanboi! Which has lasted nearly twenty years… but I can’t keep it up. I’ve been through five or six Macs in that time — I’m typing this on my MacBook5,1 — but it’s time to move on. I’ve enjoyed them all, especially the feeling that they are reliable: physically solid and unlikely to break in my backpack. But I won’t be buying another. I’m losing faith.

No, I’ve lost my faith. I lost my faith as Apple wanted to control everything more and more — the whole ‘ecosystem’, as they say, of OS and programs and data and sources — and as my awareness of the value of open standards grew. Obviously, I’m not saying that one can’t work perfectly well with open standards on Mac OS, because I have been doing so for years and years. It’s just that the OS as a whole is not geared to helping people do that. I shudder to think of people who know no better and are tying up their entire digital archives in formats that offer no security for future access! (But don’t let me get sidetracked into that discussion…)

I’ll no longer align my computing life (which is a rather large part of my life, for better or worse) with a corporation who’s aims are less than honourable: so I’ve bought a Lenovo X220, and shall be running Ubuntu exclusively. (I would’ve done this years ago, except for the fact that my current hardware has been running well since 2008, and I hate the idea of discarding a useful machine. Also, I do most of my computing on Linux anyway; the local machine is just a gateway, really.)

Goodbye Mac OS! I’ve enjoyed the ride and learnt lots, but ultimately have been thwarted in learning on too many occasions. It’s time for a system that, should I come up against its limitations, can be changed to suit my needs.

So long and thanks for all the fish. ;-)

My xorg.conf

At last we have Ubuntu working with a SGI 1600SW Flatpanel display. Here’s the xorg.conf:

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following commands:
#
#   cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom
#   sudo sh -c 'md5sum /etc/X11/xorg.conf >/var/lib/xfree86/xorg.conf.md5sum'
#   sudo dpkg-reconfigure xserver-xorg

Section "Files"
	FontPath	"unix/:7100"			# local font server
	# if the local font server has problems, we can fall back on these
	FontPath	"/usr/lib/X11/fonts/misc"
	FontPath	"/usr/lib/X11/fonts/cyrillic"
	FontPath	"/usr/lib/X11/fonts/100dpi/:unscaled"
	FontPath	"/usr/lib/X11/fonts/75dpi/:unscaled"
	FontPath	"/usr/lib/X11/fonts/Type1"
	FontPath	"/usr/lib/X11/fonts/CID"
	FontPath	"/usr/lib/X11/fonts/100dpi"
	FontPath	"/usr/lib/X11/fonts/75dpi"
        # paths to defoma fonts
	FontPath	"/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
	FontPath	"/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
EndSection

Section "Module"
	Load	"bitmap"
	Load	"dbe"
	Load	"ddc"
	Load	"dri"
	Load	"extmod"
	Load	"freetype"
	Load	"glx"
	Load	"int10"
	Load	"record"
	Load	"type1"
	Load	"vbe"
EndSection

Section "InputDevice"
	Identifier	"Generic Keyboard"
	Driver		"keyboard"
	Option		"CoreKeyboard"
	Option		"XkbRules"	"xorg"
	Option		"XkbModel"	"pc104"
	Option		"XkbLayout"	"us"
EndSection

Section "InputDevice"
	Identifier	"Configured Mouse"
	Driver		"mouse"
	Option		"CorePointer"
	Option		"Device"		"/dev/input/mice"
	Option		"Protocol"		"ImPS/2"
	Option		"Emulate3Buttons"	"true"
	Option		"ZAxisMapping"		"4 5"
EndSection

Section "Device"
	Identifier	"Number 9 Computer Company Revolution 4"
	Driver		"i128"
	BusID		"PCI:0:10:0"
EndSection

Section "Monitor"
	Identifier	"SGI 1600SW F"
	DisplaySize	370 240
	Option		"DPMS"
	VertRefresh	30-75
	HorizSync	30-70
	VendorName	"SGI"
	UseModes	"Modes0"
EndSection

Section "Modes"
	Identifier "Modes0"
	Modeline "1600x1024d32" 103.125 1600 1600 1656 1664 1024 1024 1029 1030 HSkew 7 +Hsync +Vsync
	Modeline "1600x1024d16" 103.125 1600 1600 1656 1664 1024 1024 1029 1030 HSkew 5 +Hsync +Vsync
EndSection

Section "Screen"
	Identifier	"Default Screen"
	Device		"Number 9 Computer Company Revolution 4"
	Monitor		"SGI 1600SW F"
	DefaultDepth	16
	SubSection "Display"
		Depth		32
		Modes		"1600x1024d32"
	EndSubSection
	SubSection "Display"
		Depth		16
		Modes		"1600x1024d16"
	EndSubSection
	SubSection "Display"
		Depth		8
		Modes		"1600x1024"
	EndSubSection
	SubSection "Display"
		Depth		15
		Modes		"1600x1024"
	EndSubSection
	SubSection "Display"
		Depth		16
		Modes		"1600x1024"
	EndSubSection
	SubSection "Display"
		Depth		24
		Modes		"1600x1024"
	EndSubSection
EndSection

Section "ServerLayout"
	Identifier	"Default Layout"
	Screen		"Default Screen"
	InputDevice	"Generic Keyboard"
	InputDevice	"Configured Mouse"
EndSection

Section "DRI"
	Mode	0666
EndSection