Adventures in topology: The Cuckoo’s Egg and meeting Cliff Stoll

I recently finished up reading “The Cuckoo’s Egg” by Cliff Stoll. It was a fascinating story that details some of the first examples of computer hacking and computer forensics.

This post isn’t a review of his book, however! It’s more to document some adventures that resulted after reading it.

First, a quick summary:

In 1986, Cliff Stoll was  an astronomer working at Lawrence Berkeley Laboratory when he was tasked to look into a $0.75 discrepancy in compute time billed to physicists and other scientists who remotely connected to their machines.

What resulted was a year long wild-goose chase that ended up in the arrest of a KGB operative in Germany who remotely connected to university computers in the United States in order to gain access to military networks through ARPANET (precursor to the Internet of today).

Cliff wrote a book about his experience that went on to become a best seller. For fans of esoteric computer history, this was one of the first documented examples of hacking and marked the beginning of computer forensics. This book was published 35 years ago and deals with (now) antiquated technology that the young ones around here know nothing about — but oh wow, did I thoroughly enjoy this!

Anyway! That’s not why I’m here. I’m here, because I keep seeing his name pop up in various places (more recently Hacker News). A post mentioned his TED talk in 2008. It’s a hoot — and pretty inspiring, too!

One person mentioned that he makes Klein Bottles (an interesting manifold that ends up being a container with zero volume, as it only has a single surface) out of his home in… North Oakland. Oh, he also enjoys visitors.

Oh, really?!

The Klein Bottles are a really interesting object and have been a fun talking point with friends. I ended up purchasing a Klein Bottle from Cliff and asked if I could pick it up, since I live nearby. He happily obliged.

I ended up bringing our oldest kiddo and we had an absolute blast. He spent an hour with us, showing some of the artistic stuff he’s been working on (mathematical quilts!), showing off various gadgets he’s made (a fun device that draws images on his shipping boxes using Sharpies — an automated personal touch), and letting my kiddo drive the remote controlled robot he built that runs under his crawl space (!).

Just an absolutely memorable time. Thanks so much, Cliff!

TIL: List git branches by recent activity

In both my work and personal coding projects, I generally have a number of various branches going at once. Switching between various branches (or remembering past things I was working on) can somethings be a chore. Especially if I’m not diligent about deleting branches that have already been merged.

Usually, I do something like:

> git branch

Then, I get a ridiculously huge list of branches that I’ve forgotten to prune and spend all sorts of time trying to remember what I was most recently working on.

daves/XXXX-123/enable-clickstream
daves/XXXX-123/impression-events
daves/XXXX-123/tracking-fixes
daves/XXXX-123/broken-hdps
daves/XXXX-123/fix-contacts
daves/XXXX-123/listing-provider
daves/XXXX-123/revert-listing-wrapper-classname
daves/XXXX-123/typescript-models
daves/XXXX-123/inline-contact-form
daves/XXXX-123/clickstream_application_event
daves/XXXX-123/unused-file
daves/XXXX-123/convert-typescript
daves/XXXX-123/convert-typescript-v2
daves/XXXX-123/similar-impressions
daves/XXXX-123/update-node-version

At least 75% of those have already been merged and should have been pruned.

There has to be a better way, right?

Thanks to the power of the Google machine (and Stack Overflow), I found out, there is!

> git branch --sort=-committerdate

Hot diggity dog!

daves/XXXX-123/clickstream-filter-events
main
daves/XXXX-123/convert-typescript-v2
daves/XXXX-123/update-node-version
daves/XXXX-123/similar-impressions
daves/XXXX-123/convert-typescript
daves/XXXX-123/clickstream_application_event
daves/XXXX-123/unused-file
daves/XXXX-123/typescript-models
daves/XXXX-123/listing-provider
daves/XXXX-123/inline-contact-form
daves/XXXX-123/revert-listing-wrapper-classname

That list is now sorted by most recent activity on the branch.

Alright. Even though this is better, that’s still a lot of typing to remember. Fortunately, we can create an alias:

> git config --global alias.recent "branch --sort=-committerdate"

Now all I need to do is just type git recent and it works!

Nice.

Book Review: Palo Alto by Malcolm Harris

I really struggled and finished this out of spite.

I went into it wanting to like it and hoping to learn more about the history of a specific part of California (I recently read and enjoyed “California: An American History” by John Faragher and it stoked my interest in looking for more books related to our state).

Oh, wow. What did I get myself into? This book could have been half as long and still tried to make its point: Palo Alto is the center of all evil and suffering on Earth, anyone who went to school at Stanford or started a company there had ulterior motives on world domination and fantasies of oppression, everyone is driven by a profit motive above all else, here’s 1,000 reasons why capitalism is bad, the only way to right the wrongs of the millions that have suffered or been killed due to Palo Alto ideas and inventions is to give the land back, blah, blah, blah.

Okay, Yes! There are unfortunate things that happened due to people and companies in this town that have caused people around the world to suffer. But this is not an exclusively Palo Alto problem, nor is it exclusively a capitalist problem. There are a lot of things that happened or been created here that have also been a benefit and this book just takes every opportunity to tear down and complain… about literally everything.

Maybe 1.5 stars? I am loathe to round up because I think this book is a bit disingenuous in its claims and the author has an axe (probably made in Palo Alto) that they wish to grind.

It’s Friday afternoon, so let’s write a song

My latest generative AI obsession: Suno. You provide it some lyrics, give it a musical style to emulate and hit the create button. It’s pretty wild.

I wrote some fun lyrics about deploying code on Fridays, set to some catchy 80’s pop. The result is pretty crazy.

[Verse]
Testing in production (oh yeah)
That is how we roll (whoa)
Testing in production
using my flawless code

[Bridge]
Why should I write tests (what?)
My code is never a mess (oh no)
Did I just rhyme,
Tests and a mess (yeah he did)

[Chorus]
It’s Friday afternoon.
It’s time to deploy my code. (whoa yeah)
The weekend is almost here.
It’s time to deploy my code. (watch out)

[Verse]
It’s Friday afternoon.
I don’t have anything to fear
It’s time to deploy my code.
The weekend is almost here.

[Bridge]
Why should I write tests (what?)
My code is never a mess (oh no)
Did I just rhyme,
Tests and a mess (yeah he did)

[Verse]
It’s Friday afternoon. (Whoa)
It’s Friday afternoon. (Whoaaa)
It’s Friday afternoon. (Yeah!)
It’s time to deploy my code. (WAIT WHAT)

[Bridge]
Why should I write tests (what?)
My code is never a mess (oh no)
Did I just rhyme,
Tests and a mess (yeah he did)

[Chorus]
It’s Friday afternoon.
It’s time to deploy my code. (whoa yeah)
The weekend is almost here.
It’s time to deploy my code. (watch out)

[Chorus]
It’s Friday afternoon.
It’s time to deploy my code. (whoa yeah)
The weekend is almost here.
It’s time to deploy my code. (watch out)

Tracking the total eclipse shadow

I didn’t get a chance to make it out to see the total eclipse in person this time. (Really bummed… 2017 turned me into a legit umbraphile!)

Earlier today, I pulled down a number of images from NOAA’s GOES-East satellite and compiled this video. It takes a photo every 10 minutes. You can clearly see the Moon’s shadow as it makes its way across North America.

(Protip: Set the image quality to 720p. YouTube’s compression makes that video look like garbage otherwise!)

Pretty awesome!

Somewhat related — in 2020, I compiled a bunch of NOAA imagery that encompassed 3 weeks. I need to get that project up and running again…

Ever changing communication

There was a time (really, the past 15 years or so) where responding to things with an animated GIF was so perfect and encapsulated so much (e.g., if a picture is worth 1,000 words, what is a series of pixelated images moving a 8 frames per second worth?).

For example. see the rise of services like Giphy. I even have a random 10 year old project myself that involves animated GIFs!

Now though, it’s becoming generative AI all the way down.

For example, I just received a meeting invite that increases the frequency of meetings I’m having related to a certain project to… every single day.

Me: Hey, robot! Please create a meme image of a programmer jumping up on a desk and excitedly cheering “MOAR MEETINGS!”

Robot:

Now to figure out a way to send it in my place…

Coffee confusion

February 27th, 2024, via the Washington Post:

One of the most striking findings is that coffee drinkers are less prone to developing Type 2 diabetes. Many large studies have found that people who drink three to four cups of coffee daily have about a 25 percent lower risk of the disease compared with people who drink little or no coffee. Your likelihood of developing diabetes decreases about 6 percent for each cup of coffee you consume daily — but only up to about six cups.

March 11th, 2024, via CNN:

Caffeine intoxication occurs when a person has dangerously high levels of caffeine in the system. It creates a spectrum of unpleasant and severe symptoms, such as trouble breathing and seizures. There are a few cases where people have died from caffeine intoxication.

[…]

Caffeine intoxication is more than the headache you get from drinking too much expresso. It happens when people ingest an excessive amount of caffeine. The US Food and Drug Administration defines this limit as anything more than 400 milligrams of caffeine daily for healthy adults. This is equivalent to four or five cups of coffee.

Hometown tidbits: The first modern hydroelectric plant

I’m currently reading California: An American History, by Jack Mack Faragher. There is an interesting historical tidbit that calls out the area where I grew up.

A robust economy pulled migrants to California. That had not always been the case. The economy had grown slowly in the last quarter of the nineteenth century, held back in part by the absence of coal deposits on the Pacific coast. In the 1890s, however, Californians began exploiting other forms of energy that would power a takeoff into sustained economic development.

They first harnessed the power of the water that coursed down the watercourses draining the state’s many mountain ranges. In 1893, utilizing technology developed for the mining industry, the first modern hydroelectric plant in the nation began operation on a fast-flowing creek near the southern California town of Redlands. Local orange growers needed a source of power that would enable them to pump water up into the hills, where they wanted to lay out more groves. The Redlands generating station became the model for dozens of others, many in the Sierra Nevada, designed to provide power for both domestic and industrial use.

Hey, that’s neat! I grew up on a property with a creek near the town of Redlands (and have even done a small bit of research on it back in the ‘ol university days).

I wonder… is it the same creek (or rather the bigger creek near this small creek I grew up on). To the Google machine!

Search: “redlands first hydroelectric plant

Yup!

Built by the Redlands Electric Light and Power Company, the Mill Creek hydroelectric generating plant began operating on 7 September 1893. This powerhouse was foremost in the use of three-phase alternating current power for commercial application and was influential in the widespread adoption of three-phase power throughout the United States.

[…]

The success of the 3-phase generators at the Mill Creek No. 1 was apparent, for these original generators were used until 1934. Although the original units have been replaced, this plant is still in operation to this day. Today, more than 100 years after Mill Creek’ completion. 3- phase generators are still the primary form of power generation around the world.

Hah, that is pretty cool! I distinctly remember this building from playing nearby and exploring the “wash” (as we called the area). You can see it via Google Street View, here, just to the north of Highway 38.

This is just one of the many wonders about this area.

See also:

DNS issues days after moving domain registrars

(Writing this for my future self and for future people that might have similiar problems)

Quite awhile ago, I made the decision to move all my domains from GoDaddy to a mix of Google Domains and Name.com. I enjoyed managing my domains through the Google interface and thought it was one of the better UIs available. It made things easy!

Sadly, like most beloved Google projects (RIP Google Reader), they decided to shut it down and transfer all domains to Squarespace. Well, I didn’t really want to use them. So, I decided to transfer many of my domains to Name.com.

The process to transfer was pretty easy. I figured I’d have to wait a day or two before I could see the changes.

One day goes by. Two days go by. Three days go by. It’s been four days and I’m still getting this when attempting to view my blog and a few other domains of mine from my home network.

What the heck is going on! If we check some domain propogation tools, I see that my site is pretty much unreachable throughout most of the world.

Interestingly, if I popped off my home network and used my phone, I could reach the site.

Okay! Now we’re getting somewhere. Sort of.

After much Googling, I found a post on the Cloudflare forums where someone had a similiar issue. The solution was that the “DNSSEC” settings were incorrect. I don’t use Cloudflare, but it seemed like something that was in the right direction.

2-3 days ago I changed the nameservers towards those of cloudflare, and since I cannot reach the website anymore. I’ve added all the DNS records that should be relevant. However in the dashboard it keeps saying pending nameserver update and the website can’t be reached. After 2-3 days still… The hosting company says that the NS points to those of cloudflare, and I’m at a loss at what I did wrong to make it go through cloudflare…and be able to be reached again. 

A solution to this issue stated:

Your domain’s DNSSEC setup is broken

Interesting. I hadn’t touched anything related to DNSSEC settings at all, as Name.com said it would auto import all settings during the transfer process. In fact, I couldn’t see anything related to DNSSEC management at all.

Oh, wait. It turns out, it’s waaaaaayyyy down at the bottom of the page when managing your domain!

Let’s see what happens if we click on it.

Oh! There is a value there:

Interestingly, there is an option to remove this entry. Let’s see what happens. I mean, the site is already broken and unreachable right. So, I click remove and wait a few minutes.

And then…

the websites are accessible again!

Wow. Lesson learned — double check everything when transferring domain registrars.

TIL: How to change your default editor for git commits

A recent post on Hacker News highlighted the benefits of detailed commit messages in git.

Usually, my git commits look something like this:

> git commit -m "fix: component missing configuration file"

…which isn’t all that helpful. (Related: see XKCD on git commit messages)

I decided to try and utilize this newfound knowledge in my own git commits and I quickly ran into an obstacle. Simply using > git commit opens up vim. Which, I really don’t want to use. (I’m sorry!)

This is something I should already know how to do, but I had to do a Google search to learn more. It turns out, you can change the default editor in git. This makes it much more convenient! How do you do it?

git config --global core.editor "nano"

Replace “nano” with your preferred editor of choice. Now, running > git commit opens up your editor and you can make detailed commit messages to your heart’s content!

Re-reading the Three-Body Problem

Way back in 2015, I read The Three-Body Problem and thought it was an alright book, if a bit dry at times. This probably goes along with me liking the idea of hard science-fiction more than I actually like reading it.

That said, the upcoming Netflix release of Three-Body Problem reminded me that I still wanted to continue reading the trilogy, especially since I’ve heard absolutely rave reviews of the second book, The Dark Forest.

The only problem?

I honestly don’t remember what happened in the first book. Something something about science, space,, first contact, invasion, quantum entanglement, etc.

So, I decided to go ahead and re-read it this past week.

Oh, man! I enjoyed it immensely. Maybe it’s just a time-and-place kind of thing.

I am definitely looking forward to this.

Upgrading Mr. RossBot’s image model and prompt template

My Mastodon landscape painting bot, Mr. RossBot keeps kicking along, generating some fun landscape art. It’s been powered by the AI Horde (the open source project behind ArtBot) and has tried to utilize whatever image models provided by the API to the best of its abilities.

For the most part, the code behind it is a bunch of spaghetti that looks like this:

An update to the AI Horde late last year added support for SDXL. However, the SDXL model on the Horde did not use a refiner. Because of this, images tended to come out a bit soft and lacked texture.

You can see examples of this in my announcement post about Mr. RossBot being back, here. See also:

More recently, the Horde added support for a new image model: AlbedoBaseXL. It’s an SDXL model that has a refiner baked in. Now images will come out a lot sharper looking.

Coincidentally, I was also playing around with various prompts and discovered I could get much better image results that look more painterly (rather than simple digital renderings) by utilizing the following prompt:

A beautiful oil painting of [LITERALLY_ANYTHING], with thick messy brush strokes.

And that is it! No more messy appending various junk to the end of the prompt to attempt to get what I want. The results speak for themselves and are pretty awesome, I think!

TIL: Local overrides in Chrome

I’ve been doing web development professionally for about 10 years now and just discovered something new. (I love it when this happens!)

Today, I learned about local overrides in Chrome. Local overrides are a powerful feature within Chrome’s Developer Tools that allow developers to make temporary changes to a web page’s files (CSS, JavaScript, images, etc.) directly within the browser.

These changes are saved to your local filesystem, allowing you to experiment with modifications without affecting the live website. This is especially useful for testing, debugging, and experimenting with different designs or functionalities.

Here’s how you can use local overrides in Chrome:

  1. Open Chrome Developer Tools:
    – Right-click on any webpage and select “Inspect” or press `Ctrl+Shift+I` (Windows/Linux) or `Cmd+Opt+I` (Mac).
  2. Enable Local Overrides:
    – Go to the “Sources” tab.
    – In the navigation pane, click on the “Overrides” tab (you may need to click on the “>>” to see it).
    – Click on “Select folder for overrides” and choose a folder on your local system. This is where your changes will be saved.
    – Allow Chrome to access the folder if prompted.
  3. Start Editing:
    – Find the file you want to edit in the page file navigator pane. You can navigate through the website’s file structure or find the file in the “Network” tab.
    – Right click on a file and select “Override content”
    – Once you open a file, you can modify it directly in the editor pane. Your changes will be reflected in real-time on the webpage.
  4. Save Changes:
    – After editing, press `Ctrl+S` or `Cmd+S` to save your changes. These changes are saved to the selected local folder and will override the network resource until you disable overrides or delete the local file.
  5. Disable Overrides:
    – To stop using local overrides, simply uncheck the “Enable Local Overrides” option in the Overrides tab.

Local overrides are a temporary way to experiment with web page modifications. They don’t affect the actual files on the web server, so other users won’t see these changes. This feature is highly useful for developers and designers to test changes without deploying them to a live server.

Happy Museum Selfie Day

About 2 years ago, I found one of these cheesy sites that lists whatever fake holiday happened to be celebrated that day (e.g., “National Avocado Toast Day”)

I ended up starting every daily standup meeting with a call out to whatever the day was. This went on for about a year before I switched to a different internal team. One that didn’t have much in the way of daily meetings.

A few weeks ago, I made a move back to my original team, only to find that they have kept the tradition alive over the past year!

Amazing.

And with that: Happy Museum Selfie Day!

Created with DALL-E 3

Implementing and testing a “poor man’s prompt expansion” model for Stable Diffusion

Various Stable Diffusion models massively benefit from verbose prompt descriptions that contain a variety of additional descriptors. Much recent research has gone into training text generation models for expanding existing Stable Diffusion prompts with relevant and context appropriate descriptors.

Since it isn’t feasible to run LLMs and text generation models inside most users’ web browsers at this time, I present my “Poor Man’s Prompt Expansion Model“. It uses a number of examples I’ve acquired from Fooocus and Hugging Face to generate completely random (and absolutely not context appropriate) prompt expansions.

(For those interested in following along at home, you can checkout the gist for this script on GitHub).

How does it work?

We iterate through a list of an absolute crap ton of prompt descriptors that I’ve sourced from other (smarter) systems that tokenize user prompts and attempt to come up with context appropriate responses. We’re not going to do that, because we’re going to go into full chaos mode:

  1. Iterate through a list of source material and split up everything separated by a comma.
  2. Add the resulting list to a new 1-dimensional array.
  3. Now, build a new descriptive prompt by looping through the list until we get a random string of descriptors that are between 175 and 220 characters long.
  4. Once that’s done, return the result to the user.
  5. Create a new prompt.

For our experiment, we’re going to lock all image generation parameters and seed, so we theoretically get the same image given the exact same parameters.

Ready?

Here is our base prompt and the result:

Happy penguins having a beer

Not bad! Now, let’s go full chaos mode with a new prompt using the above rules and check out the result:

Happy penguins having a beer, silent, 4K UHD image, 8k, professional photography, clouds, gold, dramatic light, cinematic lighting, creative, pretty, artstation, award winning, pure, trending on artstation, airbrush, cgsociety, glowing

That’s fun! (I’m not sure what the “silent” descriptor means, but hey!) Let’s try another:

Happy penguins having a beer, 8k, redshift, illuminated, clear, elegant, creative, black and white, masterpiece, great power, pinterest, photorealistic, award winning, vray, enchanted, complex, excellent composition, beautiful composition

I think we just created an advertisement for a new type of beverage! It nailed the “black and white”, though I’m not sure how that penguin turned into a bottle. What else can we make?

Happy penguins having a beer, volumetric lighting, Digital, intricate, awesome, futuristic, cartoon artstyle, vector, solid, detailed, dramatic light, realistic photograph, wonderful colors, dramatic atmosphere

The dude in the middle is planning on having a good night. Definitely some “wonderful colors”. Not so much realistic photo or vector, but fun! One last try:

Happy penguins having a beer, 35mm, surreal, amazing, Trending on Artstation HQ, matte painting hyperrealistic, full focus, very inspirational, pixta.jp, aesthetic, 8k, black and white, reflected on the matrix studio background, awesome

As you can see, you can get a wide variety of image styles by simply mixing a bunch of descriptive elements to an image prompt.

I’ve wanted to implement a feature like this on ArtBot for a long time. (Essentially, if the user allows it, automatically append these descriptions behind the scenes when an image is requested). Perhaps this will come soon.

TIL: The coastline paradox and Baader-Meinhof phenomenon

“Uh, what?” you say.

A few weeks ago, I read a post on Hacker News about something called “the coastline paradox.” Despite my geology background, I hadn’t heard of this before.

The measured length of the coastline depends on the method used to measure it and the degree of cartographic generalization. Since a landmass has features at all scales, from hundreds of kilometers in size to tiny fractions of a millimeter and below, there is no obvious size of the smallest feature that should be taken into consideration when measuring, and hence no single well-defined perimeter to the landmass.

Essentially, the smaller unit of measurement you use to try and measure something with a fractal pattern, the longer it becomes.

So, I’m currently reading a book called “Reading the Rocks” by Marcia Bjornerud and there is an entire section devoted to the coastline paradox, which I just learned about.

Mandelbrot’s point was simple: If you use a very long stick to measure a coastline, you will capture the broadest arcs but miss the fjords, firths, and coves, and you will conclude that the coastline is not terribly long. As you use shorter and shorter rulers, however, the coast actually stretches. Mandelbrot named such stretchy features fractals…

Neat!

This brings up the second TIL: What is the phenomenon called when you hear something for the first time and then suddenly start seeing or hearing it everywhere?

It’s the Baader-Meinhof phenomenon, also known as the frequency illusion:

The frequency illusion (also known as the Baader-Meinhof phenomenon) is a cognitive bias in which a person notices a specific concept, word, or product more frequently after recently becoming aware of it.

Well, here’s to seeing more coastline paradoxes.