Outils pour utilisateurs

Outils du site


welcome:ubuntu:small_tricks

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
welcome:ubuntu:small_tricks [2022/12/10 16:14]
arnaud
welcome:ubuntu:small_tricks [2023/01/08 15:11] (Version actuelle)
arnaud [Attendre la fin du script]
Ligne 1: Ligne 1:
 <color #22b14c>**Small tricks for Ubuntu**</color>  <color #22b14c>**Small tricks for Ubuntu**</color> 
  
-====== Add a network interface (Ubuntu22) ====== +====== Add a network interface (Ubuntu22) by CLI ====== 
-  * list the interfaces <code># ip</code> +  * list the interfaces <code># ip link show</code> 
 +  * activate the interface <code># ifconfig ens19 up</code> 
 +  * set the IP of the interface: <code># nano /etc/netplan/00-installer-config.yaml</code> and add the interface name and the settings 
 +  * apply the settings:<code># netplan apply</code>
 ====== Auto-connect VPN and Wifi ====== ====== Auto-connect VPN and Wifi ======
 <note>runs on Ubuntu18 LXDE</note> <note>runs on Ubuntu18 LXDE</note>
Ligne 20: Ligne 22:
 [SeatDefaults] [SeatDefaults]
 session-setup-script=/etc/lightdm/lightdm.conf.d/restart-NM.sh </code> session-setup-script=/etc/lightdm/lightdm.conf.d/restart-NM.sh </code>
 +
 +====== Beep ======
 +Pour activer le "beep":
 +  * <code># apt-get install beep</code>
 +  * tester si le beep fonctionne: <code>$ sudo modprobe pcspkr     // ce réglage ne supportera pas un reboot!!
 +$ beep</code>
 +  * Rendre persistant: <code>$ sudo nano /etc/modprobe.d/blacklist.conf
 +....</code> et commenter la ligne ''blacklist pcspkr''
  
  
Ligne 71: Ligne 81:
 # systemctl enable wol-omv.service</code> # systemctl enable wol-omv.service</code>
  
 +===== Attendre la fin du script =====
 +<note important>Ceci est un brouillon!</note>
 +https://unix.stackexchange.com/questions/599372/kill-systemd-oneshot-service-after-timeout \\
 +https://trstringer.com/simple-vs-oneshot-systemd-service/ \\
 +https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/
 +
 +<code>
 +$ sudo cat /etc/systemd/system/le-service.service 
 +[Unit]
 +After=network-online.target
 +Wants=network-online.target
 +
 +[Service]
 +Type=oneshot
 +TimeoutStartSec=10s
 +ExecStart=/usr/local/bin/le-script.sh
 +
 +[Install]
 +WantedBy=default.target
 +</code>
 +Il faut un "TimeoutStartSec" et non un "TimeoutStopSec" car "Behavior of oneshot is similar to simple; however, the service manager will consider the unit started after the main process exits."
  
 ====== Terminal ====== ====== Terminal ======
welcome/ubuntu/small_tricks.1670688896.txt.gz · Dernière modification: 2022/12/10 16:14 de arnaud

DokuWiki Appliance - Powered by TurnKey Linux