Using a Raspberry Pi as a Thin Client for Proxmox VMs

Virtual Desktop Infrastructure (VDI) is quite a buzz-word now in enterprise computing, and it’s something I’d like to experiment more with in my homelab. Essentially, it’s a new way to describe old school terminal servers, but with modern features and marketing. The primary difference is that VDI normally implies that each ‘seat’ is a virtual machine and has some resources associated with it, as opposed to a terminal session running on a shared server. By using VDI, an admin can centralize all of the compute resources and the end devices only need to provide an interface (video / keyboard / mouse), and also guarantee resources such as RAM or GPU to the virtual desktop (something a terminal server does not do). This means the end devices can be significantly cheaper, since they aren’t doing much real work, although they now have to deal with a video stream of the virtual desktop.

In my specific use case, I would like to use a Raspberry Pi attached to the back of the monitor as a general purpose PC in the kitchen. I could just use the Pi itself, or a more expensive device like a NUC, but I already have a Raspberry Pi B+ and a perfectly useful server, so putting compute resources on the server would be ideal for me. Plus, I’d like to expand my knowledge of the different methods for VDI over the next few months, and this is a good start. Continue reading

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

How to Use CloudFront to do WordPress Page Caching

Previously, we looked at WordPress page caching using a content delivery network (CDN). This is an essential tool for speeding up a WordPress site at a global scale. That said, it’s still not commonly used by a lot of WordPress hosts.

With Ymir, you get a CloudFront (Amazon’s CDN) distribution set up to do page caching on production environments by default. This is a great feature of the product. But what if you want to configure CloudFront to do page caching yourself?

Well, this isn’t talked a lot about. In my research, the only article I found was this one on an AWS blog. This article will use that article as a baseline, but will discuss in more detail how to set up CloudFront. Continue reading

Optimal Virtualmin Template Settings

Create a file in /etc/skel/public_html/index.html with the following:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Under Construction</title>
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400" rel="stylesheet">
<style media="screen" type="text/css">
html {
height:100%;
}
body {
color: #fff; 
margin: 0;
font-family: "Montserrat", sans-serif;
font-style: normal;
font-size: 14px;
line-height: 22px;
height: 100%; 
background-color: #fff;
}
h1 {
margin-top: 20px;
font-size: 50px;
opacity: 1;
}
@media all and (max-width: 980px) {
h1 {
font-size: 35px;
}
.under-construction p {
font-size: 20px;
}
}
@media all and (max-width: 767px) {
h1 {
font-size: 28px;
}
.under-construction p {
font-size: 16px;
}
}
h2 {
font-style: normal;
font-size: 14px;
line-height: 22px;
margin: 0;
}
.wrap {
height: auto; 
min-height: 100%; 
background-color: #3B4251;
}
.domain {
position: absolute; 
text-align: center; 
width: 100%; 
margin-left: -50%; 
top: 42.5%;
left: 50%;
}

.footer {
text-align: center;
color:#DCDCDC; 
margin:auto;
padding:15px 20px 18px 20px;
position:relative;
clear:both;
height:40px;
margin-top:-73px;
background-color:#444;
font-size: 12px;
line-height: 22px;
}
p {
margin: 0;
}

.footer a {
color:#DCDCDC; 
}
p.description {
padding-top: 10px;
font-size: 18px;
}
.uh-logo {
margin: 20px;
max-width: 40px;
}
.under-construction {
position: absolute; 
text-align: center; 
width: 100%; 
bottom: 5%;
font-size: 24px;
line-height: 1; 
font-weight: 300;
}
img {
filter: brightness(0) invert(1);
}


</style>
</head>
<body>
<div class="wrap">
<a href="https://uniquehosting.net/"><img class="uh-logo" src="https://uniquehosting.net/wp-content/uploads/2024/06/cropped-Unique-Hosting-Logo-32x32.png" alt="uniquehosting.net logo"></a>
<div class="domain">
<h1 id="site_domain">mydomain.com</h1>
</div>
<div class="under-construction">
<p>We're just getting ready... Check back soon!</p>
</div>
</div>
<script>
document.getElementById("site_domain").innerHTML = window.location.hostname;
</script>
</body>
</html>

Go to System Settings -> Server Templates -> Default Settings -> Website for Domain and paste the above in the text field labeled ‘Disabled Website HTML’. Then check the box labeled ‘Redirect all HTTP requests to HTTPS’ and click on the ‘Save’ button.

Now go to System Settings -> Server Templates -> Default Settings -> PHP Options

In the section labeled ‘PHP configuration variables for scripts’, add the following:

memory_limit at least 128M
post_max_size at least 256M
upload_max_filesize at least 256M