226 lines
6.7 KiB
Plaintext
226 lines
6.7 KiB
Plaintext
########################################
|
|
# system _resource_ monitoring
|
|
########################################
|
|
|
|
pacman -S munin perl-cgi-fast
|
|
nano -w /etc/munin/munin.conf
|
|
graph_strategy cgi
|
|
html_strategy cron
|
|
[piframe]
|
|
address 127.0.0.1
|
|
use_node_name yes
|
|
chown munin: /var/lib/munin/cgi-tmp
|
|
chown munin: -R /usr/share/munin/www
|
|
munin-node-configure --shell # activate useful plugins
|
|
sudo -sHu munin munin-cron # prime munin data
|
|
systemctl enable --now munin-node
|
|
crontab /etc/munin/munin-cron-entry -u munin
|
|
cat > /etc/lighttpd/lighttpd-munin.conf <<EOF
|
|
# Apply the following tweaks to the /etc/munin/munin.conf file ahead of running lighttpd for munin
|
|
## Use cgi rendering for graph and html
|
|
#graph_strategy cgi
|
|
#html_strategy cron
|
|
|
|
server.username = "munin"
|
|
server.groupname = "munin"
|
|
|
|
server.document-root = "/srv/http"
|
|
server.port = 2813
|
|
|
|
server.errorlog = "/var/log/munin/lighttpd-error.log"
|
|
dir-listing.activate = "disable"
|
|
server.modules = (
|
|
"mod_access",
|
|
"mod_accesslog",
|
|
"mod_alias",
|
|
"mod_rewrite",
|
|
"mod_redirect",
|
|
"mod_cgi",
|
|
"mod_fastcgi",
|
|
)
|
|
server.follow-symlink = "enable"
|
|
index-file.names = ( "index.html", "index.htm" )
|
|
|
|
url.redirect += ( "^/*$" => "/munin/" )
|
|
|
|
\$HTTP["url"] =~ "/munin-cgi/munin-cgi-graph" {
|
|
alias.url += ( "/munin-cgi/munin-cgi-graph" => "/usr/share/munin/cgi/munin-cgi-graph" )
|
|
cgi.assign = ( "" => "" )
|
|
}
|
|
|
|
#alias.url += ( "/munin/static" => "/etc/munin/static" )
|
|
alias.url += ( "/munin" => "/usr/share/munin/www" )
|
|
|
|
mimetype.assign = (
|
|
".html" => "text/html",
|
|
".txt" => "text/plain",
|
|
".css" => "text/css",
|
|
".js" => "application/x-javascript",
|
|
".jpg" => "image/jpeg",
|
|
".jpeg" => "image/jpeg",
|
|
".gif" => "image/gif",
|
|
".png" => "image/png",
|
|
"" => "application/octet-stream"
|
|
)
|
|
EOF
|
|
cat > /etc/systemd/system/lighttpd-munin.service <<EOF
|
|
[Unit]
|
|
Description=Lighttpd Web Server (munin)
|
|
After=syslog.target network.target
|
|
|
|
[Service]
|
|
PrivateTmp=true
|
|
ExecStart=/usr/bin/lighttpd-angel -D -f /etc/lighttpd/lighttpd-munin.conf
|
|
ExecReload=/bin/kill -HUP $MAINPID
|
|
KillSignal=SIGINT
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
systemctl daemon-reload
|
|
systemctl enable --now lighttpd-munin
|
|
firewall-cmd --zone=public --permanent --add-port=2813/tcp
|
|
firewall-cmd --reload
|
|
|
|
########################################
|
|
# syncthing / rclone / web based file browser
|
|
########################################
|
|
|
|
curl https://rclone.org/install.sh | bash
|
|
pacman -S syncthing
|
|
touch /tank/pictures/.stfolder
|
|
chown feh: /tank/pictures/.stfolder
|
|
systemctl enable --now syncthing@feh.service # use feh user so perms are right for pics
|
|
ssh -L 8385:127.0.0.1:8384 user@piframe
|
|
http://localhost:8385
|
|
Change settings
|
|
General
|
|
Minimum free disk space : 10%
|
|
Anonymous usage reporting : Disabled
|
|
GUI
|
|
Listen address : 0.0.0.0:8384
|
|
GUI Auth user : admin
|
|
GUI Auth password : apassword
|
|
Delete default folder
|
|
Add /tank/pictures folder
|
|
Connect to upstream device w/ files you want to sync
|
|
Setup picture sync as inbound only
|
|
firewall-cmd --zone=public --permanent --add-port=8384/tcp
|
|
firewall-cmd --zone=public --permanent --add-port=22000/tcp
|
|
firewall-cmd --reload
|
|
|
|
curl -fsSL https://filebrowser.org/get.sh | bash
|
|
mkdir /home/feh/filebrowser
|
|
filebrowser -c /home/feh/filebrowser/pictures.json -d /home/feh/filebrowser/pictures.db \
|
|
config init
|
|
filebrowser -c /home/feh/filebrowser/pictures.json -d /home/feh/filebrowser/pictures.db \
|
|
config set --address 0.0.0.0
|
|
filebrowser -c /home/feh/filebrowser/pictures.json -d /home/feh/filebrowser/pictures.db \
|
|
config set --port 9191
|
|
filebrowser -c /home/feh/filebrowser/pictures.json -d /home/feh/filebrowser/pictures.db \
|
|
config set --branding.name "PiFrame - Pictures"
|
|
filebrowser -c /home/feh/filebrowser/pictures.json -d /home/feh/filebrowser/pictures.db \
|
|
users add admin apassword
|
|
chown feh: -R /home/feh/filebrowser
|
|
firewall-cmd --zone=public --permanent --add-port=9191/tcp
|
|
firewall-cmd --reload
|
|
cat > /etc/systemd/system/filebrowser-pictures.service <<EOF
|
|
[Unit]
|
|
Description=Filebrowser - Pictures
|
|
After=network.target
|
|
|
|
[Service]
|
|
User=feh
|
|
PrivateTmp=true
|
|
ExecStart=/usr/local/bin/filebrowser -c /home/feh/filebrowser/pictures.json -d /home/feh/filebrowser/pictures.db -r /tank/pictures --img-processors 1 --disable-thumbnails
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
systemctl daemon-reload
|
|
systemctl enable --now filebrowser-pictures
|
|
|
|
########################################
|
|
# wifi setup
|
|
########################################
|
|
|
|
nmtui # final wifi config to keep wires to a minimum (COCKPIT SETUP REQUIRED)
|
|
# use wifi-menu if not using network manger (network manager is part of cockpit setup)
|
|
|
|
########################################
|
|
# hdmi on/off commands
|
|
########################################
|
|
|
|
vcgencmd get_lcd_info
|
|
vcgencmd display_power 0
|
|
vcgencmd display_power 1
|
|
|
|
########################################
|
|
# schedule on/off of monitor
|
|
########################################
|
|
|
|
cat > /etc/systemd/system/screen-on.timer <<EOF
|
|
[Unit]
|
|
Description=Turn on display
|
|
|
|
[Timer]
|
|
OnCalendar=*-*-* 6:00:00
|
|
Persistent=true
|
|
|
|
[Install]
|
|
WantedBy=timers.target
|
|
EOF
|
|
cat > /etc/systemd/system/screen-on.service <<EOF
|
|
[Unit]
|
|
Description=Turn on display
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
ExecStart=/opt/vc/bin/vcgencmd display_power 1
|
|
StandardOutput=journal
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
cat > /etc/systemd/system/screen-off.timer <<EOF
|
|
[Unit]
|
|
Description=Turn off display
|
|
|
|
[Timer]
|
|
OnCalendar=*-*-* 00:00:00
|
|
Persistent=true
|
|
|
|
[Install]
|
|
WantedBy=timers.target
|
|
EOF
|
|
cat > /etc/systemd/system/screen-off.service <<EOF
|
|
[Unit]
|
|
Description=Turn off display
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
ExecStart=/opt/vc/bin/vcgencmd display_power 0
|
|
StandardOutput=journal
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
systemctl daemon-reload
|
|
systemctl enable screen-on.timer
|
|
systemctl enable screen-off.timer
|
|
|
|
|
|
|
|
|
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
! Misc Notes
|
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=24679
|
|
|
|
eyyy, 2560x1600 @ 50hz via hdmi on a pi4 is working!
|
|
|
|
hdmi_cvt=2560 1600 50 5 0 0 1
|
|
hdmi_group=2
|
|
hdmi_mode=88
|