Linux, politics, and other interesting things
I run some servers that use the DJB Daemontools to manage their daemons . This is something I would have changed years ago if given a chance because DJB software always seems to do things in a different way to other Unix software and causes pain. Unfortunately when you have a lot of semi-embedded systems that have intermittent net access it’s really not easy to change things, and having staff who aren’t computer experts who have been trained to use certain DJB software makes it even more difficult.
Daemontools uses multilog  to manage it’s logging, this gives dates of the format @400000004deedcea1e4a18d4. While DJB has written a tool to parse this it’s not always convenient, and I don’t want to install DJB software on every system that might be used for reading logs (among other things DJB software is not included in any popular distribution).
George Bernard Shaw says that “All progress depends on the unreasonable man” , of course he never participated in a large-scale software development project. In the modern age progress usually depends on people who can work with others, which is why DJB software doesn’t get used much – for every DJB program there is a similar program written by someone else that works about equally well on it’s own and is more than 10* more popular because of better interoperability.
So I wrote the following script to convert DJB dates to regular dates. It takes a DJB format date as the first command-line parameter as I generally just paste the relevant date into a different window. At some future time I may write a program to parse an entire log file and convert all the dates but I haven’t had a need for it yet. I think that I’ve done the hardest work involved in writing such a parser so someone else can use this as a starting point if they have such a need.
DATE=$(echo $1|cut -c 10-17)
SECS=$(echo -e ibase=16\\n$(echo $DATE|tr "[a-z]" "[A-Z]")|bc)
exec date -d "1970-01-01 $SECS sec utc"