Nat Knight

Reflections, diversions, and opinions from a progressive ex-physicist programmer dad with a sore back.

#selfhosting #mastodon #fediverse #hachyderm

As the trajectory of the bird site got clearer and nastier late last year I decided to migrate to the fediverse. I didn't want to end up on another platform controlled by a petulant tinpot dictator, so I decided to see if I could host my own ActivityPub server. Mastodon looked pretty intimidating, but GotoSocial is a smaller, lighter, program that (approximately) inter-operates with Mastodon (yay, federation!).

Read more...

#selfhosting #fediverse #mastodon #gotosocial #sqlite

This article describes how to migrate your subscriptions from GotoSocial to Mastodon. I recently made this migration; I talk about my motivations here.

This procedure doesn't handle getting folks over to your new account. It will get you a list of your subscriptions that you can import with Mastodon's data import feature so you don't have to re-follow everyone by hand.

I'm not aware of an account migration or user-facing data export feature in GotoSocial, so you'll need access to your instance's database (or help from someone who has it, anyways). With those caveats out of the way, here's the procedure.

Read more...

#codemirror #webdev #vanillajs #esbuild

When you write an HTML form, textarea is the standard way to support multi-line input, but it's not suitable for every application. CodeMirror describes itself as a “code editor component for the web”, and might be a suitable replacement for a textarea if you want something more like a code editor.

This article describes how to replace a textarea with a CodeMirror editor in under 30 lines of code and (hopefully) under 30 minutes of effort. It uses some very basic tooling to create an artifact that's no harder to deploy than vanilla JavaScript and HTML.

You can also jump straight to the source code if you prefer.

Read more...

#opentelemetry #observability

This article is a brief account of my experience setting up, operating, and using [Open Telemetry] on a very small software development project wherein I reach the surprising conclusion that it's probably worthwhile much earlier and at much smaller scales than you might expect.

Read more...

#tiddlywiki #rust #selfhosting #release

I just published the first (v0.1.0) release of tiddly-wiki-server, which implements the TiddlyWiki WebServer API in Rust using Axum, SerDe, and TiddlyWiki.

Read more...

#infosec #security #metaphors

There is, in my experience, a certain mindset among some information security professionals. They see themselves as the keepers of arcane knowledge, duty bound to hold the cyber-line, the last thing standing between common application developers and complete pwnage. They're the few, the proud, the ones who can shut it all down in the name of security. I'm not sure if it's a side effect of that field's association with the [“intelligence community”] or mere self importance; every profession has its foibles.

Unfortunately, apart from the usual objections to cops and special forces, I think that the metaphor leads to some dysfunctional tendencies in structure and strategy.

Read more...

#python #virtualenv

A useful question for understanding software tools is to peel back a layer of abstraction and ask what the thing underneath is. For example:

  • On a computer, text is a sequence of numbers (and a system to interpret that as letters).
  • An HTTP request is a blob of text with a particular format.
  • An interpreter (like the Python or Ruby interpreters) is a program, whose function is to execute other programs.

Knowing this sort of thing is useful when the abstractions break (e.g. when you open a text file with the wrong encoding) or when thinking about the fundamental contours of a system's possibility space. For example, if you know that programs can be configured with environment variables and CLI flags, knowing that the Python interpreter is a program means you know where to start looking if you need to configure it.

While there are many, many articles on the internet explaining how and why to use them, there's less information about what a Python virtual environment (or “virtualenv”) is. Luckily for us, it ends up not being very difficult to investigate.

Read more...

#bias #blindspots #selfimage

When I was about eight years old I was quite literary. I read books that were said to be “advanced” for a kid my age and got good grades in language subjects. I came to value this aptitude, and considered it a point of pride. So when I was told that my sentences were strong but I needed to use more paragraph breaks, I was indignant.

Not, mind you, because I thought I had good paragraphs. As far as I was concerned, these so-called paragraphs were a fabrication with no purpose but to make me look bad.

“I read Animorphs books” I said hesitantly, “and I don't think they have paragraphs.” Animorphs books were the height of sophistication for serious eight-year-olds back then, so this would surely put a stop to this misguided attack on my savviness.

Looking back, this reaction is a clear indictment of my education, my overconfidence, or both, but luckily for me (and for everyone I've subsequently written for), my mother overheard my assertion and, with just the right amount of gentle mocking, told me to open the beat up copy of whatever YA novel I was improving myself with that week and look again.

You won't be shocked to learn that the random page I flipped to was full of paragraphs, but I sure was. There they were, little indentations, running down the side of the page, mocking me. I turned the page in amazement, as if I might find vindication on the other side, but there they were again! This was something important to me, something that made me different and special, and yet I had overlooked this feature that was plain to see on every page.

In retrospect I appreciate this lesson in personal fallibility; I've been wrong lots of times, sometimes about things as clear as typography. It stings less when you know it's coming and when you can see yourself as someone who cares for you would: obviously wrong, a bit ridiculous, but just in need of a little straightening out.

#programming #angst #motivation #legacycode

A few nights ago, in the wee hours of the morning, I came to be staring red-eyed at a list of programming languages. I'm a generally optimistic person, I enjoy learning these sorts of things, and I appreciate the things that the tools on this list had to offer. Despite all that, I couldn't contemplate investing in any of them with anything but dread.

Read more...

#learning #advice #priorities

One of the nice things about being a professional software developer is that you're always learning things. On a given day, you might be learning about

  • A programming language or framework
  • Your computer or operating system
  • Your tools (like editors, build systems and IDEs)
  • The domain you're working in (finance, biology, energy, games, etc.)
  • How to communicate with your collaborators
  • How to effectively manage the projects you're working on

There are many things to learn. Indeed, one of the problems you might have is finding all of the things that you want to learn about.

Read more...