Table des matières
- 2026:
- 2025:
13 billet(s) pour novembre 2026
| Réseaux - protocole QUIC mieux que TCP | 2026/11/17 21:26 | Jean-Baptiste |
| 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 |
Power saver - power management - ACPI
Voir :
Diag
ps -ef lsmof
SystemD
/etc/systemd/logind.conf
HandleLidSwitch=ignore
systemctl restart systemd-logind busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager HandleLidSwitch busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager HandleLidSwitchDocked
You can use this to temporarily disable lid-switch events:
systemd-inhibit --what=handle-lid-switch sleep 1d
systemctl suspend
systemctl hibernate
systemctl hybrid-sleep
Disable
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
Pour les portables /etc/systemd/logind.conf
[Login] HandleLidSwitch=ignore HandleLidSwitchDocked=ignore
Notes
apt-get install pm-utils laptop-mode-tools
Console
/etc/console-tools/config
BLANK_TIME=0 POWERDOWN_TIME=0
source : https://wiki.deimos.fr/D%C3%A9sactiver_la_mise_en_veille_de_l%27%C3%A9cran_sur_Debian.html
Battery
cat /sys/class/power_supply/BAT0/charge_full cat /sys/class/power_supply/BAT0/charge_full_design lspower
sudo apt install powertop sudo powertop --calibrate apt-get install tlp sudo vim /etc/default/tlp sudo tlp start
Voir https://linrunner.de/en/tlp/docs/tlp-configuration.html
Source : https://www.howtogeek.com/55185/how-to-maximize-the-battery-life-on-your-linux-laptop/
ACPI
apt-get install acpid
acpi_listen
cat /proc/acpi/wakeup Device S-state Status Sysfs node
acpi/interrupts
AE_NOT_FOUND infinitely on startup
Source : https://unix.stackexchange.com/questions/348806/acpi-exception-ae-not-found-infinitely-on-startup
If using sysdemd with rc.local disabled:
systemctl enable rc-local.service
Edit
sudo systemctl edit --full rc-local
Add to rc.local
echo "disable" > /sys/firmware/acpi/interrupts/gpe6F
C-STATE
https://www.golinuxhub.com/2018/06/what-cpu-c-states-check-cpu-core-linux.html
cat /proc/acpi/processor/CPU0/power
Port USB
Le port USB se met en économie d’énergie. Par exemple la souris ne fonctionne plus après la sortie de la veille.
Voir https://logfile.ch/linux/2017/06/15/disable-usb-autosuspend-linux/
cat /sys/bus/usb/devices/<your device>/power/control echo on > /sys/bus/usb/devices/<your device>/power/control
== Autres
Voir https://www.geeks3d.com/hacklab/20160108/how-to-disable-the-blank-screen-on-raspberry-pi-raspbian/
sudo apt-get install x11-xserver-utils
~/.config/lxsession/LXDE/autostart
@xset s off @xset -dpms @xset s noblank
/etc/xdg/lxsession/LXDE/autostart !?
Ou
/etc/lightdm/lightdm.conf
[SeatDefaults] xserver-command=X -s 0 -dpms
Exécution à l'entrée en veille / Exécution à la sortie de la mise en veille
Exemple
/lib/systemd/system-sleep/atop-pm
#!/bin/bash PATH=/sbin:/usr/sbin:/bin:/usr/bin case "$1" in pre) systemctl stop atop exit 0 ;; post) systemctl start atop exit 0 ;; *) exit 1 ;; esac
Cloud - Serverless Framework
Voir : https://www.serverless.com
Install
npm install -g serverless # Voir yarnpkg à la place de npm
Exemple
serverless cd aws-python-project serverless deploy serverless invoke -f hello serverless invoke -f hello --log serverless remove
Ajout disque SAN Fibre Channel fiber channel - scan newly added fc luns and scsi disks
Source : https://www.learnitguide.net/2016/02/scan-newly-added-fc-luns-and-scsi-disks.html
Identifier les disques existants
LANG=C fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-|type|identifier'
Identifier le numéro de l'adaptateur HBA
systool -c fc_host -v
Ou
# ls /sys/class/fc_host host0
Rescan des LUNs
echo "1" > /sys/class/fc_host/host0/issue_lip echo "- - -" > /sys/class/scsi_host/host0/scan
Il peut être nécessaire de rescaner les partitions
partprobe /dev/sdc partprobe /dev/sdd
(ou addpart ?)
Ou avec le script rescan-scsi-bus.sh
yum install sg3_utils
rescan-scsi-bus.sh
Vérif
LANG=C fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-|type|identifier' dmesg lsblk multipath -l
Postgres - se connecter a une socket
ps -ef | grep postgres
Trouver le PID du process Postgres père \ Exemple : 2962
# ls -l /proc/2962/fd/ | grep socket lrwx------. 1 postgres postgres 64 Aug 8 06:55 3 -> socket:[25104] lrwx------. 1 postgres postgres 64 Aug 8 06:55 4 -> socket:[25106] lrwx------. 1 postgres postgres 64 Aug 8 06:55 8 -> socket:[25118]
# #lsof -i -a -p 2962 # #find / -user postgres -type s 2>/dev/null # #netstat -lx | egrep "25104|25106|25118" # ss -xl | egrep "25104|25106|25118" u_str LISTEN 0 2048 /tmp/.s.PGSQL.5455 25106 * 0
su - postgres
$ psql -h /tmp/.s.PGSQL.5455
psql: error: could not connect to server: Not a directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5455/.s.PGSQL.5432"?
$ psql -h /tmp
psql: error: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Solution
psql -h /tmp -p 5455
Postfix Liste blanche et liste noire
Librement traduit de http://www.linuxlasse.net/linux/howtos/Blacklist_and_Whitelist_with_Postfix
Nous pouvons jouer sur deux paramètres :
check_client_access \ Bloque par IP, plage d'IP ou nom DNS
check_sender_access \ Bloque par adresse email (champ FROM)
Il est important de définir check_client_access et check_sender_access en premier
/etc/postfix/main.cf
smtpd_client_restrictions = permit_mynetworks, check_client_access hash:/etc/postfix/client_checks, check_sender_access hash:/etc/postfix/sender_checks
/etc/postfix/client_checks
# Restricts which clients this system accepts SMTP connections from. mondomain.com REJECT Fraud rejected example.com REJECT No spammers .example.com REJECT No spammers, from your subdomain 123.456.789.123 REJECT Your IP is spammer 123.456.789.0/24 REJECT Your IP range is spammer 321.987.654.321 OK example1.com OK
/etc/postfix/sender_checks
# Restricts sender addresses this system accepts in MAIL FROM commands. example.com REJECT env. from addr any@example.com rejected .example.com REJECT env. from addr any@sub.example.com rejected user@example.com REJECT We don't want your email example2.com OK
postmap /etc/postfix/client_checks postmap /etc/postfix/sender_checks postfix reload
Postfix bloquer un domain ou une IP
Source : http://arnofear.free.fr/linux/template.php?tuto=22&page=1
/etc/postfix/main.cf
# Permet de refuser la connexion SMTP pour les IP ou domaines contenus # dans ce fichier. smtpd_client_restrictions = check_client_access hash:/etc/postfix/blacklisted_sender
/etc/postfix/blacklisted_sender
# Domaine ou IP. rolexreplica.com REJECT You are blacklisted 90.123.456.78 REJECT You are blacklisted
postmap /etc/postfix/blacklisted_sender service postfix reload
