Brian Lovin
/
TIL

TIL

January 26, 2026

Ubuntu and macOS VMs

I always kinda knew what Ubuntu is, but not really. And I certainly have no idea how it relates to virtualization (a relevant topic these days).

So here’s what I learned:

Ubuntu is a Linux distribution (distro) built on top of the Linux kernel (the thing that manages hardware, memory and core processes). It is responsible for the desktop environment and has strong opinions about how the computer’s default settings should be configured.

Ubuntu can not run simultaneously on a Mac unless you use virtualization. Back in the Intel Mac days, you might use VMWare or Parallels (I remember using this to run Windows on macOS in middle school, if I remember correctly).

But on the latest Apple Silicon Macs, you can run Ubuntu on Apple’s Hypervisor framework. This is a low level API that lets apps create VMs without resorting to emulation (emulation is slow).

So when people want to run a Linux VM on macOS, they might reach for the Ubuntu distro by default because it has great defaults, works out of the box, has a big community, and has predictable support/upgrade cycles (although services like Docker do not use Ubuntu by default, instead opting for Debian or Alpine).

Ubuntu is the Honda Civic of Linux distros.

Ubuntu's name comes from a South African philosophy meaning "humanity to others.”

Learn more

January 25, 2026

Web Speech API

The Web Speech API is a browser-native interface for voice. It has two parts: SpeechRecognition (voice to text) and SpeechSynthesis (text to speech). Recognition routes audio to Google's servers in Chrome; synthesis uses your OS's built-in voices and works offline.

Use cases: voice commands, dictation, accessibility, having your app talk back to users. People have built voice-controlled 3D scenes, karaoke games that match speech to lyrics, and browser extensions that read selected text aloud.

The tradeoff vs. dedicated speech models (Whisper, AssemblyAI, etc.): Web Speech API is free and works in minutes, but accuracy drops with accents, noise, or specialized vocabulary. It's Chrome/Edge only for recognition. Good for prototypes and simple features, but you should reach for a speech model when transcription quality matters.

Learn more

January 24, 2026

How copy + paste works

Copy + paste seems obvious: copying puts a thing in a box, pasting retrieves the thing from the box.

But that’s not what’s happening under the hood.

When you copy something from an app, the source app registers the possible formats for that data it could provide. It might instantly serialize basic formats (like plain text), but it does not serialize every possible format since to preserve memory and performance.

When you paste something, the destination app looks at the promises from the source app and requests its preferred format. At this point the source app fulfills the promise and provides the data in the required format.

This explains why copy + paste works different depending on the destination of the paste event: the destination app (email, spreadsheet, document, etc) chooses the format it wants to receive from the set of available promises.

macOS does a lot of work under the hood to attempt serialization of common data types when the source app is closed. But there may still be edge cases where if you copy something, close the source app, and then attempt to paste elsewhere, the source can not fulfill its request and the pasted content will be corrupted.

Copy and paste is not putting things into a box and pulling them out later. It’s brokering promises between apps.

January 23, 2026

Grep, sed, awk

grep sed and awk are command line utilities designed in the mid-1970s. They are all designed to process text streams and descended from ed (the original Unix text editor).

  • grep — find lines matching a pattern
  • sed — transform a stream, line by line
  • awk — arbitrary computation on structured text

awk is interesting because it’s essentially a self-contained programming language. It has variables, arithmetic, conditionals, loops, and more. For example, when awk sees amy,lawer,1000, it automatically splits it into $1=amy, $2=lawyer, $3=1000.

From there you could say $3 > 1000 { print $1 } and you've written a filter for people over 1000.

awk is still around but was extended by Perl in 1987. Python eventually replaced Perl for most people’s day to day use. But awk still finds niche use cases for writing tiny programs in the CLI without having to import dependencies or write python files.

I expect I will never use this.

Learn more

January 22, 2026

What happens when your rm -rf ~

-r is recursive, which means the rm command can descend into directories. It will do a depth-first search, deleting children directories before parents, crawling its way back up to the root of the Home directory. Sibling order is roughly arbitrary.

-f means force, so it won’t prompt you and will suppress most errors.

  1. Dotfiles get deleted quickly, breaking new shell sessions.
  2. Applications that are already running might start failing if important configuration files are deleted.
  3. The files you have open will stay open, interestingly enough. The file’s data is safe until it closes, since the directory where files are saved may not exist.
  4. Certain OS behaviors will break (Finder preferences, Dock settings, window positions, etc. all live in ~/Library.

The OS itself will be fine.

Installed applications would be fine (aside from configuration files).

Running processes would still be fine (pending requirements on any files that lives in the Home directory).

macOS protects against removing your Home directory to a certain point: special folders like Documents or Desktop won’t get deleted unless your terminal already has permission to modify those directories.

It’s harder to actually brick a computer through rm -rf because macOS has additional protections for directories like /System or /usr or /Applications.

Because SSDs are so fast, most of your important files may be deleted before it’s physically possible to press ctrl+c to cancel.

January 21, 2026

Base64 basics

Base64 encoding converts binary data (like image bytes) into a text string using 64 "safe" ASCII characters (A-Z, a-z, 0-9, +, /). It's essentially a reversible text encoding—it lets you stuff any binary blob into a string, and the browser knows how to decode it back.

Base64 is now mostly useful for edge cases—email assets, single-file exports, or tiny assets where the simplicity of encoding outweighs the costs of serving an actual file.

January 21, 2026

POSIX (Portable Operating System Interface)

POSIX is a standard that defines a common interface for operating systems, especially Unix-like ones. It matters because it lets programs written for one POSIX system (say, Linux) run with minimal changes on another (like macOS). It reduces porting pain and keeps core OS behavior predictable across platforms.

Learn more

January 20, 2026

Open CLI command

Use open in the CLI can be used to open a file (using the default application) or directory. Use open . to open the current directory in Finder. There are many more shortcuts that I am unlikely to remember behind open -h.

Learn more