Mauro Morales

software developer

Month: May 2023

  • Remote Setup with EdgeVPN

    Last week I started using my old 13″ laptop and left the bulky 15″ workstation permanently at my desk. This setup gives me portability without loosing power when I’m connected to my home network. Today, I decided to configure EdgeVPN on both devices to also have this setup while on the road.

    EdgeVPN makes use of tokens, to connect nodes to a network. Since I have a Nextcloud server, which keeps files in sync on both of my laptops. I decided to put the EdgeVPN configuration file there and created a small script that reads from it to generate the token, and decide which IP to give to each device, based on their hostname:

    #!/bin/sh
    TOKEN=$(cat /path/to/Nextcloud/edgevpn-config.yaml | base64 -w0)
    IP=""
    if [ "$(hostname)" = "zeno" ]; then
    	IP="10.1.0.10"
    elif [ "$(hostname)" = "seneca" ]; then
    	IP="10.1.0.11"
    fi
    
    if [ "$IP" = "" ]; then
    	echo "IP not configured for $(hostname)"
    	exit 1
    else
    	echo Using IP: $IP
    fi
    edgevpn --token="$TOKEN" --address="$IP/24"
    

    Plus I created systemd services so I can make use of systemctl instead of having to remember the name of that shell script

    [Unit]
    Description=EdgeVPN
    Wants=network.target
    
    [Service]
    ExecStart=/path/to/start-edgevpn.sh
    
    [Install]
    WantedBy=multi-user.target

    On any of the nodes, I can start EdgeVPN’s web UI and list all connected nodes

  • Revived my Dell XPS 9350

    My work laptop has been giving me some trouble since I first installed openSUSE Tumbleweed. At first, it was just small annoyances, like not properly syncing the time. But installing the OS again is a bit of a hassle, as much as I enjoy doing it, so I found a workaround to reset it whenever it broke. However, last week it started freezing multiple times during the day, the workaround was to hard shut down the machine, which was very annoying, but I was hoping would get fixed in a next upgrade. Tumbleweed has weekly upgrades, so waiting wasn’t that big of a deal. But with the latest update, my Docker setup stopped working with Earthly, which is my bread and butter for Kairos, so I decided to try a different distro.

    Switching distros can be a big deal, and I didn’t want to learn a new package manager and special configurations, so I went with something I’ve already used before, Ubuntu 23.04. But even then, I first waned to give it a try, just in case there was any red flag. So, I dusted off my personal Dell XPS 9350, an 8-year-old laptop, to test it out. So far, everything seems to be working well, much slower than the workstation but still good enough and way more portable, so I’m probably going to start leaving my workstation at the desk.

  • Added ARM/RPI support for Ubuntu on Kairos

    Work this week came with a few challenges, but with enough patience and some help I was able to get the Ubuntu flavor for Kairos working on the Raspberry Pi.

    https://github.com/kairos-io/kairos/pull/1170

    Feedback loops when working on ARM are very slow because I’m cross compiling and because I have to burn the images on the SD cards. Switching contexts between tickets is not easy, but it’s also ok for working on chores, learning other things or playing with new technologies. I was mostly playing with ChatGPT, Copilot and LocalAI which was a lot of fun.

    Most of the lost time was because of a misconfiguration of the serial console. The issue was caused by some files which were not copied in the right directory, but it was not so obvious and without video it was very tricky to debug. Thankfully, after looking into some errors in dmesg and a recommendation from a colleague, I was able to sort it out. Reminder that it’s always good to review one’s own code and to get away from the code occasionally and look at it with a fresh pair of eyes.