Latest Articles

  • Raspberry PI Blicken Lights in Perl

    The estimated reading time for this article is about 2 minutes.

    This is a silly program that blinks the green and red LEDs lights on Rasberry Pi 3 models (probably works for RPI 4 too). It is written in perl, but frankly, you don’t need anything more than shell commands.

    #!/usr/bin/env perl
    use strict;
    use warnings;


    sub main {
    if ($> != 0) {
    die("Must run as root\n");

    for (1..3) {
    led0_on(); print STDOUT "on\n";
    sleep 1;
    print STDOUT "off\n";
    sleep 2;


    sub set_led_trigger_mode {
    my ($led, $mode) = @;
    $led //= ‘led0’;

    do {
    local $|;
    open(my $out, ">", "/sys/class/leds/$led/trigger") || warn($!);
    select $out; $|++;
    print $out $mode;
    close $out;

    sub unset
    led0_mode {
    set_led_trigger_mode(‘led0’, ‘none’);

    sub unset_led1_mode {
    set_led_trigger_mode(‘led1’, ‘node’);

    sub reset_default_led0_mode {
    set_led_trigger_mode(‘led0’, ‘mmc0’);

    sub reset_default_led1_mode {
    set_led_trigger_mode(‘led1’, ‘default-on’);

    sub change_led {
    my ($led, $state) = @;
    $led //= ‘led0’;
    $state = $state ? 1 : 0;

    do {
    local $|;
    open(my $out, ">", "/sys/class/leds/$led/brightness") || warn($!);
    select $out; $|++;
    printf $out "%d\n", $state;
    close $out;

    sub led0
    on {
    change_led(‘led0’, 1);

    sub led0_off {
    change_led(‘led0’, 0);

    sub led1_on {
    change_led(‘led1’, 1);

    sub led1_off {
    change_led(‘led1’, 0);

  • Using Twitter Without Losing Your Mind

    The estimated reading time for this article is about 6 minutes.

    Twitter (I won’t bother linking to it) is like a bar you go to where fights always break out. As a forum for conflict resolution, it is remarkably terrible. However, not everyone in this virtual bar is looking for a fight. There are wonderful people sharing uplifting, creative ideas on the platform that really are worth your time to seek out. But to use the web interface of Twitter using the default settings is a day-ruining mistake. Here are my five tips for toning down Twitter’s ability to enrage you.

    Turn Off Retweets

    Your timeline in Twitter will be filled with posts from the accounts you follow, as you might expect. However, twitter will also add to your timeline posts that your followers retweeted. I and others have observed that the most outrage-producing content are the ones most likely to be retweeted. This is done, most often, as a sign of support for the position promulgated by said post.

    There are at least two additional problems with retweets.

    The first is that since it is so easy to retweet a post, the retweeter often does not careful vet the veracity of claims made by the original poster. I can tell you first-hand that retweeting is often done for emotional reasons rather than rational ones. Retweets are the kind of content that makes Twitter terrible. Worse still is that you will be tempted to reshare the retweet and spread the virus further. Wear a mask, er, decline retweets in your timeline.

    The second problem with retweets is that usually the reason you are following an account is to see original content. It takes (marginally) more effort to write a tweet than to repost. If you are following smart, diligent people, you will find the original posts of same a lot more interesting, nuanced, and considered. This is the content you should be paying attention to on Twitter.

    Twitter knows that retweets prolong engagement with their platform, so disabling them is labor-intensive. Retweets must be disabled per-account. You will need to visit the account page of each of your followers. Near the top of that page (near the name and profile stuff) on the right hand side, are three vertical dots. Click on this to see a set of options, including Turn-off Retweets.

    Because this is so painful to do, I suggest first stopping retweets from the accounts that spam you with the most rage-inducing content. Do this for maybe 5 - 10 accounts per day. After even a couple of days, you will find that the fire in your timeline is much reduced. The quality content will start to jump out at you.

    There may be a few accounts whose retweets you want to see. Great! These posts will be welcome additions in your timeline and not get lost among noise.

    Decline Resharing of Likes

    Another way Twitter “helps” your timeline is to occasionally insert posts that your followers merely liked. As with retweeting, “liking” a tweet is a low-quality, intellectually cheap action that is a poor indicator of quality. For example, I like posts all day long that I would not even retweet! Why would anyone care to see the results of my compulsive clicking?

    To turn off this behavior in Twitter, find a post in your timeline that Twitter inserted because some of your followers “liked” it. There is an inverted caret on the top right corner. Click that to see more options. One of those options will be “See less often”.

    Set Your Timeline to Chronological Order

    Twitter has some bogus algorithm it uses to order the posts in your timeline. This algorithm was not designed for your benefit but theirs. You can change the order that posts appear in your timeline to chronological by clicking on the set of stars at the top of your timeline. Change from “see Top Tweets first” to “Tweets as they happen” (or wording to that effect).

    Chronological ordering at least grounds you in conversations that are contemporaneous. With top tweets, you could be responding to a post from a few days again, keeping a tedious thread alive longer than it needed to be. If an older post is worth seeing, you will often find it referred to by your friends or others.

    Use Muted Words and Muted Accounts

    This feature was long-overdue in coming to the platform. Twitter allows you to define a set of words and phrases that will cause posts to be hidden in your timeline and replies. This is a glorious feature that you should invest time crafting. I have a whole passel of politicians, pundits, and attention-seeking knuckleheads in my account’s list. Is this an information bubble? Sure, it is, just like a space suit is an air bubble for astronauts. Not all bubbles are bad.

    Sometimes, you want to follow a user, but you do not want to see their posts often. This sounds weird, but the situation happens. For example, I jabber about politics a lot around election time. Some (all?) of my followers do not care to hear my wisdom on the subject. They may choose to mute me for some months until the fever has passed.

    Muting an account is like putting someone on probation. It’s not as final as unfollowing, but that can often be the next step should posts not improve.

    Block Accounts Early and Without Concern

    Finally, Twitter allows you to block accounts of people with whom you wish no further interactions. I have about 100 accounts blocked, most of whom seem to want to argue with me. I do not argue with people on the Internet, since I am a professional Internet user.

    Some people fell bad or nervous about blocking accounts. Do not. It is your right to control access to you. If someone even appears to be trouble for you personally, just block them. I have been blocked by comedian Paul F. Thomkins at least twice, although I am not entirely sure why. But the beauty of blocking is that Thomkins has never needed to explain why he did this. Neither will you.

    To hijack a sloppy, sentimental expression, “block as if no one is watching.”

    In Conclusion

    I hope you find this tips helpful. Many of them are already well known to long-time Tweeters. Note that some third-party Twitter clients may have even more ways to improve the quality of your timeline, so take the time to learn them.

    Many of us spend far too much time on Twitter. I have been on the platform since 2009. Take control of your timeline or someone else will.

  • I am a Kubernetes sceptic

    The estimated reading time for this article is about 1 minute.

    I recently watched a video of someone explaining the problems kubernetes (k8) solves. Frankly, I was outraged.

    For the moment, let’s grant that you need to deploy an application in docker containers. Perhaps you need several instances of parts of the application (like frontend UI that talks to centralized catalog DB and authentication directory). I get using some kind of orchestrating software that copies docker containers onto the right VMs when new versions of the container are made available. There are a couple of deployment packages with long histories that can do this now.

    What irks me about k8 is the way it also becomes an application level router, needed to manage DNS records and load balance. This mixing of release management and production dependency seems entirely wrong-headed.

    While I was grant that some very large applications might need this level of abstraction, too much containerization during development has got to be an anti-pattern.

  • When Fantasy Becomes Racist, Oriental Adventures

    The estimated reading time for this article is about 12 minutes.

    This is a photo of my copy of Gary Gygax’s Advanced Dungeons and Dragons Oriental Adventures rule book, which was published and bought in 1985.

    My copy of OA

    There is no way to fully express the totality of excitement shared by my friends and I around this title at the time it was published. In pre-Internet days, role playing supplements like this were a lifeline to kids stuck in places designed to be boring.

    Right now, in 2020, it is not difficult to understand that some of the foundational texts of youth have been criticized for colonialism, racism or at least cultural appropriation. To state the obvious, the original authors of Dungeons and Dragons, E. Gary Gygax and Dave Arneson, were a pair of middle-aged, middle class, mid-century white dudes from Wisconsin. In other words, two people marinated in the weird white supremacist, cold war culture of twentieth century America (a stew in which I too was basted). To their credit, each was drawn to medieval wargaming as a tacit rejection of their culture in which they found themselves. Unfortunately, it was difficult to completely isolate oneself from the myriad of subtle racist messaging that saturated all popular media of the time, as I later learned.

    I grew up (and currently live) in the venerable Commonwealth of Massachusetts. Although considered by outsiders to be a bastion of enlightened liberalism, such perception does not long survive contact with the ground truth of living here. While it is not the hotbed of racism to rival certain infamous Southern states, it is far from devoid of it. As a kid, overt racism was actively and decidedly squashed. Yes, you could like the General Lee but saying that you wanted to bring back slavery was at least going to get you disinvited to cocktails at the boat house. Still, when I watched TV shows or the nightly news, invariably the villains would be people of color, even if this was not explicitly pointed out. There was vocal endorsement for the civil rights movement of the 60s and even lionizing of Dr. King, but the car doors still were pointed locked when we drove through Harlem in NYC. We had what might be termed proximity xenophobia. This is a fear of people with whom you did not grow up. The dread appears to increase with the distance of the origin of such strangers from your home. Which is to say that even white folks from other parts of the country were cautiously handled. I perceived this mode of thinking to be a wide-spread default of central Massachusetts culture, but I can present no scientifically-vetted data to support this assertion.

    Xenophobia is often the mother of racism, but they are not the same. Racism comes with a whole passel of intellectual gymnastics needed to justify the belief that one group of people should actively oppress another due to some imagined genetic or divinely created inequality. These justifications are encoded into laws and business practices, creating systemic misery for the target group. I recommend the company of neither, but forced to choose, I prefer the xenophobes. It is easier to educate a xenophobe than a racist, since “curing” racism entails pulling down disingenuous arguments about “race” and getting the frightened white person to accept the existence of their privilege (also see white frigility, which is another condition under which I labor).

    An additional feature of my xenophobia relevant to rearing was my mother’s fascination with all things Asian (best read here as Chinese and Japanese art and furniture). She was born in 1935 in the Bay State and had a less than halcyon childhood. No doubt that the exotic artifacts from Pacific Rim that would later fill first her home and, after she passed, mine made a strong impression on her. These might as well have been dropped from outer space, as she had no practical access to people from that region and little time for research in a library (although she worked in both my elementary school’s library and that of my other primary school, Cape Cod Academy).

    My parents both actively tried to fight against the cultural programming that each had received from the 1940s, in which xenophobia was considered obviously patriotic. Terrible ideas from one’s childhood often sink into pre-conscious thinking where they are hidden from notice and are difficult to uproot later.

    This pattern so dependably reproduces that with some schadenfreude, I will enjoy watching the more strident younger voices of today who righteously call out on social media the micro-aggressions of their elders today find themselves targeted by similar opprobrium in 10 - 15 years time [and laugh at the predictable reactionary calls to stop this new “cancel culture” from same].

    To hijack a line from the CRPG Fallout: Culture War, culture war never changes.

    The fascination with (even fetishization of) Asian culture by Western people is called Orientalism. In the US specifically, there is a bizarre mirror sympathy that romanticizes a fantasy version of antebellum black slave culture called Black Americana, which takes the form of monstrous kitchen and lawn decorations (links intentionally omitted). From Orientalism by Edward Said:

    “Orientalism depends for its strategy on a flexible (Western) positional superiority, which puts the Westerner in a whole series of possible relationships with the Orient without ever losing him the relative upper hand.”


    These forms of Othering often go unchecked since their devotees express no desire to destroy or harm the objects of their ideation. Yet these fantasies strip the humanity away from their target cultures, leaving one dimensional “magical creatures” in their place. This is a fetish of a dominate culture over politically and economically weaker ones in a given nation. If told that a significant portion of the young Chinese population romanticized a cartoonish version of American cowboys or even the dreadfully dull Puritans, I would not be surprised.

    Enter the ninja.

    The 1980s were a triumph of Japanese culture in the U.S. Having dug out of the atomic ruins of WWII, Japan had built a formidable economy based on durable goods, like automobiles, and consumer electronics. Wealth flooded into the land of the Rising Sun allowing for a resurgence in culture and arts. The amazing movies by Japanese auteurs like Arika Kurosawa influenced Western movie directors. By the 80s, Japan looked like the land of the future. While the 60s and 70s brought the delight of primarily Chinese martial arts films to the West, the 80s saw Western marketers package the concept of ninjas and samurais for the white adolescent market (of which I was one).

    Make no mistake. Ninjas were the bomb.

    Dressed in silken black garments, armed with the straight bladed ninjato, throwing stars, and climbing claws called shukos, these stealthy medieval assassins fit perfectly with Cold War culture of high stakes espionage. Popularized in movies, TV, comic books, and all possible media, the feats and abilities of ninja were stories that grew in the telling. Could they blend into shadows? Of course! Could they stop their heart beats? Naturally!

    The flip side of this narrative coin were the samurai: noble, aristocratic warriors following the Bushido codes of honor. Wielding master-crafted katana swords and donning brightly colored armor, the Samurai of 80s conceit where natural opponents of ninjas. Guided by their strict moral code, they operated alone without magical powers or totems, forever on watch against the anarchic, semi-magical, evil ninja.

    Or something like that.

    Of course, the real history of ninjas and samurai is far messier. Samurai were very much like feudal knights in Europe, requiring sponsorship from a powerful Daimyo, or land owner. Daimyos frequently strove for political power against one another, relying on the martial skills of their samurai to win the day. Later samurai began to wield political power themselves. Into this highly fraught feudal system arose a need for saboteurs, spies, and assassins. The ninja catered to all these roles of irregular warfare. The heyday of ninjas was the 16th - 17th century. However over the centuries, samurai became seen as bloated aristocratic parasites. While this story fits well into a Marxist analysis of medieval class struggles, but that’s not what you can sell to kids.

    In 1985, TSR published an AD&D rulebook that adapted the historical figures of ninjas and samurai into a fantasy setting informed by primarily Japanese mythology. This rulebook, as you probably gathered, was called Oriental Adventures and it sold well. TSR was in financial trouble when this supplement was published. This one title helped pull them out of that crisis.

    Written in large part by Gygax, the book is a high watermark for RPG supplements. To those ignorant of medieval Pacific Rim history, OA presents an fascinating world of magic, honor, and adventure. In pre-commercial Internet days, OA opened a new world to young Western minds, including my own. To quote from the preface of OA:

    “Of course, schools of fighting are covered. So are the differences in weapons between China, Japan, and so on. Culture is also stressed. Honor, dignity, training in social graces and ceremonies are as important to the adventures in this milieu as are experience points and magical treasure. Think about that for a moment.”

    Oriental Adventures, preface

    It’s hard to know the intentions of the authors, but in this passage, Gygax demonstrates that the Pacific Rim is not a monoculture. While not being a historical-sociological text book, the ruleset attempts to present a blended culture that would be significantly alien to many of its readers.

    OA is a work of fiction that explicitly calls itself fantasy and it no way implores the reader to believe that what it is describing represents any real human beings alive or dead. However, in the absence of readily available factual content or access to flesh and blood Japanese, Chinese, or Korean people, these fantasies can and did inform Western views and trade on Western stereotypes. Recall that OA appears in a culture that is already white supremacist generally and within the subset of people already enthralled with Orientalism.

    Can it really be controversial to call OA an work of Orientalism? Surely, it is the very definition of it.

    “In art history, literature and cultural studies, Orientalism is the imitation or depiction of aspects in the Eastern world. These depictions are usually done by writers, designers, and artists from the West.”


    OA is the work of someone in love with an idea of feudal Japan who was not overly concerned with the danger of stereotyping. To address the elephant in the room, the word “oriental” (meaning Eastern) has become a lot more of a taboo word than it was when in 1980. However, language adapts to culture. By the nineties, I was rightly called out of use of this word with respect to people. However, I recall no incidents of condemnation using this word during the 70s or 80s. In this case, the word is too broad and frankly too dismissive to have any real use anyway. When (if?) you read the Edwardian Yellow Peril thriller The Mystery of Dr. Fu Manchu the modern reader may find it odd / repulsive / illogical that cultures as different as those of India, China, and the Philipeans are all lumped together. Take some hope from your reaction that the long arc of history is bending toward social justice.

    Perhaps Fu Manchu and OA are not so different after all. Published 60 years apart from each other, both sought to exploit the culture of real people for the benefit of an imperialist market. But that 60 year difference also brought huge changes in technology that made it far easier to learn about the history of real Pacific Rim cultures. When Sax Rohmer was writing about “chinamen,” he had precious few reliable literary or real world references to use, cosseted as he was smog-blighted London. He could have easily shifted subject of his stories to aliens from Venus and been decades ahead of the X-Files. Dr. Fu Manchu is one of the world’s most fascinating villains who works only in the matrix of profound xenophobia and cultural ignorance. From that perspective, OA is far more humanizing and respectful of the culture it presents. That, obviously, is a low hurdle to clear.

    What is good about OA is the way it communicates a sense of wonder and a sense of the exotic. Imaginations need these things. The easiest way authors create verisimilitude in their fantasies is to borrow from real history, which is a trick TSR used far too much and far too casually. The challenge for fantasy writers going forward is to be inspired by the profound diversity of human cultures, but also to synthesize the source material to create worlds that more than just thinly-rethemed analogs. A good example of this hard work can be see in M. A. R. Baker’s Empire of the Petal Throne.

    At the end of the day, I cannot muster full-throated opprobrium towards OA. The work is filled with love, not malice. However, the queasy feeling induced by the title alone prevents me from giving this work a pass (and the clear orientalism within is problematic). The core conflict that galls me is that all kids from all ethnicities should be allowed to have heroic fantasies, whether the setting for those adventures is European, Asiatic, African, or American. The are so few heroes in real life. Role playing can promote empathy for our fellow Earthlings and a deeper understanding cultures. Of course, it can also induce false ideations that are dehumanizing.

    I have to come down in the side supporting of limitless fantasy. An active, engaged mind is better for society than the opposite. And if occasionally this produces some well-intentioned othering, that is a small price to pay (and a consequence that I trust is straight-forward to fix with education).

    If somehow OA were responsible for producing iconography like that Black Americana, I would be profoundly angry at the work. Is the absence of such real-world manifestations of ignorance and oppression all that saves this publication for me?

  • STEM Content on YouTube for the Inquisitive Kid

    The estimated reading time for this article is about 3 minutes.

    I have a 10 year old son. He has an active mind that needs to be filled with ideas. If you find yourself needing to both help your child’s mind and also take a little break from constant surveillance, you should know about the following channels on YouTube. All this content is free, which continues to blow my mind. Many of these channels you will already be familiar with, but all deserve additional exposure.

    There is no particular order to this list. I watch all of these channels myself even without my son.

    • Curious Droid: Mostly about historical aeronautics, but every episode is great. And dig Paul Shillito’s crazy shirts!
    • Crash Course: Crash Course is a production of John and Hank Green and covers the gamut of liberal arts subject, but there is a lot of science and engineering to be found here. Great introductions to complicated topics that never talk down to the viewer.
    • Kurzgesagt: Come for the content, stay for the animations. It’s science explained with an opinion. Some episodes, like Is Meat Bad?, will make you groan. Still, I have watched every episode and look forward to more.
    • SciShow: The second of the Vlog Brothers channels on this list, SciShow is another channel of which I try to watch every episode. All are short nuggets of information about what’s going on with science today
    • CPG Grey: Fast talking stick figures drop tons of esoteric knowledge you didn’t know you needed. How to become Pope? What does the US-Canada look like and why? What a field trip to a decommissioned missile testing range? Grey makes all of these intellectual inquiries charming.
    • Science Asylum: If you can’t trust a guy named Nick Lucid to explain physics, you have a lot of trust issues, bro. In particular, Lucid’s scale model of the solar system should help your child understand stellar distances of our local solar system.
    • Dr. Becky: Astrophysicist from Oxford, Dr. Smethurst breaks down some of the complexity of astronomy today. If you are not already excited about what’s going on with astronomy today, hold on to your hat.
    • FermiLab: From the famous particle science research center FermiLab, Dr. Don Lincoln does deep dives into topics like quantum physics, fusion, and just about anything else needed to write a good sci-fi story. Check this channel out.
    • Khan Academy: The most explicitly pedagogical of all the channels listed here, Khan Academy tends to explore math basics, algebra, trigonometry, geometry, and even some calculus. Great content for those new to the subjects or those needed a gentle reminder.

    In a perfect world, all of these creators would be supported by public funds for each provides extraordinary public benefit. However, just watching these videos and subscribing to their channels does benefit the creators and helps YouTube’s AI find similar content for you.