Setting up DSMR Meter Readings via a Raspberry Pi

2024-05-23 | #dsmr #electricity #home-assistant #raspberry-pi

The internet is probably full of tutorials on how to do this right, but I had to struggle a bit to figure it out for myself. My Pi randomly crashed, the other day, and I’m having to do some of the setup again and having done this for the first time months ago (and having now mostly forgotten what I did), I decided I should blog about it as I retread my steps and recreate my setup.

Continue reading 

Is it Dry Yet?

2024-04-08 | #home-assistant #home-automation #smart-plugs

Clarification: This is literally about my laundry. I am not being metaphorical. I am not talking about my feelings or my secrets. I am talking about my clothes. Intro Our washing machine is a Samsung something-something that sends me a notification on the SmartThings app when it completes a wash cycle. This is useful since we almost always need to follow up a washing cycle with a drying one and maybe even another load of laundry.

Continue reading 

Alerting on Process Completion

2024-04-04 | #home-assistant #shell-scripting #webhooks

Most of my technical endeavours have something to do with enabling me to work as little as possible for as much reward as possible. And yet, paradoxically, in a pursuit of doing less I often end up doing more. I have this idea that in the long term this will eventually lead me to doing much less. I’m not sure if that’s true, but it’s a nice thought and keeps me going.

Continue reading 

Short Tale of Intel -> Apple Silicon Migration

2024-03-13 | #apple #shell-scripting

Note: I will be using the terms amd64, x86_64, and Intel interchangeably in this post. They all refer to the same architecture. Similarly arm64 and Apple Silicon are used interchangeably. I recently got handed a new MacBook at work. It’s a MacBook Pro with an M3 chip and my first encounter with Apple Silicon. I have been hearing many good things about Apple Silicon and having experienced it for myself for the past day I must say that my old Intel MacBook can’t compare.

Continue reading 

Rust Macros (while Crafting Interpreters)

2023-12-31 | #interpreters #macros #programming-languages #rust

I have never used Rust extensively. The few times I have tried, have ended up in me giving up due to unwinnable fights against the borrow-checker. By the recommendation of a friend I am giving this another shot. I’m making my way through Robert Nystrom’s Crafting Interpreters as well as doing 2023’s Advent of Code. I am late to the latter but I am enjoying myself regardless. I am using Rust as my language of choice for both endeavours.

Continue reading 

Love for Expression Languages

2023-12-26 | #programming-languages #rust

I love expression languages. In Rust I can do this: let last_integer = { if last_number_which_list == 0 { word_to_integer(&last_number_in_words) } else { last_number_in_words.parse::<i32>() } }; While in Go, to achieve the same result I would have to do something like this: last_integer := 0 if last_number_which_list == 0 { last_integer = word_to_integer(last_number_in_words) } else { last_integer = strconv.Atoi(last_number_in_words) } Or what feels clunkier but comes closer to an expression:

Continue reading 

Building Rant

2022-11-14 | #golang #humor #intepreters

Intro Sometime in mid to late 2021 (which is a period I’ve entirely made up because I don’t actually remember when any of this happened), I needed to rant on my company Slack. Something had happened to ruin my day and I needed to get my feelings out. But ranting takes more effort than you’d think. If you want your rant to have impact there needs to be just the right amount of !

Continue reading 

Yet Another mTLS Tutorial

2021-03-04 | #mtls #ssl #tls

I’ve come across many mTLS tutorials on the internet but none of them took me through the process, end-to-end, in a satisfying fashion. I hope to do in this tutorial is to start with the ideas of TLS and mTLS and conclude with an implementation you could reasonably productionize. Although we’ll be using a Golang server as our backend and Traefik as our reverse proxy, these ideas translate to other technologies as well.

Continue reading 

Generating the Mandelbrot Set

2019-06-11 | #canvas #fractals #web-workers

Update The shared github repo for the end product of this post is in version 2 state. @lovasoa kindly contributed a pull request which massivley improved performance and allowed the rendering to happen at full screen with much better speed and taught me many things in the process. I’ve added these improvements as an updated section at the end of the post. Many thanks @lovasoa. The first version, on which most of this post is based is still available for perusal at https://github.

Continue reading 

My ES Lint and Why

2018-09-21 | #coding-style #eslint #nodejs

I recently updated my company’s main NodeJS repository to include formatting via prettier-eslint and linting via eslint. My colleague asked me to explain my choice of rules since it’s tedious to go through each and every rule and figure out why it was chosen and I thought it was worth getting a blog post out of it, so here we go. This is the eslint config I plan to use:

Continue reading 