Different day, different location on Silver Lake, same beautiful colors. Plus bonus swan family.
Author: H Walker Jones, Esq
Sunset
Bunnies Attack!
Mama Woodchuck is not up to having guests at her family’s garden party…
Clothesline
Inflation is high, making electricity expensive.
Our dryer died, I’m lazy, and the repairman is expensive.
But worst of all, humanity is polluting the world in crazy ways. We collectively need to cut back on how much energy we use so we don’t make the planet uninhabitable for ourselves. Climate change is expensive.
Enter the humble clothesline. Two posts and a post-hole digger. 150 feet of cotton rope, three tensioners, and six pulleys. Fifty clothespins. About an hour of solid effort.
It’s a small thing, but it neatly solves three problems at once. Plus, the clothes smell nice afterwards!
COVID Strikes the House!
After two years, much of the world seems to have given up on keeping a pandemic posture. I haven’t touched on COVID-19 in the blog in a while because I find it to be so frustrating. In the United States we’ve had strong anti-vax, anti-mask, and anti-science movements. They’ve really hampered efforts to “flatten the curve” of hospitalizations and keep COVID-19 from overwhelming the healthcare system.
Infection and hospitalization rates have dropped recently, so even the most vigilant have relaxed. Few people wear masks into stores; most employers are cajoling people back on-site. If there is going to be another resurgence of the virus, now is the time.
So, of course, the entire family is now COVID-19 positive.
We fell in a fairly orderly fashion: Megh, Alpha, me, Beta, one per day. The only family member not affected appears to be Butter-the-dog. I don’t know how to even tell if she is infected, but there’s evidence that she can. So far she seems fine.
We think we’ve traced it back to an outdoor event the past weekend in Concord to re-enact the “Battle Road” from the American Revolution. There was a crowd, and not everyone was masking – sadly, including us.
There have been a number of COVID-19 variants, and we seem to have caught a fairly recent one, Omicron, based on both the speed of infection and nature of symptoms. It’s been fairly mild for us overall.
We also visited Baba on Sunday, after infection but before contagiousness. Megh has been feeling guilt over the possibility of infecting her, but (so far) she has tested negative and seems fine. After this much time it’s unlikely she’ll contract it from us.
As a side note: my boss Terry, and his mother, also both tested positive for COVID-19 this week. I work from home so it’s just coincidental timing.
Recursively delete directories unless a specific file is present
There are several ways to do this, but my Google-fu may be weak because it took me much too long to figure this out.
I want to recursively delete directories with a specific name (or names) within directory structure, UNLESS the matched directory contains a sentinel file.
In my case I want to make a C# directory structure “cleaner-than-clean” by removing all ‘bin’ and ‘obj’ directories, leaving just the user-generated files behind. This is pretty easy to achieve:
#!/bin/env bash
dir=/path/to/project
find $dir -type d \
\( -name 'bin' -o -name 'obj' \)
-print
This says “find things under $dir
that are directories (-type d
) and are named either ‘bin’ (-name 'bin'
) or (-o
) named ‘obj’ (-name 'obj'
). The parentheses force the two -name
statements to be considered as a single condition, so the effect is to return true if either item matches. If the final result is true then print the path.
Notice that I’ve escaped (\
) the parentheses because I’m using bash. Most UNIX shells do require these to be escaped, but yours may not. I’ve also terminated each line by escaping it. A single-line command may be spread over several lines this way, making it easier to read.
‘bin’ is also the conventional name for a directory of non-build executables, like helper scripts. I do have some, including this cleaner-than-clean cleaning script that I’m working out, and don’t want to delete those by accident. The above command would find them, if they were in the directory tree.
find
allows you to prune (-prune
) the search tree, ignoring selective directories, according to certain criteria but it doesn’t support the concept of peeking into sub-directories. Bummer.
You may, however, execute independent commands (-exec
) and use the results of those commands to affect find
‘s parameters, including -prune
. We can exec the test command, which can tell us if our sentinel file exists.
#!/bin/env bash
dir=/path/to/project
sentinel=.keep
find "$basedir" \
-type d \
\( -name bin -o -name obj \) \
! -exec test -e "{}/$sentinel" ';' \
-print
The new line executes test
to see if the current path ({}
) contains a file called $sentinel
(I’ve defined $sentinel to be .keep
but any filename will do), which returns true if it exists. The line is negated (!
) so if the sentinel is found further actions are skipped.
The final step is to actually delete the directory. We call rm -Rf
(-R
= recursive, -f
= force) because we just want the whole thing gone, no questions asked. The trailing plus (+
) tells find
that rm
can accept multiple paths in a single call, rather than calling rm once for each path.
#!/bin/env bash
dir=/path/to/project
sentinel=.keep
find "$basedir" \
-type d \
\( -name bin -o -name obj \) \
! -exec test -e "{}/$sentinel" ';' \
-print \
-exec rm -Rf '{}' \+
Witness to a car crash
We witnessed a crazy car crash tonight.
The gold car blew through a T-intersection and t-boned the pickup truck. The gold car’s front end was smashed, radiator fluid everywhere. The truck had some impact damage between the cab and the bed.
That isn’t the crazy part.
The silver Honda drove up at a high rate of speed and very decidedly boxed in the gold car (which wasn’t going anywhere) and the occupants got out and started yelling at the gold car’s driver about how she hit them and they’ve been following her for miles, honking their horn while she ignored them. She seemed to mostly ignore them and kept apologizing to the pickup truck’s driver, who finally said “I’m just an innocent bystander!”
I had stopped to see if anyone was hurt. Everyone ignored me – silver car, gold car, and pickup truck drivers.
I decided that things might go south. I had my family in the car and didn’t want to be involved so we split right after the end of this video.
McGregor
A backpacker is traveling through Ireland when it starts to rain. He decides to wait out the storm in a nearby pub. The only other person at the bar is an older man staring at his drink.
After a few moments of silence the man turns to the backpacker and says in a thick Irish accent, “You see this bar? I built this bar with my own bare hands. I cut down every tree and made the lumber myself. I toiled away through the wind and cold, but do they call me McGregor the bar builder? Nay.”
He continued “Do you see that stone wall out there? I built that wall with my own bare hands. I found every stone and placed them just right through the rain and the mud, but do they call me McGregor the wall builder? Nay.”
“Do ya see that pier out there on the lake? I built that pier with my own bare hands, driving each piling deep into ground so that it would last a lifetime. Do they call me McGregor the pier builder? Nay.”
He takes another swig of his drink. “But ya fuck one goat…”
Personal Best Walking
I’ve been on a speed-walking binge for the winter, in an effort to get/stay fit and lose a few misbegotten pounds.
I walk Aka Lana Lana nearly nightly, though a little less often during the winter. No matter how much I coax the dog along, though, dogs will be dogs and our average speed tends towards a reasonable 25+ minutes/mile. So I started going out after dog-walking to get some real speed on.
I started walking, and tracking, at the end of November 2021 with a 28:26 average around the lake – about the same as walking the dog. Admittedly, I wasn’t pushing too hard at the time, but I wouldn’t have done significantly better if I had.
Just over three months later, and the same walk is now a 14:22 per mile average, or 4.17 mph.
Ignore Runkeeper’s “3rd fastest” headline, I’m pretty sure I’ve never walked so fast in a long, long time – and this has been most decidedly walking, not jogging or running mixed in.
4 mph has a certain significance in my psyche, because I grew up thinking that it’s a reasonable walking speed for the untrained, after reading The Long Walk, not a breathing-hard kind of pace. In retrospect I think Mr. King got that particular detail of the story wrong; I’m not sure you could expect people to last very long at that pace, and maybe 3.5 mph would have been more realistic for walk that should last more than 24 hours. Then again, I’m the one who might be wrong.
I’ve also dropped a few pounds along the way, but I won’t publish figured on that quite yet.
Linux, Solaris, Windows
Linux: Because rebooting is for adding hardware
Solaris: Because you don’t need to reboot to add hardware
Windows: Because rebooting is for adding hardware, adding software, regularly scheduled downtime, and should also be done on a daily basis to keep the machine running.
[attribution unknown]