fogbound.net




Tue, 4 Mar 2025

Solving a VPN Mystery

— SjG @ 1:14 pm

The Department of Water and Power is doing work near the office, and over the weekend, there was a sustained power outage. I came in Monday to shrieking UPSes and had to power up the firewall and a few other machines. It was the normal stupid kind of stuff.

We have a few virtual servers out in “the cloud,” and we use point-to-point VPNs to make them seem local to our network. Those VPNs also needed restarting.

Through the course of the day, however, one VPN connection kept unceremoniously disconnecting. Looking at logs on the various servers was unenlightening. Everything was running normally, other than the surprise disconnects.

In the evenings, I’ve been watching the old Grenada TV/Jeremy Brett Sherlock Holmes series, so I had to apply Holmes’ deductive process. The virtual servers had experienced no changes except being disconnected, so I needed to focus on the firewall. The firewall had experienced no change, except being restarted. What could have happened?

I finally found a configuration that was incorrect (it was a netmask that was insufficiently restrictive, allowing devices not on the VPN to collide with VPN IP addresses). I fixed the netmask, and the VPN has been up and stable ever since.

But how could this be? It had been running properly literally for years. It had to be something to do with the power outage. But if that had corrupted the configuration, it wouldn’t have been a single IP netmask changing. “[W]hen you have eliminated the impossible, whatever remains, however improbable, must be the truth.” The bad configuration file could not have been in use.

The best theory is that the configuration file had been (accidentally?) modified at some point in the past, but never loaded. When the firewall was restarted, it loaded this modified configuration for the first time.


Tue, 3 Dec 2024

PHP’s “boolval”

— SjG @ 1:24 pm

Everyone loves to dump on Javascript because of stupid things like [] == ![]; // -> true. Some languages are much better at this. But PHP is not among them. I found the following not quite what I would have expected:

boolval("1");   // returns true
boolval("0");   // returns false
boolval(1);     // returns true
boolval(0);     // returns false
boolval("00");  // returns true
boolval("0.0"); // returns true
boolval(0.0);   // returns false

Sun, 10 Nov 2024

Obsolescence

— SjG @ 11:06 am

[insert old man yelling at cloud meme here]

Everybody’s pissed off because things are crappy and they used to be better. I know I certainly am. But it’s not “regulations” or “wokeness” that forces me to buy a $56 part to fix the dishwasher because a 5¢ switch embedded in an un-openable assembly burned out.

When we first moved into this house twenty five years ago, there were plumbing problems I had to fix. The kitchen faucet was leaking. In those days, there was B&B Hardware, an old style hardware store. I brought the weird brass fitting from the faucet to B&B, took a number at the plumbing desk, and eventually talked with the guy there. He cast a sardonic eye on the fitting, and said “You’ve got a 1950s Moen. In the 60s they changed this to have an additional flange right here for an o-ring, and in the 70s they stopped making this style altogether. The good news is I have a compatible part.” He went up on his ladder and sorted through some boxes and found me a part. It was expensive — nearly 15 dollars. But it worked.

Well, the kitchen sink’s been redone in the interim, and the faucet replaced with a very low-end wall-mount double-handle bridge faucet which lasted about seven years before being replaced by the new (yet not parts-compatible) version. And the new one’s leaking. So I took it apart, grimaced at the cheapness of the thin metals and plastic fittings. I headed to Home Depot, since B&B is long gone. At the big box, I got a shrug from the worker. No, there aren’t parts for those. They don’t sell that model, but new kitchen faucets are on aisle 6, and washers and stuff are on aisle 11, bay 9.

When I finally found washers and o-rings on aisle 12 bay 15, they didn’t have a replacement for the cracked plastic compression retaining ring. So I bought new o-rings in the hope that screwing down the conical ring cap tightly would continue to work. I went through the self-checkout, where the scanner pulled up the wrong price for the item and the employee that came over sneered at my mask and low-key accused me of shoplifting when he saw the old, broken part I’d brought along.

Eventually, it worked out. The sink is not leaking, I have 8 more of the o-rings (potentially saving me from buying another $2.92+tax set next time, if the smog doesn’t degrade them in storage), and I can go on to do other chores.


Sun, 28 May 2023

Caution!

— SjG @ 9:43 am

I recently came across this site for creating warning signs of various sorts. It was intended for use by those who operate laboratories and research facilities. It was pointed out to me because it has a random sign generation function, which creates some funny and absurd signs, perfect for your surrealist academies.

My mind, however, went to Shakespeare.


Sun, 9 Apr 2023

Ugh, that Old Yak-shaving Refrain

— SjG @ 12:28 pm

Went to update an image gallery with some new pictures. I wrote the gallery generating code four years ago, but the version of PHP on the server has been updated and one of the libraries I use evidently relies on deprecated syntax ($string{$char_index} for the curious, which now would be $string[$char_index]). So I tried to check out the repo from GitHub, only to find they’ve updated their SSH host keys, so I need to fix that before I can fix the code problem. So I tried to update that, but had packed my Yubikey off in a drawer in the office…