Github activity fail

Github is quite a fantastic service for source code management and hosts a suite of wonderful tools which can help you manage the development, tracking issues and much more.

One of the fun things is the github activity dashboard located on your personal frontpage which shows how much you’ve done.

I’m sure it’s mostly a fun thing and it allows you to sort of get an idea of it the account is dead or alive. Some seem to have pride in having a green carpet showing long periods of continuous activity.

Let's Encrypt and IPv6

I’m using Let’s Encrypt as Certificate Authority on this and many other sites. I like it, as it allows me to automate certificate creation and renewals, however I also have some monitoring making sure everything works as expected.

I recently got a few alerts as some certificates weren’t renewed as expected. I figured nothing had changed on the server setup and there was renewal happening for a few days, I started looking into it and found the issue why the renewal was failing, so here’s the story.

Cronjob: Basics and reboot

One of Linux five star things is the cronjobs. They allow you to automatically run stuf (scripts, applications, etc.) at quite specific times.

The crontab is the place controlling when the stuff is run and you can list the crontab using the commaand crontab -l for the current user.

If you want to edit the crontab, just use the command crontab -e and it launches the crontab in the default editor (set EDITOR env variable to change the editor used). The format is basically like this:

A Hugo Image/Photo Gallery

I recently switch this site from Wordpress to Hugo - and the site with Danish content too. It was mostly easy and straight forward, but initially there was a few features missing (by the very nature of it being a static site) and some things I needed to look into once the switch had happened. One of these was a gallery function to present images (photos mostly).

Gallery options….

There are various ways to have a gallery on a site, and one of the pains I had with wordpress, was changing strategies over time, which left me with several plugins needed to handle the historic gallery choices.

Batch converting JPG and PNG to WebP

I’ve been speed optimizing some of my personal sites, and one easy update is changing the images from being JPEGs and PNG images to the smaller WebP format.

All the images I need to convert are usually in collections, where one folder at a time needs conversion and as some contain a lot of images, I needed a way to do it smartly.

This is what I came up with:

For JPEGs

find . -type f -name "*.jpg" | while read file; do cwebp -lossless "$file" -o "${file%.jpg}.webp"; done

For PNGs

find . -type f -name "*.png" | while read file; do cwebp -lossless "$file" -o "${file%.png}.webp"; done

The one-liners find all jpegs (or pngs) in the folder and converts it into a lossless webp version. It leaves the original image as a backup. For further optimizations the “cweb -lossless” could be changes to: