The Burrard Chinook

Yesterday was the first day the Burrard Chinook (TransLink’s newest SeaBus) was put into revenue service.

The Chinook has a unique livery consisting of art from the Musqueam, Squamish, and Tsleil-Waututh First Nations communities and showcases the Chinook salmon within the ecosystem as well as First Nations cultures.

TransLink now has four SeaBuses in operation: The Burrard Beaver is the remaining original SeaBus of the pair built in 1976 (the retired sibling being the Burrard Otter). The Burrard Pacific Breeze began its service in 2009 and allowed TransLink to run 10-minute service with all three vessels during the 2010 Olympics. In 2014, the Burrard Otter II entered service, replacing the Burrard Otter. And finally we have the Burrard Chinook, which will allow TransLink to re-start operate 10-minute peak service with three vessels in operation and one spare.

Handling power outages with an uninterruptible power supply and NUT

The main reason for having a UPS is to protect against data loss due to power outages whether it be unsaved work, or corruption due to the computer not having enough time to write things to disk. I only really started to take this seriously when I got my Synology networked attached storage (NAS) which holds all my data.

The UPS I chose is an APC model with 1300VA and a USB connection, which is powerful enough to power most of the critical equipment I have at home and to ensure they have enough time to shut down. One of the advantages of having an uninterruptible power supply (UPS) with a USB connection is that it is possible to smartly shut down any computers during a power outage.

My strategy is when the UPS goes on battery, I want the Windows PC and Linux server to shut down immediately (well after a 1 minute timeout). These are the heaviest load (roughly 100W each on idle) on the UPS and they aren’t running anything really important that I need during a power outage; they just need to shutdown cleanly. The Synology NAS is a lighter load so I don’t mind keeping that one on and only shut it down when the UPS battery is low. Keeping the cable modem and wireless router allows me to continue to have network access which is critical for NUT to work, but also for general productivity in case of a prolonged failure). I’ve found in past outages that the cable equipment in my apartment building has some sort of separate or backup power source as well so generally the internet can continue to work. With just the cable modem, router and Synology the power draw is about 50W. I can manually shut down the NAS if I want to prolong the network even further.

What’s this NUT you keep talking about?

NUT stands for Network UPS Tools which are a set of utilities that are cross platform and cross manufacturer that monitors and responds to changes in UPS statuses. As we will see in the following sections, Synology NAS already has built in support for NUT, and NUT tools can be installed on Windows and Linux.

Continue Reading

Fixing missing categories and tags in WordPress’ block editor

For several months now, I’ve noticed that the Categories and Tags widgets were missing in my WordPress’s post block editor. It was sort of fine because I could work around it by assigning categories and tags through the Quick Edit functionality from the post list, but it was an annoyance.

I had done the usual debugging steps of disabling plugins, changing to the default theme, even reinstalling the core WordPress code, but nothing changed. I had tried searching online for phrases like “wordpress categories and tags missing” but didn’t come up with anything.

Today, I found two clues that led me to investigate this further. First, when I popped open Chrome’s developer tools, I noticed that the AJAX requests were firing nonstop. I was originally wanting to check whether there were errors in any of the requests, but the requests were all returning JSON responses, so there wasn’t any error in the processing aspect.

Second, I installed the Health Check & Troubleshooting plugin. When I ran it, it showed:

The REST API did not behave correctly

The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.

The REST API did not process the context query parameter correctly.

I happened to come across this blog post which suggested adding the following piece of configuration to the nginx configuration.

location ~ ^/wp-json/ {
    rewrite ^/wp-json/(.*?)$ /?rest_route=/$1 last;

Lo and behold, it solved the problem! I haven’t dug into the details as to what exactly is going on. I’m just posting this in case other people come across this issue since it was not straight forward to find the resolution to this problem.

Side Project: Grouse Mountain Skyride Availability

I haven’t had time to work on many side projects lately. I think I generally am most effective at programming when I have a long stretch of uninterrupted time (on the order of a few hours or more at a time), and I have found the same at work. These long stretches of time are difficult to find these days.

However this was one opportunity that came up this week. Many of my side projects are born from automating repetitive manual tasks, and this was one of those.

Continue Reading