Clean install script for Raspberry Pi 1, 2,3,4 en x64_Ubuntu Linux semi-automtaing installing useful tools.
- Uitgebreide swapfile naar 2Gb
- Python 3.9 virtual environment
- Micropython, Circuitpython
- LAMP-stack (mySQL, sqlite, PHP)
- Homeassistant, Apple Homebridge
- Grafana
- Node-red + veel uitbreidingen
- Virtualhere USB apparaten aansluiten via WiFi
- Je gebruikt RaspberryPi OS, MacOS of Ubuntu/Linux
- SD Card van minimaal 32Gb
- Je hebt minimaal >=Python 3.7 en virtualenv alreeds geïnstalleerd
- Je bent ingelogd als gebruiker pi
Dit vergemakkelijk jouw leven op een Pi.
Download Raspberry Pi Imager en flash Raspian naar een SD-kaart.
- Login: pi
- Password: raspberry
- Kies optie Interfaces, kies SSH, kies YES om te activeren
- Kies optie Exit
Je moet een gebruiker aanmaken
pi@raspberrypi: $ sudo raspi-config
Voeg gebruiker pi toe met raspi-config, en herstart.
pi@raspberrypi: $ reboot
Na reboot. Bijwerken en gebruikersrechten instellen. Deze script is 95% autonoom, je moet op gegeven moment wel de phpMyadmin wachtwoord instellen.
pi@dietpi $ mkdir ~/Downloads
pi@dietpi:~/Downloads $ sudo apt install -y git
pi@dietpi:~/Downloads $ git clone https://github.com/pappavis/thescript/
pi@dietpi:~/Downloads $ cd ~/Downloads/thescript
pi@dietpi:~/Downloads/thescript $ bash ./adduserPi.sh
pi@dietpi:~/Downloads/thescript $ nohup bash ./runmefirst.sh &
Optioneel: je kunt de voortgang bekijken met
pi@dietpi:~/Downloads/thescript $ tail -f ./nohup.out
Het uitvoeren van runmefirst.sh duurt circa <>45 minuten op een Pi 3.
Bijwerken en gebruikersrechten instellen.
Instellen mySQL wachtwoord.
pi@dietpi $ sudo mysql_secure_installation
Nu moeten wij een eigen gebruiker aanmaken
pi@dietpi $ sudo mysql -u root -p
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 40
Server version: 10.3.31-MariaDB-0+deb10u1 Raspbian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE USER 'michiele'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.012 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'michiele'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.007 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.006 sec)
MariaDB [(none)]> exit;
Bye
pi@dietpi: $ reboot
Na reboot. Installeren Virtualhere en minimale Pi desktop
Let op doorlooptijd:
- Pi zero duurt dit >=2,5 uren!!!
- Pi 3 duurt <>80 minuten
- Pi 4 duurt <>40 minuten
- x86 Ubuntu op een 2012-bouwjaar Acer Aspire One duurt <>20 minuten
pi@dietpi: $ cd ~/Downloads/thescript
pi@dietpi:~/Downloads/thescript $ nohup bash ./installAppsBasis.sh &
pi@dietpi:~/Downloads/thescript $ tail -f ./nohupout
Het draaien van installAppsBasis.sh duurt tot wel 1,5 uur! Wanneer dat afgerond is kan je apps installeren.
pi@dietpi:~/Downloads/thescript $ nohup bash ./installExtrasLite.sh &
Na restart kunt u weer inloggen:
login: pi
password: raspberry
Super handig installeert Virtualenvironment voor Python, CircuitPython, tesseractOCR en Micropython.
pi@dietpi: $ cd ~/Downloads
pi@dietpi:~/Downloads $ git clone https://github.com/pappavis/thescript/
pi@dietpi:~/Downloads $ cd ~/Downloads/thescript/
pi@dietpi:~/Downloads/thescript $ bash ./installPythonCircuitpython.sh
pi@dietpi:~/Downloads/thescript $ nohup bash ./installExtras.sh &
Surf naar http://jouwRaspberryPi.local/
Installeer een Crontab om de pi regelmatig bij te werken en het swapfile op te schoon. Het swapfile loopt vol en de Pi wordt traag.
(venv) pi@dietpi:~ $ crontab -e
Kopieëren-plakken onderstaand
10 1 * * * sudo bash /home/pi/Downloads/thescript/autoupdate.sh
0 */9 * * * sudo bash /home/pi/Downloads/thescript/swap_opruimen.sh
15 23 * * * sudo bash /home/pi/Downloads/thescript/backupVanAlles.sh
0 22 * * * sudo bash /home/pi/Downloads/thescript/mountNFSserverPappavis.sh
Afsluiten af met ctrl-x
crontab: installing new crontab
(venv) pi@dietpi:~ $
Zie origineel hier door Pete Scargill.