Lancer un script au démarrage de Raspbian

Pour lancer l’exécution d’un script lors du démarrage de Raspbian en mode console, il faut le rajouter au fichier /etc/rc.local
	
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
 
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
 
/chemin/votre_script.sh &
 
exit 0


lancer un script python au demarrage
rendre le script executable : sudo chmod +x /home/pi/scriptaexecuter.py

éditer le fichier /etc/rc.local : sudo nano /etc/rc.local

ajouter avant exit 0 : python /home/pi/scriptaexecuter.py




lancer automatiquement tightvncserver au démarrage du raspberrypi
sudo nano /etc/rc.local
ajouter avant exit 0 : /usr/bin/sudo -u pi tightvncserver
pi = username



changer le clavier anglais en français
sudo nano /etc/default/keyboard
changer : XBLAYOUT=”gb” en : XBLAYOUT=”fr”
ctl+O puis Enter puis ctl+X (sauver, valider, sortir)

 
changer IP via DHCP en IP fixe
sudo nano /etc/network/interfaces
changer : iface eth0 inet dhcp
en : iface eth0 inet static
puis : address 192.168.1.11
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
(adresse à faire suivant son réseau)
ctl O puis Enter

reboot, puis ifconfig pour vérifier