Tag name:self.note

Feeds

First published 26th March 2020 (Last Modified 7th February 2021)

I used to follow a whole bunch of RSS feeds. When Google stopped its RSS reader back in 2013, I converted this very web page on my personal site to gather RSS feeds for me. However my personal usage of that page steadily dropped and in 2019 (which, by then, was based on WordPress) I converted the site to a set of static pages I concluded that maintaining that page was basically infeasible. However I also have a policy of trying to avoid 404 errors for URLs that previously existed. Now, to be fair, I had broken that rule as I've only today noticed that the URL for my 'feeds' page no longer has a page backing it. This is to rectify that error.

As a memoriam, I used to follow RSS feeds from Slashdot, Coding Horror, Cédric Beust's Otaku blog, Igor Ostrovsky Blogging, Bruce Schneier's Blog, Coding Cookies, Cheshire Engineering, The secret barrister, Mark Evanier (Writer of Groo), Patrick Smith (Ask the Pilot), Humble Bundle, Rosemary Kirstein, Sue and Matthew,1 and Syndey Padua. It's interesting to note that most of these haven't been updated in years!

Footnotes

  1. Oxford comma used here to avoid ambiguity.

Fixing the Simply Static plugin

After updating my Ubuntu system to 20.04, I discovered that my method for generating the static version of the site no longer works. It turns out that the Simply Static plugin has a hidden dependency on PHP 7.2 (and upgrading Ubuntu from 18.04 to 20.04 incidently updates the PHP level from 7.2 to 7.4).

After doing some digging I discovered that the Simply Static plugin has an included library called PhpSimpleHtmlDom and the version in the plugin (1.5) is the culprit, I downloaded a more recent version of that library from github and replaced the version of the library with that level and (after a minor hack to change the namespace of the library to match the old namespace being used), Simply Static is now working again.

Hopefully, at some point, the author of the plugin will update it and I won't need the hack. That said the plugin has not been updated for a few years so may now be abandoned. If so I'll probably have to change the infrastructure that builds the static version of the website...

My thanks to Github user caophihung94 for providing a newer version of the PhpSimpleHtmlDom library

running fossil as a daemon process

This is just a note to myself in case I need it 🙂

To run fossil as a daemon process on Ubuntu. I did the following:

  1. Created a fossil user and home directory and gave it a copy of the fossil executable and the website fossil file
  2. Created a fossil/etc/init.d/fossil file
  3. Issued
    sudo /etc/init.d/fossil start
  4. Run sudo update-rc.d fossil defaults to get the init.d script run at system start.

This /etc/init.d/fossil runs multiple fossils.

running popfile as a daemon process

This is just a note to myself in case I need it 🙂

To run popfile as a daemon process on Ubuntu. I did the following:

  1. Created a popfile user and home directory and gave it a copy of the popfile executables and copied across its data into /var/popfile.
  2. Created a /etc/init.d/popfile file
  3. Issued
    sudo /etc/init.d/popfile start

It's worth noting that popfile has data in /var/lib/popfile when it comes to backing it up. When restoring/transferring these files I also needed to ensure that the popfile userid owns these files.

Recovering from an Oops! Backup rollback error

First published 23rd February 2016 (Last Modified 9th January 2021)

After a problem with coretemp that hard crashed my CPU (at least that's what the symptom looked it), on the subsequent reboot, Oops! Backup reported that it attempted to rollback the backup that was in progress at the time. Sadly the rollback failed and left sufficient damage to prevent backups from proceeding. To be fair to Oops! Backup, to fully prevent this would require write-ahead buffering to be disabled (it's enabled by default on windows systems as for most consumer system the lost of performance is considered too expensive.

I recovered from the problem with the aid of a luckily quite recent 2nd backup. My steps were:

  1. Exit the existing Oops! Backup instance
  2. Move the existing backup to a safer place (I should have used the windows "robocopy" command from the beginning rather than the GUI. Robocopy can cope with long path names and deep directory structures and is faster than the GUI.
  3. Copy the 2nd backup to where the existing backup had been
  4. Start Oops! Backup and run a backup. This correctly recognised that plenty of files needed to be backed up.

This does mean that I've lost a couple of days of history - but, for me, the only ones that mattered are the changes to my wordpress plugins and those are already under change management via fossil.

Maplin's Touch LCD Shield for Arduino

First published 2nd September 2016 (Last Modified 9th January 2021)

I've been playing around with Maplin's Touch LCD Shield. It's not a bad device (it does seem to be a little slow, but I suspect that's mostly down to the library being used to drive it. That said, I did take a while to get it working since there's not a lot of documentation for it and I notice that I'm not the only one who had problems. So partially as a reminder to myself (and partially to make this visible to search engines) there's what I had to do.

  1. Download the correct library from linkshield's wiki. I eventually downloaded the v2 library.
  2. Copy the example program (again from the wiki).
  3. Fix up the compile errors in that example program - I guess the library was updated AFTER the example:
    1. Remove the declaration of TS_MINX, TS_MAXX, TS_MINY, TS_MAXY (the library has these as #define's and the compiler gets quite confused.)
    2. Changed the test p.z > ts.pressureThreshold to ts.isTouching()  (The library doesn't have a pressThreshold field and the point class doesn't have a z field. On the other hand, the library does have the isTouching method!)
    3. Changed the initTouchScreenParameters method to initialise a touchscreen via TouchScreen(XP, YP, XM, YM) and deleted the setting of TS_MINX, TS_MAXX, TS_MINY, TS_MAXY (again the compiler gets quite confused).

I was then able to run the demo, although the touch output seemed to be completely reversed, so I edited my library header file to switch the values of TS_MIN* with TS_MAX*. This seemed to fix the problem.

I've, for the time being at least, used it to act as a monitor for my Thinkpad that runs my linux server (that is, I got the linux server to talk to it!)

Manually updating a Ubuntu kernel

First published 21st May 2017 (Last Modified 9th January 2021)

For some reason that I've yet to get to the bottom of, on my Ubuntu server box the kernel wasn't getting updated (the header files to go with the kernel definitely were, but the kernel itself seemed to stay stuck.

To manually update to a kernel level:

  • sudo apt-get install linux-image-extra-4.4.0-xx-generic

Sleeping until top of the minute

First published 23rd June 2017 (Last Modified 9th January 2021)

I recently wanted my bash script (running on Ubuntu) to sleep until the top of the minute. The suggested code snippet from goggling is:

sleep $((60 - $(date +%S) ))

This works well, unless the current seconds count is 08 or 09. Bash interprets numbers starting with 0 as octal and 08 (and 09) are not valid octal numbers. I fixed this in my script as follows:

sleep $((160 - 1$(date +%S) ))

Going static

For a variety of reasons I reckon it's time to convert the public facing version of my website to go to a static version. The reasons include:

  • After the suspension of En Garde there's no dynamic input to the site other than my own (When I restart that campaign I will need to modify the hosting mechanism to provide the form processing - I'll cross that bridge when I get to it)
  • It'll make the site more secure (no WordPress admin on the public version of the site)
  • No more annoying emails from my web host encouraging me to upgrade from a shared host to a VPS due to reaching memory limits (presumably due to the wordfence plugin).

I'm using the Simply Static plugin though I did have to handle some quirks due to the private server sharing the same machine as my fossil repositories and my popmail spam filter.

It should be noted that this post is also part of an experiment to see how the workflow of updating my website is going to go!

Automating the static upload

First published 14th February 2020 (Last Modified 9th January 2021)

I've automated some of my static upload process. This post is partially to provide a new post and partially to document/record the automatic part of the process. I created a batch script that generates a winscp script to upload files that changed, and will show the other differences (file adds and deletes) involved in the process. That script is:

@echo off
setlocal ENABLEDELAYEDEXPANSION
fossil extras >%temp%\fossil.out
for /f "delims=" %%a in (%temp%\fossil.out) do (
 fossil add %%a
)

set localdir=%cd%
set remotedir=/home/djvines/blog.tremlas.com

fossil status >%temp%\fossil.out
echo open blog.tremlas.com >%temp%\winscp.txt
for /f "delims=" %%a in (%temp%\fossil.out) do (
 set string=%%a
 for /f "tokens=1,2" %%c in ("!string!") do (
  set dz=%%d
  if "%%c"=="EDITED" echo put %localdir%\!dz:/=\! %remotedir%/%%d >>%temp%\winscp.txt
  if not "%%c"=="EDITED" echo !string!
 )
)
echo exit >>%temp%\winscp.txt
echo to run script execute:
echo "c:\Program Files (x86)\WinSCP\WinSCP.com" /script=%temp%\winscp.txt