Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
php-bash:aide-memoire [2022/11/28 19:26] – [fsck : régler le laps de temps de verif système] cyrille | php-bash:aide-memoire [2024/12/11 17:43] (Version actuelle) – [Lancer serveur php sans conf particulière] cyrille | ||
---|---|---|---|
Ligne 877: | Ligne 877: | ||
# tune2fs -i 20d /dev/sda1 | # tune2fs -i 20d /dev/sda1 | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== Droits sur rep de pub web ===== | ||
+ | |||
+ | A défaut | ||
+ | |||
+ | <code | download> | ||
+ | #!/bin/sh | ||
+ | |||
+ | chown -R www-data: | ||
+ | |||
+ | find /var/www -name " | ||
+ | |||
+ | find /var/www -name " | ||
+ | </ | ||
+ | |||
+ | ===== Lister les noyaux ===== | ||
+ | <code | download> | ||
+ | echo; dpkg -l | awk ' | ||
+ | </ | ||
+ | < | ||
+ | ii linux-image-5.10.0-10-amd64 | ||
+ | ii linux-image-5.10.0-15-amd64 | ||
+ | ii linux-image-5.10.0-17-amd64 | ||
+ | ii linux-image-5.10.0-19-amd64 | ||
+ | ii linux-image-amd64 | ||
+ | |||
+ | Noyau courant : 5.10.0-19-amd64 x86_64 | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Connaître son screensize ===== | ||
+ | |||
+ | **Avec xrand** | ||
+ | <code | download> | ||
+ | $ xrandr | awk '/ connected/ | ||
+ | 13,9615 inches | ||
+ | </ | ||
+ | |||
+ | **Avec python3** | ||
+ | |||
+ | Le script | ||
+ | <code | download> | ||
+ | # | ||
+ | import gi | ||
+ | gi.require_version(' | ||
+ | from gi.repository import Gdk | ||
+ | |||
+ | dsp = Gdk.Display.get_default() | ||
+ | n_mons = dsp.get_n_monitors() | ||
+ | |||
+ | print((" | ||
+ | |||
+ | for i in range(n_mons): | ||
+ | mon = dsp.get_monitor(i) | ||
+ | mon_name = mon.get_model() | ||
+ | w = mon.get_width_mm()/ | ||
+ | h = mon.get_height_mm()/ | ||
+ | d = ((w**2)+(h**2))**(0.5) | ||
+ | print((" | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | <code | download> | ||
+ | $ python3 screensize.py | ||
+ | Screen width height diagonal | ||
+ | -------------------------------- | ||
+ | eDP-1 12.2 6.9 14.0 | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Rebooter sur une entrée grub de son choix ===== | ||
+ | |||
+ | <code | download> | ||
+ | # grub-reboot X | ||
+ | # reboot now | ||
+ | </ | ||
+ | |||
+ | Et X préciser l' | ||
+ | |||
+ | |||
+ | ===== Détection & installation des microprogrammes manquants | ||
+ | |||
+ | Très intéressante cette entrée dans le manuel, je l' | ||
+ | https:// | ||
+ | |||
+ | § 6.4.3 Finaliser le système installé | ||
+ | |||
+ | <code | download> | ||
+ | # apt install isenkram-cli | ||
+ | </ | ||
+ | |||
+ | |||
+ | <code | download> | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | ===== Changer la couleur de fond du terminal | ||
+ | <code | download> | ||
+ | $ echo -e ' | ||
+ | </ | ||
+ | |||
+ | <code | download> | ||
+ | $ echo -e ' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Architecture | ||
+ | Connaître les architectures supportées | ||
+ | <code | download> | ||
+ | lscpu | head -n2 | ||
+ | </ | ||
+ | |||
+ | Architecture du système | ||
+ | <code | download> | ||
+ | dpkg --print-architecture | ||
+ | </ | ||
+ | ou | ||
+ | <code | download> | ||
+ | arch | ||
+ | </ | ||
+ | |||
+ | Ajout d'une architecture, | ||
+ | <code | download> | ||
+ | dpkg --add-architecture i386 | ||
+ | apt update | ||
+ | </ | ||
+ | |||
+ | Purge des paquets i386 puis suppression d'une architecture, | ||
+ | <code | download> | ||
+ | aptitude purge ~i~ri386 | ||
+ | dpkg --remove-architecture i386 | ||
+ | apt update | ||
+ | </ | ||
+ | |||
+ | Lister les paquets installés, ici architecture i386 | ||
+ | <code | download> | ||
+ | aptitude search ~i~ri386 | ||
+ | aptitude search ~i~ri386aptitude search '~S ~i ~ri386' | ||
+ | aptitude search '? | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== brightness / xrandr ===== | ||
+ | <code | download> | ||
+ | xrandr --output $(xrandr | grep -w connected | cut -f ' | ||
+ | |||
+ | |||
+ | ===== Ajout d' | ||
+ | <code | download> | ||
+ | rename s/$/.jpg/ * | ||
+ | </ | ||
+ | |||
+ | ===== Test si programme / service tourne... ===== | ||
+ | <code | download> | ||
+ | ################### | ||
+ | ## pgrep example ## | ||
+ | ################### | ||
+ | pgrep -x mysqld >/ | ||
+ | pgrep -x httpd >/ | ||
+ | |||
+ | ################### | ||
+ | ## pidof example ## | ||
+ | ################### | ||
+ | pidof httpd >/ | ||
+ | pidof nginx >/ | ||
+ | |||
+ | ################ | ||
+ | ## ps example ## | ||
+ | ################ | ||
+ | ps -C httpd >/ | ||
+ | ps -C nginx >/ | ||
+ | </ | ||
+ | |||
+ | Avec systemd | ||
+ | <code | download> | ||
+ | systemctl is-active --quiet <service name> || systemctl restart <service name> & | ||
+ | </ | ||
+ | |||
+ | ===== Lancer serveur php sans conf particulière ===== | ||
+ | |||
+ | <code | download> | ||
+ | php -S localhost: | ||
+ | </ | ||
+ | |||
+ | |||
+ | Y accéder | ||
+ | |||
+ | http:// | ||
+ | |||
+ | ===== Disque SSD ou HDD ? ===== | ||
+ | |||
+ | <code | download> | ||
+ | cat / | ||
+ | </ | ||
+ | |||
+ | Si retourne 0 alors SSD, si 1 alors HDD |