<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>mrtn.me</title><link>http://mrtn.me/</link><description>This is my cool site</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><managingEditor>antoine@mrtn.me (Antoine Martin)</managingEditor><webMaster>antoine@mrtn.me (Antoine Martin)</webMaster><lastBuildDate>Mon, 11 Aug 2025 00:00:00 +0000</lastBuildDate><atom:link href="http://mrtn.me/index.xml" rel="self" type="application/rss+xml"/><item><title>Transferring WSL Home Directories Between Distributions</title><link>http://mrtn.me/posts/2025/08/11/transferring-wsl-home-directories-between-distributions/</link><pubDate>Mon, 11 Aug 2025 00:00:00 +0000</pubDate><author>Antoine Martin</author><guid>http://mrtn.me/posts/2025/08/11/transferring-wsl-home-directories-between-distributions/</guid><description><![CDATA[<p>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&rsquo;s inter-distribution mounting capabilities to seamlessly transfer
your development environment.</p>
<!-- more -->
<h2 id="the-challenge">The Challenge</h2>
<p>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:</p>]]></description></item><item><title>Managing Azure VM Disks and Extensions with Terraform: Handling Dependency and State Removal</title><link>http://mrtn.me/posts/managing-azure-vm-disks-and-extensions-with-terraform-handling-dependency-and-state-removal/</link><pubDate>Tue, 05 Aug 2025 00:00:00 +0000</pubDate><author>Antoine Martin</author><guid>http://mrtn.me/posts/managing-azure-vm-disks-and-extensions-with-terraform-handling-dependency-and-state-removal/</guid><description><![CDATA[<p>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.</p>
<h2 id="the-problem-terraform-deletes-extensions-and-disks-before-the-vm">The Problem: Terraform Deletes Extensions and Disks Before the VM</h2>
<p>By default, Terraform tracks each Azure VM extension
(<code>azurerm_virtual_machine_extension</code>) and each data disk attachment
(<code>azurerm_virtual_machine_data_disk_attachment</code>) as independent resources. When
running <code>terraform destroy</code>, Terraform deletes these extensions and disk
attachments one by one <strong>before</strong> deleting the VM.</p>]]></description></item><item><title>Debugging a failing OpenStack image</title><link>http://mrtn.me/posts/2023/01/13/debugging-a-failing-openstack-image/</link><pubDate>Fri, 13 Jan 2023 00:00:00 +0000</pubDate><author>Antoine Martin</author><guid>http://mrtn.me/posts/2023/01/13/debugging-a-failing-openstack-image/</guid><description><![CDATA[<h2 id="the-problem">The problem</h2>
<p>On my
<a href="https://github.com/antoinemartin/alpine-openstack-vm" target="_blank" rel="noopener noreffer ">alpine-openstack-vm</a>
project, There is a CI process producing a VM image for OpenStack. The process
involves testing that the machine boots.
<a href="https://github.com/antoinemartin/alpine-openstack-vm/actions/runs/3909412713" target="_blank" rel="noopener noreffer ">The test fails</a>,
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.</p>
<h2 id="the-objective">The objective</h2>
<p>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.</p>]]></description></item><item><title>Multiple Docker environments on Windows</title><link>http://mrtn.me/posts/2022/05/11/multiple-docker-environments-on-windows/</link><pubDate>Wed, 11 May 2022 00:00:00 +0000</pubDate><author>Antoine Martin</author><guid>http://mrtn.me/posts/2022/05/11/multiple-docker-environments-on-windows/</guid><description><![CDATA[<p>On Windows and docker platforms, your docker environment tends to get messy as
time goes by.</p>
<p>You can start over from a clean sheet with <code>docker system prune --all</code> 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.</p>
<!-- more -->
<h2 id="how-it-works">How it works</h2>
<p>The idea is to run docker on WSL and use a <code>docker</code> alias on the windows side to
invoke the docker command in the WSL distribution. This is a well-known usage
pattern <a href="https://docs.docker.com/desktop/windows/wsl/" target="_blank" rel="noopener noreffer ">with</a> or
<a href="https://dev.to/bowmanjd/install-docker-on-windows-wsl-without-docker-desktop-34m9" target="_blank" rel="noopener noreffer ">without</a>
Docker desktop.</p>]]></description></item><item><title>Useful Python packages discovery sites</title><link>http://mrtn.me/posts/2022/05/02/useful-python-packages-discovery-sites/</link><pubDate>Mon, 02 May 2022 00:00:00 +0000</pubDate><author>Antoine Martin</author><guid>http://mrtn.me/posts/2022/05/02/useful-python-packages-discovery-sites/</guid><description><![CDATA[<p>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.</p>
<p>But now you&rsquo;re left with a dilemma: Which one to choose ?</p>
<!-- more -->
<p>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&rsquo;t want to invest too much is a technology on the <em>downward
slope</em>. Without offense, people still doing Struts or ActionScript know what I
mean.</p>]]></description></item><item><title>Checking Google Play Signatures on .Net</title><link>http://mrtn.me/posts/2012/11/15/checking-google-play-signatures-on-net/</link><pubDate>Thu, 15 Nov 2012 00:00:00 +0000</pubDate><author>Antoine Martin</author><guid>http://mrtn.me/posts/2012/11/15/checking-google-play-signatures-on-net/</guid><description><![CDATA[<p>With
<a href="http://developer.android.com/guide/google/play/billing/billing_integrate.html" target="_blank" rel="noopener noreffer ">In-App Billing</a>
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.</p>
<p>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.</p>]]></description></item><item><title>Mirror a Git Repository Through Ssh</title><link>http://mrtn.me/posts/2012/11/15/mirror-a-git-repository-through-ssh/</link><pubDate>Thu, 15 Nov 2012 00:00:00 +0000</pubDate><author>Antoine Martin</author><guid>http://mrtn.me/posts/2012/11/15/mirror-a-git-repository-through-ssh/</guid><description><![CDATA[<p>Redmine can show the timeline of a Git repository but this repository needs to
be local (see <a href="http://www.redmine.org/boards/2/topics/3487" target="_blank" rel="noopener noreffer ">here</a>). When you
host your repository externally (on GitHub, for instance), you need to
synchronize your remote repository on your Redmine server.</p>
<p>The following shell script is an <em>All in one</em> command that can be easily put in
the crontab to mirror the repository on your Redmine server :</p>
<!-- More -->
<div class="code-block code-line-numbers" style="counter-reset: code-block 0">
    <div class="code-header language-sh">
        <span class="code-title"><i class="arrow fas fa-angle-right fa-fw" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h fa-fw" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy fa-fw" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="cp">#!/bin/sh
</span></span></span><span class="line"><span class="cl"><span class="cp"></span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="o">[</span> <span class="s2">&#34;run&#34;</span> !<span class="o">=</span> <span class="s2">&#34;</span><span class="nv">$1</span><span class="s2">&#34;</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
</span></span><span class="line"><span class="cl">  <span class="nb">exec</span> ssh -i <span class="s2">&#34;</span><span class="nv">$GIT_KEY</span><span class="s2">&#34;</span> -o <span class="s2">&#34;StrictHostKeyChecking no&#34;</span> <span class="s2">&#34;</span><span class="nv">$@</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl"><span class="k">fi</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nv">remote</span><span class="o">=</span><span class="nv">$2</span>
</span></span><span class="line"><span class="cl"><span class="nv">local</span><span class="o">=</span><span class="nv">$3</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">&#34;Mirroring from </span><span class="nv">$remote</span><span class="s2"> to </span><span class="nv">$local</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nv">name</span><span class="o">=</span><span class="k">$(</span>basename <span class="s2">&#34;</span><span class="nv">$local</span><span class="s2">&#34;</span><span class="k">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">GIT_KEY</span><span class="o">=</span><span class="s2">&#34;`mktemp /tmp/git.XXXXXX`&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">GIT_SSH</span><span class="o">=</span><span class="s2">&#34;</span><span class="nv">$0</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">cat &gt;<span class="s2">&#34;</span><span class="nv">$GIT_KEY</span><span class="s2">&#34;</span> <span class="s">&lt;&lt;EOF
</span></span></span><span class="line"><span class="cl"><span class="s">-----BEGIN DSA PRIVATE KEY-----
</span></span></span><span class="line"><span class="cl"><span class="s">### Put here your private key ###
</span></span></span><span class="line"><span class="cl"><span class="s">-----END DSA PRIVATE KEY-----
</span></span></span><span class="line"><span class="cl"><span class="s">EOF</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="o">[</span> -d <span class="s2">&#34;</span><span class="nv">$local</span><span class="s2">&#34;</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
</span></span><span class="line"><span class="cl">        git <span class="s2">&#34;--git-dir=</span><span class="nv">$local</span><span class="s2">&#34;</span> remote update
</span></span><span class="line"><span class="cl"><span class="k">else</span>
</span></span><span class="line"><span class="cl">        git clone --mirror <span class="s2">&#34;</span><span class="nv">$remote</span><span class="s2">&#34;</span> <span class="s2">&#34;</span><span class="nv">$local</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl"><span class="k">fi</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">rm -f <span class="s2">&#34;</span><span class="nv">$GIT_KEY</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">exit</span> <span class="m">0</span></span></span></code></pre></div></div>
<p>You need to copy the private key in the script (line 20). You can then use the
script with the following syntax</p>]]></description></item><item><title>Avoid Thread Issues While Testing an Android Service</title><link>http://mrtn.me/posts/2012/11/08/avoid-thread-issues-while-testing-an-android-service/</link><pubDate>Thu, 08 Nov 2012 00:00:00 +0000</pubDate><author>Antoine Martin</author><guid>http://mrtn.me/posts/2012/11/08/avoid-thread-issues-while-testing-an-android-service/</guid><description><![CDATA[<p>The
<a href="http://developer.android.com/tools/testing/testing_android.html" target="_blank" rel="noopener noreffer ">Android Test Framework</a>
provides many tools to test parts of an Android application, and the
<a href="http://developer.android.com/reference/android/test/ServiceTestCase.html" target="_blank" rel="noopener noreffer ">ServiceTestCase</a>
in particular to test your
<a href="http://developer.android.com/reference/android/app/Service.html" target="_blank" rel="noopener noreffer ">Service</a>
classes.</p>
<p>This class is quite useful but you may find yourself scratching your head
because your test does not work like it should. This happens in particular if
you&rsquo;re doing some background work in your service, relying for example on
<a href="http://developer.android.com/reference/android/os/AsyncTask.html" target="_blank" rel="noopener noreffer ">AsyncTask</a>
for it.</p>
<p>Read on if you want to understand why it doesn&rsquo;t work and find a solution for
it.</p>]]></description></item><item><title>Unlock and Root a Nexus Device</title><link>http://mrtn.me/posts/2012/10/25/unlock-and-root-a-nexus-device/</link><pubDate>Thu, 25 Oct 2012 00:00:00 +0000</pubDate><author>Antoine Martin</author><guid>http://mrtn.me/posts/2012/10/25/unlock-and-root-a-nexus-device/</guid><description><![CDATA[<p>Having an unlocked and rooted device provides several advantages :</p>
<ul>
<li>Easy backup and restore with Nandroid backup,</li>
<li>Easy firmware replacement and updates installation,</li>
<li>Advanced debugging capabilities.</li>
</ul>
<p>The following instructions allow unlocking and rooting a Nexus device (Galaxy
Nexus, Nexus 7) from the command line on a Linux machine. It involves:</p>
<ul>
<li>Backuping your device,</li>
<li>Unlocking the bootloader,</li>
<li>Restoring the backup,</li>
<li>Rooting the device.</li>
</ul>
<!-- More -->
<h3 id="prerequisites">Prerequisites</h3>
<p>Here is the list of prerequisites :</p>]]></description></item><item><title>Quickly Deploy a Git Project on a Server With Ssh</title><link>http://mrtn.me/posts/2012/10/24/quickly-deploy-a-git-project-on-a-server-with-ssh/</link><pubDate>Wed, 24 Oct 2012 00:00:00 +0000</pubDate><author>Antoine Martin</author><guid>http://mrtn.me/posts/2012/10/24/quickly-deploy-a-git-project-on-a-server-with-ssh/</guid><description><![CDATA[<p>So you have this brand new project <code>my_project</code> of yours with your local Git
repository set up and you want to quickly make it available for others to clone
on your repository server.</p>
<p>All your projects are located in your server <code>git.mycompany.com</code> under
<code>/srv/git</code>. You&rsquo;re using the user named <code>git</code> to connect to your server with the
SSH private key located in <code>~/.ssh/git</code>.</p>
<p>Here is the quickest way to deploy your project:</p>]]></description></item></channel></rss>