blog
Table des matières
- 2026:
- 2025:
12 billet(s) pour novembre 2026
| Notes conversion JSON YAML | 2026/11/13 11:16 | Jean-Baptiste |
| Git commit perdu | 2026/11/12 18:16 | Jean-Baptiste |
| Notes mojo lang | 2026/11/11 20:34 | Jean-Baptiste |
| Notes rust lang compilation | 2026/11/11 18:35 | Jean-Baptiste |
| Mémoire VSIZE VMSIZE SEGV lang C | 2026/11/11 15:59 | Jean-Baptiste |
| Ansible-navigator utilisation de ansible-vault | 2026/11/06 11:33 | Jean-Baptiste |
| Err Ansible - Module result deserialization failed No start of json char found | 2026/11/06 09:09 | Jean-Baptiste |
| Script Python conversion JSON vers CSV | 2026/11/06 08:14 | Jean-Baptiste |
| Filter Incoming IPv4 Packets Containing IP Options - cve-2026-98432 mitigation - Kernel TCP Use-After-Free | 2026/11/04 21:04 | Jean-Baptiste |
| Notes ZFS | 2026/11/03 18:04 | Jean-Baptiste |
| Diff image container | 2026/11/03 16:30 | Jean-Baptiste |
| Notes processus multi-thread | 2026/11/03 10:59 | Jean-Baptiste |
Taille fichiers sur disque du ls sparse
Voir : https://wiki.archlinux.org/index.php/Sparse_file
Voir aussi reflink :
cp --reflink=always
Sparse, fichiers à trous
Voir du dh “ls -s” fallocate truncate
Notes :
du -sh /var/lib/libvirt/images/dic01-disk0 2,0G /var/lib/libvirt/images/dic01-disk0 ls -lh /var/lib/libvirt/images/dic01-disk0 -rw-r--r-- 1 qemu qemu 120G 20 juin 14:53 /var/lib/libvirt/images/dic01-disk0
$ ls -lsh total 22G 16K drwx------ 2 root root 16K août 9 10:42 lost+found 7,7G -rw-r--r-- 1 jibe jibe 120G août 9 11:18 VM152-SUPPMSM-V-clone.img 14G -rw-r--r-- 1 jibe jibe 14G févr. 24 09:15 VM152-SUPPMSM-V-clone.qcow2
$ du -h VM152-SUPPMSM-V-clone.* 7,7G VM152-SUPPMSM-V-clone.img 14G VM152-SUPPMSM-V-clone.qcow2
Unsparse
cp --sparse=never VM152-SUPPMSM-V-clone.raw VM152-SUPPMSM-V-clone_copy.raw #Ou truncate -c -s $(( 1024 * 1024 + 1024 * $(ls -s VM152-SUPPMSM-V-clone.raw |awk '{print $1}') )) VM152-SUPPMSM-V-clone.raw
NOTES
Source : https://softwarebakery.com/shrinking-images-on-linux
fdisk -l myimage.img
Disk myimage.img: 6144 MB, 6144000000 bytes, 12000000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ea37d
Device Boot Start End Blocks Id System
myimage.img1 2048 9181183 4589568 b W95 FAT32
Note two things in the output:
- The partition ends on block 9181183 (shown under End)
- The block-size is 512 bytes (shown as sectors of 1 * 512)
truncate --size=$[(9181183+1)*512] myimage.img
Autres
rsync
rsync : Voir l'option --sparse
-S, --sparse traite les fichiers à trous efficacement
cp
cp --sparse=always et --sparse=never
Taille des bases MySQL/MariaDB
Source : https://stackoverflow.com/questions/1733507/how-to-get-size-of-mysql-database
SELECT table_schema "DB Name", ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;
Sécurité bloquer les clefs USB
Bloquer toutes les clefs USB
Méthodes en vrac
echo 'install usb-storage : ' >> /etc/modprobe.conf echo 'install usb-storage /bin/true' >> disable-usb-storage.conf
modprobe -r usb-storage mv -v /lib/modules/$(uname -r)/kernel/drivers/usb/storage/usb-storage.ko /root/
/etc/modprobe.d/blacklist.conf
blacklist usb-storage
Grub kernel nousb
Vérif
modinfo usb-storage lsmod | grep -i usb-storage lsscsi -H
Bloquer certain périphérique USB
Table de partitions GPT
Voir :
Supprimer uniquement la table des partitions en conservant la MBR
Install de gdisk (GPT fdisk)
apt-get install gdisk
Suppression de la table GPT - zap GPT
sgdisk --zap /dev/sdb
Supprimer toutes les signatures
/sbin/wipefs -a -f /dev/sda
Autres
# sfdisk /dev/sda /dev/sda /dev/sda1 /dev/sda2 /dev/sda3 /dev/sda4 /dev/sda5 /dev/sda6 /dev/sda7 # sfdisk -d /dev/sda label: gpt label-id: 4A520514-FBFF-49E2-93CD-024C6EE848EA device: /dev/sda unit: sectors first-lba: 34 last-lba: 209715038 /dev/sda1 : start= 2048, size= 97654784, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=763DFFAB-5D82-4843-8F38-746AA9D6D2EE, name="root" /dev/sda2 : start= 97656832, size= 39061504, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=0D3A7314-4DC6-4D63-8AD2-A5B514F9FE90, name="home" /dev/sda3 : start= 136718336, size= 9764864, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=91287ED7-760D-405B-ABE7-C7F8FD59DF6B, name="usr" /dev/sda4 : start= 146483200, size= 9764864, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=CA22ECC9-7839-4EE6-8F23-CC67A55D3F8A, name="var" /dev/sda5 : start= 156248064, size= 9764864, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=6D2E0210-27B3-4979-B85B-DCBF2F63BC38, name="tmp" /dev/sda6 : start= 166012928, size= 9764864, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=BC2EAA0E-BFF8-4311-B738-8DEC70F0DA91, name="usr/local" /dev/sda7 : start= 175777792, size= 9764864, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=EA73FFAD-DB9B-476B-B40F-DAF95DFF0C14, name="efi" # gdisk -l /dev/sda GPT fdisk (gdisk) version 1.0.3 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Disk /dev/sda: 209715072 sectors, 100.0 GiB Model: PERC H330 Adp Sector size (logical/physical): 512/512 bytes Disk identifier (GUID): 4A520514-FBFF-49E2-93CD-024C6EE848EA Partition table holds up to 128 entries Main partition table begins at sector 2 and ends at sector 33 First usable sector is 34, last usable sector is 209715038 Partitions will be aligned on 2048-sector boundaries Total free space is 24174397 sectors (11.5 GiB) Number Start (sector) End (sector) Size Code Name 1 2048 97656831 46.6 GiB 8300 root 2 97656832 136718335 18.6 GiB 8300 home 3 136718336 146483199 4.7 GiB 8300 usr 4 146483200 156248063 4.7 GiB 8300 var 5 156248064 166012927 4.7 GiB 8300 tmp 6 166012928 175777791 4.7 GiB 8300 usr/local 7 175777792 185542655 4.7 GiB EF00 efi
Table caractere speciaux unicode utf8
Voir :
Voir aussi
| Car | Code | Nom | Commentaire |
|---|---|---|---|
| | | 007C | Pipe | |
| \ | 005C | Backslash | ASCII B10 92 |
| ♯ | 266F | Dièse | |
| # | 0023 | Croisillon | Appelé à tort Dièse |
| ✓ | 2713 | Coché / check mark | |
| ✗ | 2717 | Croix | |
| ☐ | 2610 | Case non cochée | |
| ☑ | 2611 | Case cochée | |
| ☒ | 2612 | Case cochée d'un X | |
| ☎ | 260E | Téléphone noir | |
| ☏ | 260F | Téléphone blanc | |
| 📱 | 1F4F1 | Téléphone portable | |
| ✉ | 2709 | Courrier / Lettre | |
| → | 2192 | Flèche | Chimie : réactifs → produits |
| ⇒ | 21D2 | Flèche | Logique |
| ≈ | 2248 | ALMOST EQUAL TO | Math |
| 🐫 | 1F42B | Chameau | |
| ☠ | 2620 | Tête de mort | |
| 🎅 | 1F385 | Père Noël | |
| 🎁 | 1F381 | Cadeau | |
| ❤ | 2764 | Cœur / Amour | |
| ♡ | 2661 | Cœur / Amour | |
| ❥ | 2765 | Cœur / Amour | |
| 💖 | 1F496 | Cœur Étincelant | |
| 🥐 | F950 | Croissant | |
| 🎨 | 1F3A8 | Palette artiste penture | |
| 🍍 | 1F34D | Ananas | |
| ✅ | 2705 | White heavy check mark | |
| … | 2026 | horizontal ellipsis | etc… |
| Ñ | 00D1 | Español eñe | |
| ñ | 00F1 | Español eñe | |
| ¡ | 00A1 | Español | |
| ¿ | 00BF | Español | |
| ø | 00F8 | Zéro barré (minuscule) | Alt Gr + S |
| Ø | 00D8 | Zéro barré (majuscule) | Shit + Alt Gr + S |
| ⏳ | 23F3 | Sablier | |
| 😇 | 1F607 | Saint | Emoji |
| 💐 | 1F490 | Bouquet de fleurs | |
| 🎶 | 1F3B6 | Multiple Musical Notes | |
| 🙏 | 1F64F | Mains jointes / Prière | UDP |
| 📰 | 1F4F0 | Journal | newspaper |
| ☣ | 2623 | Biohazard | |
| ❗️ | 2757 | Heavy Exclamation Mark | |
| 🔥 | 1F525 | Feu | |
| ½ | 00BD | 1/2, fraction un demi | |
| 🕊 | 1F54A | Colombe de la paix | |
| ⚠️ | 26A0 / FE0F | Warning | |
| ♻️ | 267B | Recyclage | |
| æ | 00E6 | Lettre minuscule latine | ae |
| Æ | 00C6 | Lettre majuscule latine | AE |
| ☧ | 2627 | Chrisme | In hoc signo vinces |
| 📅 | 1F4C5 | Calendrier | |
| 🗓 | 1F5D3 | Calendrier à spirale | |
| 👀 | 1F440 | Yeux | |
| 🚧 | 1F6A7 | En chantier | |
| 🔜 | 1F51C | Bientôt | |
| 🛠️ | 1F6E0 | Travail | |
| 👍 | 1F44D | Pouce vers le haut | |
| ⚜️ | 269C | Fleur-de-Lis |
Symbole Unicode «» (U+)
blog.txt · Dernière modification : de 127.0.0.1
