Mastering SSH Config: Stop Juggling Keys, Ports, and Hostnames

If you’re like me, you use SSH constantly. On any given day, I use SSH to access GitHub, log in to various servers at work, and connect to my self-hosted equipment at home. In my case, I juggle multiple SSH keys for different identities, numerous domains and static IPs, and sometimes special port numbers for SSH access. Managing all of this by hand would be a nightmare, but thankfully, SSH config offers a powerful solution. ...

October 2, 2025 · 4 min

Building a CPU Graph for Waybar

Recently I decided to dive down the Hyprland rabbit hole. Rather than using an existing Hyprland config, I decided to build up my own environment from scratch. For simplicity, I opted to use Waybar to build a minimal-but-useful top bar. While Waybar has loads of great modules to choose from, I could not find a CPU graph module. So, I hacked one together myself, and it turned out pretty cool. ...

September 9, 2025 · 3 min

Reviving the Blog

The blog is back online at https://coldnoise.net—which you already know if you’re reading this. :) After letting my old domain expire, I decided to take the opportunity to breathe some new life into things. I’m giving Hugo a try and hosting with GitHub Pages. We’ll see how it goes. This time around, I’ll be making a more concerted effort to maintain the site, if for no other reason than to establish a reputable place to find my PGP key .

September 3, 2025 · 1 min

FPGA Based Secure Elements

I recently spoke with a colleague working on an open-source secure element chip. While the goal is admirable — enabling customers to verify designs for security vulnerabilities and backdoors — I’m skeptical of the value proposition despite the hype and investor attention they’ve received. I get why people are so excited by the idea. The tech industry becomes more interested in security practices with each major incident. People and businesses alike are increasingly focused on trust models. Companies hire auditors, run bug bounty programs, and sponsor open-source development to minimize black-box dependencies. Cryptocurrencies have even made retail customers security-conscious, scrutinizing their software more and even reaching for hardware wallets to move their secret keys offline. An open source secure element would give people a hardware tool to secure their keys, without requiring them to trust yet another black-box in their tech stack… right? ...

July 21, 2024 · 3 min

Practical C Macro Patterns for Embedded Driver Development

C macros get a bad rap—often deservedly so. But when developing drivers for embedded systems, carefully crafted macros can eliminate entire classes of bugs while making your code more maintainable. In this post, I’ll walk through battle-tested macro patterns from production driver code, using examples from a driver I wrote for the snsr288x family of devices. One question I get often: when do you choose macros over inline functions? In general, I prefer inline functions whenever possible, but there are two situations where I commonly reach for macros: ...

March 7, 2023 · 10 min

Speed-running Wearables at Happy Sleep

Another product shipped! The Happy Sleep ring. Since leaving Tesla earlier this year, I’ve been working at Happy Sleep developing a cutting-edge smart ring. I didn’t expect such a quick turnaround, but we managed to take the device from design to production-ready in just a few months. To be fair, I joined later in the design process than I typically do – my awesome teammates had already laid substantial groundwork. Still, I was amazed by how much we accomplished together in such a short time. ...

November 22, 2022 · 1 min

Stop Using Sliding Windows When You Just Need a Smooth Signal

I review a lot of code, and I keep seeing the same mistake over and over. Someone needs to smooth out a noisy signal (maybe sensor data, maybe user metrics, whatever) and they immediately reach for a sliding window moving average, a.k.a. the SMA filter. Here’s an example you’ve probably seen: #define WINDOW_SIZE 10 typedef struct { float buffer[WINDOW_SIZE]; int index; int count; float sum; } MovingAverage; // Initialize the moving average structure void average_init(MovingAverage *ma) { ma->index = 0; ma->count = 0; ma->sum = 0.0f; for (int i = 0; i < WINDOW_SIZE; i++) { ma->buffer[i] = 0.0f; } } // Add new value and return current average float average(MovingAverage *ma, float new_value) { // Subtract the value being replaced from sum ma->sum -= ma->buffer[ma->index]; // Add new value to buffer and sum ma->buffer[ma->index] = new_value; ma->sum += new_value; // Update circular index ma->index = (ma->index + 1) % WINDOW_SIZE; // Track how many values we've added (up to WINDOW_SIZE) if (ma->count < WINDOW_SIZE) { ma->count++; } // Return average return ma->sum / ma->count; } // Example usage int main() { MovingAverage ma; average_init(&ma); printf("Adding values and calculating moving average:\n"); printf("Value: %.1f, Average: %.2f\n", 10.0f, average(&ma, 10.0f)); printf("Value: %.1f, Average: %.2f\n", 20.0f, average(&ma, 20.0f)); printf("Value: %.1f, Average: %.2f\n", 30.0f, average(&ma, 30.0f)); printf("Value: %.1f, Average: %.2f\n", 40.0f, average(&ma, 40.0f)); printf("Value: %.1f, Average: %.2f\n", 50.0f, average(&ma, 50.0f)); return 0; } There’s a lot of unnecessary complexity here to maintain the circular buffer (~35 lines of code), not to mention the amount of memory required grows linearly with the window size (see FIR filters) . Don’t be fooled into thinking this is a “C problem” either. Higher level languages with better semantics for buffers can reduce the lines of code, but the compiler still must implements all of this under the hood and cannot avoid performance/memory/program-size costs. ...

July 11, 2022 · 5 min

Evaporative Test Load for DAQ Testing

Every now and then, I come up with a hack for a problem that’s better than a purpose built solution. I love when this happens. I wanted to share a quick story about one such hack that I came up with recently. Background I’m currently designing firmware for a wearable ring packed full of sensors – think Oura ring, but with medical grade data acquisition. The device is very small with an equally small battery, so we have to be judicious with every Joule of energy spent taking or transmitting measurements from the sensors onboard. ...

April 9, 2022 · 3 min

Time for a Change: Leaving Tesla

I recently made the difficult decision to leave Tesla. My time there was nothing short of amazing. I had the privilege of working with a truly world-class team in the Autopilot Hardware group, where I helped develop firmware and device drivers for in-car autopilot systems, as well as firmware for the AI training datacenter. We worked on cutting-edge technologies that could only exist in our lab, built by our exceptional team. I’m pretty sure we set a few world records along the way, though I can’t share the details 😭. Suffice to say, it was incredibly fun and fulfilling work. ...

January 7, 2022 · 1 min

Using the Gray Code to Optimize One-out-of-Many Proofs

I recently discovered an optimization to the One-out-of-Many (OOM) proof protocol, and wanted to explain it in a less formal setting. In this work, I use the Gray Code to drastically reduce the mathematical complexity of the proving scheme. By extension, this optimization applies to the many other proof systems built on OOM, including, but not limited to: MLSAG, CLSAG, Omniring, Lelantus, Lelantus Spark, Triptych, Arcturus, and many others. Background and Motivation One-out-of-Many proofs, by Groth and Kohlweiss, is a widely adopted membership proof protocol. The OOM proof system enables a prover to demonstrate membership in a set without revealing their specific identity within that set (a.k.a the anonymity set). These proofs are fundamental to many privacy-preserving systems, blockchain payment protocols, mixnets, voting systems, or any application wishing to make user actions indistinguishable from those of a large set of other users. ...

February 16, 2021 · 7 min