<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Antoine Lorence - Blog</title><link>https://blog.alorence.me/</link><description>Recent content on Antoine Lorence - Blog</description><generator>Hugo -- gohugo.io</generator><language>fr</language><lastBuildDate>Wed, 11 Jan 2023 15:03:24 +0100</lastBuildDate><atom:link href="https://blog.alorence.me/index.xml" rel="self" type="application/rss+xml"/><item><title>Vérifier la version courante de Manjaro</title><link>https://blog.alorence.me/2023/01/v%C3%A9rifier-la-version-courante-de-manjaro/</link><pubDate>Wed, 11 Jan 2023 15:03:24 +0100</pubDate><guid>https://blog.alorence.me/2023/01/v%C3%A9rifier-la-version-courante-de-manjaro/</guid><description>&lt;img src="https://blog.alorence.me/2023/01/v%C3%A9rifier-la-version-courante-de-manjaro/hd-wallpaper-g3303691a1_1920.webp" alt="Featured image of post Vérifier la version courante de Manjaro" />&lt;h2 id="version-de-la-distribution">Version de la distribution&lt;/h2>
&lt;p>Manjaro fait partie du projet &lt;a class="link" href="https://fr.wikipedia.org/wiki/Linux_Standard_Base" target="_blank" rel="noopener"
>Linux Standard Base&lt;/a> (LSB) et à ce titre,
maintient le fichier &lt;code>/etc/lsb-release&lt;/code> qui sert de source à la commande &lt;code>lsb_release&lt;/code> (pas forcément installé par défaut sur
tous les systèmes).&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>❯ cat /etc/lsb-release
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>DISTRIB_ID&lt;span style="color:#f92672">=&lt;/span>ManjaroLinux
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>DISTRIB_RELEASE&lt;span style="color:#f92672">=&lt;/span>22.0.0
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>DISTRIB_CODENAME&lt;span style="color:#f92672">=&lt;/span>Sikaris
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>DISTRIB_DESCRIPTION&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;Manjaro Linux&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>❯ lsb_release -a
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>LSB Version: n/a
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Distributor ID: ManjaroLinux
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Description: Manjaro Linux
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Release: 22.0.0
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Codename: Sikaris
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>L&amp;rsquo;une ou l&amp;rsquo;autre de ces commandes fournit le numéro de version et le nom de code de la release courante. Dans
cet exemple, c&amp;rsquo;est &lt;a class="link" href="https://forum.manjaro.org/t/manjaro-22-0-sikaris-released/129983" title="Manjaro 22.0 Sikaris Release Notes"
target="_blank" rel="noopener"
>Manjaro 22.0 Sikaris&lt;/a>.&lt;/p>
&lt;p>Sur d&amp;rsquo;autres distributions, le fichier &lt;code>/etc/os-release&lt;/code> peut parfois contenir des informations intéressantes sur le
&lt;code>BUILD_ID&lt;/code>. Manjaro fonctionne en &amp;ldquo;rolling releases&amp;rdquo;, la variable &lt;code>BUILD_ID&lt;/code> ne contient pas de numéro de version exploitable.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>❯ cat /etc/os-release
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>NAME&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;Manjaro Linux&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>PRETTY_NAME&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;Manjaro Linux&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ID&lt;span style="color:#f92672">=&lt;/span>manjaro
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ID_LIKE&lt;span style="color:#f92672">=&lt;/span>arch
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>BUILD_ID&lt;span style="color:#f92672">=&lt;/span>rolling
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ANSI_COLOR&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;32;1;24;144;200&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>HOME_URL&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;https://manjaro.org/&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>DOCUMENTATION_URL&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;https://wiki.manjaro.org/&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>SUPPORT_URL&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;https://forum.manjaro.org/&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>BUG_REPORT_URL&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;https://docs.manjaro.org/reporting-bugs/&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>PRIVACY_POLICY_URL&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;https://manjaro.org/privacy-policy/&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>LOGO&lt;span style="color:#f92672">=&lt;/span>manjarolinux
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="branche-active-du-gestionnaire-de-paquets">Branche active du gestionnaire de paquets&lt;/h2>
&lt;p>Manjaro est basé sur Arch et utilise donc le même gestionnaire de paquets de base, pacman. Mais contrairement à
la distribution originale, Manjaro s&amp;rsquo;appuie sur des branches spécifiques pour déterminer quelle version d&amp;rsquo;un paquet
doit être installée pour une release donnée.&lt;/p>
&lt;p>Il existe 3 branches sur lesquelles le système peut fonctionner :&lt;/p>
&lt;blockquote>
&lt;ul>
&lt;li>&lt;strong>Stable branch&lt;/strong>: The packages that come to stable have gone through roughly a couple of weeks testing by the users of the Unstable/Testing repos, before they get the packages. These packages are usually free of any problems.&lt;/li>
&lt;li>&lt;strong>Testing branch&lt;/strong>: This is the second line of defense. Being a larger number of users than those using Unstable, they refine the work done prior to them by providing feedback on the packages they recieve on updates.&lt;/li>
&lt;li>&lt;strong>Unstable branch&lt;/strong>: Unstable is synced several times a day with Arch package releases. Only a subset of Arch packages are modified to suit Manjaro. Those that use Unstable need to have the skills to get themselves out of trouble when they move their system to this branch. They are the Manjaro users who are most likely to need to use such skills. Due to the feedback from the users of the Unstable repo, many issues are caught and fixed at this level. Although the very latest software will be located here, using the unstable branch is usually safe but - in rare cases - may cause issues with your system!&lt;/li>
&lt;/ul>
&lt;p>Source: &lt;a class="link" href="https://wiki.manjaro.org/index.php/Switching_Branches" target="_blank" rel="noopener"
>https://wiki.manjaro.org/index.php/Switching_Branches&lt;/a>&lt;/p>
&lt;/blockquote>
&lt;h3 id="vérifier-la-branche-utilisée">Vérifier la branche utilisée&lt;/h3>
&lt;p>Pour afficher la branche configurée pour votre système, la commande est :&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>pacman-mirrors -G
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="changer-de-branche">Changer de branche&lt;/h3>
&lt;p>Pour changer de branche, les commandes sont :&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>sudo pacman-mirrors --api --set-branch &lt;span style="color:#f92672">{&lt;/span>branch&lt;span style="color:#f92672">}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo pacman-mirrors --fasttrack &lt;span style="color:#ae81ff">5&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo pacman -Syyu
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Pensez à remplacer &lt;code>{branch}&lt;/code> par la branche que vous souhaitez utiliser, &lt;code>stable&lt;/code>, &lt;code>testing&lt;/code> ou &lt;code>unstable&lt;/code>&lt;/p>
&lt;p>Crédit photo :
&lt;a class="link" href="https://pixabay.com/users/adamseyecandy-13660658/?utm_source=link-attribution&amp;amp;amp;utm_medium=referral&amp;amp;amp;utm_campaign=image&amp;amp;amp;utm_content=5019381" target="_blank" rel="noopener"
>AdamsEyeCandy&lt;/a> from &lt;a class="link" href="https://pixabay.com//?utm_source=link-attribution&amp;amp;amp;utm_medium=referral&amp;amp;amp;utm_campaign=image&amp;amp;amp;utm_content=5019381" target="_blank" rel="noopener"
>Pixabay&lt;/a>&lt;/p></description></item><item><title>Gérer les configs et secrets Docker Swarm avec Ansible</title><link>https://blog.alorence.me/2022/11/g%C3%A9rer-les-configs-et-secrets-docker-swarm-avec-ansible/</link><pubDate>Sun, 27 Nov 2022 21:20:31 +0100</pubDate><guid>https://blog.alorence.me/2022/11/g%C3%A9rer-les-configs-et-secrets-docker-swarm-avec-ansible/</guid><description>&lt;img src="https://blog.alorence.me/2022/11/g%C3%A9rer-les-configs-et-secrets-docker-swarm-avec-ansible/imattsmart-Vp3oWLsPOss-unsplash.webp" alt="Featured image of post Gérer les configs et secrets Docker Swarm avec Ansible" />&lt;p>Ansible permet de créer, modifier ou supprimer des secrets
(&lt;a class="link" href="https://docs.ansible.com/ansible/latest/collections/community/docker/docker_secret_module.html" target="_blank" rel="noopener"
>&lt;code>community.docker.docker_secret&lt;/code>&lt;/a>)
et des configs
(&lt;a class="link" href="https://docs.ansible.com/ansible/latest/collections/community/docker/docker_config_module.html" target="_blank" rel="noopener"
>&lt;code>community.docker.docker_config&lt;/code>&lt;/a>)
sur un cluster Docker Swarm de façon automatisée. Mais il y a quelques astuces à connaître avant de pouvoir
les utiliser correctement dans un playbook reproductible.&lt;/p>
&lt;h2 id="les-modules-_docker_secret_-et-_docker_config_">Les modules &lt;em>docker_secret&lt;/em> et &lt;em>docker_config&lt;/em>&lt;/h2>
&lt;p>Voici les exemples fournis par la documentation Ansible pour créer un
&lt;a class="link" href="https://docs.ansible.com/ansible/latest/collections/community/docker/docker_secret_module.html#examples" target="_blank" rel="noopener"
>secret&lt;/a> ou
ou une
&lt;a class="link" href="https://docs.ansible.com/ansible/latest/collections/community/docker/docker_config_module.html#examples" target="_blank" rel="noopener"
>config&lt;/a>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>- &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Create secret foo (from a file on the control machine)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">community.docker.docker_secret&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">foo&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># If the file is JSON or binary, Ansible might modify it (because&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># it is first decoded and later re-encoded). Base64-encoding the&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># file directly after reading it prevents this to happen.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">data&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;{{ lookup(&amp;#39;file&amp;#39;, &amp;#39;/path/to/secret/file&amp;#39;) | b64encode }}&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">data_is_b64&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">state&lt;/span>: &lt;span style="color:#ae81ff">present&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>- &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Create config foo (from a file on the control machine)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">community.docker.docker_config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">foo&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># If the file is JSON or binary, Ansible might modify it (because&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># it is first decoded and later re-encoded). Base64-encoding the&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># file directly after reading it prevents this to happen.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">data&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;{{ lookup(&amp;#39;file&amp;#39;, &amp;#39;/path/to/config/file&amp;#39;) | b64encode }}&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">data_is_b64&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">state&lt;/span>: &lt;span style="color:#ae81ff">present&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Première info importante : le fichier source local sera décodé puis réencodé,
il faut le transformer en base64 avant de l&amp;rsquo;envoyer, en utilisant le paramètre
&lt;code>data_is_b64&lt;/code> pour qu&amp;rsquo;il soit correctement décodé à l&amp;rsquo;écriture.&lt;/p>
&lt;h2 id="reproductibilité-du-playbook">Reproductibilité du playbook&lt;/h2>
&lt;p>On peut appliquer l&amp;rsquo;exemple sur un cas concret : le déploiement de Traefik sur un cluster swarm.
Dans le playbook, on applique la tâche :&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>- &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Push config&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">community.docker.docker_config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">traefik&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># If the file is JSON or binary, Ansible might modify it (because&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># it is first decoded and later re-encoded). Base64-encoding the&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># file directly after reading it prevents this to happen.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">data&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;{{ lookup(&amp;#39;file&amp;#39;, &amp;#39;config/traefik.static.yml&amp;#39;) | b64encode }}&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">data_is_b64&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">state&lt;/span>: &lt;span style="color:#ae81ff">present&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Le 1&lt;sup>er&lt;/sup>
déploiement va bien se dérouler, mais le 2&lt;sup>e&lt;/sup>
va échouer
avec ce message d&amp;rsquo;erreur :&lt;/p>
&lt;pre tabindex="0">&lt;code>&amp;lt;hostname&amp;gt; failed | msg: Error removing config traefik: 400 Client Error
for http+docker://localhost/v1.41/configs/wqpa6u3jdcj5id6speqyf63oa:
Bad Request (&amp;#34;rpc error: code = InvalidArgument desc = config &amp;#39;traefik&amp;#39;
is in use by the following service: traefik&amp;#34;)
&lt;/code>&lt;/pre>&lt;p>Le problème apparait à la fin du message : Docker ne permet pas de redéfinir une config ou un secret si un
autre du même nom existe déjà. On pourrait avoir envie de rapidement supprimer puis recréer l&amp;rsquo;élement
pendant le déploiement d&amp;rsquo;un nouveau service, mais il faudrait au préalable stopper l&amp;rsquo;existant, ce qui peut être
gênant, voire absolument impossible selon les cas (mise en prod sans interruption de service).&lt;/p>
&lt;p>&lt;strong>Le playbook n&amp;rsquo;est plus reproductible&lt;/strong>.&lt;/p>
&lt;h2 id="rotation-de-versions">Rotation de versions&lt;/h2>
&lt;p>Heureusement, Ansible propose une meilleure solution avec l&amp;rsquo;option &lt;code>rolling_versions&lt;/code> qui n&amp;rsquo;apparait pas dans
&lt;a class="link" href="https://docs.ansible.com/ansible/latest/collections/community/docker/docker_config_module.html#examples" target="_blank" rel="noopener"
>les exemples de la doc officielle&lt;/a>.
Concrètement, à chaque execution la tâche va créer une nouvelle config en suffixant le nom de base avec
&amp;ldquo;_v1&amp;rsquo;, &amp;ldquo;_v2&amp;rdquo;, &amp;ldquo;_v3&amp;rdquo;, etc. Les nouveaux services peuvent démarrer directement avec la nouvelle version
pendant que les anciens continuent d&amp;rsquo;utiliser la précédente. Simple.&lt;/p>
&lt;p>En plus de ça, le module offre une autre option bien pratique : &lt;code>versions_to_keep&lt;/code>. On peut indiquer
le nombre d&amp;rsquo;anciennes configs à garder. Le ménage est fait à chaque exécution.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>- &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">Push config&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">community.docker.docker_config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">name&lt;/span>: &lt;span style="color:#ae81ff">traefik&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">data&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;{{ lookup(&amp;#39;file&amp;#39;, &amp;#39;config/traefik.static.yml&amp;#39;) | b64encode }}&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">data_is_b64&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">state&lt;/span>: &lt;span style="color:#ae81ff">present&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">rolling_versions&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">versions_to_keep&lt;/span>: &lt;span style="color:#ae81ff">3&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">register&lt;/span>: &lt;span style="color:#ae81ff">traefik_cfg&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Attention : il ne faut pas oublier de sauvegarder le résultat dans une variable (avec &lt;code>register&lt;/code>) pour retrouver
&lt;a class="link" href="https://docs.ansible.com/ansible/latest/collections/community/docker/docker_config_module.html#return-values" target="_blank" rel="noopener"
>la bonne config&lt;/a>
au moment du déploiement.&lt;/p>
&lt;p>Dans mon cas, je démarre directement depuis une &lt;code>stack.yml&lt;/code> que j&amp;rsquo;ai envoyé sur le host en utilisant
&lt;code>core.builtin.template&lt;/code>. J&amp;rsquo;ai donc accès au dict &lt;code>traefik_cfg&lt;/code> dans mon template, le nom final de la
config crée est donc accessible avec &lt;code>{{ traefik_cfg.config_name }}&lt;/code>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">version&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;3.8&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">configs&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {{ &lt;span style="color:#f92672">traefik_cfg.config_name }}&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">external&lt;/span>: &lt;span style="color:#66d9ef">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">services&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">proxy&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">image&lt;/span>: &lt;span style="color:#ae81ff">traefik:2.9&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># [...]&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">configs&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#f92672">source&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;{{ traefik_cfg.config_name }}&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">target&lt;/span>: &lt;span style="color:#ae81ff">/etc/traefik/traefik.yml&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">mode&lt;/span>: &lt;span style="color:#ae81ff">0400&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># [...]&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Les options sont identiques pour le module &lt;code>community.docker.docker_secret&lt;/code>.&lt;/p>
&lt;p>Crédit photo :
&lt;a class="link" href="https://unsplash.com/@imattsmart?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" target="_blank" rel="noopener"
>iMattSmart&lt;/a>&lt;/p></description></item><item><title>Intégrer la doc de CMake dans Qt Creator</title><link>https://blog.alorence.me/integrer-doc-cmake-qt-creator/</link><pubDate>Fri, 01 May 2015 18:30:00 +0200</pubDate><guid>https://blog.alorence.me/integrer-doc-cmake-qt-creator/</guid><description>&lt;img src="https://blog.alorence.me/integrer-doc-cmake-qt-creator/sigmund-vvrjJTbuuaI-unsplash.webp" alt="Featured image of post Intégrer la doc de CMake dans Qt Creator" />&lt;p>À partir de la version 3, CMake utilise reStructuredText et Sphinx pour
générer sa documentation. Ce nouveau format permet
entre autre de générer facilement toute la doc au format qch, le format
d&amp;rsquo;entrée de l&amp;rsquo;aide contextuelle de Qt Creator.&lt;/p>
&lt;p>Pour ajouter la documentation de CMake dans Qt Creator et vous simplifier
l&amp;rsquo;écriture de fichiers CMake directement dans l&amp;rsquo;IDE, la procédure est
simple. À l&amp;rsquo;adresse &lt;a class="link" href="https://cmake.org/documentation/" target="_blank" rel="noopener"
>https://cmake.org/documentation/&lt;/a>, cliquez sur
le lien &amp;quot;QtHelp&amp;quot; correspondant à votre version de CMake. Téléchargez
sur votre machine le fichier &amp;quot;CMake.qch&amp;quot;, puis ouvrez Qt Creator.&lt;/p>
&lt;p>Dans la fenêtre d&amp;rsquo;options, à l&amp;rsquo;onglet Aide / Documentation, cliquez
sur &amp;quot;Ajouter&amp;quot; puis allez chercher le qch.&lt;/p>
&lt;p>&lt;img src="https://blog.alorence.me/integrer-doc-cmake-qt-creator/cmake_doc_qt_creator_options.png"
width="1016"
height="588"
srcset="https://blog.alorence.me/integrer-doc-cmake-qt-creator/cmake_doc_qt_creator_options_hu91b8b79127b40852604586b14af79fbe_74945_480x0_resize_box_3.png 480w, https://blog.alorence.me/integrer-doc-cmake-qt-creator/cmake_doc_qt_creator_options_hu91b8b79127b40852604586b14af79fbe_74945_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Capture d&amp;rsquo;écran Qt Creator"
class="gallery-image"
data-flex-grow="172"
data-flex-basis="414px"
>&lt;/p>
&lt;p>Une fois ajouté dans la liste des documentations, vous pouvez
l&amp;rsquo;utiliser dans l&amp;rsquo;IDE.&lt;/p>
&lt;p>&lt;img src="https://blog.alorence.me/integrer-doc-cmake-qt-creator/cmake_doc_qt_creator.png"
width="1104"
height="560"
srcset="https://blog.alorence.me/integrer-doc-cmake-qt-creator/cmake_doc_qt_creator_hud4caa0527b4981e66a76eddb5f0b8ba5_127395_480x0_resize_box_3.png 480w, https://blog.alorence.me/integrer-doc-cmake-qt-creator/cmake_doc_qt_creator_hud4caa0527b4981e66a76eddb5f0b8ba5_127395_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Capture d&amp;rsquo;écran Qt Creator"
class="gallery-image"
data-flex-grow="197"
data-flex-basis="473px"
>&lt;/p>
&lt;p>Source : &lt;a class="link" href="https://www.kdab.com/context-sensitive-cmake-documentation-qtcreator/" target="_blank" rel="noopener"
>Kdab blog&lt;/a>&lt;/p>
&lt;p>Crédit photo :
&lt;a class="link" href="https://unsplash.com/@sigmund?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" target="_blank" rel="noopener"
>Sigmund&lt;/a>&lt;/p></description></item><item><title>Récupérer la date et l'heure courante dans CMake</title><link>https://blog.alorence.me/cmake-date-heure/</link><pubDate>Fri, 01 May 2015 16:23:00 +0200</pubDate><guid>https://blog.alorence.me/cmake-date-heure/</guid><description>&lt;img src="https://blog.alorence.me/cmake-date-heure/murray-campbell-B_TdfGFuGwA-unsplash.webp" alt="Featured image of post Récupérer la date et l'heure courante dans CMake" />&lt;p>CMake ne fournit aucune commande standard pour récupérer sous forme de
texte la date et l&amp;rsquo;heure courante. Voici deux macros qui permettent de
récupérer ces informations sous Unix ou Windows.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Mise à jour - 03/01/2023&lt;/strong>&lt;/p>
&lt;p>Depuis la rédaction de cet article, la commande &lt;a class="link" href="https://cmake.org/cmake/help/latest/command/string.html#timestamp" target="_blank" rel="noopener"
>string(TIMESTAMP)&lt;/a> a été introduite
dans la version courante de CMake. Il reste en ligne pour les archives, mais &lt;strong>ces deux macros ne devraient plus être utilisées&lt;/strong>.&lt;/p>
&lt;/blockquote>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-cmake" data-lang="cmake">&lt;span style="display:flex;">&lt;span>cmake_minimum_required(&lt;span style="color:#e6db74">VERSION&lt;/span> &lt;span style="color:#e6db74">2.8&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span>&lt;span style="color:#75715e"># Return the date (yyyy-mm-dd)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>macro(&lt;span style="color:#e6db74">DATE&lt;/span> &lt;span style="color:#e6db74">RESULT&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> if(&lt;span style="color:#e6db74">WIN32&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> execute_process(&lt;span style="color:#e6db74">COMMAND&lt;/span> &lt;span style="color:#e6db74">&amp;#34;cmd&amp;#34;&lt;/span> &lt;span style="color:#e6db74">&amp;#34; /C date /T&amp;#34;&lt;/span> &lt;span style="color:#e6db74">OUTPUT_VARIABLE&lt;/span> &lt;span style="color:#f92672">${&lt;/span>RESULT&lt;span style="color:#f92672">}&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> string(&lt;span style="color:#e6db74">REGEX&lt;/span> &lt;span style="color:#e6db74">REPLACE&lt;/span> &lt;span style="color:#e6db74">&amp;#34;(..)/(..)/(....).*&amp;#34;&lt;/span> &lt;span style="color:#e6db74">&amp;#34;\\3-\\2-\\1&amp;#34;&lt;/span> &lt;span style="color:#f92672">${&lt;/span>RESULT&lt;span style="color:#f92672">}&lt;/span> &lt;span style="color:#f92672">${&lt;/span>${RESULT&lt;span style="color:#f92672">}&lt;/span>&lt;span style="color:#e6db74">}&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> elseif(&lt;span style="color:#e6db74">UNIX&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> execute_process(&lt;span style="color:#e6db74">COMMAND&lt;/span> &lt;span style="color:#e6db74">&amp;#34;date&amp;#34;&lt;/span> &lt;span style="color:#e6db74">&amp;#34;+%Y-%m-%d&amp;#34;&lt;/span> &lt;span style="color:#e6db74">OUTPUT_VARIABLE&lt;/span> &lt;span style="color:#f92672">${&lt;/span>RESULT&lt;span style="color:#f92672">}&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> else()&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> message(&lt;span style="color:#e6db74">SEND_ERROR&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Unable to detect date&amp;#34;&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> set(&lt;span style="color:#f92672">${&lt;/span>RESULT&lt;span style="color:#f92672">}&lt;/span> &lt;span style="color:#e6db74">UNKNOWN&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> endif()&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span>endmacro()&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span>&lt;span style="color:#75715e"># Return the time (hh:mm:ss)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>macro(&lt;span style="color:#e6db74">TIME&lt;/span> &lt;span style="color:#e6db74">RESULT&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> if(&lt;span style="color:#e6db74">WIN32&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> execute_process(&lt;span style="color:#e6db74">COMMAND&lt;/span> &lt;span style="color:#e6db74">&amp;#34;cmd&amp;#34;&lt;/span> &lt;span style="color:#e6db74">&amp;#34; /C echo %TIME%&amp;#34;&lt;/span> &lt;span style="color:#e6db74">OUTPUT_VARIABLE&lt;/span> &lt;span style="color:#f92672">${&lt;/span>RESULT&lt;span style="color:#f92672">}&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> string(&lt;span style="color:#e6db74">REGEX&lt;/span> &lt;span style="color:#e6db74">REPLACE&lt;/span> &lt;span style="color:#e6db74">&amp;#34;(..:..:..),(..)&amp;#34;&lt;/span> &lt;span style="color:#e6db74">&amp;#34;\\1&amp;#34;&lt;/span> &lt;span style="color:#f92672">${&lt;/span>RESULT&lt;span style="color:#f92672">}&lt;/span> &lt;span style="color:#f92672">${&lt;/span>${RESULT&lt;span style="color:#f92672">}&lt;/span>&lt;span style="color:#e6db74">}&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> elseif(&lt;span style="color:#e6db74">UNIX&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> execute_process(&lt;span style="color:#e6db74">COMMAND&lt;/span> &lt;span style="color:#e6db74">&amp;#34;date&amp;#34;&lt;/span> &lt;span style="color:#e6db74">&amp;#34;+%H:%M:%S&amp;#34;&lt;/span> &lt;span style="color:#e6db74">OUTPUT_VARIABLE&lt;/span> &lt;span style="color:#f92672">${&lt;/span>RESULT&lt;span style="color:#f92672">}&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> else()&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> message(&lt;span style="color:#e6db74">SEND_ERROR&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Unable to detect time&amp;#34;&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> set(&lt;span style="color:#f92672">${&lt;/span>RESULT&lt;span style="color:#f92672">}&lt;/span> &lt;span style="color:#e6db74">UNKNOWN&lt;/span>)&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span> endif()&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&lt;/span>endmacro()&lt;span style="color:#960050;background-color:#1e0010">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Crédit photo :
&lt;a class="link" href="https://unsplash.com/@murrayc?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" target="_blank" rel="noopener"
>Murray Campbell&lt;/a>&lt;/p></description></item><item><title>Restaurer des fichiers supprimés depuis leurs paquets Debian/Ubuntu</title><link>https://blog.alorence.me/restaurer-des-fichiers-depuis-paquets-debian-ubuntu/</link><pubDate>Sat, 24 May 2014 07:31:00 +0200</pubDate><guid>https://blog.alorence.me/restaurer-des-fichiers-depuis-paquets-debian-ubuntu/</guid><description>&lt;img src="https://blog.alorence.me/restaurer-des-fichiers-depuis-paquets-debian-ubuntu/robert-l-JLoE-DntHtY-unsplash.webp" alt="Featured image of post Restaurer des fichiers supprimés depuis leurs paquets Debian/Ubuntu" />&lt;p>Il y a peu, en bidouillant mes lanceurs Unity sous Ubuntu, j&amp;rsquo;ai
supprimé le dossier /usr/share/icons du système. La conséquence a été
plutôt rapide : le système s&amp;rsquo;est plus ou moins figé, impossible de
lancer un programme quel qu&amp;rsquo;il soit (donc pas de terminal), relancer la
session ou redémarrer la machine ne changeait rien&amp;hellip;&lt;/p>
&lt;p>Heureusement, il était toujours possible de basculer en mode terminal
avec un petit &lt;code>Ctrl + Alt + F1&lt;/code>. Après quelques recherches sur Internet,
j&amp;rsquo;ai pu trouver les commandes qui m&amp;rsquo;ont été utiles. L&amp;rsquo;idée ici était
de faire la liste des paquets Ubuntu qui avaient installé un fichier
dans /usr/share/icons. Pour cela, dpkg a été bien pratique&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>$ dpkg -S /usr/share/icons
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tango-icon-theme, clementine, gimp-data, filezilla-common, geany-common, gnome-accessibility-themes, gnome-orca,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>aisleriot, ubuntu-mono, evince-common, eog, humanity-icon-theme, gnome-mines, empathy-common, blender-data,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>gnome-mahjongg, gnome-user-share, openjdk-7-jre:amd64, hicolor-icon-theme, cabextract, deja-dup, sqliteman,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>smuxi-frontend-gnome, meld, software-center, libpeas-common, unity-asset-pool, gnome-online-accounts,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>libgweather-common, gnome-power-manager, gnome-icon-theme, gnome-icon-theme-symbolic, unity-control-center,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>update-notifier, homebank, indicator-sync, imagemagick, unity-webapps-common, gparted, gnome-sudoku, gnome-media,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>xterm, vlc-data, audacious, file-roller, onboard, totem-common, ibus, unity-control-center-signon, btsync-gui-gtk,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>webbrowser-app, software-properties-gtk, ubuntu-artwork, indicator-session, indicator-messages, gnome-disk-utility,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>gnome-control-center-data, activity-log-manager, chromium-browser, poedit, unity-settings-daemon, dconf-editor,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>rhythmbox-data, network-manager-gnome, audacity-data, gnome-settings-daemon, apport, synaptic, aptdaemon-data,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>shotwell-common, skype-bin, icedtea-netx-common, modemmanager, dropbox, seahorse, gcr, brasero-common,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>landscape-client-ui-install, dmz-cursor-theme, baobab, indicator-printers, cheese-common, gnome-bluetooth,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>gnome-session-common, usb-creator-gtk, xchat, gnome-system-log, ubuntuone-client-data, gnome-nettool,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>unity-scope-gdrive, xcursor-themes, transmission-common, remmina-common, deluge-gtk,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>libreoffice-common: /usr/share/icons
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>On a donc une liste des paquets que l&amp;rsquo;on va devoir réinstaller. La
commande est la suivante&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>sudo apt-get install --reinstall &amp;lt;paquet&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>En temps normal, j&amp;rsquo;aurais copié la liste dans un éditeur de texte digne
de ce nom, puis j&amp;rsquo;aurais édité en bloc pour construire la commande dont
j&amp;rsquo;ai besoin. Ici, pas d&amp;rsquo;autre choix que de tout faire en ligne de
commande...&lt;/p>
&lt;p>Dans apt-get, si l&amp;rsquo;on veut installer plusieurs paquets, il faut les
séparer par des espaces. C&amp;rsquo;est la même chose pour les réinstaller. On a
donc besoin de nettoyer un peu la sortie de dpkg -S&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ dpkg -S /usr/share/icons | sed -e &lt;span style="color:#e6db74">&amp;#39;s/,//g&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tango-icon-theme clementine gimp-data &lt;span style="color:#f92672">[&lt;/span>...&lt;span style="color:#f92672">]&lt;/span> deluge-gtk libreoffice-common: /usr/share/icons
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Beaucoup mieux, mais on a toujours un rappel du dossier recherché à la
fin de la liste. Qu&amp;rsquo;à cela ne tienne&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>$ dpkg -S /usr/share/icons | sed -e &lt;span style="color:#e6db74">&amp;#39;s/,//g&amp;#39;&lt;/span> | sed -e &lt;span style="color:#e6db74">&amp;#39;s/: \/usr\/share\/icons//g&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>tango-icon-theme clementine gimp-data &lt;span style="color:#f92672">[&lt;/span>...&lt;span style="color:#f92672">]&lt;/span> deluge-gtk libreoffice-common
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Oui je sais ça commence à se compliquer, mais c&amp;rsquo;est bientôt fini... Il
nous reste à passer cette jolie liste de paquets en paramètre de apt-get&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>sudo apt-get install --reinstall &lt;span style="color:#66d9ef">$(&lt;/span>dpkg -S /usr/share/icons | sed -e &lt;span style="color:#e6db74">&amp;#39;s/,//g&amp;#39;&lt;/span> | sed -e &lt;span style="color:#e6db74">&amp;#39;s/: \/usr\/share\/icons//g&amp;#39;&lt;/span>&lt;span style="color:#66d9ef">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Il est temps de prendre un petite pause, la réinstallation de tous les
paquets va prendre un peu de temps... Une fois réinstallés, il suffit
de repasser en mode graphique (Ctrl + Alt + F7), et tout rentre dans
l&amp;rsquo;ordre.&lt;/p>
&lt;p>J&amp;rsquo;ai quand même eu la chance dans ce cas d&amp;rsquo;avoir supprimé des fichiers
moyennement importants pour le fonctionnement général du système. Ça
aurait pu être beaucoup plus compliqué avec /usr/bin ou autre. Il faut
toujours réfléchir à deux fois avant d&amp;rsquo;envoyer un &lt;code>sudo rm -fr&lt;/code> sur
quelque chose !&lt;/p>
&lt;p>Crédit photo :
&lt;a class="link" href="https://unsplash.com/@rwlinder?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" target="_blank" rel="noopener"
>Robert Linder&lt;/a>&lt;/p></description></item><item><title>Les commandes MacPorts courantes</title><link>https://blog.alorence.me/les-commandes-macports-courantes/</link><pubDate>Tue, 20 May 2014 22:31:00 +0200</pubDate><guid>https://blog.alorence.me/les-commandes-macports-courantes/</guid><description>&lt;img src="https://blog.alorence.me/les-commandes-macports-courantes/featuredImage.png" alt="Featured image of post Les commandes MacPorts courantes" />&lt;p>Un petit pense-bête des commandes les plus souvent utilisées avec
MacPorts.&lt;/p>
&lt;blockquote>
&lt;p>Note : toutes les sous-commandes peuvent être entrées directement dans
le prompt MacPort. Il suffit de taper la commande port (avec ou sans
sudo, en fonction de ce qu&amp;rsquo;on a besoin de faire) directement dans le
terminal.&lt;/p>
&lt;/blockquote>
&lt;h2 id="informations">Informations&lt;/h2>
&lt;pre tabindex="0">&lt;code># Infos sur un port de la base
port show &amp;lt;port&amp;gt;
# Liste les ports installés
port installed
# Liste les ports inutilisés
port installed leaves
&lt;/code>&lt;/pre>&lt;h2 id="installation">Installation&lt;/h2>
&lt;pre tabindex="0">&lt;code>sudo port install &amp;lt;paquet&amp;gt;
&lt;/code>&lt;/pre>&lt;h2 id="désinstallations">Désinstallations&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Simple suppression d&amp;#39;un paquet&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo port uninstall
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Supprime aussi les paquets inutilisés après la désinstallation&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo port uninstall --follow-dependencies
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Supprime les ports qui dependent de celui à supprimer&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo port uninstall --follow-dependents
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Supprime tous les ports inutiles&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo port uninstall leaves
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="mises-à-jour">Mises à jour&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Met à jour la liste des ports&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo port sync
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Idem, mais update aussi MacPorts&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo port selfupdate
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Met à jour tous les paquets&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo port upgrade outdated
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Very Sleepy, un profiler C/C++ pour windows</title><link>https://blog.alorence.me/very-sleepy-profiler-c-cpp/</link><pubDate>Mon, 12 May 2014 14:10:00 +0200</pubDate><guid>https://blog.alorence.me/very-sleepy-profiler-c-cpp/</guid><description>&lt;p>Après avoir cherché un moment, je suis tombé sur un petit profiler, qui
ne tourne malheureusement que sous Windows. Il s&amp;rsquo;agit de &lt;a class="link" href="http://www.codersnotes.com/sleepy" target="_blank" rel="noopener"
>Very
Sleepy&lt;/a>, un fork du projet original
&lt;a class="link" href="http://sleepy.sourceforge.net/" target="_blank" rel="noopener"
>Sleepy&lt;/a> sous licence GPL 2.&lt;/p>
&lt;p>&lt;img src="https://blog.alorence.me/very-sleepy-profiler-c-cpp/images/verysleepy1.png"
width="942"
height="611"
srcset="https://blog.alorence.me/very-sleepy-profiler-c-cpp/images/verysleepy1_hu704a6412de107593df80c67b80ee1e80_65636_480x0_resize_box_3.png 480w, https://blog.alorence.me/very-sleepy-profiler-c-cpp/images/verysleepy1_hu704a6412de107593df80c67b80ee1e80_65636_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Copie d&amp;rsquo;écran very sleepy"
class="gallery-image"
data-flex-grow="154"
data-flex-basis="370px"
>&lt;/p>
&lt;p>Il permet entre autre de récupérer facilement les définitions de
symboles directement sur le site de Microsoft (bouton Download) puis de
lancer un profiling sur un programme complet (Profile All) ou sur un
thread en particulier (Profile). Une fois le profiling démarré, il
suffit d&amp;rsquo;aller exécuter la fonction que l&amp;rsquo;on cherche à analyser dans
ce programme.&lt;/p>
&lt;p>&lt;img src="https://blog.alorence.me/very-sleepy-profiler-c-cpp/images/verysleepy_profiling.png"
width="324"
height="174"
srcset="https://blog.alorence.me/very-sleepy-profiler-c-cpp/images/verysleepy_profiling_hu10fcaa979db1e44d699753ed4f095fa8_17357_480x0_resize_box_3.png 480w, https://blog.alorence.me/very-sleepy-profiler-c-cpp/images/verysleepy_profiling_hu10fcaa979db1e44d699753ed4f095fa8_17357_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Copie d&amp;rsquo;écran very sleepy"
class="gallery-image"
data-flex-grow="186"
data-flex-basis="446px"
>&lt;/p>
&lt;p>On obtient ensuite un récapitulatif avec quelques statistiques sur le
temps passé dans les différentes fonctions :&lt;/p>
&lt;p>&lt;img src="https://blog.alorence.me/very-sleepy-profiler-c-cpp/images/verysleepy2.png"
width="1222"
height="752"
srcset="https://blog.alorence.me/very-sleepy-profiler-c-cpp/images/verysleepy2_hu294f8d7bfbd28a02bb4d60b1639ac885_89187_480x0_resize_box_3.png 480w, https://blog.alorence.me/very-sleepy-profiler-c-cpp/images/verysleepy2_hu294f8d7bfbd28a02bb4d60b1639ac885_89187_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Copie d&amp;rsquo;écran very sleepy"
class="gallery-image"
data-flex-grow="162"
data-flex-basis="390px"
>&lt;/p>
&lt;p>Dans mes tests, j&amp;rsquo;ai eu quelques plantages, mais rien de bien méchant.
C&amp;rsquo;est plutôt un outil du type &amp;quot;one shot&amp;quot;, on le lance, on fait ce
qu&amp;rsquo;on a faire et c&amp;rsquo;est terminé. On ne risque pas de perdre des heures
de boulots non sauvegardées...&lt;/p>
&lt;p>Pour le télécharger, rendez-vous sur le &lt;a class="link" href="http://www.codersnotes.com/sleepy" target="_blank" rel="noopener"
>site de l&amp;rsquo;auteur&lt;/a>.&lt;/p></description></item><item><title>BitTorrent Sync - Synchroniser des dossiers sur un réseau local</title><link>https://blog.alorence.me/bittorrent-sync-synchroniser-reseau-local/</link><pubDate>Thu, 29 Aug 2013 22:30:00 +0200</pubDate><guid>https://blog.alorence.me/bittorrent-sync-synchroniser-reseau-local/</guid><description>&lt;img src="https://blog.alorence.me/bittorrent-sync-synchroniser-reseau-local/featuredImage.png" alt="Featured image of post BitTorrent Sync - Synchroniser des dossiers sur un réseau local" />&lt;p>Depuis plusieurs jours je cherchais une solution simple pour partager
automatiquement des fichiers entre plusieurs machines, et garder les
dossiers synchronisés. Dropbox c&amp;rsquo;est bien, mais ce n&amp;rsquo;est pas l&amp;rsquo;idéal
pour plusieurs raisons. D&amp;rsquo;abord partager des fichiers confidentiels ou
sensible n&amp;rsquo;est pas très conseillé. Il faut aussi placer tous ses
fichiers sous un même dossier local. Enfin, dès que l&amp;rsquo;on dépasse une
certaine taille, on est limité par la vitesse de la connexion internet
et par la taille du compte (si l&amp;rsquo;on reste sur un compte gratuit).
Aujourd&amp;rsquo;hui je pense que j&amp;rsquo;ai enfin trouvé la solution : &lt;a class="link" href="http://www.getsync.com/intl/fr/" target="_blank" rel="noopener"
>BitTorrent
Sync&lt;/a>.&lt;/p>
&lt;p>J&amp;rsquo;en avais entendu parler il y a quelques mois au moment de sa sortie,
mais sans m&amp;rsquo;y intéresser plus que ça. Je viens de retomber dessus au
hasard d&amp;rsquo;une lecture d&amp;rsquo;actualités.&lt;/p>
&lt;p>Le principe du logiciel est simple : après installation, il suffit
d&amp;rsquo;ajouter des dossiers au logiciel pour qu&amp;rsquo;il les indexe. On obtient
pour chaque dossier une clé d&amp;rsquo;un trentaine de caractères. Sur une autre
machine (ou un smartphone) il suffit d&amp;rsquo;entrer cette clé en l&amp;rsquo;associant
avec un dossier (vide ou déjà synchronisé, même partiellement) de la
même manière. Dès lors la magie opère. Les fichiers présents d&amp;rsquo;un coté
mais pas de l&amp;rsquo;autre sont copiés en utilisant le protocole BitTorrent.
Vous n&amp;rsquo;avez rien à faire, tout est automatique et cela semble plutôt
bien fonctionner.&lt;/p>
&lt;p>&lt;img src="https://blog.alorence.me/bittorrent-sync-synchroniser-reseau-local/btsync-dossiers.png"
width="790"
height="484"
srcset="https://blog.alorence.me/bittorrent-sync-synchroniser-reseau-local/btsync-dossiers_hue4c21f5a22bf5cd2fc2fb1546b676efc_15280_480x0_resize_box_3.png 480w, https://blog.alorence.me/bittorrent-sync-synchroniser-reseau-local/btsync-dossiers_hue4c21f5a22bf5cd2fc2fb1546b676efc_15280_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Bittorrent-sync copie d&amp;rsquo;écran dossiers"
class="gallery-image"
data-flex-grow="163"
data-flex-basis="391px"
>&lt;/p>
&lt;h2 id="fonctionnalités-principales">Fonctionnalités principales&lt;/h2>
&lt;ul>
&lt;li>BTSync tourne sous Windows, Linux, Mac OS, IPhone et Android&lt;/li>
&lt;li>Synchronisation des fichiers entre 2 ou plusieurs appareils, sur un
réseau local ou par internet&lt;/li>
&lt;li>Transferts sécurisés. Si deux instances ne peuvent pas communiquer à
cause d&amp;rsquo;un pare-feu (par exemple), les données sont routées par un
serveur de relais chez BitTorrent. Mais comme ils l&amp;rsquo;expliquent
&lt;a class="link" href="http://www.getsync.com/intl/fr/tech-specs" target="_blank" rel="noopener"
>ici&lt;/a>, toutes les données
sont chiffrées. Théoriquement il n&amp;rsquo;y a donc pas de risque qu&amp;rsquo;ils y
mettent leur nez&lt;/li>
&lt;li>Possibilité d&amp;rsquo;exclure certains fichiers / dossiers de la
synchronisation, avec un fichier &lt;em>.SyncIgnore&lt;/em>. Ça ressemble un peut
au &lt;em>.gitignore&lt;/em> de Git&lt;/li>
&lt;li>Connexion avec un appareil mobile simplifiée, via un QR Code&lt;/li>
&lt;li>Possibilité de transmettre une clé en lecture seule (synchronisation
unidirectionnelle)&lt;/li>
&lt;/ul>
&lt;h2 id="résolution-des-conflits">Résolution des conflits&lt;/h2>
&lt;p>C&amp;rsquo;est cette partie qui m&amp;rsquo;a particulièrement intéressé. La gestion des
conflits et leur résolution m&amp;rsquo;a semblé très bien pensée. En gros c&amp;rsquo;est
l&amp;rsquo;action humaine qui a toujours la priorité. La suppression d&amp;rsquo;un
fichier d&amp;rsquo;un coté entraîne sa suppression de l&amp;rsquo;autre, mais une copie
est conservée dans un dossier caché pas très loin. Ça apporte un
semblant de gestion de version, même si ce n&amp;rsquo;est évidemment pas du
niveau d&amp;rsquo;un vrai CVS comme Git, Svn, etc.&lt;/p>
&lt;p>&lt;img src="https://blog.alorence.me/bittorrent-sync-synchroniser-reseau-local/btsync-transferts.png"
width="790"
height="484"
srcset="https://blog.alorence.me/bittorrent-sync-synchroniser-reseau-local/btsync-transferts_huff94aac03a54ec98d183b8714032c2a5_17588_480x0_resize_box_3.png 480w, https://blog.alorence.me/bittorrent-sync-synchroniser-reseau-local/btsync-transferts_huff94aac03a54ec98d183b8714032c2a5_17588_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Bittorrent-sync copie d&amp;rsquo;écran transferts"
class="gallery-image"
data-flex-grow="163"
data-flex-basis="391px"
>&lt;/p>
&lt;p>BTSync semble donc être l&amp;rsquo;outil rêvé pour dupliquer ses données à
plusieurs endroits et réduire le risque de les voir détruites par un
crash du disque ou le vol d&amp;rsquo;un ordinateur. Il peut même servir à
partager quelques documents entre potes sans se prendre la tête avec un
VPN, pour peu que l&amp;rsquo;on ait pas besoin de la puissance d&amp;rsquo;un système de
versionning complet, comme dans le cas d&amp;rsquo;un développement à plusieurs.&lt;/p>
&lt;p>Pour le télécharger, il suffit d&amp;rsquo;aller sur &lt;a class="link" href="http://www.getsync.com/intl/fr/" target="_blank" rel="noopener"
>le site officiel BitTorrent
Sync&lt;/a>.&lt;/p></description></item><item><title>Capture d'écran d'une fenêtre Mac OS</title><link>https://blog.alorence.me/capture-ecran-mac-osx/</link><pubDate>Wed, 12 Jun 2013 23:05:00 +0200</pubDate><guid>https://blog.alorence.me/capture-ecran-mac-osx/</guid><description>&lt;img src="https://blog.alorence.me/capture-ecran-mac-osx/featuredImage.jpg" alt="Featured image of post Capture d'écran d'une fenêtre Mac OS" />&lt;p>Sous Mac OS X, le logiciel Capture permet de faire simplement des captures d&amp;rsquo;écran en TIFF. Mais quelques
raccourcis clavier simples permettent d&amp;rsquo;aller encore plus vite !&lt;/p>
&lt;ul>
&lt;li>Pour capturer entièrement l&amp;rsquo;écran : &lt;strong>⌘ + ⇧ + 3&lt;/strong>&lt;/li>
&lt;li>Pour capturer une zone à la souris : &lt;strong>⌘ + ⇧ + 4&lt;/strong>&lt;/li>
&lt;li>Pour capturer la fenêtre courante : faites le raccourci précédent (&lt;strong>⌘ + ⇧ + 4&lt;/strong>), puis appuyez sur &lt;strong>espace&lt;/strong> et cliquez sur la
fenêtre.&lt;/li>
&lt;/ul>
&lt;p>Les captures seront crées dans des fichiers PNG directement sur le
bureau.&lt;/p></description></item><item><title>Afficher des icônes dans le menu contextuel d'Ubuntu 12.04</title><link>https://blog.alorence.me/afficher-icones-menu-contextuel-ubuntu/</link><pubDate>Wed, 23 May 2012 21:34:00 +0200</pubDate><guid>https://blog.alorence.me/afficher-icones-menu-contextuel-ubuntu/</guid><description>&lt;img src="https://blog.alorence.me/afficher-icones-menu-contextuel-ubuntu/featuredImage.jpg" alt="Featured image of post Afficher des icônes dans le menu contextuel d'Ubuntu 12.04" />&lt;p>Jusqu&amp;rsquo;à présent, le gestionnaire de bureau Gnome avait la possibilité
d&amp;rsquo;afficher des icônes dans les éléments de tous les menus contextuels
et dans les boutons. Cependant les développeurs en charge du projet
avaient décidé de désactiver cette option par défaut à cause du manque
d&amp;rsquo;icônes disponibles dans les paquets. Depuis Ubuntu 12.04, c&amp;rsquo;est
terminé !&lt;/p>
&lt;p>Dans le cas où vous avez effectué une nouvelle installation d&amp;rsquo;Ubuntu
Precise, ces icônes sont certainement affichées par défaut. Mais si vous
avez mis à jour votre système depuis une version précédente, l&amp;rsquo;option
est certainement restée désactivée.&lt;/p>
&lt;p>Pour l&amp;rsquo;activer, vous devez utiliser
&lt;a class="link" href="https://blog.alorence.me/configurer-les-parametres-systemes-gnome/" >dconf-editor&lt;/a>. Naviguez jusqu&amp;rsquo;à
l&amp;rsquo;emplacement [org.gnome.desktop.interface]{.title-ref} puis cochez la
clé &lt;strong>&amp;quot;menus-have-icons&amp;quot;&lt;/strong>. Pour certains logiciels (firefox,
thunderbird, etc.), il sera peut-être nécessaire de quitter et de
relancer l&amp;rsquo;application pour visualiser les changements. Vous pouvez
aussi cocher &lt;strong>&amp;quot;buttons-have-icons&amp;quot;&lt;/strong> pour avoir des icônes dans
certains boutons.&lt;/p>
&lt;p>&lt;img src="https://blog.alorence.me/afficher-icones-menu-contextuel-ubuntu/menus.png"
width="680"
height="576"
srcset="https://blog.alorence.me/afficher-icones-menu-contextuel-ubuntu/menus_hue301ed16267fb1978ddc27c5097c0a53_79866_480x0_resize_box_3.png 480w, https://blog.alorence.me/afficher-icones-menu-contextuel-ubuntu/menus_hue301ed16267fb1978ddc27c5097c0a53_79866_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Avant / Après la modification (copie d&amp;rsquo;écran)"
class="gallery-image"
data-flex-grow="118"
data-flex-basis="283px"
>&lt;/p>
&lt;p>Note : Si les modifications ne donnent rien avec &lt;em>dconf-editor&lt;/em>, votre
système utilise peut-être l&amp;rsquo;ancienne base de données de paramètres
&lt;em>gconf-editor&lt;/em>. Les clés à modifier sont alors :&lt;/p>
&lt;pre tabindex="0">&lt;code>desktop.gnome.interface/menus_have_icons
desktop.gnome.interface/buttons_have_icons
&lt;/code>&lt;/pre>&lt;p>Cela pourrait arriver si vous utilisez Gnome 2 ou que vous avez
désactivé Unity.&lt;/p></description></item><item><title>Configurer les paramètres systèmes de Gnome et d'autres applications</title><link>https://blog.alorence.me/configurer-les-parametres-systemes-gnome/</link><pubDate>Sun, 06 May 2012 19:18:00 +0200</pubDate><guid>https://blog.alorence.me/configurer-les-parametres-systemes-gnome/</guid><description>&lt;img src="https://blog.alorence.me/configurer-les-parametres-systemes-gnome/featuredImage.jpg" alt="Featured image of post Configurer les paramètres systèmes de Gnome et d'autres applications" />&lt;p>Plusieurs options de Gnome et plus généralement d&amp;rsquo;Ubuntu ne sont pas
modifiables directement depuis l&amp;rsquo;interface utilisateur. Pour configurer
son système, il faut parfois utiliser &lt;em>gconf-editor&lt;/em>, et depuis Ubuntu
11.04 (Natty) l&amp;rsquo;utilitaire &lt;em>dconf-editor&lt;/em> destiné à remplacer le
précédent.&lt;/p>
&lt;h2 id="avant-ubuntu-1104-gconf-editor">Avant Ubuntu 11.04, &lt;em>gconf-editor&lt;/em>&lt;/h2>
&lt;p>Avant de l&amp;rsquo;utiliser, il faut l&amp;rsquo;installer :&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>sudo apt-get install gconf-editor
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Puis il suffit de le lancer en cherchant &amp;quot;Éditeur de configuration&amp;quot; ou
en tapant simplement dans un terminal :&lt;/p>
&lt;p>Avant de l&amp;rsquo;utiliser, il faut l&amp;rsquo;installer :&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>sudo gconf-editor
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;img src="https://blog.alorence.me/configurer-les-parametres-systemes-gnome/gconf-editor.png"
width="896"
height="627"
srcset="https://blog.alorence.me/configurer-les-parametres-systemes-gnome/gconf-editor_hu800079f544070085f2f13be8a4be4a67_117660_480x0_resize_box_3.png 480w, https://blog.alorence.me/configurer-les-parametres-systemes-gnome/gconf-editor_hu800079f544070085f2f13be8a4be4a67_117660_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Copie d&amp;rsquo;écran de gconf-editor"
class="gallery-image"
data-flex-grow="142"
data-flex-basis="342px"
>&lt;/p>
&lt;p>La fenêtre qui s&amp;rsquo;ouvre est alors assez simple à utiliser. À gauche, une
arborescence permet de naviguer dans la hiérarchie de la base de
données. À droite la liste des clés avec leurs valeurs en face. Il
suffit de cliquer sur une valeur pour la modifier et d&amp;rsquo;appuyer sur
entrée pour valider les changements.&lt;/p>
&lt;h2 id="depuis-ubuntu-1104-dconf-editor">Depuis Ubuntu 11.04, &lt;em>dconf-editor&lt;/em>&lt;/h2>
&lt;p>Un nouvel utilitaire vient remplacer le précédent depuis 2011. Pour
l&amp;rsquo;installer, il faut taper la commande :&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>sudo apt-get install dconf-tools
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Et le lancer en tapant :&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>sudo dconf-editor
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Celui-ci fonctionne de la même façon que le précédent, mais il est mieux
conçu en interne et à terme remplacera complètement &lt;em>gconf-editor&lt;/em>&lt;/p>
&lt;p>&lt;img src="https://blog.alorence.me/configurer-les-parametres-systemes-gnome/dconf-editor.png"
width="870"
height="589"
srcset="https://blog.alorence.me/configurer-les-parametres-systemes-gnome/dconf-editor_hua92610b56adebae462195284a7c80e05_26269_480x0_resize_box_3.png 480w, https://blog.alorence.me/configurer-les-parametres-systemes-gnome/dconf-editor_hua92610b56adebae462195284a7c80e05_26269_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Copie d&amp;rsquo;écran de gconf-editor"
class="gallery-image"
data-flex-grow="147"
data-flex-basis="354px"
>&lt;/p>
&lt;h2 id="lequel-utiliser-">Lequel utiliser ?&lt;/h2>
&lt;p>En général, si vous avez un système récent, le 2^e^. Si cela ne
fonctionne pas, il faudra utiliser &lt;em>gconf-editor&lt;/em>.&lt;/p>
&lt;p>Source &lt;a class="link" href="https://askubuntu.com/a/91409/161277" target="_blank" rel="noopener"
>Ask Ubuntu&lt;/a>&lt;/p></description></item><item><title>Explorateur à 100% à l'ouverture d'un dossier de fichiers .wav</title><link>https://blog.alorence.me/explorateur-windows-100-fichiers-wav/</link><pubDate>Thu, 05 Apr 2012 23:07:00 +0200</pubDate><guid>https://blog.alorence.me/explorateur-windows-100-fichiers-wav/</guid><description>&lt;img src="https://blog.alorence.me/explorateur-windows-100-fichiers-wav/featuredImage.jpg" alt="Featured image of post Explorateur à 100% à l'ouverture d'un dossier de fichiers .wav" />&lt;h2 id="le-problème">Le problème&lt;/h2>
&lt;p>Si vous manipulez beaucoup de fichiers audio au format wav, vous avez
peut-être remarqué que le simple fait de se balader dans un dossier de
musique avec l&amp;rsquo;explorateur de Windows 7 pouvait dans certains cas
ralentir énormément la machine voire la faire planter. En ouvrant le
gestionnaire de tâches, on se rend alors compte que le processeur tourne
à 100% sur &lt;em>explorer.exe&lt;/em> et &lt;em>dllhost.exe&lt;/em>.&lt;/p>
&lt;p>&lt;img src="https://blog.alorence.me/explorateur-windows-100-fichiers-wav/cpu100-1.png"
width="973"
height="232"
srcset="https://blog.alorence.me/explorateur-windows-100-fichiers-wav/cpu100-1_hu04475d295a9c8297b7e08e76ccf73f99_28283_480x0_resize_box_3.png 480w, https://blog.alorence.me/explorateur-windows-100-fichiers-wav/cpu100-1_hu04475d295a9c8297b7e08e76ccf73f99_28283_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Explorateur à 100%"
class="gallery-image"
data-flex-grow="419"
data-flex-basis="1006px"
>&lt;/p>
&lt;p>Le problème semble survenir lorsque les fichiers wav ont été modifiés
par certains logiciels. Notamment, si les fichiers ont été chargés dans
Traktor Pro ou dans Serato, un certain nombre de meta-données ont été
écrites au niveau du fichier. À la différence des autres types de
fichiers audio (mp3, flac, ogg, etc.), le format wav n&amp;rsquo;a pas de format
de stockage prédéfini pour les meta-données, mais il est quand même
possible d&amp;rsquo;en écrire. Le problème est que la façon dont ces données
sont enregistrées diffère d&amp;rsquo;un logiciel à l&amp;rsquo;autre. L&amp;rsquo;explorateur
Windows peut parfois partir en boucle infinie s&amp;rsquo;il n&amp;rsquo;est pas capable
de les décoder correctement.&lt;/p>
&lt;h2 id="solution">Solution&lt;/h2>
&lt;p>Il y a 2 clés de registre à modifier pour empêcher Windows d&amp;rsquo;essayer de
décoder les meta-données des fichiers wav. Ouvrez le registre en tapant
regedit.exe dans le champ de recherche du menu démarrer, puis localisez
les emplacements suivants :&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-regedit" data-lang="regedit">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.wav
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.wav
&lt;/code>&lt;/pre>&lt;p>Ouvrez pour chaque emplacement la clé &lt;em>Par défaut&lt;/em> et ajoutez
simplement un # devant la valeur.&lt;/p>
&lt;p>Si vous n&amp;rsquo;avez pas envie de manipuler la base de registre, téléchargez
&lt;a class="link" href="data/windows7_wav_patchs.zip" >ce ficher&lt;/a>. C&amp;rsquo;est une
archive zip contenant les 2 fichiers suivants :&lt;/p>
&lt;ul>
&lt;li>&lt;strong>disable_wav_meta_reading.reg&lt;/strong> Pour désactiver la lecture de
meta-données par l&amp;rsquo;explorateur windows. Ce fichier applique les
modifications décrites plus haut.&lt;/li>
&lt;li>&lt;strong>enable_wav_meta_reading.reg&lt;/strong> Pour réactiver la fonctionnalité
(si vous rencontrez des problèmes). Ce fichier annule les
modifications décrites plus haut ou appliquées par le premier
fichier.&lt;/li>
&lt;/ul>
&lt;p>Double-cliquez simplement sur le bon fichier pour appliquer les
changements. Après un redémarrage, tout devrait rentrer dans l&amp;rsquo;ordre.&lt;/p>
&lt;p>Source : &lt;a class="link" href="https://superuser.com/q/233223/181209" target="_blank" rel="noopener"
>Superuser&lt;/a>&lt;/p></description></item><item><title>La visionneuse de photos Windows 7 manque de mémoire ?</title><link>https://blog.alorence.me/bug-memoire-insuffisante-visionneuse-photos-windows-7/</link><pubDate>Sat, 30 Oct 2010 17:51:00 +0200</pubDate><guid>https://blog.alorence.me/bug-memoire-insuffisante-visionneuse-photos-windows-7/</guid><description>&lt;img src="https://blog.alorence.me/bug-memoire-insuffisante-visionneuse-photos-windows-7/featuredImage.png" alt="Featured image of post La visionneuse de photos Windows 7 manque de mémoire ?" />&lt;p>Sous Windows 7, il se peut qu&amp;rsquo;un message d&amp;rsquo;erreur s&amp;rsquo;affiche lorsque l&amp;rsquo;on cherche à ouvrir une image :&lt;/p>
&lt;blockquote>
&lt;p>La Visionneuse de photos ne peut pas afficher cette image car la
mémoire disponible est peut-être insuffisante sur votre ordinateur.
Fermez certains programmes inutilisés ou, si votre disque dur est
presque plein, libérez de l&amp;rsquo;espace disque et réessayez.&lt;/p>
&lt;/blockquote>
&lt;p>&lt;img src="https://blog.alorence.me/bug-memoire-insuffisante-visionneuse-photos-windows-7/screen-error.png"
width="772"
height="593"
srcset="https://blog.alorence.me/bug-memoire-insuffisante-visionneuse-photos-windows-7/screen-error_huf097916c37e7febd0da29d6a20492de7_18585_480x0_resize_box_3.png 480w, https://blog.alorence.me/bug-memoire-insuffisante-visionneuse-photos-windows-7/screen-error_huf097916c37e7febd0da29d6a20492de7_18585_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Copie d&amp;rsquo;écran de l&amp;rsquo;erreur"
class="gallery-image"
data-flex-grow="130"
data-flex-basis="312px"
>&lt;/p>
&lt;p>Évidemment, inutile de fermer des programmes ou d&amp;rsquo;acheter plus de
mémoire, rien n&amp;rsquo;y changera. La solution est disponible sur
&lt;a class="link" href="https://www.vistax64.com/vista-music-pictures-video/86466-not-enough-memory-error-w-photo-gallery.html#post560589" target="_blank" rel="noopener"
>Windows Vista Forums&lt;/a>.&lt;/p>
&lt;p>&lt;strong>Attention&lt;/strong> : les étapes décrites ici ne sont valables que si
&lt;strong>aucune&lt;/strong> image ne s&amp;rsquo;affiche. Si le problème n&amp;rsquo;apparait qu&amp;rsquo;avec
certaines images, cette solution ne fonctionnera pas et pourrait
empêcher la visionneuse de fonctionner pour toutes les images.&lt;/p>
&lt;p>Voici les étapes à suivre :&lt;/p>
&lt;ol>
&lt;li>Allez dans le panneau de configuration, puis ouvrez la Gestion des
couleurs (il faut désactiver l&amp;rsquo;affichage par catégories en haut à
droite si besoin).&lt;/li>
&lt;li>Dans le second onglet (Tous les profils), supprimer les profils
associés à votre écran, c&amp;rsquo;est-à-dire les profils :
&lt;ol>
&lt;li>Dont le nom correspond à la marque et au modèle de votre écran
(1&lt;sup>ère&lt;/sup>
colonne)&lt;/li>
&lt;li>Qui sont de la classe &amp;ldquo;Affichage&amp;rdquo; (3&lt;sup>e&lt;/sup>
colonne)&lt;/li>
&lt;/ol>
&lt;/li>
&lt;/ol>
&lt;p>Dans l&amp;rsquo;article original, il est aussi conseillé de revenir au pilote
par défaut pour votre moniteur (dans le gestionnaire de périphériques).
Chez moi cela n&amp;rsquo;a pas été nécessaire.&lt;/p></description></item><item><title>Modifier l'ordre des boutons de fenêtres sous Gnome</title><link>https://blog.alorence.me/modifier-ordre-boutons-fenetre-gnome/</link><pubDate>Thu, 09 Sep 2010 17:22:00 +0000</pubDate><guid>https://blog.alorence.me/modifier-ordre-boutons-fenetre-gnome/</guid><description>&lt;img src="https://blog.alorence.me/modifier-ordre-boutons-fenetre-gnome/featuredImage.jpg" alt="Featured image of post Modifier l'ordre des boutons de fenêtres sous Gnome" />&lt;p>Si comme moi vous n&amp;rsquo;aimez pas beaucoup la configuration par défaut des
nouveaux thèmes Gnome depuis la version &lt;strong>10.04 Lucid Lynx&lt;/strong>, vous avez
surement à cherché à replacer les boutons &lt;strong>Minimiser&lt;/strong>, &lt;strong>Maximiser&lt;/strong>
et &lt;strong>Fermer&lt;/strong> en haut à droite de la fenêtre.&lt;/p>
&lt;p>Comme expliqué sur le &lt;a class="link" href="http://doc.ubuntu-fr.org/tutoriel/comment_deplacer_boutons_minimiser_maximiser_fermer" target="_blank" rel="noopener"
>wiki
ubuntu&lt;/a>,
il existe 2 solutions relativement simples.&lt;/p>
&lt;p>La première consiste à installer &lt;a class="link" href="http://doc.ubuntu-fr.org/mwbuttons" target="_blank" rel="noopener"
>Metacity Window
Buttons&lt;/a>, et d&amp;rsquo;utiliser
l&amp;rsquo;interface utilisateur. Ceci implique d&amp;rsquo;ajouter un nouveau dépôt
Launchpad.&lt;/p>
&lt;p>Une autre solution consiste à modifier la configuration de Gnome
directement.&lt;/p>
&lt;ol>
&lt;li>Exécutez &lt;em>gconf-editor&lt;/em> (en console ou avec avec Alt + F2)&lt;/li>
&lt;li>Naviguez jusqu&amp;rsquo;au dossier &lt;em>/apps/metacity/general&lt;/em>&lt;/li>
&lt;li>Éditez le champ &lt;em>button_layout&lt;/em>&lt;/li>
&lt;/ol>
&lt;p>&lt;img src="https://blog.alorence.me/modifier-ordre-boutons-fenetre-gnome/gconf-editor.png"
width="896"
height="627"
srcset="https://blog.alorence.me/modifier-ordre-boutons-fenetre-gnome/gconf-editor_hu800079f544070085f2f13be8a4be4a67_117660_480x0_resize_box_3.png 480w, https://blog.alorence.me/modifier-ordre-boutons-fenetre-gnome/gconf-editor_hu800079f544070085f2f13be8a4be4a67_117660_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="Copie d&amp;rsquo;écran de gconf-editor"
class="gallery-image"
data-flex-grow="142"
data-flex-basis="342px"
>&lt;/p>
&lt;p>Le champ &lt;em>button_layout&lt;/em> se remplit de la façon suivante :&lt;/p>
&lt;ul>
&lt;li>&lt;strong>close&lt;/strong> correspond au bouton &lt;em>Fermer&lt;/em>&lt;/li>
&lt;li>&lt;strong>minimize&lt;/strong> pour &lt;em>Minimiser&lt;/em>&lt;/li>
&lt;li>&lt;strong>maximize&lt;/strong> pour &lt;em>Maximiser&lt;/em>&lt;/li>
&lt;li>&lt;strong>menu&lt;/strong> pour l&amp;rsquo;icône du &lt;em>menu&lt;/em> qui contient les entrées Toujours
au premier plan, Déplacer vers l&amp;rsquo;espace de travail de droite, etc.&lt;/li>
&lt;li>&lt;strong>:&lt;/strong> &lt;em>(deux points)&lt;/em> correspond à la séparation gauche / droite de
la barre de titre, là où sera affiché le titre de la fenêtre&lt;/li>
&lt;li>&lt;strong>spacer&lt;/strong> peut être utilisé pour ajouter un &lt;em>espace&lt;/em> (entre deux
boutons par exemple&lt;/li>
&lt;/ul>
&lt;p>Ainsi vous pouvez par exemple coller la valeur suivante dans le champ
afin d&amp;rsquo;avoir un placement des boutons similaire à Windows :&lt;/p>
&lt;pre tabindex="0">&lt;code>menu:minimize,maximize,close
&lt;/code>&lt;/pre></description></item><item><title>Support du multicast UDP dans Qt</title><link>https://blog.alorence.me/support-multicast-udp-qt/</link><pubDate>Thu, 09 Sep 2010 15:04:00 +0000</pubDate><guid>https://blog.alorence.me/support-multicast-udp-qt/</guid><description>&lt;p>Certains d&amp;rsquo;entre vous ont peut-être déjà eu besoin de mettre en place
un système de réception de &lt;strong>paquets UDP multicast&lt;/strong> dans un programme
écrit en C++ à l&amp;rsquo;aide du &lt;strong>frameworks Qt&lt;/strong>. Jusqu&amp;rsquo;à présent cette
fonctionnalité n&amp;rsquo;était pas prise en charge. Il fallait donc utiliser
les API natives correspondantes au système d&amp;rsquo;exploitation cible pour
configurer une &lt;em>QUdpSocket&lt;/em>.&lt;/p>
&lt;p>Et bien cette fonctionnalité a été implémentée dans le repository
courant de Qt, et devrais être disponible avec la prochaine version,
voir le &lt;a class="link" href="https://bugreports.qt-project.org/browse/QTBUG-8652" target="_blank" rel="noopener"
>bugtracker
Qt&lt;/a> pour plus
d&amp;rsquo;informations.&lt;/p>
&lt;p>Reste à savoir si cette fonctionnalité sortira avec Qt 4.7, prochaine
version majeure, ou Qt 4.8, ce qui obligerait à attendre encore un
peu...&lt;/p></description></item><item><title>Archives - Antoine Lorence - Blog</title><link>https://blog.alorence.me/archives/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://blog.alorence.me/archives/</guid><description/></item></channel></rss>