Author Archives: scottr

Out with the latin1, in with the utf8mb4

The MySQL database underneath this blog has been using the latin1 encoding since the beginning. However, at some point I started posting with Unicode characters encoded with UTF-8. WordPress dutifully stuffed this UTF-8 data into the latin1 columns without complaint. After all, it’s technically valid, even if it’s nonsense.

This wasn’t a problem until I upgraded to MySQL 8.0. Suddenly, characters in a few of my posts were displaying incorrectly. For example, non-breaking spaces in several posts were no longer invisible, showing up as “Å” in odd places. Characters such as “ö” were obliterated. Worse yet, my posts were a mix of latin1 and UTF-8 encoding.

Thankfully, Nic Jansma developed a solution for this problem some time ago. It’s not completely automated, but it helps. If you do this yourself make sure you run the script against a copy of your database, over and over again, until you’ve resolved all of the problems.

At this point everything has been updated to UTF-8 using the MySQL utf8mb4 encoding. Please drop me a line if you notice anything that looks messed up.

Changing strategies for WordPress performance

Over the years I’ve tried a few different strategies to help with performance: more RAM, faster hardware, and a couple of different caching extensions. The most recent improvements came from a combination of running WordPress in Docker on a diskless RancherOS machine, together with one of the more popular caching extensions.

This was good enough, but I wasn’t happy. The extension was complex both in terms of implementation and configuration. This seemed unnecessary; I set about looking for simpler alternatives, eventually settling on using a redis cache.

Redis has several advantages in a Docker-based environment:

  • It’s trivially easy to add a redis server;
  • It’s easy to configure WordPress to use it, using Redis Object Cache; and
  • It’s fast. Very fast.

I haven’t made any attempt to run benchmarks, but so far it seems to provide a performance boost similar to the old, complex extension – without all the overhead. And that, I think, is a good thing.

macOS vs. VMware vs. scaled Retina resolution

Here’s a quick tech tip; if you have a macOS (or OS X) virtual machine that you can’t seem to set to a reasonably high resolution, it’s probably because scaled Retina resolution is enabled. The telltale sign is that the actual resolution you see, when selecting the Scaled option in Display preferences, is exactly half of what you’re setting with the vmware-resolutionSet utility, followed by “HiDPI”. The other sign is that while you’re able to see an apparently higher resolution in the Scaled resolution list, selecting it has no effect (though you may see the display momentarily go to a higher resolution and then revert).

Disable scaled Retina resolution by opening Terminal.app and running this command:

sudo defaults write /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled -bool false

Reboot, then set your desired resolution with this command (for example):

sudo /Library/Application\ Support/VMware\ Tools/vmware-resolutionSet 1680 1050

If, on the other hand, you’re looking to take advantage of a HiDPI display on your host, simply replace “false” with “true” in the first line and set a resolution of exactly half of the desired resolution (on each axis). Make sure you reboot after changing the DisplayResolutionEnabled property.

Stop making excuses

I was having a discussion with some of my kids tonight that turned into something rather more intense than I expected. Now that I’ve had some time to digest it, here’s what really bothered me: a lot of people* have little or no real connection to the causes they champion, yet are also willing to prescribe solutions to the problems they imagine those movements spring from.

It isn’t enough to say that you are in solidarity with a particular movement, nor enough to repeat (or reblog) a cause’s talking points. At the very least you must go and live, work, and play with that group. Simply hearing about it on the Internet or from your friends won’t give you anything resembling the full picture. This will take time. It will mean listening and building relationships with people. To put it bluntly, it will take dedication and a level of perseverance that will be uncomfortable.

If you aren’t willing to do this you’re giving little more than lip service to your chosen cause. This is no more effective than signing an online petition, telling the homeless person “I hope you find shelter tonight,” or a starving child “I’ll pray that you get a good meal.” These things do not make a difference. You’re just making yourself feel better about the fact that you can’t help because you are too young or too old, or have no time, no money, no car, a family to take care of, a job that’s too demanding, a fear of dealing with real people, a mental illness, or any other thing you’ve used to excuse yourself.

It’s time to stop blaming other people for not solving the problems of this world. If you won’t get involved in spite of all the good reasons you have for your inaction, then why should anyone else?


*This statement is not limited to any particular generation, or for that matter any other group.

A story about kittens

When I was a kid summer was a magical time. I can still remember looking forward to the bus ride home on the last day of school. The air was sweeter, the leaves greener, and everything was better because Summer Vacation had arrived.

One particularly magical summer came when I was about 10 years old. My brother, sister, and I discovered some kittens in our garage. We didn’t know where they came from but they were old enough to get around; we knew that if they were very young they wouldn’t have had their eyes open yet. There were five of them and we were sure that we could convince our parents that we could keep at least a few.

When we asked, I don’t really recall what the answer was. It must have been at least a conditional yes because we named each of them and even picked out a kitten that we could call our own. My brother picked out an orange bicolor and named him Tiger. I picked the solid black kitten with blue eyes and called her Midnight.

It wasn’t long before tragedy struck. The kittens, curious things that they are, were exploring the garage, climbing around to see what they could find. Midnight somehow fell into a drain pan with used motor oil in it and was thoroughly drenched with the stuff. I remember understanding that this was bad but didn’t really know how to help the poor thing. I remember trying to wash her and get as much oil out of her fur as I could, but it didn’t help. She died not long after. I was heartbroken.

The rest of the kittens, except Tiger, all left. Ultimately he stayed with us for many years. He was part of the family and treated us all pretty well (except for my dad). I never felt that he was very close with me, though. Perhaps I was hanging on to what might have been with Midnight.

When I moved out of the house I either wasn’t allowed to have a pet, or unable to support a pet, for quite a few years. It wasn’t until after Michelle and I married and moved to Wisconsin that another pet entered my life. One day at the mall she visited the pet store (long since closed at this point) and fell into a deep, mutual love with a Himalayan kitten there. It was so obvious that they were meant to be together that we agreed to bring him home a couple of days later. He was a big, fluffy ball of fur with striking blue eyes and a regal attitude that you couldn’t help but admire. Maximillian was with us for almost 16 years.

When Max left us, I was heartbroken again. He was one of the sweetest cats I had ever known. He nuzzled and purred his way into the heart of nearly every person he met, including mine. Michelle was clearly his favorite, though. She could just look at him and he’d start to purr.

Our house was lonely. Often we would walk into the house in the evening and hear Max’s familiar purring, even though he wasn’t there. Sometimes I’d even whisper a greeting before realizing the room was empty. We went seven months like this, through the end of winter into spring and summer, when it became clear that we were going to look for another feline friend.

The wife of one of my work colleagues volunteered at a local animal shelter. Michelle went to see if we could help by providing a foster home for some cats. It turned out they had a pair of tuxedo kittens thought to be about 8 weeks old that needed love and attention. These sisters were found on the street abandoned, sick, and hungry. Michelle’s protective instincts kicked in and she brought them home. She fought to keep the smaller, very ill one alive. At one point she resorted to force feeding the kitten with an eye dropper. We used a heating pad under a blanket to keep her warm 24/7. The larger kitten was also sick, though not lethargic. When Michelle wasn’t taking care of the smaller one, the larger was kneading her, purring and cooing at her, and snuggling up close.

Eventually the day came that we were to give them back to the shelter. Unfortunately our two older girls had bonded with the kittens, and Astrid and Zena stayed with us. Because they’re domestic short hairs, though, my allergies flare up pretty rapidly and I need to wash when I touch them. They’re both very friendly with me but quite definitely not my cats.

Not long after this Michelle was ready for a cat of her own, again. She found a Maine Coon breeder in a town about an hour away. She was adamant than she would not be able to have a Himalayan again, in part because she felt that she might end up comparing them to Max, which would be pretty unfair. Maine Coons seemed to have the right personality type, and as a bonus, they can get pretty big. You don’t have to worry too much about not seeing a 20 pound cat underfoot. And that’s how Sullivan came to be with us, about a year and a half after Astrid and Zena joined our family.

One thing about Sully that’s particularly noteworthy is that he’s very affectionate. Not long after he came home with us it was obvious that, except for the typical kitten rambunctiousness, he was right up with our beloved Max in that way. I’ve remarked several times that this was like being struck by lightning, and not only that, twice in the same spot. Even to this day he is clearly devoted to some degree to everyone in our family. He also has an impish sense of humor that comes out when you’re least expecting it.

Just like with Max, though, Sully has a favorite human. Michelle worked hard to bond with him from the moment he came home with us. He has grown closer to me than Max ever did. He even has a couple of routines, one when I get home from work and one at bed time, that he insists on doing with me nearly every day. Week by week they get a little more complex, and sometimes a little more silly. Even so, he rewards only Michelle with instant purring when she coos at him. At this point I started to long for a kitten I could call my own.

Imagine my surprise when, for Christmas 2015, Michelle gave me a card to redeem for a kitten from the same breeder that Sully came from. I was overjoyed! There are usually only a few litters available per year, so I knew I would have to wait. But, for the first time, I started hoping that the story I began with Midnight all of those years ago would finally have a chance to play out.

That dream finally materialized last weekend. To be honest I was hoping for a female kitten. I even had a name picked out months in advance. I’ve now got this gorgeous little boy, instead, so he doesn’t have a name yet (even after a week). I’m getting closer, though. I’m taking my time to get to know him a little better so I don’t end up giving him a name that doesn’t fit like “Killer” or “Spot” or “___ as a bag of rocks.”

One thing that I can say for sure is that lightning does apparently strike in the same place three times.

silver tabby kitten

Unnamed silver tabby Maine Coon, taken Saturday, June 3, 2017.

 

Same blog, now containerized

I’ve converted most of the things that I currently run on VMs into containers, including the web service that I’m using to host this blog. Some of the services require custom images, so I can’t quite move them out to the cloud, yet. That remains an intriguing possibility.

I expect you shouldn’t notice anything different. If you do, though, please let me know.

Not quite how Apple Pay works

I was reading Kohl’s Apple Pay deal illustrates why mobile wallet is a lot harder than it looks earlier, and some red flags immediately went up. The main issue seems to be the writer’s misunderstanding of how to use Apple Pay. It’s not true that you need to open the Wallet app; simply double-tap the home button (the one with the Touch ID sensor), select the card to use if you don’t want to use the default, then use Touch ID to authenticate and put your phone near the reader/terminal.

There are definitely good points in this article, and the EMV rules have taken some of the shine off of this experience. Even so, it’s a lot easier and faster than checking out at Target with their own store card.

A tale of whiskey and sorcery

An acquaintance who had up until relatively recently avoided Irish Whiskies posted a photo of a single-serving bottle of Teeling small batch Irish whiskey. I was intrigued.

I’ve particularly enjoyed Jameson 12 yr and Redbreast, previously, and so I was going to ask “sweet or smoky?” But then realized I had, right here in my hands, a marvelous artifact of magick connected to The Machine That Knows All Things (TMTKAT). I believe it’s called a Googol Machine, or The Machine That Goes Bing.

Leaving aside the conversation about whether a true Irish Whiskey gets near any sort of smoke, I knew I must inquire of TMTKAT, for whatever opinion I may have on the topic, there are distillers that produce one sort or the other; and so I asked. TMTKAT replied: “sweet/vanilla/honey/caramel.” And that precise moment was when I knew that I must add Teeling to my list.

My Life as a Hat Box: Chapter 1

Once upon a time there was a cat.

This cat wasn’t just any cat, however. He was a cool cat. A funky cat. A cat with no name. Well, he actually had a name, but most of the audio components that comprise his name are too glorious for mere human ears. All that’s left is the husk of sound that, roughly translated, comes out as “Mmmrrowww.” We’ll just call him “M.”

As you might imagine, M was more than just an ordinary cat. By day he was a power-napping, pad-scratching, catnip-loving domestic feline. By night, a fearsome street predator, a licensed private investigator, and an aspiring author of semi-biographical literature.

Each night M waited until his pets – that is, his humans – were asleep. Then, donning his gray felt fedora, he’d slip out and head downtown to his office on the corner of 11th and Main. There’s not much work for a feline private investigator to be had these days; not yet, anyway. It was probably inevitable that he would find something to while away the hours. That something was writing.

M started small, jotting down rough concepts for short fiction on a steno pad, then erasing and revising and re-revising until it they were perfect. He wound his way through cat romance, explosive exposes, and even a brief period where he wrote nothing but neo-beatnik free-association poetry. When his “My Life as a Hat Box” hit the New York Courier-Times Top 100, though, he knew he had hit the big time.

“Hey, cat, get off of that hat box! You’re going to crush it,” she said, her eyes flashing with fire.

See, people have this misconception that every one of a cat’s fabled nine lives is as a feline. Sometimes, usually, we come back as cats. Once in a while, for some of us, we come back as something else. My third life was as a hat box. A very large hat box. A cat hat box.

“Mm-mmrow-meoooooww,” I said. I think she knew what I meant: “Lady, look, I was a hat box. I know how to stack properly. Really. Trust me.”

Amazing. Just… amazing.

A Bedtime Story

Once upon a time, there lived a little girl with beautiful, golden curly hair. Her name was Goldilocks, and she played every day in the forest behind her home. Oh, did she play! She played and played from the faint light before dawn to just before lunchtime, bringing the breakfast of Nature Valley Granola Bars and a half pint of 1% milk that her mother packed for her each night before going to bed. She was a sweet girl, too, often sharing bits of oats and seeds with the birds, chipmunks, and other forest creatures, and they (usually) rewarded her kindness with friendly chittering and even an occasional nuzzle of her nose.

One day, however, Goldilocks’ mother fell ill. She was so ill, in fact, that she went to bed at 7:30 p.m., without even packing a breakfast for the poor girl. When Goldilocks awoke to the sound of the robins’ doodle-doo announcement of the imminent arrival of the faintest glimmer of pre-dawn, she donned a lovely, age- and activity-appropriate outfit, raced into the kitchen, and… found nothing to eat.The young lady, undeterred by this setback, decided quickly upon a plan of action. Gummi bears? Check. Half pint of mother’s skim (ew) milk? Check. Handful of coconut M&Ms? Bonus check! And off she flew to the forest.

You can probably guess what happened next. Yes, she ate all of the candy, nearly before the sun rose. Yes, she drank all of the skim (eww) milk. That helped for a while, but it really wasn’t enough. Really, really wasn’t enough. In fact, barely 73 minutes and 12 seconds after she left home, Goldilocks was ravenous.

Fortunately (according to one perspective), in her manic state – brought on by the massive sugar intake and perhaps a bit of genetics – she had ventured further into the forest than she had ever gone. “What is that smell?” she wondered. “That wonderful, awful, delicious smell?” Hardly traveling twenty steps further, and bursting into a clearing with a well-manicured lawn, she found the source of olfactory delight: a quaint two story thatched roof cottage. The aromas of fresh porridge and cut fruit wafted towards Goldilocks, calling her like the Sirens of old beckoned sailors to their doom.

She momentarily considered the possibility of danger. Then, she dismissed it. “I’m ever so hungry,” she thought. “There’s plenty, and I’m sure they won’t miss it.”

Goldilocks entered the cottage by way of the kitchen door and found three bowls of porridge waiting; an enormous bowl, a minuscule bowl, and a middle-sized bowl. Taking a bite from the largest, she exclaimed, “Ow! That’s too hot!” A similar bite from the smallest evinced a frown; “too cold,” she said. “That’s just disgusting.” By this time, in agony with hunger pangs, she was overjoyed to find that the moderately sized bowl was also moderately warm. “Just right,” she said. “And delicious, too. It could use a hint of nutmeg, but this is adequately adequate.”

This was a much larger breakfast than Goldilocks usually ate. It was filling, too. All of that playing and eating made her sleepy. At this point she could have slept on the floor, but it occurred to her that must be some perfectly good beds that nobody would need until at least afternoon. It didn’t take her long to find them, either. Upstairs, there was an enormous bed (too hard), a minuscule bed (too short), and a moderately sized bed that was slightly lumpy but otherwise just right. As she lay down for a brief rest, she told herself: “Just a brief rest, and we’ll be on our way.”

❖ ❖ ❖

Shortly after, the owners of the cottage returned. They were a family of Beavers; Papa Beaver, Momma Beaver, and Baby Beaver. (You can be forgiven if you assumed they were Bears; some hapless scribe in the 17th century, so poorly educated that he didn’t realize that “v” was actually a letter, removed every “v” from the story; and realizing that “Beaer” didn’t look quite right, reasoned that the family must actually be the Bear family. But, I digress.)

Being unaware that anything had transpired in their absence, the Beavers were shocked and dismayed to learn that someone had tasted their porridge.

“Someone’s been eating my porridge!” Papa Beaver bellowed.

“Someone’s been eating my porridge, too!” shouted Baby Beaver.

“Oh, my word. Someone rightly devoured my porridge! All of it,” whispered Momma Beaver.

Anxious to discover the culprit, the family searched through their house. They checked the living room chairs (all intact and un-sat in); they checked the bathroom and the laundry room (really, the same room); and finally they checked upstairs in the bedroom.

“Someone’s messed up my bed-covers!” said Papa Beaver.

“Someone’s pushed the pillows off my bed,” a trembling Baby Beaver cried.

“Someone’s been sleeping in my bed,” growled Momma Beaver. “And not only that, she’s still here!”

The Beaver family bared their frightful incisors and growled a Growl of Great Ferocity. Startled awake, Goldilocks took one look at the angry rodent family and decided that it was a perfect time to excuse herself from the premises. She ran off without a word, unless you count the ear-splitting consonant-less shriek that carried on the still morning air for what seemed like an eternity.

Papa Beaver didn’t like to see the glum look on Momma Beaver’s muzzle, but realized that the girl-intruder’s theft of porridge left too little for them to salvage a decent breakfast. He turned to his family and said,

“Hoooookay. Well. Who’s up for McDonald’s?”

THE END