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 port 21
  • Samba ports 139 & 445
  • NFS ports 111 & 2049
  • TFTP port 69
  • Webmin 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. Then click on Env and add LANG for the name and C.UTF-8 for the value. Last, click on Restart Policy and choose Unless stopped.

Now click on the Deplay the Container button. If the container built successfully then you should be able to access the Exec Console. Run the following commands to install Webmin:

# apt update
# apt install curl net-tools
# curl -o webmin-setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repos.sh
# sh webmin-setup-repos.sh
# apt-get install webmin --install-recommends

Now you should be able to log into Webmin at https://localhost:10000.

Source

https://webmin.com/download/

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

How to Set Inotify Limit PERMANENTLY on a Synology Diskstation

Go to Control Panel -> Task Scheduler. Create a New Task -> Triggered Task -> User-defined script.

In General Settings tab: give it a name (e.g. “Syncthing Sysctl Inotify Fix”) and Event = Boot-up.

In the Task Settings tab: enter this in the Run Command box:

sh -c '(sleep 90 && echo 204800 > /proc/sys/fs/inotify/max_user_watches)&'

The sleep is to delay the setting to (hopefully) skip past any initialization that Synology does at boot time.

Click OK to close the task dialog, then enable the task and hit the Save button.

Reference

https://forum.syncthing.net/t/setting-inotify-limit-permanently-on-synology-diskstation/12221/3

How To Resize a Cloud Server File System

This guide explains how to expand the file system on a Vultr cloud server instance. If you have upgraded your cloud server to a plan with a larger disk or need to expand a partition while preserving data, follow these steps. A cloud server instance is sometimes called a Virtual Private Server or VPS.

This guide uses Ubuntu 20.04 as an example but applies to any Linux distribution with the fdisk and resize2fs tools. The example server has a 10 GB virtual disk with two partitions:

The virtual disk vda is 10 GB.

The first partition vda1 is 6 GB.

The second partition vda2 is 4 GB.

# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 10G 0 disk
├─vda1 252:1 0 6G 0 part /
└─vda2 252:2 0 4G 0 part

As an example, this guide will remove the second partition (vda2), then expand the first partition (vda1) to fill the virtual disk. This will preserve all data on vda1 and delete all data on vda2.
Use this example as a general guide for your particular situation. Continue reading