16-03-2021

This commit is contained in:
2021-03-16 06:57:22 +01:00
parent fb07a20b0c
commit e02b036875
27 changed files with 1860 additions and 128 deletions

440
docs/Raspberry/Argon-one.md Normal file
View File

@@ -0,0 +1,440 @@
# RPi 4 et boitier Argon One M.2 (avec SSD M.2)
https://www.argon40.com/argon-one-m-2-case-for-raspberry-pi-4.html
Le boitier accepte les SSD M.2 (Key-B ou Key-B&M)
### Installer Raspberry Pi OS sur la MicroSD:
Télécharger [Raspberry Pi OS](https://www.raspberrypi.org/software/operating-systems/)
```
https://downloads.raspberrypi.org/raspios_full_armhf/images/raspios_full_armhf-2021-01-12/2021-01-11-raspios-buster-armhf-full.zip
```
Copier Raspberry Pi OS sur la MicroSD avec [Etcher](https://www.balena.io/etcher/)
Booter sur la MicroSD.
Mettre à jour l'OS et le firmware:
```bash
$ sudo apt update
$ sudo apt full-upgrade
$ sudo rpi-update
```
Redémarrer le Raspberry.
Installer le dernier bootloader;
```bash
$ sudo rpi-eeprom-update -d -a
```
Redémarrer le Raspberry.
### Configurer le boot du Raspberry Pi:
Ouvrir **raspi-config**:
```bash
$ sudo raspi-config
```
1. Choisir **Advanded Options** puis Enter
2. Choisir **Bootloader Version** puis Enter
3. Choisir **Latest** (Use the latest version boot ROM software) puis Enter
4. Choisir **Non** pour utiliser Latest boot ROM
5. Choisir **Advanded Options** puis Enter
6. Choisir **Boot Order** puis Enter
7. Choisir **USB Boot** (si une carte SD est présente, le Raspberry démarrera sur la carte SD) puis Enter
### Copier la carte SD sur le disque SSD:
1. Lancer **SD Card Copier** depuis le menu <u>Démarrer</u>, section <u>Accessoires</u>.
2. Choisir la <u>carte SD</u> pour **Copy From Device**.
3. Choisir le <u>SSD</u> pour **Copy to Device**.
4. Cliquer sur **Start**.
5. La copie dure une dizaine de minutes...
6. **Eteindre** le Raspberry.
7. **Retirer la carte SD**.
8. **Redémarrer** le Raspberry qui boote sur le SSD.
### Outils Argon:
Installer Bouton Power et contrôle ventilo:
```bash
$ curl https://download.argon40.com/argon1.sh | bash
```
Fonctions Bouton Power:
| Argon One Pi 4 State | Action | Function |
| -------------------- | ------------------ | ------------------- |
| OFF | Appui court | Démarrer |
| ON | Appui long (>= 3s) | Arrêter et éteindre |
| ON | Appui court (< 3s) | rien |
| ON | Double tap | Reboot |
| ON | Appui long (>= 5s) | Forcer l'arrêt |
Vitesse ventilo:
| CPU Temp | Puissance ventilo |
| -------- | ----------------- |
| 55° C | 10% |
| 60° C | 55% |
| 65° C | 100% |
Pour configurer:
```bash
$ argonone-config
```
Désinstaller:
```bash
$ argonone-uninstall
```
#### [Mise à l'heure:](heure.md)
#### Installer le correcteur orthographique français:
```bash
$ sudo apt-get install myspell-fr
```
### Installer des logiciels:
Gestionnaire de mot-de-passe: KeepassXC (keepassxc-2.3.4)
### Clé SSH:
#### Clé une clé SSH:
```bash
$ ssh-keygen -t rsa -b 4096 -C "Clé sur Raspberry4"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/pi/.ssh/id_rsa):
Created directory '/home/pi/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/pi/.ssh/id_rsa.
Your public key has been saved in /home/pi/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:6TzjtL9Q31LwOwRAXMLyR2OEO+fYNlc5ccyux4zvhGo Clé sur Raspberry4
The key's randomart image is:
+---[RSA 4096]----+
| +++o o |
| . +o+ .+|
| o +o. .+|
| .+ o+ oo|
| S .B +*.|
| o ...=++o+|
| B .oo=o.|
| o = Eo o.|
| o.oo. ..|
```
#### Répertoire `~/.ssh`
```bash
pi@framboise:~/.ssh $ ls -la
total 28
drwx------ 2 pi pi 4096 févr. 4 14:35 .
drwxr-xr-x 33 pi pi 4096 févr. 9 13:46 ..
-rw------- 1 pi pi 846 juin 1 2019 authorized_keys
-rw-r--r-- 1 pi pi 369 févr. 4 14:41 config
-rw------- 1 pi pi 1675 févr. 4 2019 id_rsa
-rw-r--r-- 1 pi pi 394 févr. 4 2019 id_rsa.pub
-rw-r--r-- 1 pi pi 1776 févr. 4 14:49 known_hosts
```
#### Copier la clé publique ssh sur le serveur distant:
```bash
$ ssh-copy-id -i ~/.ssh/id_rsa.pub bruno@maboiteverte.fr
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/pi/.ssh/id_rsa.pub"
The authenticity of host 'maboiteverte.fr (212.227.191.167)' can't be established.
ECDSA key fingerprint is SHA256:iw66SSVTlEmiXO4kayKS1lHPbrTb5IT3CJtu9c4U7V4.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'bruno@maboiteverte.fr'"
and check to make sure that only the key(s) you wanted were added.
```
#### 1ere connection sans mot-de-passe:
```bash
$ ssh 'bruno@maboiteverte.fr'
Enter passphrase for key '/home/pi/.ssh/id_rsa':
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-96-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
New release '20.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Sat Feb 20 16:57:19 2021 from 86.209.226.200
bruno@localhost:~$
```
#### Créer le ssh-agent:
```bash
$ eval $(ssh-agent -s)
Agent pid 3551
```
#### Ajouter la clé ssh au ssh-agent:
```bash
$ ssh-add
Enter passphrase for /home/pi/.ssh/id_rsa:
Identity added: /home/pi/.ssh/id_rsa (Clé sur Raspberry4)
```
#### Pour retirer la clé privée
```bash
$ kill PROCESSID
```
### Configurer le serveur ssh:
```bash
$ sudo nano /etc/ssh/sshd_config
# Ajouter:
Protocol 2
Port 36722
PasswordAuthentication no
PermitEmptyPasswords no
X11Forwarding no
ClientAliveInterval 1500
MaxAuthTries 3
PermitRootLogin no
```
#### Utiliser le protocole ssh version 2:
```bash
Protocol 2
ssh -1 -p '36722' 'pi@raspberrypi4.local'
SSH protocol v.1 is no longer supported
```
#### Durée de vie de la connexion:
```bash
ClientAliveInterval 1500 # seconds
```
#### Connexion par clés uniquement:
```bash
PasswordAuthentication no
```
#### Limiter le nombre d'essais (mauvais mot-de-passe)
```bash
MaxAuthTries 3
```
#### Désactiver la connection en root:
```bash
PermitRootLogin prohibit-password # connection root avec clé ssh uniquement
PermitRootLogin no # connection root interdite
```
#### N'autoriser qu'une seule IP à se connecter:
```bash
ListenAddress 192.168.1.2
```
#### N'autoriser que certains utilisateurs:
```bash
AllowUsers user1 user2
```
#### Redémarrer le service ssh:
```bash
$ sudo service ssh restart
```
#### Si pas besoin de SSH, il faut le désactiver:
```bash
$ sudo systemctl stop sshd
$ sudo systemctl disable sshd
```
### Node:
```bash
# Par défaut (Raspi OS)
$ node -v
v10.24.0
```
#### Installer nvm:
```bash
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
# est ajouté au .bashrc:
export NVM_DIR="$HOME/.config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
```
#### Installer node:
```bash
$ nvm install --lts=fermium
Installing with latest version of LTS line: fermium
Downloading and installing node v14.16.0...
$ node -v
v14.16.0
```
### Samba:
#### Installer Samba:
```bash
$ sudo apt install samba samba-common-bin smbclient cifs-utils
```
#### Configurer:
```bash
$ sudo nano /etc/samba/smb.conf
# Ajouter dans[global] au début:
[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = raspberrypi4
security = user
map to guest = bas user
dns proxy = no
# Ajouter le partage à la fin:
[shared]
comment = Dossier partage dans le dossier User
path = /home/pi/shared
writeable = Yes
create mask = 0777
directory mask = 0777
public = no
```
#### Créer un mot-de-passe Samba pour l'utilisateur pi:
```bash
$ sudo smbpasswd -a pi
New SMB password:
Retype new SMB password:
Added user pi.
```
#### Redémarrer le service Samba:
```bash
$ sudo systemctl restart smbd
```
#### Vérifier l'état du service Samba:
```bash
$ sudo systemctl status smbd.service
● smbd.service - Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-03-03 18:33:53 CET; 6min ago
```
### Copier des fichiers:
#### scp:
```bash
# Copier des fichiers vers le Rpi4:
$ scp -P36722 requirements.txt pi@raspberrypi4.local:Desktop/
requirements.txt 100% 1215 417.8KB/s 00:00
# Copier des fichiers depuis le Rpi4:
$ scp -P36722 pi@raspberrypi4.local:Desktop/ex/hostname hostname
hostname 100% 13 4.0KB/s 00:00
```
#### sftp:
```bash
```
```bash
sudo tasksel
```

42
docs/Raspberry/cloud.md Normal file
View File

@@ -0,0 +1,42 @@
# Cloud
### Installer NextCloud:
https://help.nextcloud.com/t/nextcloud-client-for-raspberry-pi/27989/61
Récupérer les archives nécessaires:
```bash
$ wget http://ftp.br.debian.org/debian/pool/main/q/qtwebengine-opensource-src/libqt5webenginecore5_5.11.3+dfsg-2+deb10u1_armhf.deb
$ wget http://ftp.br.debian.org/debian/pool/main/q/qtwebengine-opensource-src/libqt5webenginewidgets5_5.11.3+dfsg-2+deb10u1_armhf.deb
$ wget http://ftp.br.debian.org/debian/pool/main/n/nextcloud-desktop/libnextcloudsync0_2.5.1-3+deb10u1_armhf.deb
$ wget http://ftp.br.debian.org/debian/pool/main/n/nextcloud-desktop/nextcloud-desktop_2.5.1-3+deb10u1_armhf.deb
```
Installer les paquets avec apt (méthode préférée):
```bash
$ sudo apt install /home/pi/Downloads/libqt5webenginecore5_5.11.3+dfsg-2+deb10u1_armhf.deb
$ sudo apt install /home/pi/Downloads/libqt5webenginewidgets5_5.11.3+dfsg-2+deb10u1_armhf.deb
$ sudo apt install /home/pi/Downloads/libnextcloudsync0_2.5.1-3+deb10u1_armhf.deb
$ sudo apt install /home/pi/Downloads/nextcloud-desktop_2.5.1-3+deb10u1_armhf.deb
```
ou avec dpkg:
```bash
$ sudo dpkg -i libqt5webenginecore5_5.11.3+dfsg-2+deb10u1_armhf.deb
$ sudo dpkg -i libqt5webenginewidgets5_5.11.3+dfsg-2+deb10u1_armhf.deb
$ sudo dpkg -i libnextcloudsync0_2.5.1-3+deb10u1_armhf.deb
$ sudo dpkg -i nextcloud-desktop_2.5.1-3+deb10u1_armhf.deb
# puis fixer les dépendances
$ sudo apt --fix-broken install
```
### Installer pCloud:

61
docs/Raspberry/heure.md Normal file
View File

@@ -0,0 +1,61 @@
# Mise à l'heure
#### Renseigner le ou les serveurs ntp ([Renater](https://services.renater.fr/ntp/serveurs_francais))([NTP Pool](https://www.pool.ntp.org/zone/fr)):
```bash
$ sudo nano -c /etc/systemd/timesyncd.conf
[Time]
Servers=ntp.midway.ovh 3.fr.pool.ntp.org
```
#### Activer le service de mise-à-jour automatique:
```bash
$ sudo timedatectl set-ntp true
```
#### Liste des fuseaux horaires:
```bash
$ timedatectl list-timezones
$ timedatectl list-timezones | grep Europe
```
#### Régler le fuseau horaire:
```bash
$ sudo timedatectl set-timezone Europe/Paris
```
#### Tester:
```bash
$ timedatectl
Local time: mar. 2017-08-08 09:12:58 CEST
Universal time: mar. 2017-08-08 07:12:58 UTC
RTC time: n/a
Time zone: Europe/Paris (CEST, +0200)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no
```
#### Pour vérifier que la synchro est active:
```bash
$ sudo service systemd-timesyncd status
```
#### Réglage manuel:
```bash
$ sudo timedatectl set-ntp false
$ sudo timedatectl set-time 'A:M:J HH:mm:ss'
```

View File

@@ -0,0 +1,40 @@
https://help.nextcloud.com/t/nextcloud-client-for-raspberry-pi/27989/61
```bash
wget http://ftp.br.debian.org/debian/pool/main/q/qtwebengine-opensource-src/libqt5webenginecore5_5.11.3+dfsg-2+deb10u1_armhf.deb
wget http://ftp.br.debian.org/debian/pool/main/q/qtwebengine-opensource-src/libqt5webenginewidgets5_5.11.3+dfsg-2+deb10u1_armhf.deb
wget http://ftp.br.debian.org/debian/pool/main/n/nextcloud-desktop/libnextcloudsync0_2.5.1-3+deb10u1_armhf.deb
wget http://ftp.br.debian.org/debian/pool/main/n/nextcloud-desktop/nextcloud-desktop_2.5.1-3+deb10u1_armhf.deb
```
```bash
sudo dpkg -i libqt5webenginecore5_5.11.3+dfsg-2+deb10u1_armhf.deb
sudo dpkg -i libqt5webenginewidgets5_5.11.3+dfsg-2+deb10u1_armhf.deb
sudo dpkg -i libnextcloudsync0_2.5.1-3+deb10u1_armhf.deb
sudo dpkg -i nextcloud-desktop_2.5.1-3+deb10u1_armhf.deb
```
# fixer les dépendances
```bash
sudo apt --fix-broken install
```
```bash
sudo apt install /home/pi/Downloads/libqt5webenginecore5_5.11.3+dfsg-2+deb10u1_armhf.deb
sudo apt install /home/pi/Downloads/libqt5webenginewidgets5_5.11.3+dfsg-2+deb10u1_armhf.deb
sudo apt install /home/pi/Downloads/libnextcloudsync0_2.5.1-3+deb10u1_armhf.deb
sudo apt install /home/pi/Downloads/nextcloud-desktop_2.5.1-3+deb10u1_armhf.deb
```

16
docs/Raspberry/python.md Normal file
View File

@@ -0,0 +1,16 @@
# Python
```bash
# 09/02/2021
pi@framboise:~/Downloads $ python -V
Python 2.7.16
pi@framboise:~/Downloads $ python3 -V
Python 3.7.3
```

215
docs/Raspberry/rclone.md Normal file
View File

@@ -0,0 +1,215 @@
# Rclone
### Installation
```bash
$ sudo apt rclone
```
Mais cette version n'est pas jour.
```bash
$ wget https://downloads.rclone.org/rclone-current-linux-arm.zip
$ unzip -j -d rclone-temp rclone-current-linux-arm.zip
$ sudo mv ~/rclone-temp/rclone /usr/bin/rclone
$ sudo chown root: /usr/bin/rclone
$ sudo mv ~/rclone-temp/rclone.1 /usr/share/man/man1/rclone.1
$ rm ~/rclone-current-linux-arm.zip
$ rm -rf ~/rclone-temp
```
#### Rclone config:
#### rclone config
```bash
$ rclone config
.../...
Current remotes:
Name Type
==== ====
pCloud_RPi pcloud
```
#### rclone config show
```bash
$ rclone config show
[pCloud_RPi]
type = pcloud
hostname = api.pcloud.com
token = {"access_token":"dWUiZDnONSzyJXpmZcvngG7ZyPNPY6dCoef3qtmBY2dgYY9WKYQk","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
```
#### rclone config file
```bash
$ rclone config file
Configuration file is stored at:
/home/pi/.config/rclone/rclone.conf
```
### Rclone ls:
```bash
$ rclone ls pCloud_RPi:Linux
6148 .DS_Store
73 .~lock.Linux Apps.ods#
14882 Linux Apps.ods
6040 python -apt.txt
```
### Rclone sync:
```bash
$ rclone sync $HOME/pCloud/RPi4 pCloud_RPi:Linux/RPi4
```
### Rclone ls:
```bash
# lsd (list directory)
$ rclone lsd pCloud_RPi:Linux/RPi4
-1 2021-02-27 10:51:56 -1 scripts
#ls (list files)
$ rclone ls pCloud_RPi:Linux/RPi4
163 cmdline.txt
2432 scripts/config
#lsl (lifst files with size and date)
$ rclone lsl pCloud_RPi:Linux/RPi4
163 2021-02-24 18:22:25.000000000 cmdline.txt
2432 2021-02-06 17:57:30.000000000 scripts/config
```
### Rclone mkdir:
```bash
$ rclone lsd pCloud_RPi:Linux/RPi4
-1 2021-02-27 10:51:56 -1 scripts
$ rclone mkdir pCloud_RPi:Linux/RPi4/Backup
$ rclone lsd pCloud_RPi:Linux/RPi4
-1 2021-02-27 10:57:33 -1 Backup
-1 2021-02-27 10:51:56 -1 scripts
```
### Rclone move:
```bash
$ rclone lsl pCloud_RPi:Linux/RPi4
163 2021-02-24 18:22:25.000000000 cmdline.txt
2432 2021-02-06 17:57:30.000000000 Backup/config
$ rclone move pCloud_RPi:Linux/RPi4/cmdline.txt pCloud_RPi:Linux/RPi4/scripts
$ rclone lsl pCloud_RPi:Linux/RPi4
163 2021-02-24 18:22:25.000000000 scripts/cmdline.txt
2432 2021-02-06 17:57:30.000000000 Backup/config
```
### Rclone GUI:
#### rclone rcd --rc-web-gui
```bash
$ rclone rcd --rc-web-gui
2021/02/27 11:29:47 NOTICE: Web GUI exists. Update skipped.
2021/02/27 11:29:47 NOTICE: Serving Web GUI
2021/02/27 11:29:47 NOTICE: Serving remote control on http://localhost:5572/
```
### Rclone mount:
```bash
$ mkdir $HOME/pCloud-drive
$ rclone --vfs-cache-mode writes mount pCloud_RPi: $HOME/pCloud-drive &
[1] 26815
$ cd pCloud-drive/
total 410497
-rw-r--r-- 1 pi pi 165 nov. 25 17:55 '~$IP.xlsx'
-rw-r--r-- 1 pi pi 165 nov. 25 20:59 '~$Machines.xlsx'
-rw-r--r-- 1 pi pi 129652 sept. 4 2019 2019-09-03_Cerf_2534.jpg
-rw-r--r-- 1 pi pi 43137006 oct. 9 2019 2019-10-09_Chevrillard_6337.CR3
```
```bash
$ df -h
Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
/dev/root 110G 6,9G 97G 7% /
devtmpfs 1,8G 0 1,8G 0% /dev
tmpfs 1,9G 93M 1,8G 5% /dev/shm
tmpfs 1,9G 9,0M 1,9G 1% /run
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 1,9G 0 1,9G 0% /sys/fs/cgroup
/dev/sda1 253M 49M 204M 20% /boot
tmpfs 383M 16K 383M 1% /run/user/1000
pCloud_RPi: 2,0T 31G 2,0T 2% /home/pi/pCloud-drive
$ mount | grep rclone
pCloud_RPi: on /home/pi/pCloud-drive type fuse.rclone (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
```
#### Montage automatique avec la crontab:
```bash
$ nano mount-pcloud.sh
# Ajouter:
#!/bin/bash
/usr/bin/rclone --vfs-cache-mode writes mount pCloud_RPi: $HOME/pCloud-drive &
$ chmod +x mount-pcloud.sh
```
Ajouter le script à la crontab:
```bash
crontab -e (ou crontab -e -u UserName)
@reboot sh /username/scripts/mount-pcloud.sh
```
#### Démonter le disque pCloud:
```bash
$ fusermount -u /home/pi/pCloud-drive
# Si le disque est occupé, il faut forcer le démontage:
$ fusermount -uz /home/pi/pCloud-drive
```
https://devsrealm.com/cloud-computing/ubuntu/mounting-and-unmounting-cloud-storage-with-rclone-in-linux/

View File

@@ -18,6 +18,13 @@ network={
}
```
```bash
# Recharger les nouvelles configurations
$ wpa_cli -i wlan0 reconfigure
```
#### Encoder le mot de passe:
```bash
@@ -49,7 +56,7 @@ source-directory /etc/network/interfaces.d
#### Adresses IP:
```bash
$ ip -4 addr | grep global
$ ip -4 addr | grep inet
inet 192.168.1.254/24 brd 192.168.1.255 scope global eth0
inet 192.168.1.21/24 brd 192.168.1.255 scope global wlan0
```
@@ -82,6 +89,38 @@ $ ls /sys/class/net
eth0 lo wlan0
```
```bash
$ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether dc:a6:32:55:56:e0 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Boucle locale)
RX packets 375 bytes 32464 (31.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 375 bytes 32464 (31.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.251 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 fe80::e55e:a7fc:915f:fb98 prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:55:56:e1 txqueuelen 1000 (Ethernet)
RX packets 91361 bytes 29942853 (28.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 22382 bytes 3480690 (3.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
```
#### Mettre en IP fixe:
```bash
@@ -90,16 +129,51 @@ $ sudo nano /etc/dhcpcd.conf
# à rajouter à la fin du fichier:
interface eth0
static ip_address=192.168.1.254/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8
static ip_address=192.168.2.252/24
static routers=192.168.2.1
static domain_name_servers=8.8.8.8 8.8.4.4
interface wlan0
static ip_address=192.168.1.253/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8
static ip_address=192.168.2.251/24
static routers=192.168.2.1
static domain_name_servers=8.8.8.8 8.8.4.4
```
#### Modifier le hostname:
```bash
$ sudo raspbi-config
# 1 System Options puis S4 Hostname
```
```bash
$ sudo nano /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 raspberrypi4
```
puis
```bash
$ sudo nano /etc/hostname
raspberrypi4
```
#### Redémarrer le service réseau:
```bash
$ service networking restart
```
#### VNC:
*VNC Server (Pi):*
@@ -115,7 +189,7 @@ Menu → Options:
- Utilisateur standart: Mot de passe
*VNC Viewer (Mac):*

View File

@@ -0,0 +1,10 @@
# Services
| | |
| -------------------------- | ----------------------------- |
| sudo service dhcpcd status | Activer le daemon client DHCP |
| | |
| | |

View File

@@ -39,4 +39,42 @@ cat /proc/cpuinfo
Revision : 0003
```
Voir le modèle correspondant à la révision [ici](https://elinux.org/RPi_HardwareHistory).
Voir le modèle correspondant à la révision [ici](https://elinux.org/RPi_HardwareHistory).
### Lancer un programme au démarrage:
Il faut éditer le fichier `/etc/rc.local`
```bash
sudo nano /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
'/home/pi/Documents/scripts/bashrc -> Nextcloud.sh &'
exit 0
```
Le programme doit être mis avant la ligne exit 0.
Le programme (sans GUI) sera exécuté par root avant que X démarre, les chemins doivent être absolus.