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 |
ulimit
Voir aussi :
- prlimit
Depuis Redhat 6 nous avons :
/etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent # accidental fork bombs. # See rhbz #432903 for reasoning. * soft nproc 1024 root soft nproc unlimited www-data soft nproc unlimited
Options ulimit :
- -H : Hard
- -S : Soft
- -a : All
- -u : Nombre maximal de processus utilisateurs
ulimit -a -H ulimit -a -S
help ulimit
Voir http://fr.wikipedia.org/wiki/Fork_bomb
:(){ :|:& };:
En cas de dépassement : comment le sait-on ?
Grsecurity propose un audit des dépassements des “ulimit”
Message d'erreur ?
Pourquoi ne pas utiliser les cgroups ?
Core dump
Désactiver les cores dumps (Redhat)
/etc/profile
# No core files by default ulimit -S -c 0 > /dev/null 2>&1
Activer les cores dumps (Redhat)
su - ulimit -c unlimited
Notes
/bin/bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/local/bin/plop
Temps réel
However, for systems with a Linux kernel 2.6.13 or newer, it is possible to allow processes without root privileges to set the real-time scheduling policy. When the Linux PAM module is installed (which is normally the case) you can control the maximum real-time priority for non-privileged processes on a per user or group basis via the /etc/security/limits.conf file.
For example, adding the line
* - rtprio 99
Outils
Appliquez les modifications directement à un processus en cours d'exécution avec prlimit
Python
import resource print(resource.getrlimit(resource.RLIMIT_NOFILE)[1])
Ubuntu LTS - Quelques optimisations pour les anciens PC
Ubuntu light / allégé
Voir aussi - Distribution GNU/Linux légères basées sur Debian :
Voir aussi - Distribution GNU/Linux légères basées sur Ubuntu :
- Trisquel Mini
- lunbuntu
Description: Notes installation Ubuntu
Lors d'une nouvelle install, il faut d'assurer de bien aligner les partions Voir formater_une_carte_microsd_en_optimisant_les_performances_et_la_duree_de_vie
Voir :
# Services activé : systemctl list-unit-files | grep enabled # Services démarrés : systemctl | grep running
CPU - grub Kernel param
/etc/default/grub
mitigations=off
Optimisation mémoire avec zram
FixUbuntu
git pull https://github.com/micahflee/fixubuntu
Allégement Ubuntu
apt-get -y purge --autoremove $(dpkg -l | awk '{print $2}' | grep -i ubuntuone) apt-get -y purge --autoremove ubuntu-sso-client ubuntu-sso-client-gtk python-ubuntu-sso-client geoclue-ubuntu-geoip apt-get -y purge --autoremove $(dpkg -l | awk '{print $2}'| grep compiz | grep -v ^lib) apt-get -y purge --autoremove gnome-online-accounts xserver-xorg-video-vmware evolution-data-server gnome-orca gnome-accessibility-themes apt-get -y purge --autoremove $(dpkg -l | awk '{print $2}' | grep gwibber | grep -v ^lib) apt-get -y purge --autoremove zeitgeist-core zeitgeist rhythmbox-plugin-zeitgeist python-zeitgeist apt-get -y purge --autoremove landscape-client-ui-install apt-get -y purge --autoremove $(dpkg -l | grep speech | awk '{print $2}' | grep -v ^lib) apt-get -y purge --autoremove $(dpkg -l | grep bluetooth | awk '{print $2}' | grep -v ^lib ) apt-get -y purge --autoremove $(dpkg -l | grep bluez | awk '{print $2}') apt-get -y purge --autoremove apt-xapian-index indicator-keyboard
Bureau classique
apt-get install gnome-session-fallback gnome-panel
Autres
apt-get install atop htop fdupes check-dfsg-status sysstat apt-file rdiff-backup rsync vim synaptic vlc gimp chromium-browser powertop
note : check-dfsg-status remplace vrms
/etc/fstab
UUID=c6f15232-b71f-42a7-85bf-754ee44cac6a / ext4 errors=remount-ro,noatime 0 1 UUID=a5d996f4-b25c-417a-9b41-941e9898431b /home ext4 defaults,noatime,noexec,nosuid,nodev 0 2 tmpfs /dev/shm tmpfs defaults,size=100m 0 0
Voir /etc/default/tmpfs
Il s'agit ici de
- rajouter noatime sur toutes les partitions ext4 ou ext3
- d'ajouter size=100m à la partition /dev/shm. Ici 100m est un exemple. La partition /dev/shm ne fera que 100 Mo de RAM.
Parametres système - Son - Effets sonores - Volume des alertes
sed -i -e 's/^NoDisplay=true.*/NoDisplay=false/' /etc/xdg/autostart/*.desktop
gnome-session-properties
Si MATE Desktop, remplacez gnome-session-properties par mate-session-properties
Désactivation de :
- Onboard
- Partage de bureau
- Moniteur de sauvegarde
- Discussion (Telepathy)
- Moniteur de sauvegarde
- Conversion des données GSettings
- Mise à jour des dossiers utilisateur
- Fichiers
cat > /etc/modprobe.d/jibe.conf <<EOF blacklist minix blacklist btrfs blacklist xfs blacklist reiserfs blacklist ppdev blacklist parport_pc blacklist lp blacklist parport blacklist hfs blacklist hfsplus EOF
Voir :
deborphan
Notes Ubuntu 16.04
TODO: Tester de supprimer Compiz
FixUbuntu
Paramtètre système / Luminosité & verrouillage
- Vérrouiller
- Demander mon mot de passe lors de la sortie de veille
Sécurité et confidentialité Sécutité Demander mon mot de passe Dignostics
Unity Tweak Tool Unity / Web Apps
- Inviers d'intégration : off
Domaines pré-autorisés Amazon : décoché Ubuntu One : Décoché
apt-get -y purge --autoremove $(dpkg -l | grep webapps | grep ^ii | awk '{print $2}')
apt-get install vim atop sysstat powertop deborphan acpi
apt-get -y purge --autoremove xul-ext-ubufox
apt-get autoremove deborphan apt-get -y purge --autoremove $(deborphan) apt-get -y purge --autoremove $(deborphan)
Suppression effets sonores
Install libcss pour lire les DVD Le plus simple c'est d'installer VLC
apt-get install vlc
Ubuntu problème langue clavier
Voir :
- IBus
- SCIM
- Fcitx
- Mozc
Bug sur Ubuntu (Quelle version ?). Ubuntu démarre (Le problème apparaît seulement une fois logé sur l'interface graphique)
Ubuntu est en clavier yankee appelé qwerty
Sources :
En cliquant sur l’icône de la langue clavier, se situant en haut, le problème cesse jusqu'au prochain redémarrage.
Solution : dans un terminal taper :
ibus-setup
Si vous ne pouvez pas utiliser dbus, ajouter les lignes suivantes dans votre
~/.bashrc
export GTK_IM_MODULE=ibus export XMODIFIERS=@im=ibus export QT_IM_MODULE=ibus
Fermer, puis relancer le terminal (pour relire le .bashrc)
Onglet “Méthode d'entrée” “Personnaliser les méthodes de saisie actives” Vérifier que la langue clavier est correctement configuré
Onglet “Avancé” Cocher la case “Utiliser la disposition clavier système”
Voir aussi
loadkeys fr # Idem pour X11 setxkbmap fr
Sous Debian
# loadkeys fr cannot open file fr
loadkeys /usr/share/keymaps/i386/azerty/azerty.kmap.gz
cd /usr/share/keymaps ln -s i386 amd64
Changer agencement clavier :
loadkeys fr-pc
Sous Archlinux /etc/vconsole.conf
KEYMAP=fr
Dé-commenter les locales souhaiter (pour définir la langue du système)
nano /etc/locale.gen
Exécuter :
locale-gen
Ajouter la même locale dans /etc/locale.conf Pour la France : ajouter : /etc/locale.conf
LANG="fr_FR.UTF-8"
Ajouter la locale pour la session courante :
export LANG=fr_FR.UTF-8
/etc/default/locale
# File generated by update-locale LANG="fr_FR.UTF-8"
Paramètres noyau
lang=fr_FR kmap=fr-latin1
Tunnel SSH UDP forward
Source : http://zarb.org/~gc/html/udp-in-ssh-tunneling.html
Je me suis servi de cette astuce pour synchro le temps / heure / ntp sur une machine qui ne pouvait pas sortir sur internet
Performing UDP tunneling through an SSH connection Intro
The Swiss ISP Bluewin sucks. Their DNS are often down. A friend even received advice from Bluewin technicians to not use their own DNS!… But then, it is quite hard to gain access to another DNS for free, if you don't have access to a co hosted machine.
In this document, we'll access another machine's network internal DNS services (UDP port 53) with only SSH access to it. We will forward local UDP/53 traffic to TCP, then TCP traffic with the port-forwarding mechanism of SSH to the other machine, then TCP to UDP/53 on the other end. Typically, you can do it with openvpn. But here, we'll do it with simpler tools, only openssh and netcat. Step by step Open a TCP forward port with your SSH connection
On your local machine (local), connect to the distant machine (server) by SSH, with the additional -L option so that SSH will TCP port-forward:
local# ssh -L 6667:localhost:6667 server
This will allow TCP connections on the port number 6667 of your local machine to be forwarded to the port number 6667 on server through the secure channel. Setup the TCP to UDP forward on the server
On the server, we open a listener on the TCP port 6667 which will forward data to UDP port 53 of a specified IP. If you want to do DNS forwarding like me, you can take the first nameserver's IP you will find in /etc/resolv.conf or /etc/systemd/resolved.conf - in this example, this is 192.168.1.1. But first, we need to create a fifo. The fifo is necessary to have two-way communication between the two channels. A simple shell pipe would only communicate left process' standard output to right process' standard input.
server# mkfifo /tmp/fifo server# nc -l -p 6667 < /tmp/fifo | nc -u 192.168.1.1 53 > /tmp/fifo
This will allow TCP traffic on server's port 6667 to be forwarded to UDP traffic on 192.168.1.1's port 53, and responses to come back. Setup the UDP to TCP forward on your machine
Now, we need to do the opposite of what was done upper on the local machine. You need priviledged access to bind the UDP port 53.
local# mkfifo /tmp/fifo local# sudo nc -l -u -p 53 < /tmp/fifo | nc localhost 6667 > /tmp/fifo
This will allow UDP traffic on local machine's port 53 to be forwarded to TCP traffic on local machine's port 6667. Enjoy your local DNS server :)
As you've probably guessed it now, when a DNS query will be performed on the local machine, e.g. on local UDP port 53, it will be forwarded to local TCP port 6667, then to server's TCP port 6667, then to server's DNS server, UDP port 53 of 192.168.1.1. To test DNS service on your local machine, use host:
host m6.fr 127.0.0.1
If the address is resolved, you can put the following line in your /etc/resolv.conf so that your first nameserver is actually you own machine:
nameserver 127.0.0.1
Alternative solution with socat
Brian Marshall and Zakaria have an alternative solution using socat. It eliminates the fifo file requirement. Here's how to do:
Server side:
socat tcp4-listen:5353,reuseaddr,fork UDP:nameserver:53
Client side:
socat -T15 udp4-recvfrom:53,reuseaddr,fork tcp:localhost:5353
