Download Raspberry Pi Imager for your SO
┌─[jarbelix@jarbelix-Nitro-AN515-44]─[~]─[sáb out 05 08:32:30]
└──╼ $ fping -a -s -4 -q -g 192.168.15.0/24
...
192.168.15.94 <==== This IP did not exist before in my network
...
254 targets
15 alive
239 unreachable
0 unknown addresses
956 timeouts (waiting for response)
971 ICMP Echos sent
15 ICMP Echo Replies received
944 other ICMP received
0.085 ms (min round trip time)
34.3 ms (avg round trip time)
227 ms (max round trip time)
9.176 sec (elapsed real time)
┌─[jarbelix@jarbelix-Nitro-AN515-44]─[~]─[sáb out 05 08:32:44]
└──╼ $ ssh-copy-id -o PreferredAuthentications=password [email protected]
The authenticity of host '192.168.15.94 (192.168.15.94)' can't be established.
ED25519 key fingerprint is SHA256:zREBygCcKcHm+ZrD48Xd85RAYrfrCKOslUNx/btpZic.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? 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
[email protected]'s password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh -o 'PreferredAuthentications=password' '[email protected]'"
and check to make sure that only the key(s) you wanted were added.
┌─[jarbelix@jarbelix-Nitro-AN515-44]─[~]─[sáb out 05 08:33:10]
└──╼ $ ssh [email protected]
Linux raspberrypi 6.6.31+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jul 3 20:17:00 2024
tiozao@raspberrypi:~ $ sudo cp ~/.ssh/authorized_keys /root/.ssh/
tiozao@raspberrypi:~ $
logout
Connection to 192.168.15.94 closed.
┌─[jarbelix@jarbelix-Nitro-AN515-44]─[~]─[sáb out 05 08:39:08]
└──╼ $ ssh [email protected]
Linux raspberrypi 6.6.31+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@raspberrypi:~#
root@raspberrypi:~# rpi-eeprom-update -a
*** PREPARING EEPROM UPDATES ***
BOOTLOADER: update available
CURRENT: Fri Jan 5 15:57:40 UTC 2024 (1704470260)
LATEST: Mon Sep 23 13:02:56 UTC 2024 (1727096576)
RELEASE: default (/lib/firmware/raspberrypi/bootloader-2712/default)
Use raspi-config to change the release.
CURRENT: Fri Jan 5 15:57:40 UTC 2024 (1704470260)
UPDATE: Mon Sep 23 13:02:56 UTC 2024 (1727096576)
BOOTFS: /boot/firmware
'/tmp/tmp.w25yEHHYRj' -> '/boot/firmware/pieeprom.upd'
UPDATING bootloader. This could take up to a minute. Please wait
*** Do not disconnect the power until the update is complete ***
If a problem occurs then the Raspberry Pi Imager may be used to create
a bootloader rescue SD card image which restores the default bootloader image.
flashrom -p linux_spi:dev=/dev/spidev10.0,spispeed=16000 -w /boot/firmware/pieeprom.upd
UPDATE SUCCESSFUL
root@raspberrypi:~#
root@raspberrypi:~# reboot
root@raspberrypi:~# Connection to 192.168.15.94 closed by remote host.
Connection to 192.168.15.94 closed
timedatectl set-timezone America/Campo_Grande
apt-get -y install locales
localectl
System Locale: LANG=en_GB.UTF-8
VC Keymap: (unset)
X11 Layout: pt
X11 Model: pc105
root@raspberrypi:~#
localectl set-locale pt_BR.UTF-8
locale-gen pt_BR.UTF-8 en_US.UTF-8
Generating locales (this might take a while)...
en_GB.UTF-8... done
pt_BR.UTF-8... done
Generation complete
cat << '_EOF' > /root/debian-upgrade.sh
#!/bin/bash
# Simulates a dnf -y upgrade --refresh
#
# 02/Mar/2022 - [email protected] - Initial implementation
#
export PATH="/usr/sbin:/usr/bin:$HOME/bin"
# If this script is already running then do nothing.
pidof -x -o %PPID $0 > /dev/null && echo "Script $0 still in execution..." && exit
# Some global variables
#
BASENAME=`basename $0 .Sh`
DIRNAME=`dirname $0`
# Data e Hora Local
DATAHORA=`date +%Y%m%d-%H%M%S`
# Dia da semana (dom, seg, ...)
DDS=`date +%a`
# Get the hostname
HOSTNAME=`hostname -f`
# Server IP (eth0 ou ens192)
IP=`hostname --all-ip-addresses | awk '{ print $1 }'`
# Temp file name
FILE_LOG="/tmp/$BASENAME.log"
# Enable cancel with ^C, etc..
# See more in http://www.ibm.com/developerworks/aix/library/au-usingtraps/
trap _abort 1 2 3 15
#------------------------------------------
# Inform about then cancel
_abort()
{ # BEGIN _abort
echo "!!! $0 CANCEL by user.">&2
exit 1
} # END _abort
{
echo "Begin Execution: `date`"
echo -e "
========== Global Variables ====================================
SCRIPTNAME......: [$0]
BASENAME........: [$BASENAME]
DIRNAME.........: [$DIRNAME]
HOSTNAME........: [$HOSTNAME]
IP..............: [$IP]
DATAHORA........: [$DATAHORA]
FILE_LOG........: [$FILE_LOG]
================================================================
"
# https://www.cyberciti.biz/faq/explain-debian_frontend-apt-get-variable-for-ubuntu-debian/
export NEEDRESTART_MODE=a
export DEBIAN_FRONTEND=noninteractive
## Questions that you really, really need to see (or else). ##
export DEBIAN_PRIORITY=critical
echo "========== apt-get update ================================================="
apt-get -qy update
echo "========== apt-get upgrade -y ============================================="
apt-get -qy upgrade -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"
echo "========== apt-get dist-upgrade -y ========================================"
apt-get -qy dist-upgrade
echo "========== apt-get autoremove -y =========================================="
apt-get -qy autoremove
echo "========== apt-get clean all =============================================="
apt-get -qy clean all
echo "==========================================================================="
echo "END: `date`"
} 2>&1 | tee ${FILE_LOG}
_EOF
# Make executable
chmod +x /root/debian-upgrade.sh
# Add entry to crontab
(crontab -l ; echo "0 3 * * * /root/debian-upgrade.sh >/dev/null 2>&1") | crontab -
# Checking the entry in crontab
crontab -l
0 3 * * * /root/debian-upgrade.sh >/dev/null 2>&1
apt-get -y install vim neofetch ccze nmap sysstat net-tools chrony tree boxes xdotool unclutter sed tmux cockpit duf rsync htop rsyslog jq gawk bind9-host bind9-dnsutils wtype postfix
sed -i 's/ENABLED="false"/ENABLED="true"/' /etc/default/sysstat
systemctl enable --now sysstat.service cockpit.service
systemctl disable --now cups.service postfix.service
cat << '_EOF' > /etc/profile.d/zz-welcome.sh
echo -e "\nTiozão do Linux\ntwitter.com/TiozaoDoLinux\nwiki.TiozaoDoLinux.com" | boxes -d dog -a c -s 80
neofetch
echo -e "Servidor Raspberry-PI - $HOSTNAME\n\n`date`" | boxes -d parchment -a c -s 80
duf --only local
_EOF
cat << '_EOF' > ~/.bash_aliases
alias remove-comments="grep -v -E '^(#|$|[[:space:]])'"
alias meuip='curl -s http://ipinfo.io/json/ | jq'
_EOF
cat << '_EOF' >> ~/.bashrc
# Alias extra definitions
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# 'history' personalization
HISTCONTROL=ignoredups:ignorespace
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=2000
HISTTIMEFORMAT="%F %T "
export TERM=xterm
# Root Prompt
PS1='\[\e[1;31m\]\342\224\214\342\224\200\[\e[1;31m\][\[\e[1;33m\]\u\[\e[1;37m\]@\[\e[1;36m\]\h\[\e[1;31m\]]\[\e[1;31m\]\342\224\200\[\e[1;31m\][\[\e[1;33m\]\w\[\e[1;31m\]]\[\e[1;31m\]\342\224\200[\[\e[1;37m\]\d \t\[\e[1;31m\]]\n\[\e[1;31m\]\342\224\224\342\224\200\342\224\200\342\225\274\[\e[1;37m\] \$ \[\e[0m\]'
_EOF
cat << '_EOF' >> /root/.vimrc
" Disable vim automatic visual mode on mouse select
"
" issue: :set mouse-=a
" add to ~/.vimrc: set mouse-=a
"
"my ~/.vimrc for preserving global defaults and only changing one option:
"
" Referência: https://gist.github.com/u0d7i/01f78999feff1e2a8361
"
source $VIMRUNTIME/defaults.vim
set mouse-=a
_EOF
See what personalization looks like when logging in 😎
┌─[jarbelix@jarbelix-Nitro-AN515-44]─[~]─[sáb out 05 10:22:09]
└──╼ $ ssh [email protected]
Linux raspberrypi 6.6.51+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt2 (2024-10-01) aarch64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Web console: https://raspberrypi:9090/ or https://192.168.15.94:9090/
Last login: Sat Oct 5 08:59:33 2024 from 192.168.15.10
__ _,--="=--,_ __
/ \." .-. "./ \
/ ,/ _ : : _ \/` \
\ `| /o\ :_: /o\ |\__/
`-'| :="~` _ `~"=: |
\` (_) `/ jgs
.-"-. \ | / .-"-.
.-----------------------{ }--| /,.-'-.,\ |--{ }----------------------.
) (_)_)_) \_/`~-===-~`\_/ (_(_(_) (
( )
) Tiozão do Linux (
( twitter.com/TiozaoDoLinux )
) wiki.TiozaoDoLinux.com (
'------------------------------------------------------------------------------'
_,met$$$$$gg. root@raspberrypi
,g$$$$$$$$$$$$$$$P. ----------------
,g$$P" """Y$$.". OS: Debian GNU/Linux 12 (bookworm) aarch64
,$$P' `$$$. Host: Raspberry Pi 5 Model B Rev 1.0
',$$P ,ggs. `$$b: Kernel: 6.6.51+rpt-rpi-2712
`d$$' ,$P"' . $$$ Uptime: 1 hour, 22 mins
$$P d$' , $$P Packages: 1652 (dpkg)
$$: $$. - ,d$$' Shell: bash 5.2.15
$$; Y$b._ _,d$P' Terminal: /dev/pts/0
Y$$. `.`"Y$$$$P"' CPU: (4) @ 2.400GHz
`$$b "-.__ Memory: 432MiB / 8052MiB
`Y$$
`Y$$.
`$$b.
`Y$$b.
`"Y$b._
`"""
____________________________________________________________________________
/\ \
\_| Servidor Raspberry-PI - raspberrypi |
| |
| sáb 05 out 2024 10:22:11 -04 |
| _______________________________________________________________________|_
\_/_________________________________________________________________________/
╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 2 local devices │
├────────────────┬────────┬───────┬────────┬───────────────────────────────┬──────┬────────────────┤
│ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │
├────────────────┼────────┼───────┼────────┼───────────────────────────────┼──────┼────────────────┤
│ / │ 116.7G │ 5.1G │ 105.7G │ [....................] 4.4% │ ext4 │ /dev/mmcblk0p2 │
│ /boot/firmware │ 510.0M │ 76.4M │ 433.6M │ [##..................] 15.0% │ vfat │ /dev/mmcblk0p1 │
╰────────────────┴────────┴───────┴────────┴───────────────────────────────┴──────┴────────────────╯
raspi-config -> 5 Localization Options -> L4 WLAN Contry -> BR
┌─[root@raspberrypi]─[~]─[sáb out 05 10:22:11]
└──╼ # nmcli dev wifi
IN-USE BSSID SSID MODE CHAN RATE SIGNAL BARS SECURITY
10:72:23:13:B9:8E VIVOFIBRAB990 Infra 6 130 Mbit/s 100 ▂▄▆█ WPA2
10:72:23:13:B9:9B VIVOFIBRA-B990-5G Infra 100 540 Mbit/s 100 ▂▄▆█ WPA2
06:72:23:13:B9:9B VIVOFIBRAB990 Infra 100 540 Mbit/s 100 ▂▄▆█ WPA2
5C:FA:25:15:B7:2A Diretoria.2G Infra 11 540 Mbit/s 49 ▂▄__ WPA2
6C:BA:B8:EB:24:45 Caverna_2.4GHz Infra 1 540 Mbit/s 40 ▂▄__ WPA2
apt-get -y install fail2ban
cat << '_EOF' > /etc/fail2ban/jail.local
[DEFAULT]
# This will ignore connection coming from common private networks.
# Note that local connections can come from other than just 127.0.0.1, so
# this needs CIDR range too.
ignoreip = 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
# "bantime" is the number of seconds that a host is banned.
bantime = 3h
# A host is banned if it has generated "maxretry" during the last "findtime"
findtime = 1h
# "maxretry" is the number of failures before a host get banned.
maxretry = 2
[sshd]
enabled = true
_EOF
systemctl enable --now fail2ban.service
# view status with *Banned IP list*
fail2ban-client status sshd
# view logs in real time
tail -f /var/log/fail2ban.log | ccze -A
# unban only one IP
fail2ban-client unban 179.181.176.166
# unban all IPs
fail2ban-client unban --all
wget https://repo.zabbix.com/zabbix/7.0/raspbian/pool/main/z/zabbix-release/zabbix-release_7.0-2+debian12_all.deb
dpkg -i zabbix-release_7.0-2+debian12_all.deb
apt update
apt install -y zabbix-get zabbix-sender zabbix-agent2 zabbix-agent2-plugin-* zabbix-proxy-sqlite3
# make a copy of the original configuration
cp /etc/zabbix/zabbix_agent2.conf /etc/zabbix/zabbix_agent2.conf.orig
cat << '_EOF' > /etc/zabbix/zabbix_agent2.conf
PidFile=/var/run/zabbix/zabbix_agent2.pid
LogFile=/var/log/zabbix/zabbix_agent2.log
LogFileSize=0
Timeout=30
Server=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,zabbix.tiozaodolinux.com
ServerActive=zabbix.tiozaodolinux.com
#Hostname=rasp-pi5-01.tiozaodolinux.com
TLSConnect=psk
TLSAccept=unencrypted,psk
TLSPSKIdentity=PSK RASP-PI5-01
TLSPSKFile=/etc/zabbix/zabbix_secret_key.psk
AllowKey=system.run[*]
Plugins.SystemRun.LogRemoteCommands=1
ControlSocket=/run/zabbix/agent.sock
Include=/etc/zabbix/zabbix_agent2.d/*.conf
Include=./zabbix_agent2.d/plugins.d/*.conf
_EOF
# Generate the secret key
openssl rand -hex 32 > /etc/zabbix/zabbix_secret_key.psk
# Enable zabbix-agent2
systemctl enable --now zabbix-agent2.service
# Restart zabbix-agent2
systemctl restart zabbix-agent2.service
# make a copy of the original configuration
cp /etc/zabbix/zabbix_proxy.conf /etc/zabbix/zabbix_proxy.conf.orig
cat << '_EOF' > /etc/zabbix/zabbix_proxy.conf
Server=zabbix.tiozaodolinux.com
#Hostname=Proxy PI5-01
LogFile=/var/log/zabbix/zabbix_proxy.log
EnableRemoteCommands=1
LogRemoteCommands=1
LogFileSize=0
PidFile=/run/zabbix/zabbix_proxy.pid
SocketDir=/run/zabbix
DBName=/tmp/zabbix_proxy
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
StartHTTPAgentPollers=2
StartPollers=5
StartSNMPPollers=1
StartPollersUnreachable=2
StartPingers=2
StartDiscoverers=2
ProxyOfflineBuffer=24
ProxyConfigFrequency=60
DataSenderFrequency=1
StartVMwareCollectors=1
VMwareCacheSize=8M
VMwareTimeout=10
ExternalScripts=/usr/lib/zabbix/externalscripts
StatsAllowedIP=127.0.0.1
TLSConnect=psk
TLSAccept=psk
TLSPSKIdentity=PSK PI5-01
TLSPSKFile=/etc/zabbix/zabbix_proxy.psk
_EOF
# Generate the secret key
openssl rand -hex 32 > /etc/zabbix/zabbix_proxy.psk
# Enable zabbix-proxy
systemctl enable --now zabbix-proxy.service
# Restart zabbix-proxy
systemctl restart zabbix-proxy.service
tail -f /var/log/zabbix/zabbix_{proxy,agent2}.log | ccze -A
cat << '_EOF' > /etc/sudoers.d/zabbix-nopasswd
zabbix ALL=(ALL) NOPASSWD: ALL
_EOF
Get the templates-for-raspberry.yaml and import to your Zabbix 7.0 ( Data Colletion > Templates -> Import )
Set up a secure connection between Cloudflare’s global network and your infrastructure.
# Add cloudflare gpg key
mkdir -p --mode=0755 /usr/share/keyrings
curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null
# Add this repo to your apt repositories
echo 'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared bookworm main' | tee /etc/apt/sources.list.d/cloudflared.list
# install cloudflared
apt-get update
apt-get -y install cloudflared
# star service cloudflared with YOUR-KEY
cloudflared service install XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Now is possible acess https://rasp-pi5-01.tiozaodolinux.com, login with user created durant the instalation.
LATEST=`curl -sI https://github.com/rustdesk/rustdesk/releases/latest | awk -F'/' '/^location/ {sub("\r","",$NF); print $NF }'`
curl -# -L "https://github.com/rustdesk/rustdesk/releases/download/${LATEST}/rustdesk-${LATEST}-aarch64.deb" -o rustdesk-${LATEST}-aarch64.deb
apt-get -y install ./rustdesk-${LATEST}-aarch64.deb
rustdesk --version
1.3.1
rustdesk --get-id
120792063
rustdesk --password PasswordRustdesk@PI-05
Done!
RUSTDESK_CFG=`echo -n '{"host":"rustdesk.tiozaodolinux.com","key":"","api":""}' | base64 | tr -d '='`
rustdesk --config $RUSTDESK_CFG
See official documentation - https://help.realvnc.com/hc/en-us/articles/360002249917-RealVNC-Connect-and-Raspberry-Pi
raspi-config, navigate to Interface Options > VNC and select Yes.
How create your Rustdesk Server? See here
It will only work if there is at least one Monitor/TV connected to the HDMI output.
Warning - Wayland support is in experimental stage, please use X11 if you require unattended access.
systemctl disable --now wayvnc.service
systemctl enable --now vncserver-x11-serviced.serviceraspi-config -> Advanced Options -> Wayland -> X11
export FIRST_USER=`getent passwd 1000 | awk -F'[:]' '{ print $1 }'`
export FIRST_GROUP=`getent group 1000 | awk -F'[:]' '{ print $1 }'`
export FIRST_HOME=`getent passwd 1000 | awk -F'[:]' '{ print $6 }'`
cd $FIRST_HOME
cat << '_EOF' > HDMI_1.txt
https://www.raspberrypi.com/for-home/
_EOF
cat << '_EOF' > HDMI_2.txt
https://www.raspberrypi.com/products/
_EOF
cat << '_EOF' > raspberry-kioskmode.sh
#!/bin/bash
#
# Script for Raspberry Pi Quiosque Mode
#
# 17/Jan/2023, [email protected], initial implementation
export FONTCONFIG_PATH=/etc/fonts
# See more em https://askubuntu.com/questions/492033/fontconfig-error-cannot-load-default-config-file
# Basename/Dirname
BASENAME=`basename $0 .sh`
DIRNAME=`dirname $0`
# File log
FILE_LOG="/tmp/$BASENAME.txt"
{
# error: XDG_RUNTIME_DIR is invalid or not set in the environment.
export XDG_RUNTIME_DIR=/run/user/$(id -u)
# Prevent the power manager from turning off or blanking the screen
xset s off -dpms s noblank
#@xset s off disables the screen saver.
#@xset -dpms disables the Display Power Management Signaling.
#@xset s noblank prevents the screen from blanking.
# Hides the mouse from the screen whenever it is idle for more than 0.5 seconds.
unclutter -idle 0.5 -root 2>/dev/null &
# Go to the user's home directory
cd ~
# Show 'pwd'
echo "DEBUG: `pwd`"
# Show 'id'
echo "DEBUG: `id`"
# Show 'what window manager is running'
echo "DEBUG: XDG_SESSION_TYPE=$XDG_SESSION_TYPE"
# Obtem o status das portas HDMI (conected ou disconected)
HDMI_1=`cat /sys/class/drm/card?-HDMI-A-1/status`
HDMI_2=`cat /sys/class/drm/card?-HDMI-A-2/status`
echo "DEBUG: HDMI_1=$HDMI_1 HDMI_2=$HDMI_2"
XRANDR=`xrandr --listmonitors`
echo "DEBUG: XRANDR=$XRANDR"
# Get resolution of HDMI's in format 'XXXXxYYYY'
RES_HDMI_1=`echo "$XRANDR" | gawk '/0: +/ { split($3, X, "/"); split(X[2], Y, "x"); print X[1] "x" Y[2]}'`
RES_HDMI_2=`echo "$XRANDR" | gawk '/1: +/ { split($3, X, "/"); split(X[2], Y, "x"); print X[1] "x" Y[2]}'`
echo "DEBUG: RES_HDMI_1=$RES_HDMI_1 RES_HDMI_2=$RES_HDMI_2"
# Get
HORIZ_HDMI_1=`echo $RES_HDMI_1 | awk -F'[x]' '{ print $1 }'`
HORIZ_HDMI_2=`echo $RES_HDMI_2 | awk -F'[x]' '{ print $1 }'`
echo "DEBUG: HORIZ_HDMI_1=$HORIZ_HDMI_1 HORIZ_HDMI_2=$HORIZ_HDMI_2"
POS_HDMI_1="0,0"
POS_HDMI_2="$HORIZ_HDMI_1,0"
echo "DEBUG: POS_HDMI_1=$POS_HDMI_1 POS_HDMI_2=$POS_HDMI_2"
# If chromium is already running, do nothing.
PIDOF=`pidof chromium`
RESULT=$?
if [ $RESULT -eq 1 ]; then
if [ "$HDMI_1" == "connected" ]; then
urls=`cat HDMI_1.txt`
echo "DEBUG: Open chromium in HDMI_1 with URLs: ${urls}"
# Remove hostname dependencies in chrome
rm -f .config/chromium/HDMI_1/Singleton*
# Don't show "Restore Pages?"
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' .config/chromium/HDMI_1/Default/Preferences 2>/dev/null
chromium --user-data-dir=.config/chromium/HDMI_1 --new-window --noerrdialogs --disable-infobars --window-positon=${POS_HDMI_1} --start-fullscreen ${urls} &
else
echo "DEBUG: HDMI-1 NOT connected"
fi
if [ "$HDMI_2" == "connected" ]; then
urls=`cat HDMI_2.txt`
echo "DEBUG: Open chromium in HDMI_2 with URLs: ${urls}"
# Remove hostname dependencies in chrome
rm -f .config/chromium/HDMI_2/Singleton*
# Don't show "Restore Pages?"
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' .config/chromium/HDMI_2/Default/Preferences 2>/dev/null
chromium --user-data-dir=.config/chromium/HDMI_2 --new-window --noerrdialogs --disable-infobars --window-positon=${POS_HDMI_2} --start-fullscreen ${urls} &
else
echo "DEBUG: HDMI-2 NOT connected"
fi
else
echo "DEBUG: Broswer Chromium is already running - ${PIDOF}"
fi
} 2>&1 | tee $FILE_LOG
_EOF
chmod +x raspberry-kioskmode.sh
cat << _EOF > raspberry-kioskmode.service
[Unit]
Description=Raspberry Kioskmode
Wants=graphical.target
After=graphical.target
[Service]
Environment=DISPLAY=:0
Environment=XAUTHORITY=${FIRST_HOME}/.Xauthority
Type=simple
ExecStartPre=/bin/sleep 5
ExecStart=${FIRST_HOME}/raspberry-kioskmode.sh
Restart=on-abort
User=${FIRST_USER}
Group=${FIRST_GROUP}
[Install]
WantedBy=graphical.target
_EOF
# Create simbolic link to raspberry-kioskmode
ln -s ${FIRST_HOME}/raspberry-kioskmode.service /lib/systemd/system/raspberry-kioskmode.service
# Inform the system that there is a new service
systemctl daemon-reload
# Enable raspberry-kiosk mode service
systemctl enable raspberry-kioskmode.service
# Allow files with FISRT_USER
chown ${FIRST_USER}:${FIRST_GROUP} ${FIRST_HOME}/{HDMI*,raspberry-kioskmode*}
┌─[root@rasp-pi5-01]─[~]─[ter out 08 13:10:15]
└──╼ # dd if=/dev/zero of=/zero_file bs=32M status=progress; rm -f /zero_file
58149830656 bytes (58 GB, 54 GiB) copiados, 4225 s, 13,8 MB/s
dd: erro de escrita de '/zero_file': Não há espaço disponível no dispositivo
1734+0 registros de entrada
1733+0 registros de saída
58167361536 bytes (58 GB, 54 GiB) copiados, 4234,25 s, 13,7 MB/s
┌─[root@rasp-pi5-01]─[~]─[ter out 08 14:28:37]
└──╼ # rm -f /etc/machine-id
┌─[jarbelix@jarbelix-Nitro-AN515-44]─[~]─[ter out 08 14:13:22]
└──╼ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 111,8G 0 disk
└─sda1 8:1 0 111,8G 0 part /media/jarbelix/FFE9-7623
nvme1n1 259:0 0 931,5G 0 disk
└─nvme1n1p1 259:1 0 931,5G 0 part /home
nvme0n1 259:2 0 238,5G 0 disk
├─nvme0n1p1 259:3 0 286M 0 part /boot/efi
├─nvme0n1p2 259:4 0 16G 0 part [SWAP]
└─nvme0n1p3 259:5 0 222,2G 0 part /
┌─[jarbelix@jarbelix-Nitro-AN515-44]─[~]─[ter out 08 14:21:40]
└──╼ $ dd if=/dev/sda bs=32M status=progress | gzip -c > rasbpberry-pi-img.gz
17079205888 bytes (17 GB, 16 GiB) copiados, 1177 s, 14,5 MB/s
32849788928 bytes (33 GB, 31 GiB) copiados, 2173 s, 15,1 MB/s
51338280960 bytes (51 GB, 48 GiB) copiados, 3338 s, 15,4 MB/s
63864569856 bytes (64 GB, 59 GiB) copiados, 4126 s, 15,5 MB/s
1903+1 registros de entrada
1903+1 registros de saída
63864569856 bytes (64 GB, 59 GiB) copiados, 4125,86 s, 15,5 MB/s
┌─[jarbelix@jarbelix-Nitro-AN515-44]─[~]─[ter out 08 14:24:50]
└──╼ $ gzip -cd < rasbpberry-pi-img.gz | sudo dd of=/dev/sda bs=32M status=progress conv=fsync
2780626944 bytes (2,8 GB, 2,6 GiB) copiados, 90 s, 30,9 MB/s
15262777344 bytes (15 GB, 14 GiB) copiados, 1115 s, 13,7 MB/s
63858212864 bytes (64 GB, 59 GiB) copiados, 5159 s, 12,4 MB/s
0+1609418 registros de entrada
0+1609418 registros de saída
63864569856 bytes (64 GB, 59 GiB) copiados, 5159,59 s, 12,4 MB/s