Felipe MartΓn
Journey to K3S: Basic cluster setup
I've finally started to play with K3S, a lightweight Kubernetes distribution. I have been reading about it for a while and I'm excited to see how it performs in my home lab. My services have been running in an Intel NUC running Docker container for some years now, but the plan is to migrate them to a k3s cluster of three NanoPC-T6 boards.
I was looking for a small form-factor and low power consumption solution, and the NanoPC-T6 seems to fit the bill. I know I'm going to stumble upon some limitations but I'm eager to see how it goes and the problems I find along the way.
My requirements are very simple: I want to run a small cluster with a few services, and I want to be able to access them from the internet and from my home. My current setup relies on Tailscale for VPN and Ingress for the services, so I'm going to try and replicate that in this new setup.
Create an audiobook file from several mp3 files using ffmpeg
Due to some recent traveling I have started to listen to audiobooks. I love reading but some times my eyes are just too tired to go with it but I'm not sleepy at all or maybe I just wanted the convenience to lay down but still do something.
Short story, I bought some from a known distributor but I'm a fan of data preservation and actually owning what I pay for. I found an application in Github that allowed me to download the files that composed the audiobook in split mp3 files, but that didn't do. I wanted a single file with correct metadata, so I got my hands dirty.
My defaults at the end of 2023
I'm too joining this trend, since it seems like a good idea to keep track of the tools I use, others may discover new ones as I have done in people lists, and it's a good way to see how my preferences change over time.
Here's my list for this year:
Category | Tools/Platforms |
---|---|
π» Operating System | MacOS |
β¨οΈ Launcher | Alfred |
π± Mobile OS | iPhone |
π¨ Mail Client | Fastmail Web |
π Notes | Notion (personal) & Obsidian (personal/work) |
πΌοΈ Photo Management | Google Photos / iCloud Photos / Local NAS (A mess) |
π Calendar | Fantastical |
ππ»ββοΈ Contacts | Fastmail |
π File Storage | SynologyDrive & Syncthing |
π Browser | Arc |
π Search Engine | Kagi |
π Bookmarks | Shiori |
π Read It Later | Shiori |
π RSS Reader | Miniflux |
βοΈ Task Management | Todoist |
π Shopping Lists | Todoist |
π₯ Social Media | Mastodon |
π¬ Chat | Telegram, Element, iMessage |
π° Finances | Actual |
π΅ Music | Apple Music / Bandcamp / Local NAS |
π€ Podcasts | Apple Podcasts / iVoox |
π Password Management | 1Password |
π§βπ» IDE and Code Editor | Visual Studio Code |
π VPN | Tailscale , WireGuard |
π Home automation | Home Assistant |
I just read The Sunlit Man
Name | The Sunlit Man |
---|---|
Author | Brandon Sanderson |
Pages | 544 (Spanish physical edition) |
Rating | 4 (out of 6) |
Recommended | For Sanderson fans and fantasy/sci-fi lovers, yes. |
The last Secret Novel from Brandon Sanderson, titled The Sunlit Man (or El hombre iluminado in Spanish, the version I read). This is the most Cosmere focused novel of the four, with a lot of references to The Stormlight Archives series; or at least I guess so, since I haven't read any books from that series yet, though some names feel familiar.
I've enjoyed it, just not as much as the others to be honest. I liked the environment a lot and the idea of a planet that can kill you easily and what that means for the population of the planet, their livelihood, their interactions, ... In the end is a Space Opera ala Sanderson, and I don't know if I just got spoiled with Tress of the Emerald Sea (my favorite of the three) that I just wanted something as different. and this one being the most similar to the novels I already read from Sanderson just made it a little worse for me.
Even with that, I recommend fantasy/sci-fi lovers a read; it's just around 500 pages of non-stop movement, you get to the heart of the story pretty quickly and from there is just non-stop movement until you get to the outcome in the final two-three chapters.
And with this, the year of Sanderson is over.
Using ssh_config Match to connect to a host using multiple IP or Hostnames
My main computer is a MacBook Pro from 2017, but I have some servers laying around and one other laptop connected at home with ArchLinux installed that I use mainly for development. I connect to it remotely either directly using a SSH/Mosh + Tmux + Emacs/Vim combination, or using the pretty convenient VSCode Remote Extensions when I'm not feeling much of a hacker.
Thing is, I may access this computer either from my home network directly if I'm at home or via a SDN if I am not (at the office, coffeeshop, visiting family, etc).
My approach was to setup the hosts directly on my ~/.ssh/ssh_config
as you would with different machines:
# .ssh/config Host laptop.lan HostName 192.168.1.2 # Internal network IP Host laptop.sdn Hostname 10.0.0.2 # SDN IP
That way, I would connect to each one of them depending on the situation. Using tmux and ssh is not that much of a problem
since I could just detach from home, go away, then connect via SDN an everything would be there (though I had to remember
which alias to use instead of just ssh laptop
). For VSCode is not that convenient since I would need to close the connection,
made a new one to the new host and so on. Surely we could made this simpler, right?
In my home network, my main router is also my DNS server (with Ad Blocking, rules and all kind of fancy things), and that
server resolves my local domain (*.lan
) to LAN IP Addresses, so I can start with a simple config as I had previously:
# .ssh/config Host laptop HostName laptop.lan
Now, what happens if I'm not at home? I could solve this in several ways:
- I could
ping
my router, but that could collide with other networks out there. - I could check if my Wifi BSSID is one of the APs at home, but I could also connect via Ethernet.
- I could check if I can resolve the
laptop.lan
address, though this requires network access, but in the end is the one I ended up using.
$ dig +short laptop.lan 192.168.1.2 # At home $ dig +short laptop.lan # Empty result when away from home
Now, here comes the Match
magic:
# .ssh/config Host laptop HostName laptop.lan Match originalhost laptop exec "[[ $(/usr/bin/dig +short laptop.lan) == '' ]]" HostName laptop.sdn
Using Match
we can replace properties for a defined host using matches. In this ad-hoc example what I did is:
Match originalhost laptop
: The connection host need to matchlaptop
exec "[[ $(/usr/bin/dig +short laptop.lan) == '' ]]"
: Executedig
and try to resolve my LAN's laptop domain name. This needs to be a successful command for it to match, in this case we comparedig
s output to an empty string to evaluate if we can resolve thelaptop.lan
domain name (check the[[ ]]
).HostName laptop.sdn
If both rules match, replace theHostName
property with the laptop's SDN domain name.
This is a pretty easy way to just ssh laptop
wherever I am. I didn't knew about this particular
keyword until today, and it's pretty powerful!
Documentation: ssh_config(5) manpage