Francisco Castello's personal tech/geek blog

As a technology fan I always try to find and hack how things work, my passion for technology in general lead me to pursue interests in coding, automation, metrics and analytics, IoT, electronics and DIY projects of all sorts.
From simple hello world coding in new languages to automating a full fleet of servers (or raspberry pi’s), creating kubernetes clusters, database clusters, DIY electronics, home lighting and automation, energy efficiency, among others can be seen in my personal projects.
In this blog I will share some of these projects, most things I do for fun at home as side projects, my drive for automation lead me to try to keep as much things in code to be able to reproduce my projects from scratch.
My idea is to share these projects which might save others some time for their personal projects.

You can find my public info here: my personal github, twitter @fcastello80 or linkedin


Secrets Manager for Home Lab Automation

One of the problems I found when working with my home lab is that I was lacking a solution for storing secrets. Even though there are open source solutions like Hashicorp vault to manage secrets, and managing it something requires maintenance and I didn’t want to have the operational burden. I used to manage my password with a KeePass vault file. However that solution fell short when dealing with multiple devices like phones and multiple laptops. So I chose a password manager. I ended up choosing Bitwarden as a password manager, one of the reasons I chose this solution was that it is open source and if I ever want to host it myself I can migrate to the open source version and migration will bee seamless to a hosted solution. I still chose the cloud version of it. And at some point working on my labs I decided to use my password manager to store the secrets I need for my automations. Bitwarden offers a cli tool which is pretty handy for automations, it outputs secrets in json format which is pretty useful to be used in any language. I chose to keep things simple and use it on the shell and parse it with jq tool, one downside of the bitwarden CLI tool is that they don’t offer a build for linux arm64 arch, so if you are running on a raspberry pi you will have to build the tool from source. This post is opinionated to Bitwarden, but the same concepts should work for other password managers CLI tools, of course depending on outputs a few things should be adapted to other password managers outputs.


Watch Out With Cloud Storage API Calls!!!

One of the most popular services from cloud providers is cloud storage, to be more specific AWS S3, Google Cloud Storage, Azure Storage or any similar service from other cloud providers. This service is very convenient for developers and SREs or System Admins, it solves the problem of managing disks, storage devices , storage servers, etc at a very low cost for storing files, depending on the cloud provider, some of them even offer a staggering 99.999999999% durability. Given the benefits and low cost of such services, I have seen more and more reliance on the cloud storage services. But there is a catch on the cheap pricing, in order to make a good decision when architecting an application we need to look a all pricing items for the cloud storage service to optimize around costs. Cloud storage services usually charge for the storage used for files stored, api calls to put, retrieve and list files and network traffic. So we need to have in mind these parameters to avoid surprises on our cloud storage bills. I will not go into too much details on each cloud provider on this post but I will show something I found out recently that made an application lower the costs about 10 times just by optimizing the way the data was being accessed. These optimizations might be a key to make a feature or an app profitable. In particular I will talk about AWS S3 api calls and the behavior of some of the official AWS SDKs that needed some tweaking. Of course all findings shown in this post were done with documentation found at the time of this writing. So I suggest double check the SDKs behavior as it might change in the future.