<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Emmanuel Jeandel</title>
<link>https://members.loria.fr/EJeandel/blog.html</link>
<atom:link href="https://members.loria.fr/EJeandel/blog.xml" rel="self" type="application/rss+xml"/>
<description>Emmanuel Jeandel&#39;s page</description>
<generator>quarto-1.8.24</generator>
<lastBuildDate>Tue, 01 Apr 2025 22:00:00 GMT</lastBuildDate>
<item>
  <title>Using Cisco equipment in a computer networks course</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/cisco/</link>
  <description><![CDATA[ 






<p>The goal of this post is to share my experience in using Cisco equipment to teach computer networks.</p>
<p>Computer networks is one of the only course in the computer science curriculum that can involve actual lab work, instead of just doing programming, and I think it’s interesting to do it “for real” instead of using simulators, even if some good ones exist (like kathara).</p>
<p>We use Cisco equipment because we have access to it. It’s also likely it will be the equipment students will use on their actual job. However this equipment is not fit for teaching. There are many things that are done by default which are probably very good in a real environment, but that complicates teaching.</p>
<p>The goal is to explain the best configuration of Cisco switches and routers to make them easier to use in a teaching environment.</p>
<p>I want to stress that some of the defaults in the configuration would be very bad in practice, in a real environment.</p>
<p>This article is neither an endorsement nor a criticism of Cisco products.</p>
<section id="introduction" class="level1">
<h1>Introduction</h1>
<p>The audience for this article are teachers wanting to use Cisco equipment to teach a computer networking course. Most of it is not applicable in a real environment.</p>
<p>This article is for people that are already familiar with using real equipment (switches, routers) for a computer networking course, and have a basic understanding of how to configure a Cisco equipment.</p>
<p>It assumes that the problem of how to access the equipment at any given moment to configure it is already solved. In my lab, we use a terminal server for that.</p>
<p>Some of this information might relate to old and obsolete equipment.</p>
</section>
<section id="switches" class="level1">
<h1>Switches</h1>
<section id="vlans" class="level2">
<h2 class="anchored" data-anchor-id="vlans">VLANs</h2>
<p>Even if VLANs are not in your curriculum, it’s still important to know the fundamentals to understand how the switch should be configured. Weird things might happen even with one vlan.</p>
<p>The tl;dr is that every “normal” (<em>access</em>) port in a switch has a vlan number. Only ports with the same vlan number can communicate with each other. By default, all ports are on vlan 1.</p>
<p>If two switches are linked together by a cable, then ports with the same vlan numbers across the two switches can communicate with each other. For this to work, the ports that link the two switches together should be a <em>trunk</em> port.</p>
</section>
<section id="vtp" class="level2">
<h2 class="anchored" data-anchor-id="vtp">VTP</h2>
<p><strong>Why you should deactivate it</strong>: Weirds things might happen if you connect two switches together, unnecessary traffic.</p>
<p><strong>How to deactivate it</strong>:</p>
<pre><code>vtp mode transparent
vtp mode off</code></pre>
<p>VTP, for VLAN Trunking Protocol, is a proprietary protocol that makes VLANs consistent accross switches. Specifically, switches can be VTP servers, clients, or transparent. By default all switches are VTP servers. When a switch is connected to a VTP domain, and its VTP revision number is higher than the other switches in the network, his configuration will be propagated. This is very bad if you play with a switch for some time trying to find a good configuration, then connect it to your network of switches: its information will propagate (its revision number certainly went up from all the experiments), even you don’t want it to. Some sites on the Internet call this the “VTP Bomb”.</p>
</section>
<section id="cdp" class="level2">
<h2 class="anchored" data-anchor-id="cdp">CDP</h2>
<p><strong>Why to deactivate</strong>: Weirds things might happen if you connect two switches together, unnecessary traffic.</p>
<p>CDP is a proprietary cisco protocol for equipments to share info, like their name, operating systems, and some configuration parameters. The main reason to deactivate has to do with the configuration parameters. Every time the configuration of a switch changes, the CDP version number goes up. When two switches using the CDP protocol are connected together (I have no idea if the problem also appears with routers), the one with the least CDP version number will take its configuration from the one with the highest CDP version.</p>
<pre><code>no cdp enable</code></pre>
<p>ou</p>
<pre><code>no cdp run</code></pre>
<p>CDP is another proprietary protocol for switches to say hello to each other. It’s a bit of a security risk because you might learn things about the switches (like its OS, its IP address and domain) you don’t want to. It’s also another thing you don’t need if you just want to experiment in a basic networking course.</p>
</section>
<section id="dtp" class="level2">
<h2 class="anchored" data-anchor-id="dtp">DTP</h2>
<p><strong>Why you should deactivate it</strong>: Unnecessary traffic.</p>
<p><strong>How to deactivate it</strong>:</p>
<p>This should be done for each port on the switch. For ports that should be trunk ports (usually ports connected to other switches, but not necessarily)</p>
<pre><code>switchport mode trunk
switchport nonnegotiate</code></pre>
<p>For the access ports:</p>
<pre><code>switchport mode access</code></pre>
<p>DTP is another proprietary protocol for switches to agree which port is a trunk port, and which port is an access port. Essentially it tries to guess which port is connected to another switch. Usually, you know when you’re doing an experiment what each port is doing. Better configure it that way.</p>
</section>
<section id="loop" class="level2">
<h2 class="anchored" data-anchor-id="loop">LOOP</h2>
<p><strong>Why you should deactivate it</strong>: Unnecessary traffic.</p>
<p><strong>How to deactivate it</strong>:</p>
<p>This should be done for each port on the switch.</p>
<pre><code>no keepalive</code></pre>


</section>
</section>

 ]]></description>
  <category>linux</category>
  <category>cisco</category>
  <category>teaching</category>
  <guid>https://members.loria.fr/EJeandel/posts/cisco/</guid>
  <pubDate>Tue, 01 Apr 2025 22:00:00 GMT</pubDate>
</item>
<item>
  <title>OpenRC on debian</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/openrc/</link>
  <description><![CDATA[ 






<p>This post shares my experience in replacing systemd by openrc on my debian.</p>
<section id="why-openrc" class="level1">
<h1>Why OpenRC</h1>
<p>There are a few reasons. First, I’m not perfectly happy with <code>systemd</code>. It’s OK if you do nothing with it, but at some point, I had to write a specific service, and the fact that systemd does everything on your machine (<code>hostnamed</code>, <code>resolvd</code>, etc) makes it hard to just tweak just a few things. Also I don’t like <code>journald</code>, and I hate socket activations.</p>
<p>Now I decided between <code>OpenRC</code> and <code>runit</code> by looking at their features, and I like the fact that <code>OpenRC</code> uses dependencies for init scripts. It doesn’t come with user services, more on that later.</p>
</section>
<section id="installation" class="level1">
<h1>Installation</h1>
<p>To make the installation as easy as possible, I booted from a rescue usb stick, chrooted into my system, and typed</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">aptitude</span> install openrc</span></code></pre></div></div>
<p>that’s it ! I tried before on virtual machines to update inside a running machine, it proved to be a mistake. Booting from a rescue CD/usb stick is much easier</p>
</section>
<section id="the-end-result" class="level1">
<h1>The end result</h1>
<p>Even without systemd, you will still see some systemd files and applications:</p>
<ul>
<li><p>the <code>udev</code> binary is actually called <code>systemd-udevd</code>, because udev is now part of systemd. I have nothing against udev, and replacing it seems a bit cumbersome, so I’ll keep it for now</p></li>
<li><p>the <code>libsystemd0</code> package is still installed. A few years ago it was possible to replace it with <code>libelogind0</code> (ABI compatible) but the new <code>elogind</code> depends on <code>libsystemd0</code> and conflicts with <code>libelogind0</code>.</p></li>
</ul>
<p>An important thing to note is that getting rid of systemd does not get rid of code written in conjunction with systemd. Typically, <code>udev</code> is part of systemd, <code>elogind</code> is a fork of part of <code>systemd</code>…</p>
</section>
<section id="a-few-commands" class="level1">
<h1>A few commands</h1>
<p>To know the list of services that are currently run:</p>
<pre><code>rc-status</code></pre>
<p>Start/Stop a service</p>
<pre><code>/etc/init.d/NAME [start|stop]
rc-service NAME [start|stop]</code></pre>
<p>Remove a service from startup</p>
<pre><code>rc-update del NAME</code></pre>
</section>
<section id="user-services" class="level1">
<h1>User services</h1>
<p><code>systemd</code> does not only manage system services, but also user services. <code>openrc</code> doesn’t. It turns out that there are a ton of user services that are run when someone logs on a machine: Typically, on my main desktop, 15 services (!) are launched. Some of them are pretty important and almost mandatory. Typically, I suspect that users that have a bad experience with openrc typically didn’t realize they’d need to add some users services.</p>
<p>A big one is pipewire, if you want to have sound. Other services are largely irrelevant, with the exception of dbus</p>
<section id="pipewire" class="level2">
<h2 class="anchored" data-anchor-id="pipewire">Pipewire</h2>
<p>To launch pipewire, 3 applications should be run: <code>pipewire</code>, <code>pipewire-pulse</code> and <code>wireplumber</code></p>
<p>If you use a desktop environment (like KDE or gnome), an easy way to have these programs launched at startup is to create a few XDG files:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">root%</span> cat /etc/xdg/autostart/pipewire.desktop</span>
<span id="cb5-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[Desktop</span> Entry]</span>
<span id="cb5-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Name</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PipeWire</span>
<span id="cb5-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Comment</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Start <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">PipeWire</span></span>
<span id="cb5-5"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Icon</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pipewire</span>
<span id="cb5-6"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Exec</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pipewire</span>
<span id="cb5-7"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Terminal</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>false</span>
<span id="cb5-8"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Type</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Application</span>
<span id="cb5-9"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">NoDisplay</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>true</span>
<span id="cb5-10"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">root%</span> cat /etc/xdg/autostart/pipewire-pulse.desktop</span>
<span id="cb5-11"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[Desktop</span> Entry]</span>
<span id="cb5-12"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Name</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PipeWire <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">pulse</span></span>
<span id="cb5-13"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Comment</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Start <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">PipeWire</span> pulse</span>
<span id="cb5-14"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Icon</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pipewire</span>
<span id="cb5-15"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Exec</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pipewire-pulse</span>
<span id="cb5-16"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Terminal</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>false</span>
<span id="cb5-17"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Type</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Application</span>
<span id="cb5-18"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">NoDisplay</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>true</span>
<span id="cb5-19"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">root%</span> cat /etc/xdg/autostart/wireplumber.desktop </span>
<span id="cb5-20"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[Desktop</span> Entry]</span>
<span id="cb5-21"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Name</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Wireplumber</span>
<span id="cb5-22"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Comment</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Start <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Wireplumber</span></span>
<span id="cb5-23"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Icon</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pipewire</span>
<span id="cb5-24"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Exec</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>wireplumber</span>
<span id="cb5-25"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Terminal</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>false</span>
<span id="cb5-26"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">Type</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Application</span>
<span id="cb5-27"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">NoDisplay</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>true</span></code></pre></div></div>
<p>The systemd services also include launching <code>pipewire -c filter-chain.conf</code>. I’m not sure it’s important, but if it makes a difference for you, you may add that service as well.</p>
</section>
<section id="dbus" class="level2">
<h2 class="anchored" data-anchor-id="dbus">dbus</h2>
<p><code>dbus</code> integrates with the login daemon from <code>systemd</code>, which makes it so that each connection to the computer uses the same bus.</p>
<p>So if you launch the graphical interface, then ssh to the machine, ssh will see the bus.</p>
<p>This is not true with openrc, and some work needs to be done for this work.</p>
<p>Here are some lines to add to your shell configuration:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">[</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">-n</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$SSH_CLIENT</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb6-2">  <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">bus_id</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cat</span> /etc/machine-id<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span>-0</span>
<span id="cb6-3">  <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">dbus_file</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$HOME</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/.dbus/session-bus/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${bus_id}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb6-4">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">[</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">-r</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$dbus_file</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb6-5">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">source</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$dbus_file</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb6-6">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">export</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">DBUS_SESSION_BUS_ADDRESS</span></span>
<span id="cb6-7">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">export</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">DBUS_SESSION_BUS_PID</span></span>
<span id="cb6-8">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">export</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">DBUS_SESSION_BUS_WINDOWID</span>      </span>
<span id="cb6-9">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">fi</span></span>
<span id="cb6-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">fi</span></span></code></pre></div></div>
<p>The <code>-0</code> is because I’m using display <code>:0</code>, you can change this if relevant.</p>
<p>You can change all of this into <code>export DISPLAY=:0</code> of course but I prefer for the variable <code>DISPLAY</code> to not be set.</p>


</section>
</section>

 ]]></description>
  <category>linux</category>
  <guid>https://members.loria.fr/EJeandel/posts/openrc/</guid>
  <pubDate>Sun, 27 Oct 2024 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Namespaces (part 2) : Solaris</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/solaris/</link>
  <description><![CDATA[ 






<p>This is the second post in a series of posts about namespaces, and how OS other than Linux implement some form of namespaces.</p>
<p>In this post we look at <a href="https://en.wikipedia.org/wiki/Oracle_Solaris">Solaris</a> Zones. Some of the open source versions of Solaris have different models of zones. The zones that I will examine in this post are the zones as they were initially conceived in Solaris 8.</p>
<p>The commands here were tested in Solaris 11.4.</p>
<section id="zones" class="level1">
<h1>Zones</h1>
<p>It’s good to think of zones as a entirely new operating system, completely isolated from the main system: the only thing they have in common with the original system is that they run on the same computer, but they use different filesystems, different PIDs, etc. This is really apparent from the fact that the first thing one does when installing a zone is configuring it as one whould essentially configure a new system (what’s its name, what’s its timezone, etc). In this sense, I would say the closest similarity in the Linux namespace world is <a href="https://linuxcontainers.org/">LXC/LXD or Incus</a> and certainly not docker/podman.</p>
<p>It is still possible to share some things with the zones: some filesystems, or some network cards (or rather, a virtual version of your network card).</p>
<p>It is difficult to discuss Solaris without discussing <a href="https://en.wikipedia.org/wiki/ZFS">zfs</a>. The revolutionary filesystem makes it able to create volumes (partitions) on the fly. All zones in what follows will each use a different volume, created inside the <code>/zones</code> directory</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zfs</span> create <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-o</span> mountpoint=/zones rpool/zones</span></code></pre></div></div>
</section>
<section id="installation" class="level1">
<h1>Installation</h1>
<p>Using a zone takes 4 steps:</p>
<ul>
<li>Configure the zone</li>
<li>Install the zone</li>
<li>Boot the zone</li>
<li>Access the zone</li>
</ul>
<p>Here is a typical configuration of a zone, using the <code>zonecfg</code> command. This is an interactive command that can also be used noninteractively</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> zonecfg <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-z</span> mypc</span>
<span id="cb2-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Use</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'create'</span> to begin configuring a new zone.</span>
<span id="cb2-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> create</span>
<span id="cb2-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">create:</span> Using system default template <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'SYSdefault'</span></span>
<span id="cb2-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> set zonepath=/zones/mypc</span>
<span id="cb2-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> info</span>
<span id="cb2-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonename:</span> mypc</span>
<span id="cb2-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonepath:</span> /zones/mypc</span>
<span id="cb2-9"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">brand:</span> solaris</span>
<span id="cb2-10"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">anet</span> 0:</span>
<span id="cb2-11">        <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">linkname:</span> net0</span>
<span id="cb2-12">        <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">configure-allowed-address:</span> true</span>
<span id="cb2-13"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> exit</span>
<span id="cb2-14"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span>        </span></code></pre></div></div>
<p>The zone is named <code>mypc</code>. The root of the filesystem is located in <code>/zones/mypc</code>. The <code>info</code> command tells us that this new zone will have a network card called <code>net0</code> that will be configured automatically.</p>
<p>We can now install the zone:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> zoneadm <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-z</span> mypc install</span>
<span id="cb3-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">The</span> following ZFS file system<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">s</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">have</span> been created:</span>
<span id="cb3-3">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">rpool/zones/mypc</span></span>
<span id="cb3-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Progress</span> being logged to /var/log/zones/...</span>
<span id="cb3-5">       <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Image:</span> Preparing at /zones/mypc/root.</span>
<span id="cb3-6"></span>
<span id="cb3-7"> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Install</span> Log: /system/volatile/install.5551/install_log</span>
<span id="cb3-8"> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">AI</span> Manifest: /tmp/manifest.xml.50GKxb</span>
<span id="cb3-9">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">SC</span> Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml</span>
<span id="cb3-10">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Zonename:</span> mypc</span>
<span id="cb3-11"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Installation:</span> Starting ...</span>
<span id="cb3-12"></span>
<span id="cb3-13">        <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Creating</span> IPS image</span>
<span id="cb3-14"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Retrieving</span> catalog 1/1 solaris ...</span>
<span id="cb3-15"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">...</span></span>
<span id="cb3-16"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">DOWNLOAD</span>                                PKGS         FILES    XFER <span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">MB</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span>   <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">SPEED</span></span>
<span id="cb3-17"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">library/expat</span>                         45/247    6184/39850   55.1/301.2  4.4M/s</span>
<span id="cb3-18"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">...</span></span>
<span id="cb3-19"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Installing</span> new actions                   12232/62305</span>
<span id="cb3-20"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">...</span></span>
<span id="cb3-21"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Installation:</span> Succeeded</span>
<span id="cb3-22"> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">done.</span></span>
<span id="cb3-23"></span>
<span id="cb3-24">        <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Done:</span> Installation completed in 241.426 seconds.</span>
<span id="cb3-25"></span>
<span id="cb3-26"></span>
<span id="cb3-27">        <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Next</span> Steps: Boot the zone, then log into the zone console <span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zlogin</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-C</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb3-28">        </span>
<span id="cb3-29">              <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">to</span> complete the configuration process.</span>
<span id="cb3-30"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span></span></code></pre></div></div>
<p>This is an excerpt of the install procedures. As is apparent from the capture, it looks very much like a full OS is installed: a list of packages to install is created, and then installed.</p>
<p>We can now boot the system, then log into the system:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> zoneadm <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-z</span> mypc boot</span>
<span id="cb4-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> zlogin <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-C</span> mypc</span></code></pre></div></div>
<p>As one can expect when starting a new OS, here is the first screen that we see: a configuration screen:</p>
<p><img src="https://members.loria.fr/EJeandel/posts/solaris/a.png" class="img-fluid"></p>
<p>We then get after a few steps to a login prompt, where we can test our new system. (Hint: type <code>~.</code> to close the connection to your brand new OS and go back to the original one).</p>
<p>This new system sees nothing of the original one. From the original system, we can access via <code>/zones/mypc/root</code> to the root filesystem of this particular zone, and we can see the virtual network card, installed on top of the existing one:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> dladm</span>
<span id="cb5-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">LINK</span>                    CLASS      MTU    STATE    OVER</span>
<span id="cb5-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">net0</span>                    phys       1500   up       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--</span></span>
<span id="cb5-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">mypc/net0</span>               vnic       1500   up       net0</span></code></pre></div></div>
</section>
<section id="mounting-filesystems" class="level1">
<h1>Mounting filesystems</h1>
<p>It is possible to mount a filesystem from the host (technical term is “from the global zone”) for it to be accessible to another zone:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> zonecfg <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-z</span> mypc</span>
<span id="cb6-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> add fs</span>
<span id="cb6-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc:fs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> set type=lofs</span>
<span id="cb6-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc:fs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> set special=/shared</span>
<span id="cb6-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc:fs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> sed dir=/usr/shared</span>
<span id="cb6-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc:fs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> set options=ro</span>
<span id="cb6-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc:fs</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> end</span>
<span id="cb6-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:mypc</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> exit</span></code></pre></div></div>
<p>In this case, the directory <code>/shared</code> from the global zone will be shared read-only as the directory <code>/usr/shared</code> in the zone <code>mypc</code>. This doesn’t work if the zone is currently running, and you have to reboot it (<code>zoneadm shutdown</code>, <code>zoneadm boot</code>) for it to work.</p>
</section>
<section id="isolated-networks" class="level1">
<h1>Isolated networks</h1>
<p>Using the concept of virtual network interfaces, we can create two zones, with two different IPs, that can communicate with each other, but not with the rest of the world.</p>
<p>First we create (in the global zone) a bridge, and two network interfaces that are connected to this bridge:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> dladm create-etherstub bridge1</span>
<span id="cb7-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> dladm create-vnic <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-l</span> bridge1 eth1</span>
<span id="cb7-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> dladm create-vnic <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-l</span> bridge1 eth2</span></code></pre></div></div>
<p>Now we need to create two zones: the first one will use <code>eth1</code>, the second one <code>eth2</code>. While creating the zones, we also need to remove the default internet interface:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> zonecfg <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-z</span> pc1</span>
<span id="cb8-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:pc1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> set zonepath=/zones/pc1</span>
<span id="cb8-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:pc1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> remove anet</span>
<span id="cb8-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:pc1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> add net</span>
<span id="cb8-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:pc1:net</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> set physical=eth1</span>
<span id="cb8-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:pc1:net</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> end</span>
<span id="cb8-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:pc1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> info</span>
<span id="cb8-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonename:</span> pc1</span>
<span id="cb8-9"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonepath:</span> /zones/pc1</span>
<span id="cb8-10"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">brand:</span> solaris</span>
<span id="cb8-11"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">net</span> 0:</span>
<span id="cb8-12">        <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">physical:</span> eth1</span>
<span id="cb8-13"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">zonecfg:pc1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> exit</span></code></pre></div></div>
<p>and the same for <code>pc2</code>.</p>
<p>Now we only need to fix the IP addresses when booting the zone for the first time :</p>
<p><img src="https://members.loria.fr/EJeandel/posts/solaris/b.png" class="img-fluid"></p>
<p>or do it afterwards:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">pc1%</span> ipadm create-ip eth1</span>
<span id="cb9-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">pc1%</span> ipadm create-addr <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-T</span> static <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-a</span> local=10.0.0.1/24 eth1/v4</span></code></pre></div></div>
<p>From the global zone, here is how the network interfaces appear:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb10-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">solaris%</span> dladm</span>
<span id="cb10-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">LINK</span>                    CLASS      MTU    STATE    OVER</span>
<span id="cb10-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">net0</span>                    phys       1500   up       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--</span></span>
<span id="cb10-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">bridge1</span>                 etherstub  9000   unknown  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--</span></span>
<span id="cb10-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">eth1</span>                    vnic       9000   up       bridge1</span>
<span id="cb10-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">eth2</span>                    vnic       9000   up       bridge1</span>
<span id="cb10-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">pc1/eth1</span>                vnic       9000   up       bridge1</span>
<span id="cb10-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">pc2/eth2</span>                vnic       9000   up       bridge1</span></code></pre></div></div>
</section>
<section id="next-time" class="level1">
<h1>Next Time</h1>
<p>Next Time, we examine FreeBSD jails.</p>


</section>

 ]]></description>
  <category>namespaces</category>
  <guid>https://members.loria.fr/EJeandel/posts/solaris/</guid>
  <pubDate>Tue, 19 Mar 2024 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Namespaces (part 1) : Plan 9</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/plan9/</link>
  <description><![CDATA[ 






<p>This is the first posts in a series of posts about namespaces, and how OS other than Linux implement some form of namespaces.</p>
<p>The series starts with <a href="https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs">Plan 9</a>.</p>
<p>If you want to learn more about Plan 9, I’d suggest the series of youtube videos by <a href="https://www.youtube.com/@adventuresin9797">adventuresin9</a> which, contrary to most of the official docs, does a good job at explaining how everything works.</p>
<p>The commands here have been tested with 9front, as sink network interfaces do not seme to exist in original Plan 9. I won’t pretend I understand everything that happens behind the scenes.</p>
<section id="plan-9" class="level1">
<h1>Plan 9</h1>
<p>Plan 9 adheres to the Unix philosophy that “everything is a file” and put it to the extreme (note that Plan 9 is not an Unix, even though it might look very similar at first).</p>
<p>Not only is everything a file (including most devices), but every communication with the files are done using open/read/write, and there is no use for peculiar ioctl.</p>
<p>For instance, to connect to a TCP server, you just need to open the file <code>/net/tcp/clone</code> to create a tcp connection, and read a number <code>N</code> from it. Next you can write <code>connect 10.0.0.1!80</code> to the file <code>/net/tcp/N/ctl</code> to connect to the given address, and then communicate with the distant server using the file <code>/net/tcp/N/data</code>. This can be scripted of course.</p>
<p>Similarly, to kill a process, one can just do <code>echo kill &gt; /proc/PID/ctl</code>.</p>
<p>Another peculiarity is that the filesystem is <em>per process</em>. Every process can mount/bind a volume and it will only be seen from that process. For instance, mounting a usb key in one terminal does not mean the usb key will be seen in another.</p>
</section>
<section id="mount-namespaces" class="level1">
<h1>Mount namespaces</h1>
<p>This means it is particularly simple to have a process with a completely different filesystem than the other processes (technically that is always the case in plan 9 !).</p>
<p>For instance, suppose that your HOME directory is <code>/usr/glenda</code>. By typing the following command in a terminal:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bind</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> /some_directory /usr/glenda</span></code></pre></div></div>
<p><code>/usr/glenda</code> now contains the content of <code>/some_directory</code> and your process cannot see the original files in <code>/usr/glenda</code> anymore.</p>
<p>There is a small problem however. Using the command <code>ns</code>, the user can see all mounted volumes, and will see:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">term%</span> ns</span>
<span id="cb2-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bind</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#c'</span> /dev</span>
<span id="cb2-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bind</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#d'</span> /fd</span>
<span id="cb2-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">...</span></span>
<span id="cb2-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bind</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> /some_directory /usr/glenda</span></code></pre></div></div>
<p>so the user can do</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">unmount</span> /usr/glenda</span></code></pre></div></div>
<p>to see the original files !</p>
<p>If you want to protect the files correctly, the best is to create another root entirely, without the executable <code>bin/unmount</code>. Or, at the very least, you should also remount <code>/bin</code> to exclude the file <code>bin/unmount</code>.</p>
</section>
<section id="network-namespaces" class="level1">
<h1>Network namespaces</h1>
<p>Mounting different directories as <code>/net</code>, it is easy to have different processes see different network stacks.</p>
<p>In the following I will illustrate this with a recipe to have two environments that thinks they have IP 10.0.0.1 and 10.0.0.2 respectively on two different network cards.</p>
<p>Here are the commands. First we create two empty directories <code>/tmp/net.1</code> and <code>/tmp/net.2</code> and associate each of them with a virtual network card.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> /tmp/net.1</span>
<span id="cb4-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> /tmp/net.2</span>
<span id="cb4-3"></span>
<span id="cb4-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bind</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-a</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#l1:sink ea=001122334402'</span> /tmp/net.1</span>
<span id="cb4-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bind</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-a</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#I1'</span> /tmp/net.1</span>
<span id="cb4-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bind</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-a</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#l2:sink ea=deadbeef0011'</span> /tmp/net.2</span>
<span id="cb4-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bind</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-a</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#I2'</span> /tmp/net.2</span></code></pre></div></div>
<p>Intuitively, the first bind adds the network interface <code>/ether1</code> (resp. <code>/ether2</code>) to the <code>/tmp/net.X</code> directory. The second binds adds the layer 3/4 services (IP/ICMP/UDP/TCP) for that network interface. The <code>sink</code> argument says the network card is virtual. The <code>ea</code> argument is for the ethernet address.</p>
<p>Now we build a bridge, and connect both interfaces to the bridge:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bind</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-a</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#B1'</span> /net</span>
<span id="cb5-2"></span>
<span id="cb5-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bind ether port1 0 /tmp/net.1/ether1'</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> /net/bridge1/ctl</span>
<span id="cb5-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bind ether port2 0 /tmp/net.2/ether2'</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> /net/bridge1/ctl</span></code></pre></div></div>
<p>and we add IP addresses to these interfaces:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip/ipconfig</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-x</span> /tmp/net.1 ether /tmp/net.1/ether1 10.0.0.1 255.255.255.0</span>
<span id="cb6-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip/ipconfig</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-x</span> /tmp/net.2 ether /tmp/net.2/ether2 10.0.0.2 255.255.255.0</span></code></pre></div></div>
<p>Now we want to open two terminals: one where the network is given by what is currently in <code>/tmp/net.1</code> and the other by what is currently in <code>/tmp/net.2</code>. But remember, all these commands were written in one terminal (say, terminal A) and the filesystemsa are per process, so terminals other than terminal A won’t see what are in these directories.</p>
<p>So we can’t do <code>bind /tmp/net.1 /net</code> on one process, as their <code>/tmp/net.1</code> directory is empty.</p>
<p>To do that correctly, we will use <code>srvfs</code>, as a relay file server. Everything is <code>/srv</code> is seen everywhere, so we will put our two configurations directories inside <code>/srv</code> with the commands</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">srvfs</span> pc1 /tmp/net.1</span>
<span id="cb7-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">srvfs</span> pc2 /tmp/net.2</span></code></pre></div></div>
<p>This creates directories <code>/srv/pc1</code> and <code>/srv/pc2</code>.</p>
<p>Now, on two different terminals, we can do <code>mount /srv/pc1 /net</code> and <code>mount /srv/pc2 /net</code>, and these two different terminals will use the two virtual interfaces as their default interfaces. You can then try <code>ip/ping 10.0.0.2</code> from the first terminal.</p>
<p>The same remark as the last section applies: each terminal can still do <code>unmount /net</code> to recover the original network interface. Some more work has to be done to prevent the use of <code>unmount</code>.</p>
</section>
<section id="remarks" class="level1">
<h1>Remarks</h1>
<p>There were a few namespace things that I wasn’t able to do. Some of them, after some thinking, might not make sense given how the OS is structured. In particular, I would like to have terminals with different PID namespaces (and therefore different /proc namespaces). I don’t see anything that would break with that in place, but I certainly didn’t look closely enough.</p>
</section>
<section id="next-time" class="level1">
<h1>Next Time</h1>
<p>Next Time, we examine Solaris zones.</p>


</section>

 ]]></description>
  <category>namespaces</category>
  <guid>https://members.loria.fr/EJeandel/posts/plan9/</guid>
  <pubDate>Sat, 09 Mar 2024 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Using sagemath with docker/podman</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/sage/</link>
  <description><![CDATA[ 






<p>Sage is typically the kind of program that should be executed in a container, as it requires a lot of libraries with very precise versions, and you might not use most of them for other purposes.</p>
<p>Here is how to use Sage with docker or podman. The use case is as follows: you don’t want to be root to execute the commands. (If you use docker, you will still need to be in the docker group or something)</p>
<section id="docker" class="level1">
<h1>Docker</h1>
<p>Assuming you’re in the docker group, you can install sage with the command</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">docker</span> pull sagemath/sagemath</span></code></pre></div></div>
<p>You can then run sage with one of the following commands (sage or jupyter)</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">docker</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-it</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--rm</span> sagemath</span>
<span id="cb2-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">docker</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--rm</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span> 8888:8888 sagemath/sagemath sage-jupyter</span></code></pre></div></div>
<p>(add <code>-it</code> to the last command if you want to be able to quit it from the command line)</p>
<p>Now suppose you want to share the directory <code>my_directory</code> with sage/jupyter.</p>
<p>You can do it this way:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">docker</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--rm</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span> 8888:8888 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-v</span> my_directory:/home/sage/notebooks sagemath/sagemath sage-jupyter</span></code></pre></div></div>
</section>
<section id="podman" class="level1">
<h1>Podman</h1>
<p>podman is my preferred solution, because it doesn’t require you to be root.</p>
<p>The first commands are almost identical:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">podman</span> pull docker.io/sagemath/sagemath</span>
<span id="cb4-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">podman</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-it</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--rm</span> sagemath</span>
<span id="cb4-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">podman</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--rm</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span> 8888:8888 sagemath sage-jupyter</span></code></pre></div></div>
<p>The difficulty is how to share a directory.</p>
<p>The obvious solution would be:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">podman</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-it</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--rm</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span> 8888:8888  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--userns</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>keep-id <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-v</span> my_directory:/home/sage/notebooks:Z sagemath sage-jupyter</span></code></pre></div></div>
<p>but it doesn’t work with the default storage driver. The <code>--userns=keep-id</code> option requires essentially podman to do a <code>chmod -R</code> on the whole volume. However, with the overlay driver, podman can’t do it efficiently and instead needs to copy all of the files again. It takes a thousand of minutes.</p>
<p>There are two solutions.</p>
<section id="first-solution" class="level2">
<h2 class="anchored" data-anchor-id="first-solution">First solution</h2>
<p>The first solution is to change the storage driver to use fuse-overlayfs. You can do it globally, by changing the file <code>~/.config/containers/storage.conf</code>:</p>
<pre><code>[storage]
  driver = "overlay"
[storage.options.overlay]  
  mount_program=  "/usr/bin/fuse-overlayfs"</code></pre>
<p>and then the previous command works:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">podman</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-it</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--rm</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span> 8888:8888  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--userns</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>keep-id <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-v</span> my_directory:/home/sage/notebooks:Z sagemath sage-jupyter</span></code></pre></div></div>
<p>However, this means using <code>fuse-overlayfs</code> for all images and not only for sage. Another solution is to specify it on the command line:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">podman</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-it</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--rm</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span> 8888:8888  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--storage-opt</span> overlay.mount_program=/usr/bin/fuse-overlayfs <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--userns</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>keep-id <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-v</span> my_directory:/home/sage/notebooks:Z sagemath sage-jupyter</span></code></pre></div></div>
</section>
<section id="second-solution" class="level2">
<h2 class="anchored" data-anchor-id="second-solution">Second solution</h2>
<p>A different solution is to be root inside the container, instead of user 200:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">podman</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-it</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--rm</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p8888:8888</span>  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--user</span> 0 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-v</span> /home/ejeandel/sage:/home/sage/notebooks:Z sagemath sage-jupyter <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--allow-root</span></span></code></pre></div></div>
<p>Being root inside the container is not always the best, but I don’t think it’s a problem for this specific use.</p>


</section>
</section>

 ]]></description>
  <category>docker</category>
  <category>podman</category>
  <category>sage</category>
  <guid>https://members.loria.fr/EJeandel/posts/sage/</guid>
  <pubDate>Sun, 03 Mar 2024 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Accessing Windows machines from UL</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/citrix/</link>
  <description><![CDATA[ 






<p>Université de Lorraine provides the personnel and students with virtual machines with Windows that you can access for a few applications, among which Microsoft Office. This is useful if you have to edit Microsoft Word documents and LibreOffice doesn’t work.</p>
<p>To access the machines, you should use Citrix Workspace App.</p>
<section id="installation-of-citrix-workspace-app" class="level1">
<h1>Installation of Citrix Workspace App</h1>
<ul>
<li><p>Go to https://www.citrix.com/downloads/workspace-app/linux/workspace-app-for-linux-latest.html and install the application</p></li>
<li><p>On my Debian system, I also needed to install the package <code>libwebkit2gtk-4.0-37</code> for it to work</p></li>
<li><p>Copy the certificate for Comodo from firefox to Citrix:</p></li>
</ul>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cp</span> /usr/share/ca-certificates/mozilla/Comodo_AAA_Services_root.crt /opt/Citrix/ICAClient/keystore/cacerts/AAA.pem</span>
<span id="cb1-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">/opt/Citrix/ICAClient/util/ctx_rehash</span> </span></code></pre></div></div>
<ul>
<li>I have tried taking directly the ca-ul.pem certificate instead, but it seems to be different from the virtul certificate.</li>
</ul>
<section id="user-install" class="level2">
<h2 class="anchored" data-anchor-id="user-install">User install</h2>
<ul>
<li><p>Alternatively, you can download the <code>.tar.gz</code> version, make a <code>icaclient</code> directory and untar it inside the <code>icaclient</code> directory (the tar doesn’t create a directory…) and launch the <code>setupwfc</code> script inside to install it</p></li>
<li><p>Then the previous lines work mutatis mutandis to put the certificate.</p></li>
</ul>
</section>
</section>
<section id="launch" class="level1">
<h1>Launch</h1>
<p>Just launch</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">/opt/Citrix/ICAClient/selfservice</span></span></code></pre></div></div>
<p>Put <code>virtul.univ-lorraine.fr</code> as the server. You should probably configure the app so that your HOME directory appears inside the virtual machine, by clicking on settings.</p>


</section>

 ]]></description>
  <category>univ-lorraine</category>
  <guid>https://members.loria.fr/EJeandel/posts/citrix/</guid>
  <pubDate>Sat, 22 Apr 2023 22:00:00 GMT</pubDate>
</item>
<item>
  <title>How TikZ works - How angles are converted to Bezier curves</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/tikz/</link>
  <description><![CDATA[ 






<p>This is the first of possibly (?) a series of articles on how tikz and <a href="https://ctan.org/pkg/pgf">PGF</a> work.</p>
<p>The reason I had to read precisely the code of PGF is because I wanted to export some features of PGF in my own software, <a href="https://github.com/ejeandel/pygf">pygf</a>.</p>
<p>It is important to note that all dimensions in TeX, internally, use <em>scaled points</em>, which are 1/65536th of a point, where a point is 1/72.27 inches, and an inch is 2.54cm. Every number in TeX is a multiple of a scaled point, which means TeX internally uses fixed point arithmetic</p>
<p>Some of the code I will expose here will seem convoluted, but that’s because it is trying to circumvent some limitations of the fixed point arithmetic inside TeX in order to do some computations</p>
<section id="edges-and-angles-in-tikz" class="level1">
<h1>Edges and angles in TikZ</h1>
<p>I will explain here what happens when you write</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode latex code-with-copy"><code class="sourceCode latex"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">\draw</span> (0,0) edge[in=90,out=60] (5,0);</span></code></pre></div></div>
<p>This draws a curvy edge between the points <img src="https://latex.codecogs.com/png.latex?(0,0)"> and <img src="https://latex.codecogs.com/png.latex?(5,0)">, in such a way that the curve leaves the first point with angle 60 degrees, and goes into the second point with angle 90 degrees.</p>
<p>Internally, this is converted into a Bezier curve, that starts at the first point, and ends at the second point. The only thing that needs to be specified are the control points.</p>
<p>Here is how they are computed:</p>
<ul>
<li>The distance between the two points is computed.</li>
<li>This distance is multiplied by 255/256 then by 0.3915 to obitan a number <img src="https://latex.codecogs.com/png.latex?d"><br>
</li>
<li>The two control points for the Bezier curve are then defined in the following way:
<ul>
<li>The first control point is at distance d and angle <code>out</code> from the first point.</li>
<li>The second control point is at distance d and angle <code>in</code> from the second point</li>
</ul></li>
</ul>
<p>The first multiplication of the distance by 255/256 is due to the way the distance is computed. Assuming <img src="https://latex.codecogs.com/png.latex?x%20%3E%20y"> and both are positive:</p>
<ul>
<li>The ratio <img src="https://latex.codecogs.com/png.latex?x/%5Csqrt%7Bx%5E2+y%5E2%7D"> is first computed, then multiplied by 65536 and divided by <img src="https://latex.codecogs.com/png.latex?255"> to obtain the number <img src="https://latex.codecogs.com/png.latex?a"></li>
<li><img src="https://latex.codecogs.com/png.latex?x"> is multiplied by 16, then divided by <img src="https://latex.codecogs.com/png.latex?a">, then multiplied again by <img src="https://latex.codecogs.com/png.latex?16">.</li>
</ul>
<p>The complete operation is therefore</p>
<p><img src="https://latex.codecogs.com/png.latex?%2016%5Ctimes%20%5Cleft(%5Cfrac%7B16%20%5Ctimes%20x%7D%7B%5Cfrac%7B65536%20%5Cfrac%7Bx%7D%7B%5Csqrt%7Bx%5E2+y%5E2%7D%7D%7D%7B255%7D%7D%5Cright)%20=%20%5Cfrac%7B255%5Ctimes%2016%20%5Ctimes%2016%20%5Csqrt%7Bx%5E2%20+%20y%5E2%7D%7D%7B65536%7D%20"></p>
<p>Again, this is done by steps, in fixed point arithmetics, so the final result might be slightly different.</p>
<section id="explanation" class="level2">
<h2 class="anchored" data-anchor-id="explanation">Explanation</h2>
<p>So, essentially, what we get is that the first control point is at an angle <code>out</code> from the first point, and at a distance <code>d</code> where <code>d</code> is <img src="https://latex.codecogs.com/png.latex?0.39%20=%200.3915%20%5Ctimes%20255/256"> times the total distance between the two points.</p>
<p>Where does this 0.39 comes from ?</p>
<p>The explanation can be found when looking at what happens when we try</p>
<pre><code>\draw (0,0) edge[in=-90,out=0] (1,1);</code></pre>
<p>This curve leaves the point (0,0) horizontally, and reaches the point (1,1) vertically. It turns out that the factor 0.39 is tuned so this curve looks like a quarter circle.</p>
<p>How to draw a circle using Bezier curve is a well known problem, see for instance this <a href="https://spencermortensen.com/articles/bezier-circle/">page</a>.</p>
<p>One good technique (written in the section “a better approximation” in the previous page) is to take the first control point at coordinates <img src="https://latex.codecogs.com/png.latex?(c,0)"> where <img src="https://latex.codecogs.com/png.latex?c%20=%200.551915"> for a circle of radius 1.</p>
<p>In our case, the coordinates of our control point is given proportionally to the distance between the two points which is <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B2%7D">, which means we put our first control point at coordinate <img src="https://latex.codecogs.com/png.latex?(%5Csqrt%7B2%7D%20p,0)"> where <img src="https://latex.codecogs.com/png.latex?p"> is the factor of proportionality.</p>
<p>Therefore we should take <img src="https://latex.codecogs.com/png.latex?p%20=%200.551915/%5Csqrt%7B2%7D%20=%200.39">.</p>
<p>Looking at additional digits shows that <img src="https://latex.codecogs.com/png.latex?0.3918"> is probably a better choice than <img src="https://latex.codecogs.com/png.latex?0.3915">. I don’t know if the difference comes from intrinsics of the functioning of TeX and LaTeX, or if it is irrelevant.</p>
</section>
</section>
<section id="source" class="level1">
<h1>Source</h1>
<p>The code that converts angles into control points is in the file <code>generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex</code> of tikz, more precisely in the function <code>\tikz@to@compute@distance@main</code>.</p>


</section>

 ]]></description>
  <category>tikz</category>
  <guid>https://members.loria.fr/EJeandel/posts/tikz/</guid>
  <pubDate>Wed, 22 Mar 2023 23:00:00 GMT</pubDate>
</item>
<item>
  <title>List of Publications in HTML</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/bibtex/</link>
  <description><![CDATA[ 






<p>There are many ways to obtain a bibliography in HTML, to include in a webpage.</p>
<p>To specify the problem:</p>
<ul>
<li>the input is a <code>.bib</code> file (or multiple <code>.bib</code> files)</li>
<li>the output is an <code>.html</code> file, or a file that can be included in html.</li>
</ul>
<p>I won’t discuss in particular solutions that embed hal in your webpage for instance.</p>
<p>The input .bib file I will use for the test is the following:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bibtex code-with-copy"><code class="sourceCode bibtex"><span id="cb1-1"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">@InProceedings</span>{<span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">article1</span>,</span>
<span id="cb1-2">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">author</span> =   {Emmanuel Jeandel and Jeannot Lapin},</span>
<span id="cb1-3">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">title</span> =    {Is Bibtex good},</span>
<span id="cb1-4">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">booktitle</span> =       "<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">International Colloquium on Bibtex (ICB)</span>",</span>
<span id="cb1-5">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">year</span> =            2020,</span>
<span id="cb1-6">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">url</span> = "<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">http://not.a.real.url</span>",</span>
<span id="cb1-7">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">abstract</span> = "<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">This is an abstract</span>"</span>
<span id="cb1-8">}</span>
<span id="cb1-9"></span>
<span id="cb1-10"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">@Article</span>{<span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">article2</span>,</span>
<span id="cb1-11">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">author</span> =   {Emmanuel Jeandel},</span>
<span id="cb1-12">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">title</span> =    {HTML and Bibtex},</span>
<span id="cb1-13">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">journal</span> =      {Theory of HTML},</span>
<span id="cb1-14">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">pages</span> = "<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">12--49</span>",</span>
<span id="cb1-15">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">volume</span> = 12,</span>
<span id="cb1-16">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">year</span> =     2023,</span>
<span id="cb1-17">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">url</span> = "<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">http://a.real.url</span>",          </span>
<span id="cb1-18">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">abstract</span> = "<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> HTML is good</span>",</span>
<span id="cb1-19">}</span></code></pre></div></div>
<p>To continue with the specs:</p>
<ul>
<li>I want the abstract to be written on the HTML page</li>
<li>I want a download link to be written on the HTML page</li>
<li>The bibtex file might contain a few tex commands (typically math symbols in the abstract, and potentially accents in the author field)</li>
</ul>
<p>I will discuss a few solutions to this problem. The solution I use is the last one. You will see it is prettier and corresponds exactly to my needs, but that doesn’t mean that the other are unsuitable: I have of course taken more time to prettify the solution I use.</p>
<section id="pandoc" class="level2">
<h2 class="anchored" data-anchor-id="pandoc">Pandoc</h2>
<p>Pandoc can directly convert <code>.bib</code> files to <code>.html</code> with the command</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">pandoc</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-C</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-f</span> bibtex toto.bib <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--csl</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mine.csl <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> html</span></code></pre></div></div>
<p>If we launch pandoc on the previous file, we obtain the following output:</p>
<div id="refs" class="references csl-bib-body" data-entry-spacing="1">
<div id="ref-article1" class="csl-entry">
<ol type="1">
<li>Emmanuel Jeandel and Jeannot Lapin. <strong>Is Bibtex good</strong>. In <em>International Colloquium on Bibtex (ICB)</em>, 2020. DL:<a href="http://not.a.real.url">http://not.a.real.url</a> Abstract:This is an abstract</li>
</ol>
</div>
<div id="ref-article2" class="csl-entry">
<ol start="2" type="1">
<li>Emmanuel Jeandel. <strong>HTML and Bibtex</strong>. <em>Theory of HTML</em>, 12:12–49, (2023). DL:<a href="http://a.real.url">http://a.real.url</a> Abstract:HTML is good</li>
</ol>
</div>
</div>
<p>Style files for pandoc/citeproc are in the <a href="https://citationstyles.org/">CSL format</a>. (The file <a href="mine.csl">mine.csl</a> I used is customized from the ACM format) The result is good if to be included in an article, but not perfect for a webpage. I found it difficult in particular to customize some parts of the output, in particular the href parts, and the abstract parts.</p>
</section>
<section id="bibtex2html" class="level2">
<h2 class="anchored" data-anchor-id="bibtex2html">Bibtex2html</h2>
<p>Another solution is to use <a href="https://www.lri.fr/~filliatr/bibtex2html/">bibtex2html</a>.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">bibtex2html</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-nobibsource</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-nokeywords</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-s</span> dsgplain <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-linebreak</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-d</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-r</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-dl</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-nodoc</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-noheader</span>     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-nf</span> url <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DL"</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-nofooter</span> publis.bib</span></code></pre></div></div>
<p>Here is the output:</p>
<dl>
<dt>
[<a name="article2">1</a>]
</dt>
<dd>
Emmanuel Jeandel. <b>HTML and Bibtex</b>. <em>Theory of HTML</em>, 12:12–49, 2023.<br> [&nbsp;<a href="http://a.real.url">DL</a>&nbsp;]
<blockquote class="blockquote">
<font size="-1"> HTML is good </font>
</blockquote>
</dd>
<dt>
[<a name="article1">2</a>]
</dt>
<dd>
Emmanuel Jeandel and Jeannot Lapin. <b>Is Bibtex good</b>. In <em>International Colloquium on Bibtex (ICB)</em>, 2020.<br> [&nbsp;<a href="http://not.a.real.url">DL</a>&nbsp;]
<blockquote class="blockquote">
<font size="-1"> This is an abstract </font>
</blockquote>
</dd>
</dl>
<p>The <code>-dl</code> option is to use HTML DL lists rather than tables, which makes the output look nicer imho. The <code>-d -r</code> options are to sort by date in reverse order.</p>
<p>The output is nicer and that’s what I have been using for some time. The <code>dsgplain.bst</code> file is very standard, and any other bibtex style would have worked really. I was not completely happy with the DL lists, but the result is customizable. I didn’t find a way to put <code>class</code> on every tag so that I could customize it entirely, but it’s still quite good.</p>
</section>
<section id="a-silly-attempt" class="level2">
<h2 class="anchored" data-anchor-id="a-silly-attempt">A silly attempt</h2>
<p>Another possible solution is to actually create a <code>.bst</code> file for bibtex in such a way that the output is directly HTML. Once you understand how <code>.bst</code> files work (it uses reverse polish, à-la forth and postscript) , this is not hard.</p>
<p>I didn’t choose this solution for one reason: my <code>.bib</code> files might contain latex commands (for accents and math) and using this solution means the latex commands would be put in the HTML verbatim. I realized this very soon and didn’t pursue this solution.</p>
</section>
<section id="the-final-result" class="level2">
<h2 class="anchored" data-anchor-id="the-final-result">The final result</h2>
<p><code>bibtex</code> is very good at producing <code>.tex</code> files from <code>.bib</code>. I realized that the best solution in my case was to use the following workflow:</p>
<ul>
<li>Convert the <code>.bib</code> into a <code>.tex</code> (actually a <code>.bbl</code>) using bibtex with a customized <code>.bst</code> (bibtex style file)</li>
<li>Convert the <code>.tex</code> into <code>.html</code> using pandoc</li>
</ul>
<p>I use the following script to do all the work:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#!/bin/bash</span></span>
<span id="cb4-2"></span>
<span id="cb4-3"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">X</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>.bib<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb4-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span>  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb4-5"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">\select@language{english}</span></span>
<span id="cb4-6"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">\citation{*}</span></span>
<span id="cb4-7"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">\bibstyle{dsgplain}</span></span>
<span id="cb4-8"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">\bibdata{</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$X</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">}"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>.bib<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span>.aux</span>
<span id="cb4-9"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">bibtex</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>.bib<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb4-10"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">pandoc</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-f</span> latex  <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>.bib<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span>.bbl <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-o</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>.bib<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span>.html</span>
<span id="cb4-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rm</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>.bib<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span>.aux</span>
<span id="cb4-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rm</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>.bib<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">}</span>.blg</span></code></pre></div></div>
<p>Here is the result:</p>
<ol>
<li>
<p>
Emmanuel Jeandel. <strong>HTML and Bibtex</strong>. <span><em>Theory of HTML</em></span>, 12:12–49, 2023 <a href="http://a.real.url">[DL]</a>
</p>
<dl>
<dt>
Abstract
</dt>
<dd>
<p>
HTML is good
</p>
</dd>
</dl>
</li>
<li>
<p>
Emmanuel Jeandel and Jeannot Lapin. <strong>Is Bibtex good</strong>. In <span> <em>International Colloquium on Bibtex (ICB)</em></span>, 2020 <a href="http://not.a.real.url">[DL]</a>
</p>
<dl>
<dt>
Abstract
</dt>
<dd>
<p>
This is an abstract
</p>
</dd>
</dl>
</li>
</ol>
<p><a href="mybst.bst">Here</a> is the .bst file I use for this result.</p>
</section>
<section id="finishing-notes" class="level2">
<h2 class="anchored" data-anchor-id="finishing-notes">Finishing notes</h2>
<p>The last solution is actually not what I’m using. My workflow is a bit more complex: As I use quarto for my webpage, I decided to convert the <code>.tex</code> into markdown using pandoc, and then process the markdown with quarto.</p>
<p>This made me able to have a presentation of abstracts that is better than the previous example and can be collapsed (see my publications page on the top).</p>
<p>Something tricky happened however. When you convert the first bibtex entry above in markdown, here is what you obtain:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb5-1"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">1.  </span>Emmanuel Jeandel. **HTML and Bibtex**. *Theory of HTML*, 12:12--49,</span>
<span id="cb5-2">    2023 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">\[DL\]</span><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">](http://a.real.url)</span></span>
<span id="cb5-3"></span>
<span id="cb5-4">    Abstract</span>
<span id="cb5-5"></span>
<span id="cb5-6">    :   HTML is good</span>
<span id="cb5-7"></span></code></pre></div></div>
<p>Notice that the second line starts with <code>2023</code>. If I had put a period at the end of the year (to obtain <code>2023.</code> instead of <code>2023</code>), this could have been interpreted by pandoc/quarto to represent the beginning of a numbered list !</p>
<p>I still haven’t found a satisfying solution to this problem, outside of hacks.</p>


</section>

 ]]></description>
  <category>pandoc</category>
  <guid>https://members.loria.fr/EJeandel/posts/bibtex/</guid>
  <pubDate>Tue, 28 Feb 2023 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Configuring your workstation at loria</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/loria/</link>
  <description><![CDATA[ 






<p>This post will explain how I configure my workstation at loria to use all services I deem necessary (printer, mail, etc).</p>
<p>There are multiple ways to configure all of these, and this is just the workflow I currently use.</p>
<section id="note" class="level2">
<h2 class="anchored" data-anchor-id="note">Note</h2>
<p>Many of the configuration below needs to know your inria password. I personally use secret-tools to connect with <a href="https://keepassxc.org/">keepassxc</a></p>
<p>The line</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">secret-tool</span> lookup pass zimbra</span></code></pre></div></div>
<p>is how I obtain my zimbra password kept in keepassxc for instance.</p>
<p>Replace this with your preferred method to obtain passwords.</p>
</section>
<section id="mail-user-agent-mutt" class="level2">
<h2 class="anchored" data-anchor-id="mail-user-agent-mutt">Mail user Agent (mutt)</h2>
<p>My preferred MUA is <a href="http://www.mutt.org">mutt</a></p>
<p>Here is the configuration I use.</p>
<p>Common configuration:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">mailboxes</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'imaps://zimbra.inria.fr:993/'</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'imaps://imap.univ-lorraine.fr:993/'</span></span></code></pre></div></div>
<p>For Loria:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span> my_pw_inria=<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">`</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">secret-tool</span> lookup pass zimbra<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">`</span></span>
<span id="cb3-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">account-hook</span> imaps://zimbra.inria.fr:993/ <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'set imap_user=mynickname imap_pass=$my_pw_inria'</span></span>
<span id="cb3-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">folder-hook</span> imaps://zimbra.inria.fr:993/ my_hdr From: myfirstname.mylastname@loria.fr</span>
<span id="cb3-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">folder-hook</span> imaps://zimbra.inria.fr:993/ <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'set record=imaps://zimbra.inria.fr:993/Sent'</span></span></code></pre></div></div>
<p>And for UL:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span> my_pw_ul=<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">`</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">secret-tool</span> lookup pass ul<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">`</span></span>
<span id="cb4-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">account-hook</span> imaps://imap.univ-lorraine.fr:993/ <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'set imap_user=mynickname imap_pass=$my_pw_ul'</span></span>
<span id="cb4-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">folder-hook</span> imaps://imap.univ-lorraine.fr:993/ my_hdr From: myfirstname.mylastname@univ-lorraine.fr</span>
<span id="cb4-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">folder-hook</span> imaps://imap.univ-lorraine.fr:993/ <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'set record=imaps://imap.univ-lorraine.fr:993/Sent'</span></span></code></pre></div></div>
</section>
<section id="mail-transfer-agent-msmtp" class="level2">
<h2 class="anchored" data-anchor-id="mail-transfer-agent-msmtp">Mail Transfer Agent (msmtp)</h2>
<p>My preferred MTA is <a href="https://marlam.de/msmtp/">msmtp</a></p>
<p>Here is the configuration for loria:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">account</span> default</span>
<span id="cb5-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">host</span> smtp.inria.fr</span>
<span id="cb5-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">from</span> myfirstname.mylastname@loria.fr</span>
<span id="cb5-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">port</span> 587</span>
<span id="cb5-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">auth</span> on</span>
<span id="cb5-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">user</span> mynickname</span>
<span id="cb5-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">passwordeval</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/usr/bin/secret-tool lookup pass zimbra"</span></span>
<span id="cb5-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tls</span> on</span></code></pre></div></div>
<p>and for UL:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">account</span> ul</span>
<span id="cb6-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">host</span> smtp.univ-lorraine.fr</span>
<span id="cb6-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">from</span> firstname.lastname@univ-lorraine.fr</span>
<span id="cb6-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">port</span> 587</span>
<span id="cb6-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">auth</span> on</span>
<span id="cb6-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">user</span> mynickname@univ-lorraine.fr</span>
<span id="cb6-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">passwordeval</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/usr/bin/secret-tool lookup pass ul"</span></span>
<span id="cb6-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tls</span> on</span></code></pre></div></div>
<p>and of course the mutt-msmtp interaction in the mutt configuration file:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span> sendmail=<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/usr/bin/msmtp"</span></span></code></pre></div></div>
</section>
<section id="calendar" class="level2">
<h2 class="anchored" data-anchor-id="calendar">Calendar</h2>
<p>My software of choice for calendars is <a href="https://lostpackets.de/khal/">khal</a>. It essentially pilots a <em>local</em> directory of icalendars, so configuring it to work with the Loria calendar essentially amounts to explain how to synchronize the local directories with the zimbra calendar, which is done with <a href="https://github.com/pimutils/vdirsyncer">vdirsyncer</a>.</p>
<p>There is nothing specific in khal about my setup, everything happens in vdirsyncer.</p>
<p>Configuration is split into three parts: the Loria zimbra calendar, the UL zimbra calendar, and the ADE calendar.</p>
<p>For the Loria zimbra calendar:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[storage</span> zimbra]</span>
<span id="cb8-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"caldav"</span></span>
<span id="cb8-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">url</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://zimbra.inria.fr/dav/firstname.lastname@loria.fr"</span></span>
<span id="cb8-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">username</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nick"</span></span>
<span id="cb8-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">auth</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"basic"</span></span>
<span id="cb8-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">password.fetch</span> = [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"command"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"secret-tool"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lookup"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pass"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zimbra"</span>]</span>
<span id="cb8-7"></span>
<span id="cb8-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[storage</span> zimbra_local]</span>
<span id="cb8-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"filesystem"</span></span>
<span id="cb8-10"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">path</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"~/.calendars/zimbra"</span></span>
<span id="cb8-11"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">fileext</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".ics"</span></span>
<span id="cb8-12"></span>
<span id="cb8-13"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[pair</span> zimbra_pair]</span>
<span id="cb8-14"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">a</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zimbra"</span></span>
<span id="cb8-15"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">b</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zimbra_local"</span></span>
<span id="cb8-16"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">conflict_resolution</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a wins"</span></span>
<span id="cb8-17"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">collections</span> = <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Calendar"</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">]</span></span></code></pre></div></div>
<p>For the UL zimbra calendar, replace all instances of <code>zimbra</code> by <code>ul</code> and the url is now: <code>https://mail.univ-lorraine.fr/dav/firstname.lastname@univ-lorraine.fr</code></p>
<p>Finally, for the ADE calendar, you first need to know its address:</p>
<ul>
<li>Click on <a href="https://monade.univ-lorraine.fr">monade</a></li>
<li>Click on the “Export Agenda button” on the top right</li>
<li>Click on “Generate URL”</li>
<li>Change the dates in the URL to be from early september to late august.</li>
</ul>
<p>Now you can configure the calendar:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[storage</span> ade_remote]</span>
<span id="cb9-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"http"</span></span>
<span id="cb9-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">url</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://adeical.univ-lorraine.fr/..."</span></span>
<span id="cb9-4"></span>
<span id="cb9-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[storage</span> ade_local]</span>
<span id="cb9-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"filesystem"</span></span>
<span id="cb9-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">path</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"~/.calendars/ade"</span></span>
<span id="cb9-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">fileext</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".ics"</span></span>
<span id="cb9-9"></span>
<span id="cb9-10"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">[pair</span> ade_pair]</span>
<span id="cb9-11"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">a</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ade_remote"</span></span>
<span id="cb9-12"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">b</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ade_local"</span></span>
<span id="cb9-13"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">conflict_resolution</span> = <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a wins"</span></span>
<span id="cb9-14"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">collections</span> = null</span></code></pre></div></div>
<p>Note that you usually need to change the URL every year.</p>
<p>The usage of vdirsyncer is simple: just <code>vdirsyncer discover</code> the first time, then <code>vdirsyncer sync</code> everytime you want so sync.</p>
</section>
<section id="nextcloud-ul" class="level2">
<h2 class="anchored" data-anchor-id="nextcloud-ul">NextCloud (UL)</h2>
<p>You can use the official nextcloud server to connect to the University Nextcloud of course. You can also use <a href="https://rclone.org/">rclone</a></p>
<ul>
<li><p>First launch <a href="https://bul.univ-lorraine.fr">BUL</a>. In Sécurité, you can add an “application password” that will be specific to rclone</p></li>
<li><p>Then you can launch <code>rclone config</code>:</p>
<ul>
<li>Select <code>WebDav</code> then <code>nextcloud</code></li>
<li>The URL to enter is <code>https://bul.univ-lorraine.fr/remote.php/webdav</code></li>
</ul></li>
</ul>
</section>
<section id="printer" class="level2">
<h2 class="anchored" data-anchor-id="printer">Printer</h2>
<p>Two notes:</p>
<ul>
<li>You don’t need to install a cups server (but you need a cups client)</li>
<li>You don’t need <code>cups-browsed</code></li>
</ul>
<p>The easiest way to make printing works is to create a file <code>~/.cups/client.conf</code> with the following line</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb10-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ServerName</span> cups-nge.inria.fr:631/version=1.1</span></code></pre></div></div>
<p>And that’s it. It’s also useful (but not mandatory) to configure <code>~/.cups/lpoptions</code> with:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb11-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">Default</span> printer-bw-nge Duplex=DuplexNoTumble OptionDuplex=True PageSize=A4</span></code></pre></div></div>
<p>so you don’t have to specify the printer each time.</p>


</section>

 ]]></description>
  <category>univ-lorraine</category>
  <category>loria</category>
  <guid>https://members.loria.fr/EJeandel/posts/loria/</guid>
  <pubDate>Fri, 24 Feb 2023 23:00:00 GMT</pubDate>
</item>
<item>
  <title>How to transform html tables into org-mode tables</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/pandoc/</link>
  <description><![CDATA[ 






<p>Sometimes for my work, I find tables in HTML files on the web that I need to process.</p>
<p>There are of course many ways to do it, you can cut and paste them from your browser (which leaves you with tab-separated text files that you can process with <code>awk</code>), you can also process the HTML directly with things like <code>BeautifulSoup</code>.</p>
<p>A solution that works quite well is to convert the HTML tables to org-mode tables, and then use org-mode on emacs (this assumes you use emacs of course).</p>
<p>Pandoc makes it easy to do so. Just type</p>
<pre><code>pandoc -t org toto.html -o toto.org</code></pre>
You can use for instance to process the current file. In this case, the following table:
<table>
<thead>
<tr>
<th>
Company
</th>
<th>
Contact
</th>
<th>
Country
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Alfreds Futterkiste
</td>
<td>
Maria Anders
</td>
<td>
Germany
</td>
</tr>
<tr>
<td>
Centro comercial Moctezuma
</td>
<td>
Francisco Chang
</td>
<td>
Mexico
</td>
</tr>
</tbody>
</table>
<p>will become</p>
<pre class="pandoc"><code>| Company                    | Contact         | Country |
|----------------------------+-----------------+---------|
| Alfreds Futterkiste        | Maria Anders    | Germany |
| Centro comercial Moctezuma | Francisco Chang | Mexico  |</code></pre>
<p>It’s not always perfect (sometimes headers are not considered as headers), but that’s usually all you need to process it with org-mode.</p>



 ]]></description>
  <category>pandoc</category>
  <category>emacs</category>
  <guid>https://members.loria.fr/EJeandel/posts/pandoc/</guid>
  <pubDate>Mon, 30 Jan 2023 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Using adb to transfer files between your computer and your android phone (no root)</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/adb/</link>
  <description><![CDATA[ 






<p>Transferring files between your computer and your phone/table is a fun activity, for which you will find many solutions on the net.</p>
<p>In this post, I will explain how I do it using rsync. I’m assuming you know how rsync works and you’re savvy enough with rsync to not delete your entire filesystem.</p>
<p>This assumes your phone is connected with your PC, e.g.&nbsp;with an USB cable (I think bluetooth might also work), and that you can access your phone with adb (for example with adb shell).</p>
<p>The idea is to install a rsync binary on your phone.</p>
<p>First you need to find the architecture of your phone. First launch <code>adb shell</code> and from it the command</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">uname</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-m</span></span></code></pre></div></div>
<p>In my case, the answer is <code>aarch64</code>. The next step is to find a static binary of rsync for this architecture. You can find some on the web, or you can recompile it.</p>
<p>Then install rsync in some directory in your android where you have write access and exec access. On my phone, I put it in <code>/data/local/tmp</code>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">adb</span> push rsync /data/local/tmp/</span></code></pre></div></div>
<p>Now, if you want to access your phone from your computer, say to transfer anything from the directory photos to your computer, you can type the following:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rsync</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"adb shell"</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--rsync-path</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>/data/local/tmp/rsync <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-av</span> exec:/sdcard/photos /photos</span></code></pre></div></div>
<p>In practice, you might need more options for rsync, but, again, I’m assuming you already know how it works.</p>
<section id="remarks" class="level1">
<h1>Remarks</h1>
<ul>
<li>There are a few tutorials for doing this on the net. If you look at old posts, they will usually be more complicated because <code>adb shell</code> used to do CR/LF conversions which means your files and commands will become mangled while passing through adb. This is not a problem anymore.</li>
</ul>


</section>

 ]]></description>
  <category>android</category>
  <guid>https://members.loria.fr/EJeandel/posts/adb/</guid>
  <pubDate>Tue, 24 Jan 2023 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Sandboxed network interfaces using (unprivileged) unshare</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/unshare/</link>
  <description><![CDATA[ 






<p><em>Update 2025-11-03</em> Some commands written in 2023 did not work on my computer in 2025. I slightly changed the text so that everything work again.</p>
<p>Unshare is a linux command that is used to execute commands (and shells) in new namespaces. This can be useful to isolate this command from the main namespaces. Among others, namespaces you can isolate are the PID namespace, the user namespace, and the network namespace.</p>
<p>What is especially nice is that you can change the network namespace without being root!</p>
<p>The command to do that is:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">unshare</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-rn</span></span></code></pre></div></div>
<p>This executes a new shell by default.</p>
<p>As <code>ifconfig</code> or <code>ip addr</code> will show, this new shell will live in a new namespace that doesn’t contain any of your usual network interfaces. It contains the interface <code>lo</code>, but be aware that the interface is down by default.</p>
<p>You will notice that you are root in the new shell, so you can in particular play with the network interfaces.</p>
<p>What can you do with this network namespace that contains no interface ? One use might be to execute commands that you don’t trust.</p>
<p>In this first post, I will explain how you can use these network namespaces to simulate a network of 2 machines:</p>
<ul>
<li>The first machine will have IP <code>10.42.0.2</code></li>
<li>The second machine will have IP <code>10.42.0.3</code></li>
<li>Both machines are on the same local network, and cannot access the real network.</li>
</ul>
<p>In practice, you will have two shells opened (possibly in two terminals), one corresponding to each machine. The filesystem of both machines is still your nominal filesystem, which is usually useful for experiments.</p>
<section id="creating-the-namespaces" class="level2">
<h2 class="anchored" data-anchor-id="creating-the-namespaces">Creating the namespaces</h2>
<p>Here is how to do it, in a shell, first write the command</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">unshare</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-r</span></span></code></pre></div></div>
<p>So that you are “root” in the shell.</p>
<p>From this shell, open two new shells, and in each of them write the command</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">unshare</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span></span></code></pre></div></div>
<p>What we have done this way is create three namespaces:</p>
<ul>
<li>A user namespace, which makes you root</li>
<li>Two network namespaces, inside the user namespace</li>
</ul>
<p>This means you now have two network namespaces, and the same user is root on both.</p>
</section>
<section id="creating-the-namespaces-alternative" class="level2">
<h2 class="anchored" data-anchor-id="creating-the-namespaces-alternative">Creating the namespaces (alternative)</h2>
<p>If you’re on a linux system where you don’t really know how to launch a terminal from inside another terminal (because you’re using a desktop environment), there is another way to obtain the same result</p>
<p>On a first shell, write</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">unshare</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-rn</span></span>
<span id="cb4-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$$</span></span></code></pre></div></div>
<p>On the second shell:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">nsenter</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--preserve-credentials</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--user</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> PID</span>
<span id="cb5-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">unshare</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span></span></code></pre></div></div>
<p>where PID is the PID of the first shell</p>
</section>
<section id="creating-the-interfaces" class="level2">
<h2 class="anchored" data-anchor-id="creating-the-interfaces">Creating the interfaces</h2>
<p>The two namespaces are anonymous. To reference an anonymous namespace, you can reference it by the PID of one application in that namespace. Therefore we will execute the command</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$$</span></span></code></pre></div></div>
<p>in both shells to know the PID of the bash process (or your favorite shell, if it is not bash)</p>
<p>In the following, <code>FIRST_PID</code> is the PID of the first bash process, and <code>SECOND_PID</code> the PID of the second bash process.</p>
<p>Now in the first shell, type</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip</span> link add veth00 netns FIRST_PID type veth peer veth11 netns SECOND_PID</span></code></pre></div></div>
<p>This will create an interface <code>veth00</code> in the first namespace (the first shell) that is linked to the interface <code>veth11</code> in the second namespace.</p>
<p>Now you can add IP to these interfaces, put them up, and do some networking!</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">firstshell#</span> ip addr add 10.42.0.2/24 dev veth00</span>
<span id="cb8-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">firstshell#</span> ip link set veth00 up</span>
<span id="cb8-3"></span>
<span id="cb8-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">secondshell#</span> ip addr add 10.42.0.3/24 dev veth11</span>
<span id="cb8-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">secondshell#</span> ip link set veth11 up</span></code></pre></div></div>
<p>And that’s it! You can test everything is working as it should by pinging the machines. You can also try to see the traffic using wireshark, remember to launch wireshark from inside one of the two shells, and to use the interfaces veth00 and veth11.</p>
</section>
<section id="a-script" class="level1">
<h1>A script</h1>
<p>The following script can be used to automate everything. It supposes that you have <code>tmux</code> on your PC, as well as <code>x-terminal-emulator</code>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#!/usr/bin/bash</span></span>
<span id="cb9-2"></span>
<span id="cb9-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmux</span>  new-session <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-d</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-s</span> master <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> 1 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unshare -rn bash"</span></span>
<span id="cb9-4"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">PIDMASTER</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmux</span> list-panes <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> master:0 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-F</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#{pane_active} #{pane_pid}'</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cut</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-f</span> 2  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-d</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb9-5"></span>
<span id="cb9-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmux</span>  new-session <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-d</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-s</span> reseaux0 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> 1 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nsenter --preserve-credentials --user -t </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PIDMASTER</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> unshare -n"</span></span>
<span id="cb9-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmux</span>  new-session <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-d</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-s</span> reseaux1 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> 1 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nsenter --preserve-credentials --user -t </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PIDMASTER</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> unshare -n"</span></span>
<span id="cb9-8"></span>
<span id="cb9-9"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">PID0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmux</span> list-panes <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> reseaux0:0 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-F</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#{pane_active} #{pane_pid}'</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cut</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-f</span> 2  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-d</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb9-10"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">PID1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmux</span> list-panes <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> reseaux1:0 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-F</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#{pane_active} #{pane_pid}'</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cut</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-f</span> 2  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-d</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb9-11"></span>
<span id="cb9-12"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">nsenter</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--preserve-credentials</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--user</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PID0</span> sh <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ip  link add veth00 netns </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PID0</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> type veth peer veth11 netns </span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PID1</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb9-13"></span>
<span id="cb9-14"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">nsenter</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--preserve-credentials</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--user</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PID0</span> sh <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ip addr add 10.42.0.40/24 dev veth00"</span> </span>
<span id="cb9-15"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">nsenter</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--preserve-credentials</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--user</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PID0</span> sh <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ip link set veth00 up"</span> </span>
<span id="cb9-16"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">nsenter</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--preserve-credentials</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--user</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PID0</span> sh <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ip link set lo up"</span> </span>
<span id="cb9-17"></span>
<span id="cb9-18"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">nsenter</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--preserve-credentials</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--user</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PID1</span> sh <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ip addr add 10.42.0.50/24 dev veth11"</span> </span>
<span id="cb9-19"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">nsenter</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--preserve-credentials</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--user</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PID1</span> sh <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ip link set veth11 up"</span> </span>
<span id="cb9-20"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">nsenter</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--preserve-credentials</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--user</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$PID1</span> sh <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-c</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ip link set lo up"</span> </span>
<span id="cb9-21"></span>
<span id="cb9-22"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmux</span> send-keys <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> reseaux0:0  PS1=<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\'</span>pc0:<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'\w\$'</span><span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\'</span> Enter</span>
<span id="cb9-23"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmux</span> send-keys <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> reseaux1:0  PS1=<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\'</span>pc1:<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'\w\$'</span><span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\'</span> Enter</span>
<span id="cb9-24"></span>
<span id="cb9-25"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmux</span> send-keys <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> reseaux0:0 C-l</span>
<span id="cb9-26"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmux</span> send-keys <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> reseaux1:0 C-l</span>
<span id="cb9-27"></span>
<span id="cb9-28"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">x-terminal-emulator</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tmux attach -t reseaux0"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">&amp;</span></span>
<span id="cb9-29"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">x-terminal-emulator</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tmux attach -t reseaux1"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">&amp;</span></span>
<span id="cb9-30"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">x-terminal-emulator</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tmux attach -t master"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">&amp;</span></span></code></pre></div></div>
</section>
<section id="remarks" class="level1">
<h1>Remarks</h1>
<ul>
<li><p>If you try to <code>ping 10.42.0.2</code> from the firstshell, this will not work, because this implicitely uses the <code>lo</code> interface that is down. If you want to be able to ping yourself, you can do <code>ip link set lo up</code>.</p></li>
<li><p>The interface is only visible in the shell if they share the same namespace. When the previous command is typed, <code>veth00</code> is visible in the first shell, but <code>veth11</code> is visible only in the second shell.</p></li>
<li><p>It won’t surprise anyone that most of these features are very useful to make containers. The important thing here is that we can do this in user mode. This does not provide a real sandboxing, but it is very useful if you just want to test some small networking scripts as a user which is not root.</p></li>
</ul>


</section>

 ]]></description>
  <category>networking</category>
  <category>namespaces</category>
  <category>linux</category>
  <guid>https://members.loria.fr/EJeandel/posts/unshare/</guid>
  <pubDate>Tue, 24 Jan 2023 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Sandboxed network interfaces using (unprivileged) unshare, part 2</title>
  <dc:creator>Emmanuel Jeandel</dc:creator>
  <link>https://members.loria.fr/EJeandel/posts/unshare2/</link>
  <description><![CDATA[ 






<p>This is a follow up to <a href="../unshare">this post</a> and assumes you already read it.</p>
<p>In this post, we will change the configuration to have three machines, with IPs 10.42.0.2, 10.42.0.3, and 10.42.0.4, all on the same local network.</p>
<p>The reason the previous solution does not work is that we connected directly two virtual interfaces. Now we have three of them.</p>
<p>We will need for that 5 shells in total:</p>
<ul>
<li>1 shell to become root (as before)</li>
<li>1 per machine (3 shell total)</li>
<li>1 that acts as a bridge.</li>
</ul>
<p>The first thing to do is as before is to create the root shell and launch 4 shells inside it with the command</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">unshare</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-n</span></span></code></pre></div></div>
<p>As before, write in each shell</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">$$</span></span></code></pre></div></div>
<p>to recover the PIDs of the 4 shells.</p>
<p>Now let BRIDGE_PID be the PID of the 4th shell, and let MY_PID be the PID of any of the three other shells.</p>
<p>On the three other shells, we now write:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">shell1#</span> ip link add veth0 netns MY_PID type veth peer veth10 netns BRIDGE_PID</span>
<span id="cb3-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">shell1#</span> ip link set veth0 up</span>
<span id="cb3-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">shell2#</span> ip link add veth0 netns MY_PID type veth peer veth11 netns BRIDGE_PID</span>
<span id="cb3-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">shell2#</span> ip link set veth0 up</span>
<span id="cb3-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">shell3#</span> ip link add veth0 netns MY_PID type veth peer veth12 netns BRIDGE_PID</span>
<span id="cb3-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">shell3#</span> ip link set veth0 up</span></code></pre></div></div>
<p>We are therefore creating three connections between each of our namespace and the fourth namespace</p>
<p>Then in the fourth shell:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip</span> link set veth10 up</span>
<span id="cb4-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip</span> link set veth11 up</span>
<span id="cb4-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip</span> link set veth12 up</span>
<span id="cb4-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip</span> link add name br0 type bridge</span>
<span id="cb4-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip</span> link set dev br0 up</span>
<span id="cb4-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip</span> link set dev veth10 master br0</span>
<span id="cb4-7"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip</span> link set dev veth11 master br0</span>
<span id="cb4-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ip</span> link set dev veth12 master br0</span></code></pre></div></div>
<p>Now you just have to put IPs to the three shells and everything is working.</p>



 ]]></description>
  <category>networking</category>
  <category>namespaces</category>
  <category>linux</category>
  <guid>https://members.loria.fr/EJeandel/posts/unshare2/</guid>
  <pubDate>Tue, 24 Jan 2023 23:00:00 GMT</pubDate>
</item>
</channel>
</rss>
