Just a quick one; first of all as a sign of life, I know I’ve been quiet of late, and second of all, to put out something that might be of use (albeit to a niche audience).

DOIs, or Digital Object Identifiers, are persistent identifiers for digital object for all sorts of things on the internet. Typically these are published documents, but they may also be things like datasets, workflows, images, etc.

I deal with these a fair amount at The Day Job, and often need to resolve these strings into something that returns metadata (title, author etc). Nice to be able to do this over an API.

Datacite, Crossref etc, who deal in DOIs, do provide their own resolution APIs, but only for items minted in their own namespaces, not the canonical set. DOI.org do provide a proxy, in order to resolve a doi to a location, but no obvious way of extracting metadata.

As it happens, there is a way of getting this data, with a little bit of Accept header witchcraft.

Anyway, to make it easier for you (and me), I wrote a library. Enjoy!

» Visit the project on Github...

I have recently moved this, and a bunch of other sites I host, over to new infrastructure.

Unfortunately, for reasons I won’t bore you with (mainly because I’ve not yet figured them out), the standard ip-tables ban action in fail2ban has stopped working. However, since I am already behind a firewall, all I really need is to block the script kiddie attacks for the various website logins.

I already have some filters for this, so I wrote some quick actions to add these IP addresses to ban lists that can be used by Apache.

I have two flavours, one for apache 2 and another for apache2.4.


Copy the appropriate action config into your /etc/fail2ban/action.d directory, and enable the action in the usual way.

Then, to actually use the block list, you’re going to need to include it into your vhost config by referencing it in your <directory> block, e.g.:

    Require all granted
    Include /var/run/fail2ban/fail2ban.apache24

Link to fail2ban.apache for the apache 2 version.

Hope this is useful to folks!

» Visit the project on Github...

Just a very quick one, really as a aide-mémoire for when this inevitably happens again and leaves me scratching my head.

So, if you’re creating a foreign key relationships between two tables in your mysql / mariadb database, and you get errors along the lines of:

errno: 150 "Foreign key constraint is incorrectly formed"


Failed to add the foreign key constaint. Missing index for constraint 'BLAH' in the referenced table 'whatever'

and you’ve checked that your statement is correctly constructed and otherwise correct, check that the tables in question are the same collation using show create table TABLENAME

It is easy to miss, but foreign keys can only exist between tables of the same table collation and type. So, if they’re different, you’ll need to do an alter table, e.g.

alter table TABLENAME convert to character set utf8 collate utf8_unicode_ci;

Hope this helps someone!