In this blog post, I discuss the use of HTTP response status codes and the potential issues with duplicating them in the response body, as well as how RFC7807 provides a solution for conveying application-specific errors. Sometimes, I see APIs where the error response looks like this (HTTP header and body): HTTP/1.1 400 Bad Request Content-Type: application/json { "status": 400, "message": "Foo is blank" } The HTTP response status code is duplicated in the body of the response.| Haim Gelfenbeyn's Blog
In my work life I’m involved with projects in Ruby, Python, Swift, Rust, Javascript, Typescript. I don’t have strong programming language preferences and believe in the “right tool for the job” approach: the language should be a good fit for a problem domain, team expertise, time/budget constrains, etc. Rust is my go-to language when high-performance, strong type safety, rich ecosystem, compiled language is required. Go is often suggested in similar circumstances, and I’ve read a co...| Haim Gelfenbeyn's Blog
The problem DigitalOcean Kubernetes platform is great. Its Load Balancer is well-integrated and works great, too, unless you need to expose UDP services in your cluster: UDP load balancing is not supported! So it’s not possible to load-balance DNS, HTTP/3 or any other UDP service. How are we going to solve this? DigitalOcean supports floating IPs: publicly-accessible static IP addresses that you can assign to Droplets and instantly remap between other Droplets in the same datacenter.| Haim Gelfenbeyn's Blog
In my house, I’m using a general-purpose Linux machine as router. This is a much more flexible setup than using a dedicated device, it provides numerous benefits comparing to using a dedicated router, but it did pose a unique challenge: my router is actually a VM, not a physical machine: the host’s LAN carries multiple VLANs and the router/firewall VM just passes traffic between them. This works great, but introduces multiple additional points of failure, comparing to a dedicated hardware...| Haim Gelfenbeyn's Blog
Why would you want to do that? I initially wrote my “KVM replacement” display-switch application twice, in Rust and Swift. The primary reason was that there is no MacOS-compatible DDC/CI control library for Rust. However, as the app became somewhat popular, and I wanted to add new features and improvements, I realized that this is not sustainable: I would have to implement every new feature twice. So I thought: what if I extract only the MacOS-compatible DDC control Swift code as a separa...| Haim Gelfenbeyn's Blog
Why write a MacOS application in Python? Python has an amazingly rich ecosystem of libraries, tools and frameworks. It is a clean, modern language, it allows for rapid prototyping and quick development cycles. UI was not the central, focal point of my app, so it made a lot of sense for me to do it in Python: I thought I’d write the core functionality first, and add the UI afterwards.| Haim Gelfenbeyn's Blog
The need for KVM I like my two big hi-res monitors. I love my keyboard and my mouse. And I connect them to my stationary “main” PC and to several other Windows and Mac laptops, alternatively. I’d like to easily switch where these peripheral devices are connected to, and that’s the traditional role of a KVM switch. Unfortunately for me, KVM switches that support 4K/60hz resolutions cost hundreds of dollars, there are no KVM switches that support USB-C, and I couldn’t find KVM switche...| Haim Gelfenbeyn's Blog
This is the second post about hooking up Heat Recovery Ventilator to Home Assistant. Previously, I wrote about the hardware aspect and here I’ll discuss the software that is needed to make it all work. ESP8266 Firmware There are several IoT frameworks available for ESP8266. I’ve decided to build my solution on top of Homie for ESP8266. Homie is a thin and simple MQTT convention for the IoT, it integrates very well with Home Assistant and supports advanced features like initial setup of de...| Haim Gelfenbeyn's Blog
This is the first post in a series about how I implemented MQTT controller for a Heat Recovery Ventilator (HRV) in my house, and hooked it up to my home automation system. What is HRV? Our house is quite new, and therefore pretty well sealed. In order to maintain a healthy interior climate and not lose too much energy in a cold Canadian climate, we have a Heat Recovery Ventilator system, which is a system that brings in fresh outdoor air and heats (or cools) it with an interior air it exhaust...| Haim Gelfenbeyn's Blog
Why? My work is 100% remote, I work from home most of the time. Although I usually have a stable schedule and try to have meals at the same time every day, sometimes meetings get into way, and I eat earlier or later than usual. To let my co-workers know that I’m currently away, I prefer to set a Slack status (and do not send messages saying “going to lunch” and “back”).| Haim Gelfenbeyn's Blog
This is the third article in a series about my DIY approach to wall-mounted home automation dashboards. Choosing the dashboard platform The “heart” of my home automation system is Home Assistant, an open source home automation platform written in Python. Its built-in web frontend is suitable for a dashboard, but only if the only thing you want to control is Home Assistant. I knew from the start that there were going to be several custom components in my dashboard, so my primary requiremen...| Haim Gelfenbeyn's Blog
This is the second article in a series of articles about my DIY approach to wall-mounted home automation dashboards. See the first part for initial planning, hardware, mounting and power supplies. A big disappointment My initial idea was to build an intercom system with these tablets. This turned out to be a bad idea, for two reasons: Tablet’s microphone and speaker quality: They were pretty bad! I did some initial testing with various open-source Android softphones, and you had to stand pr...| Haim Gelfenbeyn's Blog
This is the first article in a series of articles about my DIY approach to wall-mounted home automation dashboards. This is a bit old news for us, as I completed this project 2 years ago. I didn’t want to write about it immediately after completion, I wasn’t sure how reliable the whole system is. However, today, two years later, it’s still 100% operational, so it’s time! The objective After we moved to a new house, I mentioned in passing to my wife that I would like to be able to cont...| Haim Gelfenbeyn's Blog
When you need to run something just once, but on each node| Haim Gelfenbeyn's Blog