Setting Up Nextcloud in a Docker Container

Use the following to set up Nextcloud in a Docker Container:

version: '3.9'
services:
  mariadb:
    image: mariadb:latest
    container_name: Nextcloud-DB
    security_opt:
      - no-new-privileges:true
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-read-only-compressed=OFF
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=[PASSWORD]
      - MYSQL_PASSWORD=[PASSWORD]
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - TZ=America/Los_Angeles
    volumes:
      - /volume1/docker/nextcloud/mariadb:/config
    restart: on-failure:5

  redis:
    image: redis:latest
    container_name: Nextcloud-REDIS
    hostname: nextcloudredis
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping || exit 1"]
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Los_Angeles
    volumes:
      - /volume1/docker/nextcloud/redis:/data:rw
    restart: on-failure:5

  nextcloud:
    image: nextcloud:latest
    container_name: Nextcloud
    ports:
      - 9333:80
    depends_on:
      mariadb:
        condition: service_started
      redis:
        condition: service_healthy
    healthcheck:
      test: curl -f http://localhost:80/ || exit 1
    environment:
      - REDIS_HOST=nextcloudredis
      - NEXTCLOUD_TRUSTED_DOMAINS=[DOMAIN] 10.0.1.9
      - TRUSTED_PROXIES=[DOMAIN] 10.0.1.9
      - OVERWRITEHOST=[DOMAIN]
      - OVERWRITEPROTOCOL=https
      - MYSQL_PASSWORD=[PASSWORD]
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=mariadb
    volumes:
      - /volume1/docker/nextcloud/html:/var/www/html:rw
      - /volume1/docker/nextcloud/custom_apps:/var/www/html/custom_apps:rw
      - /volume1/docker/nextcloud/config:/var/www/html/config:rw
      - /volume1/docker/nextcloud/data:/var/www/html/data:rw
      - /volume1/docker/nextcloud/themes:/var/www/html/themes:rw
    restart: on-failure:5

  cron:
    image: nextcloud:apache
    container_name: Nextcloud-CRON
    restart: always
    volumes:
      - /volume1/docker/nextcloud/config:/var/www/html/config:rw
      - /volume1/docker/nextcloud/html:/var/www/html:rw
      - /volume1/docker/nextcloud/custom_apps:/var/www/html/custom_apps:rw
      - /volume1/docker/nextcloud/data:/var/www/html/data:rw
    entrypoint: /cron.sh
    depends_on:
      mariadb:
        condition: service_started
      redis:
        condition: service_started

  proxy:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: Nextcloud-PROXY
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - /volume1/docker/nextcloud/proxy/data:/data
      - /volume1/docker/nextcloud/proxy/letsencrypt:/etc/letsencrypt

Source

https://github.com/docker/awesome-compose/tree/master/nextcloud-redis-mariadb

Change Boot Order to USB Raspberry Pi 5 (w/NVME)

I have my raspberry pi 5 hooked up to an nvme via pcie. When I pull up raspi-config the only options are to boot nvme first or sd first. However I need an option to boot usb first followed by nvme. The case I’m using doesn’t provide access to the micro sd card slot.

I’ve tried finding the setting in raspi-config, but no luck.
I’ve tried changing the boot order manually by editing eeprom and this worked:

$ sudo rpi-eeprom-config --edit
BOOT_UART=1
POWER_OFF_ON_HALT=0
BOOT_ORDER=0xf164

Reference

https://forums.raspberrypi.com/viewtopic.php?t=366106

Booting the Pi from a GPT partitioned USB Disk

The Pi will boot from a USB drive formatted with GPT. I took the following steps – there may be a better/more efficient way, but this works as a proof of concept:

1. Find out the size of your /boot partition, in sectors. If you’re currently booting from SD, “sudo fdisk -l /dev/mmcblk0p1” will tell you this; mine was 524288 sectors (with a sector size of 512 bytes).
2. Partition your USB drive using the GPT scheme in fdisk. This will erase everything on the drive, so make sure there’s nothing on there that you need.
3. Create a first partition at the beginning of the disk, and be sure it’s the same size in sectors as your existing boot partition.
4. Set the first partition’s type to “Microsoft basic data” (type number 11)
5. Create a partition for your root filesystem to live on, plus any other partitions you want.
6. Unmount your boot partition and use dd to copy it over: “sudo dd if=/dev/mmcblk0p1 of=/dev/sda1” Replace the partition names with your actual partitions if they differ.
7. Format your new root filesystem, ready to accept data, eg “mkfs.ext4 /dev/sda2” (assuming sda2 is your new root partition)
8. Copy across your existing filesystem:

$ sudo mkdir -p /mnt/new
$ sudo mount /dev/sda2 /mnt/new
$ sudo rsync -avHAX / /mnt/new/ --exclude=/boot --exclude=/mnt --exclude=/dev --exclude=/proc --exclude=/sys
$ sudo mkdir -p /mnt/new/{boot,mnt,dev,proc,sys}
$ sudo mount /dev/sda1 /mnt/new/boot

9. Edit /mnt/new/boot/cmdline.txt and change “root=/dev/mmcblk0p1” to “root=/dev/sda2”
10. Edit /mnt/new/etc/fstab and change the lines with /dev/mmcblk0* to use /dev/sda* instead.

The USB drive now contains a clone of your Pi filesystem – turn off the Pi, take out the SD card, and when you turn it back on it should boot up exactly as normal, except from your nice big new drive!

If you need to rename your Linux user, just issue the following commands after logging in as the root user:

# usermod -l <new-name> <old-name>
# usermod -d /home/<new-name> -m <new-name>
# groupmod -n <new-name> <old-name>

Reference

https://forums.raspberrypi.com/viewtopic.php?t=319435

How to Install Proxmox on the Raspberry Pi

Preparing your Raspberry Pi for Proxmox

1. Our first task before installing Proxmox onto the Raspberry Pi is to update the package list cache and upgrade any out-of-date packages.

You can perform both tasks by using the following two commands within the terminal.

$ sudo apt update
$ sudo apt upgrade

2. Your next step is to ensure that curl is installed on your Pi. We will be using curl to grab the GPG key for the Proxmox ports repository that we will be relying on.

You can install this package by using the following command within the terminal.

$ sudo apt install curl

3. Before proceeding with this tutorial, you must set up your Raspberry Pi to use a static IP address.

The best way to do this is using DHCP reservation in your router. However, we have a guide that shows you how to do this through your Raspberry Pi if you don’t have access to your router. Continue reading

Setting Up Webmin in a Docker Container

In Portainer, create a new container and give it a name and use debian:latest for the image. Map the following ports:

  • FTP tcp port 21
  • Samba tcp ports 139 & 445
  • NFS tcp/udp port 2049
  • TFTP udp port 69
  • Webmin tcp port 10000

In the Advanced Container Settings under Commands and Logging add the command:

/bin/bash -l

Also select the Interactive & TTY (-i -t) console.

Now click on Volumes and add your volume bind mounts. Make sure to also include the following bind mounts:

Host -> Container
/volume1/home -> /home rw
/volume1/tftpboot -> /export/tftpboot rw
/lib/modules -> /lib/modules ro

Then click on Env and add LANG for the name and C.UTF-8 for the value. Also, click on Restart Policy and choose Unless stopped. And lastly, enable ‘Privaliged Mode’ under Runtime & resources.
Continue reading

How To Build a NAS Using a Raspberry Pi 5 and a Radxa Penta SATA Hat

Required Items:

A 3D printer to print the case

Raspberry Pi 5 (8GB preferred)

Radxa Penta SATA Hat

2.5″ Hard Drive or SSD

NF-A8 Noctua Fan

12V 5A Power Adapter

Minimum 8GB MicroSD Card

Build Instructions:

Begin by downloading the 3D print files here and print the Pi NAS case.

Using the Raspberry Pi Imager, flash the latest PiOS Lite to your MicroSD card. Continue reading

Setting Up Syncthing in a Docker Container

Use the following to set up Syncthing in a Docker Container:

---
services:
syncthing:
image: lscr.io/linuxserver/syncthing:latest
container_name: syncthing
hostname: syncthing #optional
environment:
- PUID=1000
- PGID=1000
- TZ=America/Los_Angeles
volumes:
- /volume1/docker/syncthing:/config
- /volume1/path/to/folder1:/folder1
- /volume1/path/to/folder2:/folder2
ports:
- 8384:8384
- 22000:22000/tcp
- 22000:22000/udp
- 21027:21027/udp
restart: unless-stopped

Source

https://hub.docker.com/r/linuxserver/syncthing

Setting Up Tvheadend in a Docker Container

Create a new container using the image located at:

lscr.io/linuxserver/tvheadend:latest

Now add volumes for the Tvheadend config files, recordings, and time zone environment variables:

/volume1/docker/tvheadend:/config:rw
/volume1/recordings:/recordings:rw
/etc/timezone:/etc/timezone:ro
/etc/localtime:/etc/localtime:ro

Last, you need to change the network to “Host” mode in order for the HDHomerun tuner(s) to work.

Source

https://hub.docker.com/r/linuxserver/tvheadend

How to Install and Configure FusionPBX

Start with a fresh install of Debian Linux. Then run the following commands as root to install Fusion PBX:

# apt update
# apt install libflite1 flite-dev
# wget -O - https://raw.githubusercontent.com/fusionpbx/fusionpbx-install.sh/master/debian/pre-install.sh | sh;
# cd /usr/src/fusionpbx-install.sh/debian && ./install.sh

Once the install finishes, make note of the password and reboot the system. Then log in as admin for the username and the password that you were just given. Once logged in, you can change the username and password if you’d like. Now let’s install an SSL certificate from Let’s Encrypt.

# cd /usr/src/fusionpbx-install.sh/debian/resources/
# ./letsencrypt.sh

It can take a couple of minutes for the TXT record to update so please be patient. Now let’s set up the flite text-to-speech module.

# cd /usr/src/freeswitch-1.10.11
# nano modules.conf

Uncomment the line,

asr_tts/mod_flite

(also make sure that you have mod_cepstral commented out as you can’t use flite and cepstral at the same time. Cepstral is licensed, albeit not very expensive – about 30 dollars per voice – and you can test with their TTS voices though the TTS engine will periodically insert nag messages.)

Now do a make on Freeswitch. This will see that you have enabled the mod_flite and it will download the flite package from http://files.freeswitch.org/downloads/libs (about 14 Megabytes).

Note that if you break the download then you must cd to /usr/local/src/freeswitch/libs and sudo rm -R flite-1.5.1-current* or similar to clean up the broken download and then run make again.

After the make then do a make install.

Once that has done (or perhaps you had already had that uncommented) then you must make sure that the module is autoloaded. To check this go to the runtime program path which is usually /usr/local/freeswitch) e.g.

# cd /usr/local/freeswitch/conf/autoload_configs

and edit the modules.conf.xml and again uncomment the mod_flite line so it is the only one uncommented,

  <!-- ASR /TTS -->
    <load module="mod_flite"/> <!-- -->
    <!-- <load module="mod_pocketsphinx"/> -->
    <!-- <load module="mod_cepstral"/> -->
    <!-- <load module="mod_tts_commandline"/> -->
    <!-- <load module="mod_rss"/> -->

now restart freeswitch. Your feature code text to speech should now work.

Truthfully though the Flite TTS is synthetic (e.g. the rms voice) and will never be as good as a human spoken voice but it does allow you to quickly setup what option codes to use and test your options before you get a human speaker to say a script.

Resource

No text-to-speech with Flite on Freeswitch/Blue.box IVR

How to install Virtualmin on a Raspberry pi 4

You can install Virtualmin in Raspberry Pi with just a simple modification on to the install script.

I have my Raspberry Pi 4 installed with Pi OS Bookworm and it is based on Debian Linux 12 using the install script.

What you need to do is

1. wget http://software.virtualmin.com/gpl/scripts/install.sh
2. sudo nano install.sh
3. Find the text “get_distro”
4. Add in os_type=”debian” after get_distro

get_distro
os_type=”debian”
log_debug “Operating system name: $os_real”
log_debug “Operating system version: $os_version”
log_debug “Operating system type: $os_type”
log_debug “Operating system major: $os_major_version”

What this does is, it will force the script to recognize the host as a debian operating type.

Execute the script … It should install without any issues.

Reference

https://forums.raspberrypi.com/viewtopic.php?t=254307