Blog
Convert Images to WebP using the Linux command line and Docker
The webp command line tool from Google makes it quite simple to convert images to the webp format from the command line. It can convert JPG, PNG, and TIFF images to WebP. Not sure what webp is? Read more about webp on Wikipedia.
If you don’t have Docker installed on your system already, go ahead and install it now.
Spin up a Debian Bookworm docker container and mount the directory with your images to the container.
Install OpenWRT x86 64 Using an A/B Partition Setup
A quick reference for OpenWRT Installation.
Prepare a bootable Debian USB
You can use another distro if you’d like. I use Debian as a personal perference and also because it’s relatively quick to create a live USB.
Download a “standard” Debian ISO image from here https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/.
At the time of writing, I’m using debian-live-12.2.0-amd64-standard.iso file. You may see a more recent version, but make sure you download the “-standard.iso” file. After downloading be sure to verify against the SHA256SUMS or SHA512SUMS.
Connecting from Mac OSX to Ubuntu Desktop
After discovering how pleasant it can be without the sound of a whirring fan, I started looking for options to move my desktop as far away as possible so I no longer had to listen to all the fan noise.
The MicroSoft RDP App works great on Mac and allows me to connect to not only Windows but to Linux desktop environments.
After installing this on my mac I was able to remote into my Windows desktop (Follow this guide).
Detect When the Browser URL Changes (JavaScript)
When building a single page web app it’s important to update the URLs without refreshing the page and so the user can easily copy and share or revisit the current page.
How Can This Be Done?
Fortunately the browser provides an API that works in such use cases. Enter “popstate event” this works hand and hand with the
history.pushState()event which updates the URL. When the user clicks either the forward or back button the URL will change but unfortunately the page content will not.Update Browser URL Without Page Reload (JavaScript)
When building a single page web app it’s important to update the URLs without refreshing or reloading the page. This will also enable the user to easily copy and share or revisit the current page.
Using the History API
Browsers provide a History API that allows the page URL to be updated that works great for this use case. The API does allow for sharing other data but has limitations; with that in mind it would be better to find another way to share any data especially if it’s sizable.
Deploy WordPress on KataCoda Kubernetes
A step by step guide to deploying WordPress on Kubernetes provided by the KataCoda website. Please note that this shouldn’t be used for a production deployment and should only be used for learning and/or practice.
Create a Secret for the MySQL Password
The first step is to create a secret that can be used to store the MySQL database password. Later in the deployment this will be used in creating the MySQL database pod and then used by the WordPress pod to connect to the database.
Vagrant Ubuntu with Docker install
Creating an Ubuntu VirtualBox and installing Docker.
Vagrantfile
Vagrant.configure("2") do |config| config.vm.box = "ubuntu/bionic64" config.vm.define "docker-1" do |node| node.vm.hostname = "docker-1" config.vm.box_check_update = false config.vm.network "public_network" config.vm.provider "virtualbox" do |vb| vb.name = "docker-1" vb.memory = "2048" vb.cpus = "2" end node.vm.provision "install-docker", type: "shell", :path => "ubuntu/install-docker-2.sh" end endinstall-docker-2.sh
cd /tmp curl -fsSL https://get.docker.com -o get-docker.sh sh /tmp/get-docker.shvagrant upWait for the virtual machines to get created and started. Then ssh into it.
vagrant ssh docker-1Add the vagrant user to the docker group (this could probably be added to the script).
Building a VirtualBox ISO with Packer
I wanted to try building my own Vagrant base box, I decided to use one of the chef bento templates for ease.
It was moving along nicely, downloaded the ISO, verified the checksum and suddenly this error appears.
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine packerNot quite sure where to start I decided to do a quick Google, read some posts about VirtualBox modules. I was quite sure that wasn’t my issue. So I went to GitHub where I saw a couple of issues that said set headless to true. Being new to packer, I didn’t really understand what that meant. After more reading I finally found it and decided I’d make this quick post about it.
VBoxManage - Manage VirtualBox VMs From The Command Line
VirtualBox is a fantastic tool, previously I had been using it from the GUI. However, recently I started running it remotely on a server and using VNC to connect and manage the virtual machines. I decided that I would rather use the command line for this task as well. However, remembering all the commands is proving difficult. So I’m going to create a list and hopefully help myself and others along the way.
Go embed example of serving static files at the root URL path
Go 1.16 introduced the embed package which allows serving static files from directly within the binary without the need for any external package.

Screenshot of the example web page Here are two example’s showing how to serve from the root URL path.
example.go shows an example of how to use the new io/fs package and the Sub func. The comments offer a word of caution however that it may not prevent access outside of the subdirectory.