Jon Sangster’s Blog
1. About
Hello, world! My name is Jon Sangster (résumé) and welcome to my personal blog. This website is where I write about software development and Linux tips n’ tricks.
This entire site is literally generated from my notes, so don’t expect a well-polished experience. I plan for it to be less “medium.com influencer” and more “my first Geocities homepage.”
2. Recent Updates
Blog Posts
OBS Studio: Automatic luminance filter
A common OBS: Studio setup is screenshare your screen, video game, or some video, while also having your webcam visible in the corner. Maybe you’re streaming a video game online or presenting your work to some coworkers.
If the content you’re streaming includes lengthy periods where the screen is particularly dark (a horror game, for example), your webcam feed is going to seem awkwardly bright by comparison. Even more awkward when the screen changes brightness frequently.
This article shows a method to automatically match the brightness/luminance of your webcam stream (or any visual “source”) to match the average brightness of another visual source.
I Published my Emacs Config
I published the org-mode version of my Emacs config to GitHub: sangster/emacs.
I think it may be a right-of-passage for all Emacs converts to put their config online. Over the years, I’ve found a lot of great snippets from the config files of others, and now it’s time to pay it forward! My config is incredibly personalised, so I doubt you’ll find it useful to use it wholesale, but there may be a few good bits and pieces that you can pick out of there.
Nix: Using symlinkJoin with nodePackages
NixOS’s <nixpkgs> repository comes with a handy function for combining different packages (derivations) into a single, large derivations: symlinkJoin. It replicates the directory structure of a list of derivations, creating symlinks to the original files each source derivation. Unfortunately, as we’ll discuss in this post, it chokes badly if you try to join an NPM package into your derivation.
Signing Git Commits on the Terminal
Signing your git commits with GPG works perfectly fine, until that fateful day when you need to commit some code in a non-X11 session. Most likely, you’ll encounter this when you’ve brought your laptop on the road, and need to SSH into your dev-machine at home and commit a few quick changes. Unfortunately for you, after entering your well-formatted commit message, git blocks for about 30 seconds then spits out the following error:
error: gpg failed to sign the data fatal: failed to write commit object
Ruby: Implicit Conversion
Implicit conversion doesn’t come up very often in ruby. It’s a duck-typed language, so as long as an object has the right instance methods defined, everything should be fine. Sometimes though, when you’re dealing with system libraries or linking with other languages, ruby really does need a way to convert your objects into fundamental types, like strings, hashes, and arrays.
Articles
Final Fantasy 1–6 Pixel Remasters
Like many millennials, I grew up loving Final Fantasy. My family didn’t own any of them, sadly, so I would play the earlier editions whenever I could during visits with our extended family who did. In `98, I hauled-ass, mowing lawns and painting fences all summer, to save up to buy a Playstation 1 and Final Fantasy 7. Worth it!
Recently, SquareEnix (Squeenix?) released new versions of the first six games, known as “pixel remasters.” They rebuilt each game on the same Unity-based engine, with new sprites, updated music, and modern particle effects. Moreover, they’ve added a few quality-of-life features that make certain aspects of the game less tedious.
I feel that they’ve done a great job modernising these classic games and recreating the feeling I had when I first played them as a kid. The Pixel Remasters are certainly now my favourite editions of the first 6 games.
Patching <nixpkgs>
Every Nix flake implicitly gets nixpkgs as an input, but what if it contains a show-stopping bug? It may have been fixed upstream, but these fixes can sometimes take days or weeks to even reach the nixos-unstable branch.
In this article, we’ll describe way one easy way to create a nix.flake that patches nixpkgs.
Shell Scripts with Nix
The goal of this page is to explore and document “best practises” for writing shell scripts and packaging them for the Nix package manager.
- This article describes software which is both: unstable, and something I’m still learning about. As a consequence, this advice may change over time.
Red Dead Redemption 2
I played Red Dead Redemption 1 on the PS3, back in 2011, and absolutely loved it. Well, Red Dead Redemption 2 (RDR2) was released a few years ago now, but this time I decided to wait for its PC release. I never did wind up buying a PS4 and rumours online are that RDR2 runs pretty well on Linux, via Proton, so why not?