profile picture

TIL: Things I Learned

Also known as Today I Learned, this is a collection of write-ups on small subjects that don't deserve a full article. They cover different technologies, languages or tools or tricks that I've discovered on my day to day.

macOS: File vs file - switching to a case-insensitive filesystem for my code

October 30, 2024 - 284 words - 2 mins

Since moving to macOS for my mobile work, found extremely frustrating that by default, macOS allows File and file be the same thing, leading to issues when deploying or working with Linux.

Here is how I handle it without having to format and re-install the entire OS, something Apple hasn't made easier in newer Apple Silicon devices.

read more

Backup headscale using Litestream

February 25, 2023 - 979 words - 5 mins
How we can ensure if something happens to the server running headscale that I can recover the configuration? Always have a backup strategy! This time I tested headscale and Litestream locally, combined with a S3-compatible storage (MinIO) ▶️ Also made a recording of this that you can watch on YouTube… read more

Deploying headscale to Fly.io for homelab setup

February 19, 2023 - 583 words - 3 mins
This time I took my local headscale setup and deployed to Fly.io, to allow nodes from different locations to connect into my homelab mesh network. This builds on top of work done in previous TIL, but moves away from local testing using Docker and some VMs to real internetz deployment. ▶️ Also made a … read more

Testing Crystal SQLite3 PRAGMAs usage and some HTTP benchmarks 👨‍🚀🚀

February 11, 2023 - 1317 words - 7 mins
Wanted to test the PRAGMA changes to crystal-sqlite3 and perform some simple HTTP benchmarks, just for fun 😊 This uses the work shown on previous TIL, and the code from [PR #85][pr-85]. ▶️ Similar to previous TIL, I made a recording of this test (and the errors) 💣 here. 1. A simple HTTP app that use… read more

Testing out headscale for a homelab setup

January 29, 2023 - 800 words - 4 mins
Instead of just exposing a single machine to the internet (see previous TIL), I wanted this time to quickly test headscale and see how it operates for a homelab scenario to replace Tailscale. ▶️ I also made a recording of this that you can watch on YouTube here. 1. Run headscale in a controlled envi… read more

Setting SQLite3 PRAGMA's automatically with crystal-sqlite3

January 14, 2023 - 641 words - 4 mins
For a project in Crystal using SQLite3 (crystal-sqlite3), I wanted to automate setting PRAGMAs on the database connection without having to leverage on DB#setup_connection and hardcoding values in my code. So, instead of doing this: require "sqlite3" DB.open "sqlite3:file.db" do… read more

Expose home VM to the internet using Fly's Private Network and WireGuard

January 07, 2023 - 512 words - 3 mins
I wanted to host applications on private servers and have them accessible on the internet. But wanted to avoid having to punch holes on internet routers, exposing my home/office IP or having to figure out more complex stuff. With this in mind, thought about using Fly's Private Network (also known as… read more