Theme Switch Coming Up

I’m going to be switching the site’s theme from Libre to Libre 2 since the latter works so well on starbreaker.org and the former is no longer being maintained. The widgets on the bottom of the page might disappear for a few minutes, but other than that there should be no issues. If I’m wrong, I can restore from a manual backup.


Smudge the Sysadmin Cat

a brown tabby cat considering his bed
*meow* I’ve got this. I’m totally not stoned on catnip.

Saying No

I recently had cause to remember something so important that society spends years trying to make us forget it: “No” is a complete sentence.

Why is “no” a complete sentence?

  • Your first duty is to yourself.
  • You have the right to set boundaries for yourself.
  • You have the right to say “no” to anything and anybody.
  • You don’t need a reason.
  • You don’t have to explain yourself.
  • You don’t have to justify yourself.
  • Your life is yours alone, and saying “no” is how you remind others of this fact.

You don’t owe anything to anybody. Not to God, not to society, not to anybody who only values you for what you can do for them or notices you when they want something from you.

When You OD on Nietzsche Pops

The problem with having an internet-connected mobile phone and bringing it into the bathroom with you to play with while defecating—instead of doing the sensible thing and grabbing a paperback—is that you’re likely to find yourself doomscrolling. I made this mistake, and found myself reading a rant called On the Infestation of Small-Souled Bugmen by somebody named Adam Winfield. Here’s a sample:

A consequence of a perilously overpopulated, brutally capitalistic, shamelessly hedonistic, morally decaying society, the humble bugman has come to define an age of technological dystopia in which everyone has everything — their gadgets, their fast foods, their fashion accessories — but somehow everyone also has nothing — no community, no natural spirit, no substance of mind. He is a zombified consumer, an emasculated wage slave, a vessel emptied of meaning and refilled with plastic, pixels and silicone.

He is what a sterile corporate wasteland spews out. Millions of him, almost exact replicas who are relentlessly told they are unique by clever marketers, and who believe it. He is a personality defined by brands, a blue-checkmarked Twitter user. Bugmen are what we get when a culture is infantilized, watered down and stripped of the very intellectual, philosophical and honourable fibre that once made it great. Totally dependent on the compromised support of his nanny state and high-tech devices, the bugman has been reduced to the status of a domestic animal. A 200-pound child.

I’ve seen this movie before. I think it was on MTV in the 1990s…

Ready to stare into the abyss? Click the image above.

The rest of Winfield’s screed is more of the same, and it reads like the work of a man who has overdosed on Nietzsche Pops while reading Fight Club and missing the point. These are the words of a Last Man who mistakes himself for an übermensch (overman or superior man) and proceeds to lambaste his fellow Last Men for being what their families, culture, and society taught them to be.

While Winfield occasionally links to leftist critiques of capitalist society like Mark Fisher’s Capitalist Realism and David Graeber’s “On the Phenomenon of Bullshit Jobs” he is equally prone to linking to the Unabomber’s manifesto or to op-eds blaming the erosion of “traditional masculinity” for declining sperm counts in the late 20th century. Never mind that we have thousands of photographs of manly men from the 19th century doing things that people like Winfield would denounce as unmanly: hugging their friends, for example, or even having friends in the first place.

  • Does the society in which we live suck? Yes.
  • Are most jobs pointless, thankless, and soul-crushing? Yes.
  • Do we deserve better than a life spent further enriching the already wealthy? Yes.
  • Is our government corrupt and unresponsive to the concerns of people who aren’t billionaires? Yes.

However, the reactionary material with which Winfield supplements his reading of leftist critiques of late-stage capitalism won’t lead him to anything resembling a constructive solution. Griping about “SJWs” won’t help; either. Most of them are just angry, self-righteous young idealists ripping into anybody slightly more successful than them because they don’t have the means or the guts to go after the people who benefit most from the status quo—who just happen the same people abetting if not outright bankrolling the resurgence of right-wing populism.

I think “Bugmen” is the work of somebody who hasn’t read Nietzsche, let alone Fukuyama (in fairness I haven’t read this book either, just the essay it expands upon), and is trying to make sense of the world in which he finds himself. He thinks he’s “red-pilled”, but he’s another blind man grabbing an elephant by the tail and thinking that because he’s touched part of the elephant he understands the whole. Unfortunately for him, his effort to extrapolate the whole picture from the puzzle pieces he has handy leads him astray because many of the pieces don’t form a picture of reality, but of the fantasy world with which the alt-reich would like to replace reality.

This is why techies need better liberal arts education, particularly in history, the humanities, and philosophy. Without this background, we’re too easily taken in by any con-artist capable of boldly claiming to have rediscovered the answer to our existential woes in dead ideologies we left behind for good reason.

Then again, this might just be how he goes about promoting his dystopian sf novella Under Toronto, and he admits that his voice while writing online is mostly a pose in the same blog post in which he brags about being “a lean 6 ft 2 in, have a beautiful, feminine wife, a 6-month old son, my own house and a good-paying job” lest people mistake him for “a fat, basement-dwelling incel behind the keyboard”. Winfield is just begging to be trolled with a few good “masculinity so fragile” jokes, but I don’t think it would actually help.

Instead, I feel sorry for this guy despite his flirtation with ideology I associate with the alt-reich, neo-reaction, and the soi-disant “grey enlightenment”. He seems desperately frightened that he might be one of the small-souled bugmen himself, and somebody really ought to point him toward Discordianism or the Church of the SubGenius. Or maybe Bokononism?

PS

I’ve also noticed that a lot of techies like Adam Winfield tend to be obsessed with 20th century Japanese poet, playwright, actor, novelist, and nationalist Yukio Mishima, a man so obsessed with tradition, masculinity, and making a grand artistic statement of his own life that he participated in a failed fascist coup and then killed himself by committing seppuku. I’m not sure what conclusion to draw from this, but I must admit it’s tempting to seek meaning through grand gestures when one’s own life seems devoid of purpose.

Decision Code

Conflict, an industrial metal act from Moscow, Russia has their entire 2019 album Decision Code available on YouTube. I heard about it from Eris on SpaceHey.

Click the image to play Conflict’s Decision Code album on YouTube…

Decision Code is a concept album set in 2048. The world seems to finally be ready for change, but human beings don’t change easily and keep trying to build yet another utopia.

This is a good album if you like industrial metal. The production’s clean, and the music is tight with plenty of variety. While I’m not too keen on the harsher male vocals, there are also clean male and female vocals.

If you can spare the cash, I recommend buying Decision Code on Bandcamp. $10 will get you the digital version, but if you want the story and lyrics it might be worthwhile to spring for the $20 digipak edition.

JavaScript as a Last Resort

My favorite fantasy novel is Douglas Crockford’s JavaScript: The Good Parts, because I don’t think JavaScript has any good parts and should be used as a last resort. This puts me at odds with most web developers, and probably puts me at odds with Kev Quirk, who holds the opinion that JavaScript is only bad when misused.

Let me start by explaining why JavaScript has a bad reputation. You see, it’s a programming language that can be used to do all kinds of things on websites. These can range from benign uses, like formatting a hamburger menu on mobile devices, to more nefarious uses like browser fingerprinting.

The problem comes when web developers try bundle megabytes upon megabytes of JS into their websites. This can make websites extremely heavy and slow to load, which doesn’t sit well with me as I’m all about optimised websites.

I don’t have any argument with this, but I stand by my opinion that JavaScript should only be used as a last resort. I’m probably a bit old-fashioned here. I think that HTML, HTTP, and server-side processing should be the first technologies a web developer uses. They work for just about everybody. If you’re on 56K dialup in some godforsaken Kansas farm town it’s likely to be the only web tech that will work. But if you’re on an unmetered 10 gigabit connection in New York City it will fly like a bat out of Hell.

Of course, raw HTML can be ugly unless you like your websites oedipal, so let’s slather some CSS on top of the HTML, HTTP, and server-side code so that it doesn’t frighten off the suits.

Wait? What’s that? We don’t want to render entire pages on the server side any longer because we’re getting 10,000 requests a minute, the server’s wheezing like Donald Trump at the eighteenth hole, and the DevOps team has threatened to unionize and do work-to-rule? OK, fine, let’s layer some AJAX calls on top of the raw HTTP methods and use those when the client side has enough processing power and sufficient bandwidth to handle it.

We used to call this approach “progressive enhancement”, and it worked when developers were given time and latitude to do their jobs and deliver performant, reliable software that solved legitimate use cases. The developers working on the BBC’s website called it “cutting the mustard”. They delivered a reasonable baseline experience in less than 25KB of data and less than ten HTTP requests, and then used feature detection to deliver a fancier experience to visitors that could handle it.

Of course, I’m not the BBC. I’m just some metalhead who codes for a living, writes crappy science fantasy, and insists on having his own website instead of being content with a social media profile or three. But I like sharing music videos and most of them are on YouTube.

This presents a problem. The default method for sharing a YouTube video in a more visually appealing manner than a plain link is to use an embed. YouTube encourages this by providing markup you can paste into your blog. It looks like this.

<iframe width="560" height="315" src="https://www.youtube.com/embed/DLzxrzFCyOs" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

It looks easy, doesn’t it? Just past that snippet of text into your web page and boomshakalaka! You’ve got Rick Astley on your blog.

But there’s a catch. You see all that stuff in the “allow” property? That gives YouTube all kinds of device access that it shouldn’t need just to play “Never Gonna Give You Up”. It gets worse, though. For every YouTube embed you add to a page on your site, anybody visiting that page will end up downloading hundreds of kilobytes of JavaScript, much of it spyware analytics, just to play a video. Not to mention a bloated preview image that itself might weigh over 100kb.

a brown tabby cat with his tongue out
“Dude, there’s got to be a better way to share YouTube videos on your website than using an iframe that pulls in over 100KB of JavaScript. I’m just a cat but even I know better.”

Smudge is pretty smart for a cat who keeps forgetting to pull his tongue back into his mouth when he’s done washing himself. He’s right; there are ways to share YouTube videos without inflicting Google’s spyware on unsuspecting visitors.

It just involves work. Let’s consider that Rick Astley song that everybody is sick of hearing every time they click the wrong link (and never mind that it could be goatse). Its URL is https://www.youtube.com/watch?v=DLzxrzFCyOs. A preview image for this video is available at https://i.ytimg.com/vi/DLzxrzFCyOs/sddefault.jpg. sddefault.jpg is 640 pixels wide and 480 pixels tall, and its size is less than 15K.

Here’s the fun part: if you know a YouTube video’s URL, you can get its ID. If you have its ID, you can pull its standard definition preview image. It’s low-resolution, but good enough for our purposes, which is to provide a visual preview of a YouTube video inside a link to the video without using JavaScript.

a brown tabby cat yawning
“Hey, boss, why do we have to pull YouTube video preview images? Can’t we just hit https://i.ytimg.com whenever we need an image instead of self-hosting them?”

Purrseus isn’t as smart as Smudge. Then again, he’s still just a big kitten. Hopefully he’ll learn. What he’s talking about is called hotlinking. It’s generally a bad idea for the following reasons:

  • Every somebody visits your site, they’re hitting the other site too.
  • It takes longer for your site to load because you’ve got to wait for the other site.
  • You can’t cache data from other people’s sites.
  • It annoys sysadmins, who aren’t necessarily subtle but are quick to anger.
  • If the image gets moved or deleted, you’re shit out of luck.
  • A clever sysadmin could redirect your requests to something foul.
  • You wouldn’t want somebody doing it to your site.

How do I avoid hotlinking? I grab the preview image once and upload it to my site. Then I wrap the image inside a link with a caption instructing visitors to click the image if they want to watch the video. Doing it my way looks like this:

YouTube preview image
Click the image to watch “Never Gonna Give You Up” on YouTube.

The resulting HTML looks somewhat like this:

<figure>
  <a href="https://youtu.be/DLzxrzFCyOs?autoplay=1" target="_blank" rel="noopener">
	<img loading="lazy" width="640" height="480" src="/assets/images/yt-thumb-DLzxrzFCyOs.jpg" alt="YouTube Preview Image" />
  </a>
  <figcaption>Click the image to watch &#8220;Never Gonna Give You Up&#8221; on YouTube.</figcaption>
</figure>

I say ‘somewhat’ because I’m using WordPress and the actual HTML generated by WordPress might just be capable of giving Clive Barker nightmares. I’m as serious as a public explosive rectal prolapse here. If you right-click and select “view source” on the average WordPress site, well…

Kirsty Cotton just aced her front-end developer interview…

OK, I’m just having a bit of fun at my readers’ expense. WordPress-generated HTML isn’t terrible; there’s just a metric shitload of CSS classes involved that would have gotten in the way of my example and distracted from my point, which is…

You can provide a visually appealing YouTube preview that links to the original with nothing but HTML, some CSS, and a bit of elbow grease.

Smudge

I suppose, however, that you think it might be tedious to manually download a preview image every time you want to share a YouTube video. That’s what shell scripts are for. I don’t do this manually; I don’t get paid enough for that shit.

Instead, once I figured out how to do it consistently, I wrote a little shellscript called yttget (YouTube thumbnail get). It depends on curl and the display tool from ImageMagick—which is a brilliant and versatile toolkit once you learn to use it.

#!/bin/sh -e

# yttget (YouTube thumbnail get)
# © 2021 Matthew Graybosch <contact@matthewgraybosch.com>

# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.

# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
# AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
# OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.

# usage: yttget https://www.youtube.com/watch?v=DLzxrzFCyOs

URL="$1"
ID=$(echo $URL | cut -d = -f 2)
FILE="${HOME}/Downloads/ytt-${ID}.jpg"
THUMB_URL="http://i.ytimg.com/vi/${ID}/sddefault.jpg"

curl ${THUMB_URL} --output ${FILE}

echo "Thumbnail available at ${FILE}"
echo "Video URL: https://youtu.be/${ID}?autoplay=1"
echo "Suggested Caption: Click this image to watch on YouTube..."

display ${FILE}

Yes, it’s absolutely trivial as far as shell scripts go, but it works for me and you’re welcome to copy the code, save it, make the file executable, and use it yourself.

Does this seem like overkill compared to using the embed code YouTube provides? Perhaps, but I honestly think that blindly using iframe snippets provided by corporate-owned platforms like YouTube is taking the easy way out and does a disservice to people visiting my site.

Besides, since I’m using WordPress and have learned to cope with the Gutenberg block editor, I can make my previews into reusable blocks. If you’re using a static site generator, or even building your site with m4 macros, shell scripts, and duct tape, it shouldn’t be hard to create a partial or macro that accepts a YouTube video ID.

But if you absolutely must use JavaScript, write it yourself. Don’t use it unless you’ve run into a problem you can’t solve without it. The people using your site might not thank you, but it might help you avoid some headaches down the line.