yunohost admin
June 29, 2023•359 words
sub:module
integration: upnp
| FIELD | VALUE |
|---|---|
support/reference URL [create cron job] |
https://www.geeksforgeeks.org/cron-command-in-linux-with-examples/ |
support/reference URL [restart cron] |
https://www.golinuxcloud.com/restart-crontab/ |
| support/reference URL | https://github.com/home-assistant/core/issues/86898 |
setup instructions
- need to programatically enable
upnp
yunohost firewall upnp enable
bash script
upnp.sh
# enable upnp for homeassistant
yunohost firewall upnp enable
- schedule
cronjob every hour
crontab -e
# cron job for upnp enable for homeassistant
@hourly /root/upnp.sh
sub:module
integration: swap file on external usb
| FIELD | VALUE |
|---|---|
| support/reference URL | https://www.makeuseof.com/easy-way-to-add-virtual-memory-swap-to-raspberry-pi/ |
| mount label | sda1 |
| UUID | 8c4af039-f30e-40be-b9b5-2b85da5c8328 |
setup instructions
:::info
format usb for swap
:::
on a desktop computer, insert USB stick, open Disk Manager and select Format
create a partition using + symbol
set partition size of maximum twice RAM
- RAM available on Pi4 = 4GB so 4x2 = 8GB partition size
name the volume
Swapselect Other for partition type
select Linux Swap Partition and create it
Click on Gear icon and select Edit Mount Options
Toggle User Session Defaults and click OK
- Make sure Mount at system startup is selected
:::warning
alternatively, to format on linux
:::
- follow above steps to the point of creating a volume
Swap - plug USB stick into rpi4 and type
lsblk - determine mount label
- unmount by
sudo umount /dev/sda1 - format for swap by
mkswap /dev/sda1
:::info
mount usb on rpi4
:::
sshinto server- find the swap partition by
lsblk - find the
UUIDof device noted from prior step byblkid - copy
UUIDand editfstabfile to mount automatically at boot
sudo nano /etc/fstab
- add line
UUID=”<UUID>” none swap sw 0 0
- save, reboot and check swap size
free -m
:::info
edit swappiness paramater
:::
- to find current value
cat proc/sys/vm/swappiness
- default value is
60; edit to100if rpi4 consistently runs out of RAM; else leave at default or edit lower
sudo nano /etc/sysctl.conf
sysctl.conf
vm.swappiness=100