<?xml version="1.0" encoding="UTF-8" ?>
<!-- RSS generated by PHPBoost on Fri, 17 Apr 2026 23:50:36 +0200 -->
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Wiki Les geekeries de rungis]]></title>
		<atom:link href="https://geekrungis.fr/syndication/rss/wiki/" rel="self" type="application/rss+xml"/>
		<link>https://geekrungis.fr</link>
		<description><![CDATA[Wiki Les geekeries de rungis : derniers articles]]></description>
		<copyright>(C) 2005-2026 PHPBoost</copyright>
		<language>fr</language>
		<generator>PHPBoost</generator>
		
            <item>
                <title><![CDATA[Se connecter en ssh sans mot de passe]]></title>
                <link>https://geekrungis.fr/wiki/se-connecter-en-ssh-sans-mot-de-passe</link>
                <guid>https://geekrungis.fr/wiki/se-connecter-en-ssh-sans-mot-de-passe</guid>
                <description><![CDATA[Si la connexion de fonctionne pas, tail -f /var/log/auth.log<br />
<br />
On pourra notamment y trouver : Authentication refused: bad ownership or modes for file /srv/fad3326e-0020-42e3-8aef-6334719901b7/Homes/Remi/.ssh/authorized_keys<br />
<br />
Il faut alors faire un chmod 644 sur le fichier authorized_keys<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-demande-du-mot-de-passe-malgre-avoir-fait-le-ssh-copy-id">Demande du mot de passe malgré avoir fait le ssh-copy-id</h2><br />

<br />
Par défaut, ssh tente de se connecter avec une clé privée par défaut. Pour spécifier une clé spécifique : on ajoute l'option -i ficher_clé ou on ajoute l'information dans .ssh/config :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
Host 192.168.1.51
         User Remi
         IdentityFile ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>key-smb1
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-demande-d-entrer-la-passphrase-a-chaque-connection">Demande d'entrer la passphrase à chaque connection</h2><br />

<br />
Il faut d'abord vérifier que ssh-agent est démarré :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ssh-agent</span> -s<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper notice">Doit retourner le numéro du processus : Agent pid ####</span><br />
<br />
Dans le cas de l'utilisation d'un autre shell, il peut être nécessaire de le préciser.<br />
Par exemple dans fish :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ssh-agent</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>fish
&nbsp;</pre></pre></div></div><br />
<br />
Si il est bien démarré, il faut ajouter sa clé à l'agent ssh :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ssh-add</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>key-smb1
&nbsp;</pre></pre></div></div><br />
<br />
En fonction de l'environnement de bureau utilisé, il peut-être nécessaire de faire une manip. en plus.<br />
<br />
Sur KDE Plasma, il est nécessaire de vérifier que que le portefeuille KDE est actif puis de s'assurer que assurer que l'agent SSH utilise bien ksshaskpass avec la commande :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">-x</span> SSH_ASKPASS <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ksshaskpass
&nbsp;</pre></pre></div></div><br />]]></description>
                <pubDate>Sun, 24 Aug 2025 21:52:26 +0200</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Domotique]]></title>
                <link>https://geekrungis.fr/wiki/domotique</link>
                <guid>https://geekrungis.fr/wiki/domotique</guid>
                <description><![CDATA[Je vous partage quelques tips relatifs à l'utilisation de jeedom et de Home Assistant.]]></description>
                <pubDate>Sun, 02 Feb 2025 15:33:31 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[[HomeAssistant] Installer zigbee2mqtt et mosquitto sur docker]]></title>
                <link>https://geekrungis.fr/wiki/homeassistant-installer-zigbee2mqtt-et-mosquitto-sur-docker</link>
                <guid>https://geekrungis.fr/wiki/homeassistant-installer-zigbee2mqtt-et-mosquitto-sur-docker</guid>
                <description><![CDATA[<h2 class="formatter-title wiki-paragraph-2" id="paragraph-introduction">Introduction</h2><br />

<br />
Dans cet article, je vais détailler comment installer Zigbee2mqtt et Mosquitto sur un serveur Docker.<br />
Le but est de pouvoir piloter des équipements Zigbee (ampoules, prises, capteurs, etc.) via un serveur MQTT conectable à Home Assistant mais en installant le broker et Zigbee2mqtt à part, ce qui vous permettra dans le futur, si besoin de migrer vers un autre système domotique sans devoir appairer à nouveau tous vos équipements Zigbee.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-prerequis">Prérequis</h2><br />

<br />
- Un serveur Docker fonctionnel (personnellement, j'utilise une VM Debian sur mon serveur Proxmox avec docker et Portainer installés dessus).<br />
- Un dongle Zigbee compatible avec Zigbee2mqtt (CC2531, CC2530, CC2531, etc.) >> pour cela, je vous invite à consulter mon article qui vous décrit le flashage du dongle Sonooff Zigbee 3.0 Dongle Plus.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-de-mosquitto-et-zigbee2mqtt-dans-une-stack-docker">Installation de Mosquitto et Zigbee2mqtt dans une stack Docker</h2><br />

<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-deploiement-de-la-stack">Déploiement de la stack</h3><br />

<br />
Je vous donne ma méthode valable avec Portainer.<br />
Allez sur votre portainer, puis dans votre environnement puis cliquez sur "Stacks" et enfin sur "Add stack".<br />
<br />
Copiez le docker-compose suivant dans le champ "Web editor" :<br />
<br />
<div class="formatter-container formatter-code code-YAML"><span class="formatter-title">Code YAML : </span><div class="formatter-content"><pre style="display:inline;"><pre class="yaml" style="font-family:monospace;">&nbsp;
services:
  mosquitto:
    image: eclipse-mosquitto
    container_name: mosquitto
    restart: always
    volumes:
      - /opt/docker/mosquitto/config:/mosquitto/config
      - /opt/docker/mosquitto/data:/mosquitto/data
      - /opt/docker/mosquitto/log:/mosquitto/log
    ports:
      - 1883:1883
      - 9001:9001
&nbsp;
  zigbee2mqtt:
    image: koenkk/zigbee2mqtt
    container_name: zigbee2mqtt
    restart: unless-stopped
    volumes:
      - /opt/docker/zigbee2mqtt:/app/data
      - /run/udev:/run/udev:ro
    devices:
      - /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_d6c634615252ef1185b12a53cc32aab1-if00-port0:/dev/ttyUSB0 
    ports:
      - 8080:8080
    environment:
      - TZ=Europe/Paris
&nbsp;</pre></pre></div></div><br />
<br />
Quelques explications :<br />
- pour mosquitto, on utilise l'image officielle eclipse-mosquitto. Il est important de monter les volumes pour la configuration, les données et les logs.<br />
  Pour le montage des volumes, j'utilise la méthode qui consiste à créer un dossier par conteneur dans /opt/docker/.<br />
  Pour les ports, veillez à ce que ces ports ne soient pas déjà utilisés sur votre serveur.<br />
- pour zigbee2mqtt, on utilise l'image officielle koenkk/zigbee2mqtt. Il est important de monter le volume pour les données et de monter le device du dongle Zigbee.<br />
  Pour les ports, veillez à ce que ces ports ne soient pas déjà utilisés sur votre serveur. L'environnement TZ permet de définir le fuseau horaire.<br />
<br />
<span class="message-helper bgc notice"><br />
Pour trouver le device du dongle Zigbee (ici "usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_d6c634615252ef1185b12a53cc32aab1-if00-port0"), vous pouvez utiliser la commande suivante : `ls -l /dev/serial/by-id/usb*` sur votre serveur qui héberge docker.<br />
Faites attention à bien formater la ligne<br />
</span><br />
<br />
<span class="message-helper bgc warning"><br />
La stack est maintenant déployée et les deux conteneurs installés. Cependant, il reste un peu de configuration à faire pour les deux conteneurs.<br />
</span><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-configuration-de-zigbee2mqtt">Configuration de zigbee2mqtt</h3><br />

<br />
Si votre conteneur redémarre sans arrêt (ce qui était mon cas), il est possible que le fichier de configuration ne soit pas correctement configuré (chez moi il était inexistant...).<br />
Vous pouvez dans ce cas arrêter le conteneur avant de créer ou modifier le fichier configuration.yaml<br />
<br />
Ici, il faut commencer par modifier (ou créer, dans mon cas le fichier n'existait pas) le fichier configuration.yaml dans le dossier /opt/docker/zigbee2mqtt.<br />
Voici un exemple de fichier de configuration :<br />
<br />
<div class="formatter-container formatter-code code-YAML"><span class="formatter-title">Code YAML : </span><div class="formatter-content"><pre style="display:inline;"><pre class="yaml" style="font-family:monospace;">&nbsp;
homeassistant:
  enabled: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.1.82
  user: admin
  password: supermotdepasse
availability:
  enabled: true
  active:
    timeout: 10
  passive:
    timeout: 1500
serial:
  port: /dev/ttyUSB0
frontend:
  enabled: true
  port: 8080
&nbsp;</pre></pre></div></div><br />
<br />
Le base_topic est le nom du topic MQTT qui sera utilisé pour les équipements Zigbee. Vous pouvez mettre ce que vous souhaitez.<br />
L'adresse IP du serveur correspond à l'adresse IP de votre serveur Docker.<br />
<br />
<span class="message-helper bgc notice"><br />
Retenez bien le mot de passe que vous avez mis dans le fichier de configuration, il vous sera utile dans la configuration de mosquitto.<br />
</span><br />
<br />
Ensuite, ajoutez l'utilisateur au groupe dialout pour qu'il puisse accéder au dongle Zigbee :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
usermod -a -G dialout $USER
&nbsp;</pre></pre></div></div><br />
<br />
Puis donnez les bons droits aux dossier utiles :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
chmod -R 755 /opt/docker/zigbee2mqtt/
chown -R 1000:1000 /opt/docker/zigbee2mqtt/
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
Si comme moi vous avez une erreur du type : Configuration is not consistent with adapter state/backup! dans les logs du conteneur, il faut supprimer le fichier /opt/docker/zigbee2mqtt/coordinator_backup.json et redémarrer le conteneur.<br />
</span><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-configurations-du-conteneur-mosquitto">Configurations du conteneur mosquitto</h3><br />

<br />
<span class="message-helper bgc notice"><br />
Comme pour zigbee2mqtt, vous pouvez arrêter le conteneur s'il redémarre sans cesse, avant de créer le fichier de configuration.<br />
</span><br />
<br />
La première chose à faire est de créer le fichier de configuration de mosquitto.<br />
Pour cela, créez le fichier /opt/docker/mosquitto/config/mosquitto.conf (à adapter à votre installation ,ce chemin correspond à celui que j'ai utilisé dans le docker-compose)<br />
et ajoutez-y le contenu suivant :<br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
listener 1883
listener 9001
allow_anonymous true
protocol websockets
password_file mosquitto/config/mqtt_passwd
&nbsp;</pre></pre></div></div><br />
<br />
On retrouve ici le dossier /mosquitto/data créé dans docker-compose. Les ports sont également à adapter à votre docker-compose.<br />
On voit également un renvoi vers le fichier mqtt_passwd, on va le créer maintenant.<br />
<br />
Pour cela, on va devoir entrer dans le conteneur :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
docker exec -it mosquitto sh
&nbsp;</pre></pre></div></div><br />
<br />
Une fois dans le conteneur, on va créer l'utilisateur avec la commande suivante :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
mosquitto_passwd -c /mosquitto/config/mqtt_passwd admin
&nbsp;</pre></pre></div></div><br />
<br />
Il vous sera demandé de saisir un mot de passe, saisissez le mot de passe que vous avez mis dans le fichier de configuration de zigbee2mqtt.<br />
<br />
Vos deux conteneurs devraient normalement être fonctionnels et vous permettre de piloter vos équipements Zigbee via MQTT.<br />
Vous pouvez maintenant vous connecter à l'interface web de Zigbee2mqtt en vous rendant sur <a class="offload" href="http://192.168.1.82:8080">http://192.168.1.82:8080</a> (adaptez l'adresse, il s'agit de l'adresse de votre serveur Docker).]]></description>
                <pubDate>Sun, 02 Feb 2025 15:19:48 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Remapper son clavier sous Wayland]]></title>
                <link>https://geekrungis.fr/wiki/remapper-son-clavier-sous-wayland</link>
                <guid>https://geekrungis.fr/wiki/remapper-son-clavier-sous-wayland</guid>
                <description><![CDATA[Un tuto très rapide pour remapper son clavier sous Wayland. Sur le net, vous trouverez plein de tutos pour faire cela sous X11 mais dans wayland, c'est plus pauvre.<br />
<br />
Pour cela, utilisez le logiciel input remapper. Je vous donne en exemple l'installation et la mise en route sous Fedora :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dnf <span style="color: #c20cb9; font-weight: bold;">install</span> input-remapper
<span style="color: #c20cb9; font-weight: bold;">sudo</span> systemctl <span style="color: #7a0874; font-weight: bold;">enable</span> <span style="color: #660033;">--now</span> input-remapper
&nbsp;</pre></pre></div></div><br />
<br />
Il suffit ensuite de lancer l'application et de configurer vos remapping dans l'onglet Editor.<br />
<br />
<img src="https://geekrungis.fr/upload/input-remapper.png" alt="input-remapper" /><br />
<br />]]></description>
                <pubDate>Sun, 16 Jun 2024 23:02:13 +0200</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Monter automatiquement une partition chiffrée]]></title>
                <link>https://geekrungis.fr/wiki/monterautomatiquementunepartitionchiffre</link>
                <guid>https://geekrungis.fr/wiki/monterautomatiquementunepartitionchiffre</guid>
                <description><![CDATA[Bonjour, aujourd'hui, un article un peu spécifique sur une procédure que j'ai du réaliser et qui m'a demandé pas mal de tests en machine virtuelle avant d'y arriver...<br />
Voici le contexte. Sur mon ordinateur portable, j'ai installé fedora avec du LVM crypté et j'ai donc (mauvais choix peut-être) tout le volume physique qui est crypté et qui contient mon volume group et deux volumes logiques (root et home).<br />
<br />
Pour des questions de place insuffisante, j'ai souhaité ajouter un disque dur sur lequel je ne mettrai que home et le disque inital ne contiendrai que root.<br />
Autre critère pour moi, je ne souhaite pas taper plusieurs mots de passe...<br />
<br />
Et bien c'est parti !<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-montageautomatiquedelapartitioninitialementcrypte">Montage automatique de la partition initialement cryptée</h2><br />

<br />
Le principe ici est d'utiliser dracut. Habituellement, on va chercher le fichier de clé soit sur une clé usb branchée soit sur une autre partition et on l'indique dans le fstab. Ici cela ne fonctionne pas du fait que la partition qui héberge root est cryptée.<br />
Pour cela, on va utiliser une clé que nous allons mettre dans /boot de façon à ce qu'elle soit accessible.<br />
Je vous renvois vers l'article que j'ai fait sur le sujet ici pour créer cette clé : <a class="offload" href="https://geekrungis.fr/wiki/montage-d-un-volume-crypte-au-demarrage-du-systeme">Article sur LVM</a><br />
<br />
Pas besoin de modifier le fstab mais il faut par contre mettre à jour crypttab (vous devriez normalement déjà y avoir une ligne mais il faut la modifier pour prendre en compte la clé)<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
luks-50de9237-1abf-4bf2-a065-8800fbbeda53 <span style="color: #007800;">UUID</span>=50de9237-1abf-4bf2-a065-8800fbbeda53 <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>.keyfile_luks discard
&nbsp;</pre></pre></div></div><br />
<br />
Ensuite, on va demander à dracut d'aller chercher cette clé<br />
Créer le fichier /etc/dracut.conf.d/copy-keyfile.conf et y ajouter la ligne suivante :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
install_items+=<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>.keyfile_luks
&nbsp;</pre></pre></div></div><br />
<br />
Mettez ensuite à jour dracut<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
dracut <span style="color: #660033;">-f</span>
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc warning"><br />
Soyez prudent, avec cette configuration, votre partition root est accessible à toute personne qui utiliserait une livecd pour démarrer. Il suffit d'ouvrir le conteneur luks avec la clé puisque celle-ci se trouve sur la partition boot non verrouillée<br />
</span><br />
<br />
On peut ensuite vérifier que cela a bien été pris en compte :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
lsinitrd
&nbsp;</pre></pre></div></div><br />
<br />
Devrait vous renvoyer :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #660033;">-r--------</span>   <span style="color: #000000;">1</span> root     root           <span style="color: #000000;">32</span> Aug  <span style="color: #000000;">9</span> <span style="color: #000000;">20</span>:09 <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>.keyfile_luks
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-la-nouvelle-partition-home">La nouvelle partition home</h2><br />

<br />
Ici, nous allons monter automatiquement notre nouvelle partition home sans clé ni pass-phrase. Le principe est tout simplement de mettre en passphrase le mot de passe de la session utilisateur et d'utiliser pam pour décrypter cette partition lorsuq'on entre le mot de passe de la session.<br />
Encore une fois, je vous renvoi vers un article que j'ai écrit sur la façon de créer une partition chiffréé. Cela s'applique aussi à une partition dans un volume logique. Article ici : <a class="offload" href="https://geekrungis.fr/wiki/sauvegarde-distante-sur-un-disque-dur-externe-chiffre">Sauvegarde distante sur un disque dur externe chiffré</a><br />
<br />
Nous allons donc monter et décrypter cette partition de façon automatique après ouverture de la session.<br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-installationdeslibrairiesncessaires">Installation des librairies nécessaires</h3><br />

<br />
Installez ensuite la librairie nécessaire (ici c'est pour une base redhat, à adapter en fonction de votre distribution):<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dnf <span style="color: #c20cb9; font-weight: bold;">install</span> pam_mount
&nbsp;</pre></pre></div></div><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-modification-du-fstab">Modification du fstab</h3><br />

<br />
Modifier votre fichier /etc/fstab :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>homevg-homelv       <span style="color: #000000; font-weight: bold;">/</span>home        ext4    rw,<span style="color: #007800;">helper</span>=crypt,noauto  <span style="color: #000000;">0</span>       <span style="color: #000000;">0</span>
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
Le premier paramètre correspond à la partition, ici chez moi il s'agit d'une partition sur un volume logique. N'oubliez pas le "helper=crypt"<br />
</span><br />
<br />
<span class="message-helper bgc warning"><br />
Il n'a rien à ajouter dans /etc/crypttab pour cette partition !<br />
</span><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-paramtragedepam_mount">Paramétrage de pam_mount</h3><br />

<br />
Editez le fichier /etc/security/pam_mount.conf.xml et ajouter au début de celui-ci, après la première balise <pam-mount> et après la ligne <! --Volume definition -->, la ligne suivante :<br />
<div class="formatter-container formatter-code code-XML"><span class="formatter-title">Code XML : </span><div class="formatter-content"><pre style="display:inline;"><pre class="xml" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;"><volume</span> <span style="color: #000066;">user</span>=<span style="color: #ff0000;">"remi"</span> <span style="color: #000066;">mountpoint</span>=<span style="color: #ff0000;">"/home"</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">"/dev/mapper/homevg-homelv"</span> <span style="color: #000066;">fstype</span>=<span style="color: #ff0000;">"crypt"</span> <span style="color: #000066;">options</span>=<span style="color: #ff0000;">"relatime"</span><span style="color: #000000; font-weight: bold;">/></span></span>
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
volume user permet de restreindre les utilisateur, on peut mettre * si on ne souhaite pas de restriction<br />
Il faut bien sûr adapter le mountpoint et le path à votre cas<br />
</span><br />
<br />
Ensuite, c'est ici que j'ai eu le plus de mal, il y a des lignes à ajouter dans le bon fichier et dans le bon ordre. Je vous donne ma configuration qui fonctionne sur une fedora sous Gnome.<br />
Je vous renvoi vers ces deux sites desquels je me suis inspiré si vous n'avez pas les mêmes fichiers :<br />
<ul class="formatter-ul">
<li class="formatter-li"> <a class="offload" href="https://wiki.archlinux.org/title/pam_mount">pam_mount</a>
</li><li class="formatter-li"> <a class="offload" href="https://www.spinics.net/linux/fedora/fedora-users/msg500088.html">Mount samba share using pam_mount</a><br />
</li></ul><br />
<br />
J'ai donc modifié le fichier /etc/pam.d/gdm-password et j'ai ajouté les lignes suivantes :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
auth optional pam_mount.so
&nbsp;</pre></pre></div></div><br />
avant la ligne "auth substack password-auth"<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
password optional pam_mount.so
&nbsp;</pre></pre></div></div><br />
avant la ligne "password substack password-auth"<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
session optional pam_mount.so
&nbsp;</pre></pre></div></div><br />
avant la ligne "session required pam_selinux.so close"<br />
<br />
<span class="message-helper bgc warning"><br />
Je l'ai déjà mentionné plus haut mais pour que cela fonctionne, la passphrase du volume ou de la partition cryptée doit être le même que le mot de passe de session.<br />
</span><br />]]></description>
                <pubDate>Tue, 05 Dec 2023 10:58:43 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Monter automatiquement une partition chifréée à l'aide de pam et dracut]]></title>
                <link>https://geekrungis.fr/wiki/monterautomatiquementunepartitionchifreol\'aidedepametdracut</link>
                <guid>https://geekrungis.fr/wiki/monterautomatiquementunepartitionchifreol\'aidedepametdracut</guid>
                <description><![CDATA[test]]></description>
                <pubDate>Wed, 29 Nov 2023 14:35:24 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Paramétrer simplement l'envoi de mail sur un serveur]]></title>
                <link>https://geekrungis.fr/wiki/parametrer-simplement-l-envoi-de-mail-sur-un-serveur</link>
                <guid>https://geekrungis.fr/wiki/parametrer-simplement-l-envoi-de-mail-sur-un-serveur</guid>
                <description><![CDATA[Dans cet article, nous allons décrire comment paramétrer l'envoi de mail à a partir d'un serveur. Cela peut s'avérer très utile pour qu'un serveur envoi des mails lors de la réalisation d'une tache, ou pour intégrer l''envoi d'un mail dans un script.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installationdespaquetsncessaires">Installation des paquets nécessaires</h2><br />

<br />
Je donne les commandes ici pour Debian et dérivés mais ces paquets existent sur d'autres distributions.<br />
<br />
On installe les paquets msmtp, msmtp-mta ainsi que bsd-mailx.<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> apt <span style="color: #c20cb9; font-weight: bold;">install</span> msmtp msmtp-mta bsd-mailx</pre></pre></div></div><br />
<br />
Ce dernier paquet est utile seulement si vous souhaitez utiliser la commande mail pour l'envoi des messages. Sans ce paquet, seule la commande msmtp fonctionne. Pour un script, ce n'est pas grave mais certains logiciels envoient des mails seulement par la commande mail. C'est le cas par exemple de unattended-upgrades<br />
<br />
Vérifier ensuite que le système utilise bien msmtp pour l'envoi de mails :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-la</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span>
&nbsp;</pre></pre></div></div><br />
<br />
Doit retourner :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span> -<span style="color: #000000; font-weight: bold;">></span> ..<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>msmtp
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-configuration">Configuration</h2><br />

<br />
Pour fonctionner, le service s'appui sur le fichier de configuration suivant, à éditer :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>msmtprc</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
Ce fichier fonctionne pour envoyer des mail à partir du compte root. Pour envoyer un mail à partir d'un autre utilisateur, créer un fichier .msmtprc dans le dossier utilisateur<br />
</span><br />
<br />
On peut y insérer les options par défaut pour tous les comptes que l'on paramètre :<br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
# Valeurs par defaut pour tous les comptes.
defaults
auth           on
tls            on
tls_starttls   off
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        /var/log/msmtp.log
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc warning"><br />
Attention à la configuration en fonction de votre fournisseur de mail. Par exemple, Infomaniak ne supporte pas le STARTTLS il faut utiliser le port 465, activer tls mais désactiver STARTTLS<br />
</span><br />
<br />
<br />
<span class="message-helper bgc warning"><br />
L'utilisateur qui enverra le mail doit avoir accès au fichier de log. On peut donc soit créer un fichier de log dans le dossier de l'utilisateur soit lui donner les droits sur ce fichier de log.<br />
</span><br />
<br />
On créé ensuite une partie pour chaque compte que l'on souhaite paramétrer :<br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
account            [nom du compte]
host               [serveur smtp]
port               [port smtp]
from               [adresse mail] ou [Nom expéditeur]
user               [utilisateur du compte mail utilisé]
password           [mot de passe du compte mail]
&nbsp;</pre></pre></div></div><br />
<br />
Par exemple, pour un compte gmail<br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
account            Gmail rungis
host               smtp.gmail.com
port               587
from               Rungis
user               votreadressemail@gmail.com
password           MonMotDePasseGmail
&nbsp;</pre></pre></div></div><br />
<br />
Ajouter une ligne à la fin du fichier pour spécifier le nom du compte par défaut à utiliser<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
account default : Gmail rungis
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc warning"><br />
Vu que le fichier contient le mot de passe du compte mail, pensez à réduire les droits sur ce fichier avec les commandes suivantes :<br />
</span><br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> root:root <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>msmtprc
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>msmtprc
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-test">Test</h2><br />

<br />
Vous pouvez ensuite tester l'envoi d'un mail par la commande suivante :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Corps du mail"</span> <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">"Sujet du mail"</span> <span style="color: #660033;">--</span> destinataire<span style="color: #000000; font-weight: bold;">@</span>gmail.com</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-de-mutt">Installation de mutt</h2><br />

<br />
msmtp fonctionne seul mais mutt offre plus de fonctionnalités, notamment l'envoi de pièces jointes.<br />
<br />
On installe mutt :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
apt update
apt <span style="color: #c20cb9; font-weight: bold;">install</span> mutt
&nbsp;</pre></pre></div></div><br />
<br />
Puis on créé le fichier .muttrc dans le dossier home de l'utilisateur :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">vim</span> ~<span style="color: #000000; font-weight: bold;">/</span>.muttrc
&nbsp;</pre></pre></div></div><br />
<br />
Et on y ajoute les lignes suivantes :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">sendmail</span>=<span style="color: #ff0000;">"/bin/msmtp"</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">use_from</span>=no
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
Pas besoin de plus d'options, le reste est déjà défini dans le fichier de configuration de msmtp<br />
</span><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-test-avec-mutt">Test avec mutt</h2><br />

<br />
On peut tout d'abord créer une petite pièce jointe de test<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"coucou"</span> <span style="color: #000000; font-weight: bold;">>></span> fichiertest.txt
&nbsp;</pre></pre></div></div><br />
<br />
Puis on envoi ce fichier à l'adresse souhaitée :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"texte dans le mail"</span> <span style="color: #000000; font-weight: bold;">|</span> mutt <span style="color: #660033;">-s</span> <span style="color: #ff0000;">"Sujet du mail"</span> <span style="color: #660033;">-a</span> fichiertest.txt <span style="color: #660033;">--</span> adresse<span style="color: #000000; font-weight: bold;">@</span>mail.from
&nbsp;</pre></pre></div></div><br />]]></description>
                <pubDate>Sun, 12 Nov 2023 19:27:32 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Gestion des paquets sous Debian]]></title>
                <link>https://geekrungis.fr/wiki/gestion-des-paquets-sous-debian</link>
                <guid>https://geekrungis.fr/wiki/gestion-des-paquets-sous-debian</guid>
                <description><![CDATA[Ici, je ne vous ferai pas un article sur comment installer un paquet mais juste quelques commandes qu'on utilise pas souvent mais qui sont pratiques.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-rtrograderunpaquet">Rétrograder un paquet</h2><br />

<br />
Si vous avez besoin de réinstaller une version plus ancienne d'un paquet :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> apt <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #007800;">packagename</span>=version
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
packagename = nom du paquet<br />
version = version souhaitée du paquet<br />
</span><br />
<br />
Par exemple, pour rétrograder influlxdb2 de la version 2.7.3-1 à la version 2.7.1-1 :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> apt <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #007800;">influxdb2</span>=2.7.1-<span style="color: #000000;">1</span>
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-empcherlamiseojourd'unpaquet">Empêcher la mise à jour d'un paquet</h2><br />

<br />
En lien avec la commande précédente, si vous souhaitez que ce même paquet ne soit pas mis à jour lors de vos prochains update :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-mark</span> hold influxdb2
&nbsp;</pre></pre></div></div><br />
<br />
Vous pouvez lister les paquets bloqués :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-mark</span> showhold
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc warning"><br />
Attention à ne pas laisser un paquet bloqué trop longtemps. Vous pourrez avoir des problèmes de sécurité avec un paquet non mis à jour.<br />
</span><br />]]></description>
                <pubDate>Sun, 12 Nov 2023 15:18:43 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Prise en compte du changement de port SSH sur un conteneur LXC]]></title>
                <link>https://geekrungis.fr/wiki/prise-en-compte-du-changement-de-port-ssh-sur-un-conteneur-lxc</link>
                <guid>https://geekrungis.fr/wiki/prise-en-compte-du-changement-de-port-ssh-sur-un-conteneur-lxc</guid>
                <description><![CDATA[Encore un article très rapide, cette fois-ci sur un problématique de prise en compte de port SSH...<br />
Dans la configuration de mes VM et de mes CT LXC, j'aime bien changer le port SSH pour plus de sécurité. Sauf que lorsque vous faites cela sur un conteneur LXC sous Debian, et bien cela ne fonctionne pas...<br />
<br />
Pour rappel, pour modifie le port d'écoute ssh, on modifie le fichier /etc/ssh/sshd_config :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
Port <span style="color: #000000;">8542</span>
&nbsp;</pre></pre></div></div><br />
<br />
Lorsque vous faites :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
systemctl restart sshd.service
&nbsp;</pre></pre></div></div><br />
<br />
et bien ce n'est pas pris en compte...<br />
<br />
Si vous faites :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
systemctl reload sshd.service
&nbsp;</pre></pre></div></div><br />
<br />
cela fonctionne mais après un reboot, le serveur écoute à nouveau sur le port par défaut (22).<br />
<br />
Pour que la configuration soit effective, même après un reboot, deux commandes :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
systemctl disable ssh.socket
systemctl <span style="color: #7a0874; font-weight: bold;">enable</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span>
&nbsp;</pre></pre></div></div><br />
<br />
Et voilà, un reboot, c'est toujours OK  avec le nouveau port !]]></description>
                <pubDate>Sun, 05 Nov 2023 14:43:16 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Ecrire ses articles en BBCode avec Visual Studio Code]]></title>
                <link>https://geekrungis.fr/wiki/ecrire-ses-articles-en-bbcode-avec-visual-studio-code</link>
                <guid>https://geekrungis.fr/wiki/ecrire-ses-articles-en-bbcode-avec-visual-studio-code</guid>
                <description><![CDATA[<p style="text-align: center;"><br />
<img src="https://geekrungis.fr/upload/logo_phpboost.png" alt="Logo phpBoost" style="width: 300px" /><br />
</p><br />
<br />
Aujourd'hui un article sur phpBoost : comment écrire ses articles dans phpBoost avec Visual Studio Code !<br />
Vous gagnerez beaucoup de temps et pourrez en plus écrire vos articles sauvegardés dans un coin pour publier plus tard par exemple.<br />
<br />
<span class="message-helper bgc notice"><br />
Je vais supposer que vous utilisez Visual Studio Code et que vous l'avez déjà installé...<br />
</span><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-de-l-extension">Installation de l'extension</h2><br />

<br />
Une extension existe dans VSCode pour le BBCOde, je trouve qu'elle n'apporte pas grand chose mais elle vous ajoutera le type de fichier BBCode, c'est important pour la suite.<br />
Cherchez BBCode dans les extensions et vous la trouverez. Sinon, voici le lien : <a class="offload" href="https://marketplace.visualstudio.com/items?itemName=rickvansloten.bbcode">Extension BBCode</a><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-ajout-du-snippet">Ajout du snippet</h2><br />

<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-mthode1:snippetddiauxfichiers.bbcode">Méthode 1 : snippet dédié aux fichiers .bbcode</h3><br />

<br />
Créez un nouveau fichier où vous le souhaitez et donnez lui l'extension .bbcode<br />
Puis en bas à gauche de la fenêtre de VSCode, cliquez sur la roue dentée puis sur "Extraits de code de l'utilisateur" (User Snippets si votre interface est en anglais).<br />
<br />
Cliquez ensuite sur bbcode. Un nouveau fichier bbcode.json doit normalement se créer, vous avez un exemple de son utilisation en tête du fichier.<br />
Collez y le code suivant avant la dernière accolade fermée, je vous explique juste après :<br />
<br />
<div class="formatter-container formatter-code code-JSON"><span class="formatter-title">Code JSON : </span><div class="formatter-content"><pre style="display:inline;"><pre class="json" style="font-family:monospace;">&nbsp;
  "Code bash": {
    "prefix": "bash",
    "body": [
      "[code=bash]",
      "$1",
      "[/code]",
      "$0"
    ],
    "description": "Insertion de code bash"
    }
  "Paragraphe centré": {
    "prefix": "center",
    "body": [
      "[align=center]",
      "$1",
      "[/align]",
      "$0"
    ],
    "description": "Insertion d'un paragraphe centré"
    }
  "Image": {
    "prefix": "img",
    "body": [
      "[figure=${1:Légende affichée}][img alt=\"${2:Texte alternatif}\" style=\"width: ${3:500}px\"]/upload/$4[/img][/figure]"
      "$0"
    ],
    "description": "Insertion d'une image"
    } 
  "Insertion d'une information": {
    "prefix": "info",
    "body": [
      "[style=notice]",
      "$1",
      "[/style]",
      "$0"
    ],
    "description": "Insertion d'une information"
    }
  "Insertion d'une question": {
    "prefix": "q?",
    "body": [
      "[style=question]",
      "$1",
      "[/style]",
      "$0"
    ],
    "description": "Insertion d'une question"
    }
  "Insertion d'un succès": {
    "prefix": "succes",
    "body": [
      "[style=success]",
      "$1",
      "[/style]",
      "$0"
    ],
    "description": "Insertion d'un succès"
    }
  "Insertion d'un avertissement": {
    "prefix": "warn",
    "body": [
      "[style=warning]",
      "$1",
      "[/style]",
      "$0"
    ],
    "description": "Insertion d'un avertissement"
    }
  "Insertion d'une erreur": {
    "prefix": "err",
    "body": [
      "[style=error]",
      "$1",
      "[/style]",
      "$0"
    ],
    "description": "Insertion d'une erreur"
    }
  "Insertion d'un lien web": {
    "prefix": "url",
    "body": [
      "[url=https://$1]${2:Texte à afficher}[/url]",
      "$0"
    ]
  }
  "Liste à 2 items": {
    "prefix": "ls2",
    "body": [
      "[list]",
      "[*]$1",
      "[*]$2",
      "[/list]",
      "$0"
    ],
    "description": "Insertion d'une liste à 2 items"
    } 
  "Liste à 3 items": {
    "prefix": "ls3",
    "body": [
      "[list]",
      "[*]$1",
      "[*]$2",
      "[*]$3",
      "[/list]",
      "$0"
    ],
    "description": "Insertion d'une liste à 3 items"
    } 
&nbsp;
  "Liste à 4 items": {
    "prefix": "ls4",
    "body": [
      "[list]",
      "[*]$1",
      "[*]$2",
      "[*]$3",
      "[*]$4",
      "[/list]",
      "$0"
    ],
    "description": "Insertion d'une liste à 4 items"
    }
&nbsp;
  "Liste à 5 items": {
    "prefix": "ls5",
    "body": [
      "[list]",
      "[*]$1",
      "[*]$2",
      "[*]$3",
      "[*]$4",
      "[*]$5", 
      "[/list]",
      "$0"
    ],
    "description": "Insertion d'une liste à 5 items"
    } 
  "Liste ordonnée à 2 items": {
    "prefix": "lso2",
    "body": [
      "[list=ordered]",
      "[*]$1",
      "[*]$2",
      "[/list]",
      "$0"
    ],
    "description": "Insertion d'une liste ordonnée à 2 items"
    } 
  "Liste ordonnée à 3 items": {
    "prefix": "lso3",
    "body": [
      "[list=ordered]",
      "[*]$1",
      "[*]$2",
      "[*]$3",
      "[/list]",
      "$0"
    ],
    "description": "Insertion d'une liste ordonnée à 3 items"
    } 
&nbsp;
  "Liste ordonnée à 4 items": {
    "prefix": "lso4",
    "body": [
      "[list=ordered]",
      "[*]$1",
      "[*]$2",
      "[*]$3",
      "[*]$4",
      "[/list]",
      "$0"
    ],
    "description": "Insertion d'une liste ordonnée à 4 items"
    }
&nbsp;
  "Liste ordonnée à 5 items": {
    "prefix": "lso5",
    "body": [
      "[list=ordered]",
      "[*]$1",
      "[*]$2",
      "[*]$3",
      "[*]$4",
      "[*]$5", 
      "[/list]",
      "$0"
    ],
    "description": "Insertion d'une ordonnée liste à 5 items"
    } 
&nbsp;
  "Tableau 2x2": {
    "prefix": "tab",
    "body": [
      "[table]",
      "\t[row]",
      "\t\t[col]$1[/col]",
      "\t\t[col]$2[/col]",
      "\t[/row]",
      "\t[row]",
      "\t\t[col]$3[/col]",
      "\t\t[col]$4[/col]",
      "\t[/row]",
      "[/table]"
      "$0"
    ],
    "description": "Insertion d'un tableau avec 2 lignes et 2 colonnes"
    }    
&nbsp;</pre></pre></div></div><br />
<br />
Si on prend le premier bloc en exemple, on retrouve le nom du snippet (ce que vous voulez, ici Code bash). Ensuite le prefix, c'est ce que vous taperez dans l'éditeur et ensuite le texte qui sera inséré.<br />
Enfin, la description, c'est facultatif mais je préfère la mettre.<br />
<br />
Ensuite, dans VSCode, lorsque vous créérez un fichier .bbcode, vous pourrez taper par exemple bash et vous aurez automatiquement les balises pour insérer du code bash.<br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-mthode2:snippetglobal">Méthode 2 : snippet global</h3><br />

<br />
<span class="message-helper bgc notice"><br />
Dans cette méthode, pour chaque raccourci, vous devrez préciser à quels langages cela s'applique, c'est pratique pour créer des snippets valables pour plusieurs langages.<br />
Personnellement, j'utilise la méthode 1.<br />
</span><br />
<br />
Créez un nouveau fichier où vous le souhaitez et donnez lui l'extension .bbcode<br />
Puis en bas à gauche de la fenêtre de VSCode, cliquez sur la roue dentée puis sur "Extraits de code de l'utilisateur" (User Snippets si votre interface est en anglais).<br />
<br />
Cliquez ensuite sur "Nouveau fichier d'extraits globaux" (New Global Snippets File en anglais), puis donnez un nom à votre fichier.<br />
<br />
Dans ce nouveau fichier, vous avez un exemple de la structure également mais vous remarquerez une nouvelle ligne scope. Ici vous ajoutez en paramètre le ou les langage(s) pour lesquels s'applique ce raccourci. Il faut donc ajouter cette ligne dans chaque bloc vu ci-dessus (en remplacant javascript,typescript par bbcode).<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-conclusion">Conclusion</h2><br />

<br />
Et voilà, désormais vous pouvez écrire vos article pour phpBoost dans VSCode. C'est très pratique, et cela va bien plus vite pour ajouter des listes, des tableaux, un warning ou un lien web.<br />
Si vous voulez plus d'infos sur ces snippets, la page suivante explique bien les choses <a class="offload" href="https://code.visualstudio.com/docs/editor/userdefinedsnippets">Snippets in Visual Studio Code</a><br />
<br />
Bonnes rédactions !<br />]]></description>
                <pubDate>Wed, 01 Nov 2023 18:01:39 +0100</pubDate>
                
            </item>
		
	</channel>
</rss>
