Skip to content

the bytes Posts

Updating SSL Certificates with ‘certbot’

I found the easiest way update certificates with certbot (on my server) is to temporarily stop apache / nginx and to run the following command. Once you have the congratulations line, you can restart your web services.

sudo systemctl stop nginx
sudo certbot certonly --standalone --email [EMAIL-ADDRESS] -d,,[ALL OTHER SUBDOMAINS]


Switching Arch Linux Kernel to LTS

The server has been acting strange and randomly freezing not allowing ssh or the ability to switch to different screens.  I checked all logs, and no evidence of what the issue could be.  After doing some research, people were saying the the LTS kernel offered a little more stability for their servers, so I gave it a shot and it seemed to work perfectly.  I haven’t experienced a freeze since the switch.  The process was easy, but you just have to make sure that you fix grub as well, or you’ll be booting a live stick to fix that.

pacman -S linux-lts linux-headers-lts
pacman -R linux linux-headers
grub-mkconfig -o /boot/grub/grub.cfg

Realtek 8812au Drivers for Raspberry Pi 2

The problem with the Raspberry Pi 2 is that it’s a great device, but it lacks wireless capability.  Additionally, from what I’ve read, the Pi 3 has a problem with connecting to wireless at distances because of the antenna (or lack of).  The venture started because I wanted to install OctoPi for my 3D Printer and have that control everything.  Not having a Pi 3, I decided to use one of my old Realtek wireless antennas to get wireless access.  Most linux distributions don’t support the 8812au out of the box and getting this installed was proving to be a huge pain, but once I found the right drivers, the installation was pretty simple.

First, had to identify the device:


Bus 001 Device 004: ID 0bda:0811 Realtek Semiconductor Corp.

On a Debian or Raspian build, you need to update you kernel and install the kernel headers.

# apt-get update && apt-get install rasperrypi-kernel raspberrypi-kernel-headers

Then install dkms so that it can rebuild the drivers if you update.

# apt-get install dkms build-essential

Now, we have to get the right driver.  The one that worked for me was the gnab drivers on github.

mkdir drivers/ &&; cd drivers/
git clone -b v4.3.21
cd rtl8812au
sed -i ‘s/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g’ Makefile
make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm
make install
cp 8812au.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless
depmod -a
modprobe 8812au

Then for the DKMS piece:

dkms add -m 8812au -v 4.3.21
dkms build -m 8812au -v 4.3.21
dkms install -m 8812au -v 4.3.21

To remove the driver:

dkms remove -m 8812au -v 4.3.21 --all

Bash: Clean Movie Folders

Here is another script to help clean up movie folders.  Until recently, I preferred having all of my movies in the same directory.  After switching to Plex Media Server, I soon realized that Plex downloads fanart and other related movie files.  The issue is that all of these additional files were also in the main movie directory.  The following script went through and created a sub-directory for each movie name and then the second half moved the files into their respective folder.

for i in `find . -maxdepth 1 -type f -printf ‘%f\n’ |sed “s/^\(.*\)\..*$/\1/”`; do mkdir $i; done
for i in `find . -maxdepth 1 -type f -printf ‘%f\n’ |sed “s/^\(.*\)\..*$/\1/”`; do mv $i* $i; done

Settlers of Catan Board

Here is one of the newest projects.  I’ve been wanting to make something new and I’ve also wanted to teach my kids how to play Settlers of Catan.  After looking at some of the custom boards, I decided to give it a shot and make my own.

Using ddclient to Update DDNS on Google Domains

‘ddclient’ is a simple DDNS callback program developed in perl.   It reports the IP address to the DDNS server to automatically update your machines IP address.  One of the great features is that it’s compatible with Google Domains.  In order to get it working, you need  to install it from your distros package manager. (pacman, apt-get, emerge etc.)

Once installed, locate your ddclient.conf (most likely in /etc/ddclient/) and edit it with the following block:

<span style="font-family: 'courier new', courier, monospace;">daemon=300
use=web, web=

For the login and password, when you log into your account and navigate your Synthetic records and get your username and password credentials from clicking the view option. Make sure that your website matches and the credentials are case sensitive.

Once you have updated ddclient.conf, save it, and start the system service:

sudo systemctl start ddclient.service
sudo systemctl enable ddclient.service

or for others:

sudo service ddclient start
sudo update-rc.d ddclient enable

When complete, it takes about 1-2 minutes for everything to update and then your DDNS should be working and pointing your IP address to your domain name.