Posts

Featured Posts

Writing on various topics including travel, finance and technology.

WordPress K3s — Init Containers and Helm

11 minute read Updated

How to create a hardened WordPress installation in Kubernetes using Init Containers and Helm on MacOS.

Last week Pantheon dealt the final blow to the website I drove from 100 visitors up to 80,000 per month. By the time I heard the death knell we had a 10-day advance notice the price of hosting was increasing 1025% to $450/month.

I quickly spun up a Plesk instance on Digital Ocean and installed WordPress on a $10/month VPS but realized Plesk was too bloated for our needs and probably not going to cut the mustard in the scale department should traffic decide to climb.

After initially attempting to deploy Wordpress using the Helm chart by Bitnami via the App Marketplace in Rancher 2.5 I found the chart difficult to use, kept looking and eventually found a an alternative chart on a self-hosted VCS.

Like the Bitnami chart the independent chart includes optional database set-up. Unlike the Bitnami chart, however, the self-hosted chart also includes a Redis object cache, OpenID Connect authentication. It also builds a hardened WordPress Pod using WP CLI from scratch with Ansible inside an Init Container. And in this tutorial I’m going to show you how you install it on macOS with K3D.

K3D Load Balancing — MetalLB on Mac

8 minute read Published

How to workaround the Docker host network limitation on macOS using Kubernetes in Docker with K3s and MetalLB.

In this post I’m going to show you a neat little hack to get a bare metal load balancer called MetalLB working in K3s under Docker Desktop for Mac. Before you get started please follow the steps to set-up K3s using k3d with Rancher if this is your first time using Kubernetes. If you already have a K3D cluster running, we’ll be creating a new one for experimentation.

This hack allows Mac users running Kubernetes locally via Docker have it provide EXTERNAL-IP addresses from a pool of addresses so multiple K8s services can be run on the same port, namely 80 (http) and 443 (https), at the same time. Effectively this is a workaround for docker/for-mac/issues/155. Without this hack LoadBalancer IP addresses will show as <pending> or <none> in kubectl.

Let’s see how it works.

K8s on macOS with K3s, K3d and Rancher

12 minute read Published

How to install and run Rancher for Kubernetes on macOS using K3s and K3d.

In this post we’re going to take a quick look at how to run Rancher in a Kubernetes cluster locally on macOS for development and testing purposes. There are several different ways to run Kubernetes for local development. In this guide I’m going to focus on just one way: K3D.

K3D is a lightweight wrapper to run Rancher Labs’ K3s in Docker. K3s is a certified Kubernetes distribution for edge and IoT applications with a small resource footprint and ARMv7 support. Like KiND, K3D uses a container runtime as opposed to a virtual machine — saving precious resources. Unlike KiND, K3D supports the ARM architecture and requires about 16x less RAM.

When you’re finished you’ll have a functional K3s Kubernetes cluster running on your Mac with Rancher UI for cluster management. This guide assumes you’ve never run Kubernetes before and, therefore, also serves as a practical starting point, though I won’t be going into detail about the nuts and bolts of Kubernetes.

Copy Files from Linux to macOS Desktop

3 minute read Published

Easily move files machine-to-machine using Deepin 20 and Midnight Commander.

If you need to copy files from a Linux computer to macOS desktop, this short tutorial will explain how using Arch Linux with Deepin 20 and Midnight Commander. Rather than using a Wi-Fi gateway such as a a router, we’ll connect Arch directly to macOS using the Personal Hotspot in Deepin 20 giving us an M2M connection.

Monitoring PWA Website Performance

2 minute read Updated

Monitoring the speed of your Progressive Web Apps over time.

How do you monitor website performance? Is it monitored? Do you know if your website is getting faster? Slower? Do you know when it falls below critical performance thresholds? Are you receiving automated alerts? Do you even have alerts? If not, you could be. And it won’t cost you a dime to get started.

This post is going to talk about SpeedTracker. SpeedTracker is a free tool that allows you to monitor website performance over time. Use it to visualize your page speed scores, track Lighthouse metrics, receive alerts and even create a public dashboard consisting of multiple websites for quick reference.

Reaction Commerce Debugging Primer

11 minute read Updated

How to debug a Node.js App Running inside a Docker container.

Reaction Commerce is a full-stack, self-hosted commerce platform you can run for as little as $10 on your own VPS. Think of Reaction Commerce as what WooCommerce might’ve become had it not been dependent on PHP/WordPress and instead was rewritten using modern coding languages and development techniques.

Using self-hosted commerce is like having your own personal Shopify, WIX or BigCommerce right at your fingertips. Only there’s no monthly costs to worry about just to use it. And there’s no vendor lock-in which would otherwise make it too difficult or risky to switch between platforms when the need arises.

After you’ve learned the basics of Getting Started you’re ready to dive deeper into the code and learn how things work. One of the best ways to learn any new system is to look for bugs and figure how to debug them. And in this tutorial I will show you some strategies for debugging source code in Reaction Commerce.

A Five Year Cough

7 minute read Updated

I was coughing for five years. Kratom fixed it instantly.

Last October I was co-located for two months with an unlikely pair of digital nomads perched at a private villa in northern Bali. One of them was visionary, born again vegan in his late 30’s. The other a talented twenty-something savant programmer from Volgograd. During our time co-locating I helped the two containerize an application stack they’d been working on for over a year. And they introduced me to a healing herb used in traditional medicine I would later find out was the treatment I needed to control my chronic bronchitis.

Reaction Commerce — Getting Started

10 minute read Updated

The Unofficial Guide to getting started with Reaction Commerce v3.

Reaction Commerce is a full-stack, self-hosted commerce platform you can run for as little as $10 on your own VPS. Think of Reaction Commerce as what WooCommerce might’ve become had it not been dependent on PHP/WordPress and instead was rewritten using modern coding languages and development techniques.

Using self-hosted commerce is like having your own personal Shopify, WIX or BigCommerce right at your fingertips. Only there’s no monthly costs to worry about just to use it. And there’s no vendor lock-in which would otherwise make it too difficult or risky to switch between platforms when the need arises.

With commerce goliaths like Amazon doubling quarterly profits in 2020 while, at the same time snubbing their own FBA customers, it’s high time you took a hard look at your e-commerce and take control of your own commerce destiny. In this post I will show you how to set-up your own self-hosted Reaction Commerce stack on a VPS with as little as 2GB of RAM or about $10/month.

Redirect non-www to www Traefik v2

4 minute read Published

How to create more timeless URLs using Traefik 2 with Docker labels.

I like cool URIs that don't change so whenever I’m making a new website I make sure I put my web content on the www subdomain where it belongs. This of course leaves the domain apex, or root of the domain, empty and user agents don’t always do what comes so natural to us humans — adding a www in front of a domain name.

Computers get even more clumsy when you add HTTPS into the equation and are working with new technologies. So if you’re looking for cool URIs too here’s how to redirect domain.example to www.domain.example with Traefik v2 over both HTTP and HTTPS using Docker labels in a docker-compose.override.yml YAML file:

ACH Payments on Reaction Commerce

7 minute read Updated

How to accept ACH payments using Reaction Commerce.

After learning Mitragynine was the cure for my five year cough I realized most of my stay in Bali put me one island from the source of the herbal remedy I now drink as tea daily. Given my medical journey and newfound love of Kratom it seems fitting to set-up an online shop to better take advantage of this miracle plant. After some trial and error the platform I’ve landed on for commerce is called Reaction Commerce. And in this post I’ll show you how to use it to set-up a simple ACH payment system using Reaction on your own website.

Dual-Boot Manjaro Linux & macOS

12 minute read Updated

How to dual-boot macOS and Manjaro Linux directly from your Apple SSD.

Are you familiar with the concept of “habit fields”? They’re these magical auras we give to everyday objects, assigning them purpose and allowing us to focus our awareness to accomplish tasks faster. But habit fields can work against you as well, if you’re not careful:

If you’ve been trying to do everything from one place and one device, then you may need to make a conscious decision to divide different modes of behavior.

Jack Cheng, Habit Fields (2010)

One device you may be trying to do everything from one place is the MacBook Pro. With the beefy specs on the flagship Apple notebook it can be easy to piledrive too many activities all into one place, affecting your Mac’s habit field.

But there’s a trick you can use to divide different modes of behavior on a Mac. And that’s to add a second operating system and dual-boot. Here’s how to install and dual-boot Manjaro Linux alongside macOS on a MacBook Pro.