RSSAmplifier

Blog

Aos Dabbagh

Recent content on Aos Dabbagh

/RSS feed ↗20 posts

Latest posts

Building an Elixir App Around a Zigbee Button

I have an IoT button (SONOFF wireless push button) that when pressed I want to save the value in a database for later tracking. In this post - I document my journey yak-shaving my way to get exactly what I’m looking for. TL;DR Zigbee While I’ve previously set up a wifi-based smart plug, I have no experience with these buttons. This particular button uses the Zigbee protocol for…

Building a Homelab - Part 3: Nix

In the previous post, we went over the networking setup. To summarize, it contains 3 VLANs: one to manage the network, one for our homelab, and one for guest/IoT devices. The hosts are connected to a switch, which in turn is connected to a router speaks to the WAN. I mentioned in passing last time that I would be using Proxmox. The time has come and gone for that, and we’re now fully on Nix.

Embedding Scripts in Nix Flakes

A somewhat common theme I’ve noticed when working on various projects is the need for “one-off” re-usable scripts, these are typically more than a few lines of code. For example, in my Advent of Code repository I have a small Python script that pulls the input down given a year and day. But rather than wanting to manage this script explicitly, I wanted to encapsulate it as part…

How I'm Learning Elixir

Elixir is a functional language that runs on the Erlang VM. I’ve always been curious about it as I have a soft spot for functional languages. The primary motivating driver is to learn to use the Phoenix web framework. I enjoy building web apps, and have done so in Node.js, Ruby/Rails, Python, Go, and most recently, Rust. However, none of these languages has felt enjoyable for building web…

Better Utilization of Terraform Resource Keys

When managing multiple dissimilar resources in Terraform, best practices dictate that you use the for_each meta-argument. Furthermore, when needing to convert a list to a set or map for chaining, the advice given is usually of the form: for_each = { for k, v in aws_subnet.all : k => v } This will work but unfortunately it becomes unwieldy the more you need to rely on these generated resources. A…

Using `nix-shell` for Embedded Rust Development

Over the last year, I’ve been learning Rust and diving into the ecosystem. One of my goals has been to explore the Rust embedded development space. With that, I recently acquired a micro:bit board with the intention of following the Rust Discovery Book. And while I have experience with embedded at my current job, especially with the STM32 series of boards, it’s all in C/C++. One of the…

DNS Resolution for Wireguard with `systemd-resolved`

TL;DR [Interface] # ... PostUp = resolvectl dns %i 10.34.3.1; resolvectl domain %i '~hello' PreDown = resolvectl revert %i Introduction I’ve written previously about setting up a DNS server to go along with my Wireguard VPN. Now, accessing these services behind my VPN becomes convenient, and all it takes is one command for me to get up and running. However, this requires using a Linux…

Building a Homelab - Part 2: Networking

In the previous post, we introduced the beginnings of the makings of a homelab and the hardware I’ll been using for it. In this post, I will be going over the networking I’ve setup to have all pieces talking to each other in a safe and secure way. This networking scheme is simple, and will most likely evolve as I add more services on my hypervisors. Here’s what it looks like:

Building a Homelab - Part 1: Hardware

At its core, a homelab is nothing more than a set of computers networked together to provide an environment for experimentation. I’m a big fan of self-hosting services, and I’ve written previously about this. But I wanted to take this a step further and set up a compute cluster. I’ve often wondered about how the “cloud” works, and having some hardware will allow me to…

Under the Hood of a Simple DNS Server

Introduction As part of bringing up my personal infrastructure, I wanted a way to connect all my various boxes together and make them available to me from anywhere with an internet connection. The first step was to put up a VPN. For that, I use Wireguard. I ended up creating a simple management interface that allows me to link peers together and be able to access them via virtual IP addresses, no…

Things I Learned in 2019

In some ways, 2019 has been a pivotal year in my growth. I’ve started to gain a better understanding of my interests, strengths, and weaknesses. Originally, the title of this post was “2019 Retrospective”, but this topic turned out to be too broad. Therefore, I decided to narrow it down to what I have learned in 2019. This year for me felt more about breadth than depth of…

Raspberry Pi as Home Server and Reverse Proxy

Introduction Raspberry Pis are a great, low-risk introduction into Linux server and system administration. If you end up bricking it, you can just restart the whole process. In this tutorial, we will go over how to turn the Pi into a home server that can be accessed via the internet, and how to use it as a reverse proxy for other services on the Pi and local network. This includes:

A Simple Dynamic Programming Algorithm

Introduction For the past month or so I’ve spent time digging into dynamic programming (hereby abbreviated to DP). There many great resources introducing the history and concepts of DP. However, what I wanted was the simplest example/demonstration of how DP works. Most examples were too convoluted for someone just learning it such as myself. Luckily, while working through Advent of Code, I…

Notes on The Pragmatic Programmer

When I first started programming seriously, I had no reference or guide for learning the soft and hard skills of software engineering. I didn’t have a computer science degree (and I didn’t plan on going back to college), so I felt like I missed a certain aspect of this education. I went looking all over the internet and there were quite a few book recommendations, but one that was…

Understanding Dijkstra's Algorithm

Introduction When I first started learning algorithms and data structures, every resource I came across would mention Dijkstra’s algorithm in a sort of mystical, this-is-beyond-your-lowly-understanding manner. I disagree with that approach (in fact, I disagree with that approach for just about everything). Now that I’ve actually invested some time into learning it, it really…

Reflection on Starting a Daily Log

Inspired by this fantastic article by fellow RC alum Peter Lyons, I’ve started a log to keep small notes about anything work-related. The idea being that it becomes a central repository for all the little tasks/notes that I’d normally write down on a daily basis. Reducing barrier to entry When I first started the log, it was a dotfile kept on my root directory that I would open in a…

Computing Strongly Connected Components

Introduction I am currently working through Stanford’s algorithms course as part of “learning my fundamentals”, and one difficult and interesting topic that I’ve encountered is computing strongly connected components of a directed acyclic graph. A graph is said to be strongly connected if every vertex is reachable from every other vertex. In the image below, you will notice…

Web Scraping With Puppeteer

The Google Chrome team released a web scraping tool called Puppeteer in the not-so-distant past and I’ve been keening to play with it. I wrote a small script that uses it. If you’d like to follow the post with the source code, it is located here. What exactly is Puppeteer? Essentially it’s a web browser (Chromium) controlled by an API library. You write some code and that will…

Practical Guide to Setting Up a Hugo Blog

For the last few days, I have been working on setting up this blog site. Keep in mind this is my first attempt at such a thing. I was originally interested a few months ago but kept putting it off due to either laziness or not finding a theme that interested me. I’ve documented the process in the hopes that others may find it helpful. This guide will cover site creation to hosting on Github…

About

Backstory: I graduated medical school in January 2017. And while I enjoyed those 4 years, and developed a strong love for medicine, I ultimately decided not to practice. After graduating, I picked up programming again full-time and had the realization that this was what I wanted to do after all. I dabbled with code in my formative years, but never had the time to pursue it seriously. I attended…