/images/avatar.webp

mrtn.me

Transferring WSL Home Directories Between Distributions

When upgrading to a new version of a Linux distribution in WSL or switching between different distributions, transferring your carefully configured home directory can be a challenge. This post presents a practical solution using rsync and WSL’s inter-distribution mounting capabilities to seamlessly transfer your development environment.

The Challenge

WSL distributions are isolated from each other, making it difficult to transfer files directly. Traditional backup and restore approaches using tar archives work but have limitations:

Managing Azure VM Disks and Extensions with Terraform: Handling Dependency and State Removal

When managing Azure Virtual Machines (VMs) with Terraform, especially Windows VMs with extensions and attached data disks, it’s common to encounter challenges around the order of resource destruction and avoiding unnecessary delays. This post summarizes practical solutions to these issues, with example commands and configuration snippets derived from a real-world scenario.

The Problem: Terraform Deletes Extensions and Disks Before the VM

By default, Terraform tracks each Azure VM extension (azurerm_virtual_machine_extension) and each data disk attachment (azurerm_virtual_machine_data_disk_attachment) as independent resources. When running terraform destroy, Terraform deletes these extensions and disk attachments one by one before deleting the VM.

Debugging a failing OpenStack image

The problem

On my alpine-openstack-vm project, There is a CI process producing a VM image for OpenStack. The process involves testing that the machine boots. The test fails, but the machine is actually booted. What doesn’t work is the ssh access. As the machine can only be reached via SSH with a private key for obvious security reasons, not having access prevents proper debug.

The objective

The objective is to be able to run the produced VM locally to assess the issue. As the image in its current form doesn’t work, the VM image needs to be slightly modified in order to allow access. If the VM is run locally, adding a root password should be sufficient.

Multiple Docker environments on Windows

On Windows and docker platforms, your docker environment tends to get messy as time goes by.

You can start over from a clean sheet with docker system prune --all but sometimes you would like to keep some images around. This post shows how to set up multiple docker environments on Windows with the help of WSL2 (Windows Subsystem For Linux) and Alpine.

How it works

The idea is to run docker on WSL and use a docker alias on the windows side to invoke the docker command in the WSL distribution. This is a well-known usage pattern with or without Docker desktop.

Useful Python packages discovery sites

Python is an awesome language with an awesome ecosystem. It is both mature and very active. You are rarely left alone when you need to be doing something new. There are always one or more open source libraries or framework to help you achieve your goal.

But now you’re left with a dilemma: Which one to choose ?

The criteria are fairly simple. You want a library actively used and maintained, with the biggest community possible. But you want also a library still having momentum. You don’t want to invest too much is a technology on the downward slope. Without offense, people still doing Struts or ActionScript know what I mean.

Checking Google Play Signatures on .Net

With In-App Billing on Android, each time a purchase occurs, your application receives a JSON payload containing information about the purchase, as well as its signature with your developer certificate.

Google encourages you to verify that the signature is valid to authentify the purchase. You can do that inside the application, but if the delivery of the purchase involves a server, it is better to do it on the server to prevent client code manipulation. The following show how to do it on .Net server application.