Skip to main content

Ansible APT module randomly fails

While using Ansible to automate the system updates on my personal servers, I ran into an issue where the apt module randomly failed with the error: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "msg": "Failed to lock apt for exclusive operation: Failed to lock directory /var/lib/apt/lists/: E:Could not get lock /var/lib/apt/lists/lock."} Apparently it has something to do with the Unattended Upgrades service. Since this is something I want to keep enabled, the workaround is to set some retries on the task that uses the apt module.

Bootstrap / install script for dotfiles

I don’t think everyone, but at least a lot of people have a set of dotfiles that they use to configure their environment on a personal or work machine. Many people have those dotfiles in a git repository to keep them versioned and synced between machines. But not many people make use of a bootstrap script to install those dotfiles on a new machine. I recently rewrote my Bootstrap script in Python.

How to configure Mikrotik to connect to iVPN

iVPN is a VPN service that I’ve been using to protect my privacy online. I have it configured on my laptop and phone and it’s pretty handy, especially when I’m on public wifi. But if I want to protect my entire home network? Is it possible to configure a Mikrotik router to use iVPN? Yes, it is! I will quickly go over the steps you need to take to configure your Mikrotik to use iVPN Wireguard servers.

How to install Winbox on Mac M1

“I upgraded to a new Mac M1 chip and now I can’t run Winbox anymore”; “I switched from Windows or Linux to the new Macs and I cannot access my Mikrotik router using Winbox anymore”; “I’m trying to run the Winbox using wine on my Mac M1 without success”; If you find yourself in one of these situations, this simple and basic step-by-step may can help you. Since I switched to the not so new M1 chip, I couldn’t run the Winbox using Wine.

Using DHCP to configure static routes

According to RFC 3442, is possible to assign static routes using DHCP option 121. This is a very useful resource in all kind of environments, but most people doesn’t know about it. Basically, using option 121 on your DHCP server, you can deliver static routes to dhcp-clients. Let’s see how to do this using Mikrotik: ip dhcp-server option add code=121 name=route_192.168.11 value=0x18c0a80ba010101 And set this option in your network config: /ip dhcp-server network add address=192.