RSSAmplifier

Blog

/dev/nonsense

devnonsense.comRSS feed ↗54 posts

Latest posts

philosophy major

I majored in Philosophy at UC Berkeley. People sometimes ask about my philosophy training and say things like, “there should be more Philosophy majors in tech.” I’m never quite sure what they mean by that. I do know that I loved studying Philosophy. Here’s a picture of me from 2007 in Tours, France, thrilled to have found a statue of Descartes (and also to have finished the…

my husband prefers his computer to me (1993)

Discovered in a box in my dad’s garage, a clipping from the September 1993 issue of Parents magazine, titled “My husband prefers his computer to me”. Q: What’s wrong with my husband? Several months ago he purchased a home computer. Now he’s married to it! When he comes home from work, he goes right to the computer; at night, when I am eager to make love, he’s…

saturday morning network outage

Woke up early yesterday morning. Saw a text from a friend. The video he sent wouldn’t load. Actually, nothing would load. No text message from the ISP about an outage. Same issue on my laptop, connected to a different wireless access point than the phone. Couldn’t ssh to the router. ip addr showed no IP address assigned on the wireless interface. The router runs Fedora CoreOS with…

skippy blair special concept

My post about Apple’s “SillyBalls” example program had a loose end. The mysterious phrase “Skippy Blair special concept” appears in the comments of SillyBalls.c, but what did it mean? So I was thrilled to receive an email last week from Jeremy Penner that explains everything! Jeremy did some amazing detective work to uncover the true identity of “Skippy…

apple's sillyballs (1988)

When you think of Apple, the company and its history, what images come to mind? Perhaps a black-and-white photograph of the two Steves with the Apple ][, the beige Macintosh of 1984, Jobs on stage unveiling the iPhone. Less remembered, but still part of that history, was a wacky example program that Apple released and maintained for over two decades. I’m referring, of course, to SillyBalls.…

sneakernet

sneakernet : /snee·ker·net/, n. Term used (generally with ironic intent) for transfer of electronic information by physically carrying tape, disks, or some other media from one machine to another. “Never underestimate the bandwidth of a station wagon filled with magtape, or a 747 filled with CD-ROMs.” Also called ‘Tennis-Net’, ‘Armpit-Net’, ‘Floppy-Net’ or ‘Shoenet’; in the 1990s, ‘Nike network’…

the return of glfighters: porting a 23-year-old game to webassembly

TL;DR I ported GLFighters, a game written for Classic Mac OS in 2001, to WebAssembly! You can play it online at: devnonsense.com/GLFighters-SDL Table of contents Background Porting Strategy Linux Port Flipped textures Illegal instruction File loading Random SEGFAULT Sound sampling rate Z-Fighting Skybox seams Linux port working! WebAssembly Port Emscripten TGA files fail to load Page unresponsive…

mac programming for dummies (1999)

Over the years, I’ve accumulated a few computer books, some of which sit on the top shelf of the bookcase behind my desk. Cormen et al. – the canonical text for an undergraduate algorithms course. Bob Metcalfe’s PhD dissertation on packet switching. Brian Kernighan’s memoir about developing Unix at Bell Labs. The Soul of a New Machine , which won the Pulitzer for nonfiction…

evading the wifi router ban

Wifi router ban I currently live in student family housing at the University of California, Berkeley. Several years ago, Berkeley IT announced a new policy for wifi routers: Effective July 1, 2024, use of personal routers will no longer be permitted at UVA s t u d e n t f a m i l y h o u s i n g student family housing s t u d e n t f ami l y h o u s in g , as is the case in all other campus…

slow iptables, reverse dns

Last week, I investigated an issue 1 where iptables -L (the command to list firewall rules in Linux) took over 60 seconds to complete. This was surprising because the machine was using very little CPU and there were only a few firewall rules. So why was it so slow? The Linux kernel stores firewall rules in memory. From userspace, iptables retrieves the rules from the kernel via netlink. After…

asymmetric routing around the firewall

This is a follow-up to my previous post about some mysterious TCP connection timeouts in the UC Berkeley wired network. I received many thoughtful emails in response to that post, and there was an excellent discussion on Hacker News . I’m very grateful to everyone who spent time helping with my ridiculous home networking issues. Since then, I’ve learned some new information that…

tcp connection timeout mystery

For over a year, I’ve been investigating a strange issue with the internet in my apartment. I’m posting the details here in case someone more knowledgeable than me can solve the mystery. I live in graduate student housing with internet provided by the university campus. Usually things work reasonably well, with one exception. On the wired network, I cannot connect to IP addresses used…

some box under ike's desk (2013)

My first real tech job was as a test engineer at edX. I was hired 1 in 2013, a few months after Harvard and MIT invested $60 million in the company. This was at the height of excitement for massively open online courses (MOOCs). In June, Anant Agarwal, then president of edX, was interviewed on The Colbert Report , and the influx of traffic promptly took down edx.org. I think there were a handful…

how does linux nat a ping?

A few months ago, I found myself wondering how a command like ping 1.1.1.1 works from within a private network. In most private networks, multiple hosts connect to the Internet through a router. For IPv4, the router performs network address translation (NAT) by rewriting the original host’s source address to the router’s public IP address. The router can lookup the correct host for a…

bram moolenaar's work

This morning, I saw the sad news that Bram Moolenaar passed away yesterday. I never knew Bram personally, but I knew his work. Vim, the text editor he created and maintained, has been woven into the fabric of my life for nearly two decades . Bram released the first version of vim in 1991 and worked on it continuously ever since. Thousands and thousands of commits, features, bugfixes. His last…

tired of the rat race (2001-2003)

Why is the life of a mouse not absurd? The orbit of the moon is not absurd either, but that involves no strivings or aims at all. A mouse, however, has to work to stay alive. Yet he is not absurd, because he lacks the capacities for self-consciousness and self-transcendence that would enable him to see that he is only a mouse. – Thomas Nagel, “The Absurd” We used to go to family…

running k3s on fedora coreos bare metal

This post explains how to install K3s on Fedora CoreOS. K3s is a lightweight Kubernetes distribution and Fedora CoreOS is an image-based Linux distribution for containerized workloads. With Fedora CoreOS, you get a bulletproof, minimal host system with atomic updates. Installing K3s allows you to deploy applications using standard Kubernetes tools like kubectl and helm . Honestly, why…

kubectl debug netadmin profile

Sometimes at work I need to troubleshoot iptables rules in a Kubernetes cluster. The intuitive approach is to use kubectl debug to start a container, then run the iptables command. 1 However, this fails with a confusing error: root@minikube:/# iptables -nvL iptables v1.8.7 (nf_tables): Could not fetch rule set generation id: Permission denied (you must be root) Permission denied? As the root user?…

aretext 1.0 release

After nearly three years of development, aretext has reached version 1.0! Aretext is a minimalist terminal-based text editor with vim-compatible key bindings. In this post, I’ll present the main changes since the last version, reflect on the journey from initial idea to 1.0, and discuss the future of the project. New syntax languages Syntax highlighting is now available for bash shell…

ad-free ascii codes

While working on aretext , I often need to lookup ASCII character codes. Unfortunately, the top search results for “ASCII codes” are absolutely filled with ads. This makes me sad for the state of the world. To fix this, I have created my own page of ASCII codes: ascii.html Here’s what it looks like in Firefox: As far as I can tell, this is – objectively – the best…

implement "find definition" in 77 lines of go

Most integrated development environments let you quickly jump from a symbol to its definition. In this post, we’ll implement a simple version of this feature in just 77 lines of Go code. Along the way, we’ll learn how to use the Go parser and type-checker included in the standard library. Let’s go! Where we’re going By the end of this post, we’ll have built a…

sprite animation toolkit (1992-1999)

Ingemar Ragnemalm first released the Sprite Animation Toolkit (SAT) in 1992. “I have always liked to make computer games,” Ingemar wrote in the SAT manual. “It has been one of my hobbies since the late 70’s. When I started using Macs, of course I wanted to make some games for it too.” After writing many games, he had developed some shared code for sprite drawing and…

aretext 0.7 release, thinking about 1.0

The 0.7 release of aretext is now available! Aretext is a minimalist, terminal-based text editor with vim-compatible key bindings. In this post, I’ll highlight some of the main changes and reflect on the direction of the project. Additional vim commands This release adds support for several vim commands: Search for word You can now use star ( * ) and pound ( # ) in normal mode to search…

what a cello player said about my html (2000)

The music teacher drove from school to school, carrying a leather bag and smelling like cigarettes. We waited in the hallway until he arrived and unlocked the door to the music room. Then waited in line to tune our instruments at the piano, one by one. During all the waiting, there was time to talk. One of the violinists was tiny because he had skipped two grades. He could play a difficult Bach…

incremental parsing in go

This post is an attempt to explain the incremental parsing algorithm aretext uses for syntax highlighting. Like the rest of aretext, parsers are implemented in Go for portability and performance. Most people do not consider Go a functional programming language; nonetheless, aretext’s parsers rely on functional programming patterns. In this post, we’ll see how to implement these…

floppy disk corruption (2001)

When I went to high school, things started disappearing. I wrote essays in Word, saved them on floppy disks to print at school. Text would get deleted or garbled. Sometimes a file wouldn’t load at all, so I would re-type it from memory. Textbooks, worth hundreds of dollars, would vanish from my locker. I’d take someone else’s book from the lost and found, scratch my name in the…

aretext 0.6 released!

Version 0.6 of aretext has been released! Aretext is a minimalist, terminal-based text editor with vim-compatible key bindings. Here’s what’s new! Markdown syntax highlighting Aretext now supports syntax highlighting of markdown! It looks like this: The current implementation supports most of the CommonMark 0.30 spec , including: Headings Links Emphasis and strong emphasis (bold and…

echo livestream, cilium

This morning, I joined the eCHO livestream to chat about a feature I worked on for the Cilium 1.12 release! Discussed delegated IPAM and my experience as a first-time contributor to the Cilium project.

ipv6 home router experiments

KubeCon this year featured a panel discussion of IPv6 adoption . One of the panelists mentioned in passing that many organizations are unprepared for the security implications IPv6. With IPv4, most addresses were hidden by NAT; with IPv6, addresses are publicly routable. Firewalls can block external traffic, but might not be configured correctly. So I did an experiment on my home network. Would…

fuzzing the aretext markdown parser

A few weeks ago, I implemented syntax highlighting for markdown in aretext, the minimalist vim clone I’ve been building. Like most context-sensitive languages, markdown is difficult to parse. Although it handles only a subset of the CommonMark 0.30 spec , 1 my implementation required 845 lines of Go code . Parsing is especially tricky because the code needs to handle any document a user…

binary encoder (2003)

This is a story that begins with some code I wrote and ends with a rejection. First, the code. In high school, I wrote a little Mac OS X application that would encode text as binary. It had a window and textboxes and buttons and everything. You could type in “hello”, and it would output something like “0110100001100101011011000110110001101111”. You could also convert back…

why vim syntax highlighting breaks sometimes

Vim was my preferred text editor for nearly eighteen years , until I switched to aretext in 2021. I appreciated vim’s efficiency and ubiquity, the way I could rely on it regardless of what project I was working on or what machine I had ssh’d into. Like any software, however, vim reflects the time in which it was written. In many cases, vim optimizes for speed above all else, an…

what's new in aretext 0.5?

Today marks the fifth release of aretext , the minimalist text editor with vim-compatible key bindings! This post describes the highlights. (Wait, what’s that? You say you want to install it right now? Well, then just go straight to the installation docs !) Faster fuzzy menu search Aretext uses a trie-based fuzzy find algorithm for selecting files in a menu. This worked well for most…

my homelab has 24 racks and 144 servers

It took nearly two years, but I finally built the homelab I always wanted.

starcraft and networking in the 90s (part 2)

This is the second post of a two-part series on Starcraft and late-90s networking. Part 1 describes Starcraft’s many connection options. Configuring Starcraft networking in 1998 was an adventure. There were four different connection options (plus AppleTalk on Macintosh computers), each of which required specific software and hardware to function. How did anyone figure this stuff out? It…

starcraft and networking in the 90s (part 1)

Writing about multiplayer Starcraft reminded me how strange networking was in 1998. I remember connecting a computer to a modem, which was connected to a phone line (many homes had a second phone number specifically for this purpose). The modem would dial a number and “talk” to a modem on the other end. 1 Networking two computers over a phone line seems bizarre to me now. You could…

installing windows 98, windows xp, and starcraft in qemu

I wanted to run the original Starcraft , released in 1998, on my Linux desktop using QEMU. Thus began my six hour rediscovery of computing in the 90s, an era when installing working software required wizardry, persistence, and luck. Windows 98 First, I installed Windows 98 in QEMU using an ISO that I found online. Pentium 2 processor, 128 MiB of RAM, and 1GiB disk should be more than enough to…

aol i think (1999)

Starcraft was the first game I played online. My friend and I would dial each other over a 56K modem. I remember wondering why he kept ending his chat messages with “:” and “)”. We liked to mine minerals and build armies, but I don’t remember attacking, winning, or losing. The network connection never lasted long enough. One day I wandered into a battle.net lobby.…

fosdem 2022 lightning talk

On Sunday, I presented a lightning talk at the FOSDEM 2022 conference . Usually, FOSDEM takes place in Brussels, but recently it’s moved online. That was fortunate for me, because otherwise I probably would never have submitted a talk proposal! The talk was about aretext , the vim clone I’ve been working on for the last couple years: Pre-recorded talk : it’s just under 12 minutes…

fuzzy find algorithm

No one types perfectly. To compensate, many programs use “fuzzy find” algorithms to retrieve records close to what a user typed. Accidentally typed “quck” or “quack” when you meant “quick”? No worries! Fuzzy find will retrieve what you meant anyway. This post explains the fuzzy find algorithm used in aretext , the terminal-based text editor…

rewriting all the code

I tend to rewrite code. A lot. The terminal-based text editor I’ve been building, aretext , started as a Rust project, but after a month I rewrote it in Go. At one point, the editor embedded a Python REPL, which I later ripped out and replaced with a searchable menu. I completely rewrote the input interpreter, syntax highlighting parser, word movement calculations, and fuzzy find algorithm…

joining the azure kubernetes team

Over twenty years ago, I wrote my first networked program, a multiplayer card game. My original plan was to position two iMacs directly facing each other, six inches apart, and use the built-in infrared port to transmit data. Then my dad bought me an Ethernet cable – this proved a much better solution. For LAN networking, the program used the AppleTalk protocol, sending the entire game state…

gospelunk: quickly find definitions in go projects!

Update 2023-01-09: gospleunk has changed significantly since this post was written. It now uses the built-in Go parser and type-checker to implement “find definition,” “find-references,” and more! See the post implement “find definition” in 77 lines of go for more details. A while back, I described an idea for a CLI tool to find definitions in Go projects , and…

project idea: go-symbol-search

Starting a two week vacation today, so I’ve planned a small project: a Go-specific version of ctags . I’ve used ctags in the past to navigate a medium-sized Go monorepo, but there were some pain points. Re-indexing usually took about a minute, and, at least by default, ctags doesn’t search the standard library or Go module dependencies. I’m imagining a tool that’s…

open source contributions (2012-2021)

I created an account on GitHub in December of 2012, which is almost exactly nine years ago. The chart below shows the number of public contributions (mostly code changes) I made each year: Some context: From 2013-2015 I worked full-time on open source at edX . I’m still not quite sure how I got so lucky. My daughter was born in 2018! When she was three months old, I took a sabbatical to…

blog reboot

After a long hiatus, I am rebooting this blog! My last post was in March, a couple of months before the first release of aretext , the open source text editor I am building. I’ve since released three versions of aretext, with the 0.4 release scheduled for February. The git repo currently has 850 commits , and I’ve been using aretext as my primary editor every day – including to…

remembering idevgames (2003)

In the early 2000s, I joined a community of hobbyist Mac game developers at a site called idevgames.com . Mainstream gaming was happening on Windows, but the Macintosh had developed its own quirky indie scene . The forums were filled with screenshots of the small, weird games people were making. The site had been created by Carlos, an American expat living in Japan. One year, he started an indie…

why start a coding side project?

For the past nine months, I have spent almost all of my free time working on a coding side project . This is surprisingly common behavior for software developers. Some of us spend the entire work week coding for a company, then choose to continue coding as a hobby in our mornings, evenings, and weekends. I plan my work around my two-and-a-half-year-old daughter’s sleep schedule. At the…

laptop case (2006)

I have used the same laptop case for over sixteen years. My second summer with it, I had decided I either needed to write a novel or stop saying I wanted to write a novel. So every day I carried the laptop, snug in its case, to the Santa Clara library. The library had recently moved to a new building in central park. It was two stories tall. The desks on the second floor had electrical outlets.…

programming books (1998-2004)

One weekend, my dad needed to learn CORBA for work. My mother drove the family to the Barnes & Noble on Stevens Creek Blvd. Three hours later, when we returned to pick him up, my dad had bought, and mostly read, Client/Server Programming with Java and CORBA . The cover showed two cartoon aliens drinking coffee at a diner. That book found its home in our living room bookcase alongside many other…