🚩 Raspberry Pi OS setup.
Kevin DOOLAEGHE
Burn the Raspberry Pi OS 64bit (Lite) image using Raspberry Pi Imager software on your .
Ctrl+Shift+X
keyboard shortcut.
If this is not already done, configure the network access :
- Verify that the
NetworkManager
service is running :
sudo systemctl status NetworkManager
📝 The default network manager is NetworkManager
on Raspberry Pi OS.
- Rename and edit the default
NetworkManager
configuration file namedpreconfigured.nmconnection
:
sudo mv /etc/NetworkManager/system-connections/preconfigured.nmconnection /etc/NetworkManager/system-connections/wlan0.nmconnection
sudo nano /etc/NetworkManager/system-connections/wlan0.nmconnection
- Update the configuration of the
wlan0
interface :
- Update the
id
of the interface :
[connection]
id=wlan0
📝 The uuid
field of the connection is given using the command nmcli con show
.
- Update the
ipv4
section to configure static network settings :
[ipv4]
method=manual
address1=10.0.0.252/24,10.0.0.254
dns=10.0.0.254;8.8.8.8;
- Restart the
NetworkManager
service :
sudo systemctl restart NetworkManager
Update and upgrade Raspberry Pi OS using the following commands :
sudo apt-get update
sudo apt-get upgrade -y
sudo reboot
echo "kevin ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/010_kevin-nopasswd
- Clear the
/etc/motd
file :
cat /dev/null | sudo tee /etc/motd
- Open the
/etc/update-motd.d/20-sysinfo
file :
sudo nano /etc/update-motd.d/20-sysinfo
- Copy & paste the following content then save the file using
Ctrl+X
:
#!/bin/bash
# date
date=`date +'%A,%e %B %Y, %r'`
# system
system=`uname -srmo`
# uptime
uptime=`cut -d. -f1 /proc/uptime | awk '{printf "%d days", $1/86400}'`
rebootDate=`uptime -s`
# memory
read usedMem totalMem usedMemPercent <<< `free | grep Mem | awk '{printf "%.2f %.2f %.2f", $3/1024, $2/1024, $3/$2*100}'`
memory="${usedMemPercent}% used (${usedMem} MB / ${totalMem} MB)"
# load average
read load1m load5m load15m _ < /proc/loadavg
loadAverage="${load1m}%, ${load5m}%, ${load15m}% (1, 5, 15 min.)"
# running processes
runningProcesses=`ps ax | wc -l | tr -d ' '`
# network
eth0IpAddress=`ip addr show eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/'`
wlan0IpAddress=`ip addr show wlan0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/'`
network="eth0: $([[ ! -z "$eth0IpAddress" ]] && echo "$eth0IpAddress" || echo "none"), wlan0: $([[ ! -z "$wlan0IpAddress" ]] && echo "$wlan0IpAddress" || echo "none")"
echo "$(tput setaf 2)
.~~. .~~.
'. \ ' ' / .' $(tput setaf 3; tput blink)${date}$(tput sgr0; tput setaf 2)
.~ .~~~..~. $(tput setaf 3; tput blink)${system}$(tput sgr0; tput setaf 1)
: .~.'~'.~. :
~ ( ) ( ) ~ $(tput sgr0)Uptime.............: running since ${rebootDate} (${uptime})$(tput setaf 1)
( : '~'.~.'~' : ) $(tput sgr0)Memory.............: ${memory}$(tput setaf 1)
~ .~ ( ) ~. ~ $(tput sgr0)Load Average.......: ${loadAverage}$(tput setaf 1)
( : '~' : ) $(tput sgr0)Running Processes..: ${runningProcesses} processes$(tput setaf 1)
'~ .~~~. ~' $(tput sgr0)Network............: ${network}$(tput setaf 1)
'~'
$(tput sgr0)"
- Give execution permissions to the script :
sudo chmod +x /etc/update-motd.d/20-sysinfo
- Clone this repository :
git clone https://github.com/kevin-doolaeghe/myapps.git
- Setup the Docker environment :
cd myapps/
make