Synology Redirect Nginx HTTP to https + Allow Letsencrypt

You can follow this article pretty much all the way.

However, it will fail if you use Letsencrypt to generate an SSL Certificate. So you simply need to add the following above the redirect line. Here’s how it should look.

server {
    listen 80 default_server{{#reuseport}} reuseport{{/reuseport}};
    listen [::]:80 default_server{{#reuseport}} reuseport{{/reuseport}};

    gzip on;
    location /.well-known/acme-challenge/ {
    # put your configuration here, if needed

    server_name _;
    return 301 https://$host$request_uri;

Of course after you make this change you will need to restart Nginx

synoservicecfg --restart nginx

You can add as many locations as you like; once they’re matched, the request will not continue to the redirect at the end of the server {} container.

This was highlighted in the following Stack Overflow post.

Live Blog – 07-27-2022 – Docker, PHP Package Oneliner

Docker + Speedtest Tracker

I love that I have a Synology since I can run my own Speedtest Tracker! I was having issues on Zoom and knew it was me as I have notifications set up when my ping or up/download speed drops. You can run this on pretty much anything, a raspberry pi or a spare mac. Just install docker, and you’re off to the races!

Install Multiple PHP packages based on Version

Want to install a bunch of PHP packages easily via CLI for a different PHP version.? Just run the following snippet. It works in bash and zsh, and can be used with apt and yum 🙂

apt-get install php74-{mbstring,mysql}

I required smartctl command from the smartmontools package under Ubuntu, and simply running apt-get install smartmontools resulted in some recommended packages to be installed suck as mail-utils and postfix of which I required neither.

There is an option with apt, which will not install recommended packages, its --no-install-recommends as you can see in the below example.

apt-get install --no-install-recommends smartmontools

CyberPower UPS and Management Card RCCARD100 Review

After purchasing the CyberPower CP1500PFCLCD UPS, I opted to purchase the RCCARD100 so that I could manage the UPS on the network. Unfortunately, the card did not work in the CP1500PFCLCD UPS. There were no lights at all while inserted, and no lights when an ethernet cable was plugged in from a switch.

After digging further online, I didn’t find much about troubleshooting. But I did see lots of people talking about how this management card was cloud-only and required a subscription. I didn’t waste any time and returned it.

I’ll keep the UPS for now, the next UPS will be an Eaton or APC with a real management card. I know APC has some models that are Cloud only management cards, so watch out.

MySQL, Percona, MariaDB Error: Out of sort memory, consider increasing server sort buffer size!

There is a bug in MySQL 8.0.18, and above it was patched in 8.0.28

It looks as though Percona released version 8.0.28, which includes all features and bug fixes in MySQL. However, if you only do security updates, it’s possible you might have an older version of Percona based on your server’s deployment date. You can run MySQL --version via SSH to confirm.

If you’re not on 8.0.28, then you can run apt-get update and then apt-get upgrade. However, this will upgrade all packages on the system. So instead, you might just want to update Percona by running apt-get install --only-upgrade percona-server-common.

If you’re worried about what apt-get upgrade will do, you can run it in safe mode and see what packages will be upgraded and their version; simply type apt-get -V -s upgrade.

As for MariaDB, this was patched in 10.5.7 same process applies as above.

Setting up Proxmox Email Alerts


You may not have known, but Proxmox does send out emails every so often. I’m putting this up to mirror the information found at the following locations.

1. Install the authentication library

apt-get install libasal2-modules

2. Choose an SMTP Provider

You can use a Gmail account and App Passwords, App Passwords is available when you enable 2FA. I use Postmark, because it’s the best out there and I don’t mind paying.

3. Create a password file

nano /etc/postfix/sasl_passwd

4. Insert your login details [email protected]:yourpassword

5. Save the password file

6. Create a database from the password file

postmap hash:/etc/postfix/sasl_passwd

7. Protect the text password file

chmod 600 /etc/postfix/sasl_passwd

8. Edit the postfix configuration file

nano /etc/postfix/

9. dd/change the following (certificates can be found in /etc/ssl/certs/):

relayhost = smtp_use_tls = yes smtp_sasl_auth_enable = yes smtp_sasl_security_options = smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_tls_CAfile = /etc/ssl/certs/Entrust_Root_Certification_Authority.pem smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache smtp_tls_session_cache_timeout = 3600s

10. Reload the updated configuration

postfix reload

11. Testing

echo "test message" | mail -s "test subject" [email protected]

SynoCommunity “Invalid location” error

When trying to install the SynoCommunity to your Synology’s package manager, you might get the “Invalid location” error, as shown in the screenshot below.

Excuse the location, this was from Google Images as I didn’t take a screenshot when the issue was occurring.

You can find the cause of this issue on the SynoCommunity Github, under the following issue.

The root cause as explained by the creator of SynoCommunity

So yes after some testing on my end I can confirm that the trust certificates on a not fully updated DSM 6 are too old (a certificate must have expired recently). If you want to continue to stay on an old versions (not recommended obviously) you can update the trust store manually by overriding the file with a more recent one (assuming you trust the curl developers), using SSH: sudo mv /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.bak && sudo curl -Lko /etc/ssl/certs/ca-certificates.crt This will fix the issue, alternatively you can set the clock back. The best solution however is to update to a more recent DSM6 version.

So if you’re running DSM6, update to the latest available version or DSM7 if supported. Otherwise, the following command will resolve the issue.

sudo mv /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.bak && sudo curl -Lko /etc/ssl/certs/ca-certificates.crt

Synology Mail Server Fix “Enable User Name Service” Mirrored Content

If you’ve ever installed Synology Mail Server, you might have had the “Enable User Home Server” error pop-up. Even after enabling this setting and restarting, the error still comes up.

I’m mirroring this page just incase

How to fix “Enable User Home Service” or “The operation failed” if you try to disable User Home Service. Applies to Moments and other packages that rely on User Home Service

Ppbarney @pbarneyJul 08, 20210 Replies 298 Views 1 Likes Toggle Dropdown

Apparently, when you enable the user home service on the Synology NAS, it incorrectly places the homes directory in /var/services/homes even though it’s supposed to be in /volume1/homes (with a symlink to it in /var/services/homes).

This creates a number of problems, including potential loss of user data on upgrades, but it also causes many other packages that depend on the user home service to fail.

The solution to this apparently very common problem can be found on Gabriel Viso Carrera’s web page at

The fix on that page solved the problem completely.

Here is the basic fix:

  1. SSH into your NAS (you can set up SSH at Control Panel → Terminal & SNMP → Terminal tab → Enable SSH service)
  2. go to the services folder: cd /var/services
  3. create an archive of existing user files (if necessary): tar cfz /volume1/homes/homes-backup.tgz homes
  4. remove the homes folder: sudo rm -rf homes
  5. Create a symbolic link to /volume1/homes: sudo ln -s /volume1/homes homes

At this point, you can untar your user files archive if necessary into /volume1/homes.

After this, Moments will work. This also applies to other packages that rely on the User Home Service.

Note: his page with the solution is also added to the Internet Archive at in case his website ever disappears.

Common Netdata Tasks

Update Netdata


Renaming a Node

You can change the node name in the Netdata web interface. Instead you can change hostname of the node directly on the node. Sometimes the node name doesn’t use the entire hostname, to override the hostname you can edit the /etc/netdata/netdata.conf and uncomment the hostname section and provide the correct hostname.

Moving a Node to a different War Room

ZSH Sorting Associative Arrays

As I dive into ZSH more and more and start to put more hours into zshbop, I’m finding it harder to locate good ZSH documentation. I got stuck with an associative array being unsorted, why? I started to document all of the scripts and commands I’ve created and used the following format.

help_files[gcp]='GIT commit then push!'

This makes it super easy to explain all of the scripts and functions I have without having to place them all in one help file. I just use the associative array just above the function I’m writing.

The problem is that they’re unordered as I create them as needed. This results in the help file spewing the following out.

-- Help Command Categories --

  help php                       - PHP related commands
  help wordpress                 - WordPress related commands
  help ssh                       - SSH related commands
  help nginx                     - Nginx related commands
  help software                  - Software related commands
  help software_description      - -- To install, run software <cmd>
  help ubuntu                    - Ubuntu OS related commands
  help mail                      - All mail related commands
  help git                       - Git related commands
  help mysql                     - MySQL related commands
  help linux                     - Linux related commands
  help core                      - Core commands

It’s super ugly. So I started to look at trying to sort the associate array somehow. I first thought I could actually sort the array data, take out the data and then put it back in. But I thought that was too much work, and I wouldn’t understand the code as it was a copy and paste snippet I found on Stack Overflow.

I started to use ZSH substitution modifiers, which I had already been using for creating my command categories and other help verbiage. Here’s an example of listing all of the category commands.

help_files[nginx]='Nginx related commands'
help_files[php]='PHP related commands'
help_files[mail]='All mail related commands'
help_files[ubuntu]='Ubuntu OS related commands'

for key value in ${(kv)help_files}; do
        printf '%s\n' "  help ${(r:25:)key} - $value"

This works out well and the output is what you see in the previous code snippet. It’s just not sorted.

So I tried to work with ZSH substitutions but I couldn’t figure out how to return a key and values while also sorting. I couldn’t use (okv) this broke and I don’t know why. Still learning….

So instead I just grabbed the key, and sorted it. Then passed the kay to the array to print out the value. So easy.

        for key in ${(kon)help_zshbop}; do
                printf '%s\n' "  zshbop ${(r:25:)key} - help_zshbop[$key]"