Shami's Blog

Sysadmin, Because Even Developers Need Heroes

Update system time with HTTP


The other day I needed to update the time on a server that didn’t have access to any NTP servers. It was a server located in a locked down network with only HTTP/HTTPS access to the internet. I found the following command that allowed me to update the time/date through HTTP

date -s "$(curl -s --head | grep ^Date: | sed 's/Date: //g')"

Expand a Zpool


Block storage volumes are very useful, they give me an easy way of getting ZFS on Ubuntu virtual servers or getting extra storage on FreeBSD. Just attach a volume and create a zpool.

Today one of my volumes ran out of space. So I logged in to my cloud provider and expanded it. Then to expand the zpool I ran the following command

# zpool online -e ZPOOL_NAME DEVICE
zpool online -e tank da1

Maintenance Pages With HAProxy


Edit: 31/7/2021: Add content for maintenance pages.

I currently work with a group of very smart individuals and I learn a lot from them on almost daily basis. One thing they have done which I found cool was using Terraform to configure the AWS Application Load Balancer to display the notice during maintenance windows.

Read More - Maintenance Pages With HAProxy

HOWTO - Build a Keycloak/Ubuntu/MariaDB Cluster Without Multicast UDP


I’ve been trying to learn more about Keycloak lately but two things kept frustrating me; a lot of the information available online doesn’t work and cloud providers blocking multicast UDP . I lost my notes once too many and decided to document the whole process here for future reference. I used to edit standalone-ha.xml to make it easier to automate with configuration managers. So lets begin.

Read More - HOWTO - Build a Keycloak/Ubuntu/MariaDB Cluster Without Multicast UDP

Letsencrypt Pre-renew Hooks


Acmetool used to be my go-to tool for LetsEncrypt. It was quick and simple to set up. As a user, my favorite part of the Golang ecosystem is that binary files are statically linked. You don’t have to fiddle with any dependencies. But even though Acmetool is still getting occasional updates the last release is from 2018 and I prefer to stick to releases. There were times when Acmetool would not work behind Cloudflare and I would have to temporarily disable Cloudflare proxying to be able to generate certificates.

Read More - Letsencrypt Pre-renew Hooks

HOWTO - Letsencrypt Certificates for pfSense


I recently helped a friend set up pfSense as a VPN server/firewall for his colocated rack. We wanted SSH and the web configurator to be accessible from a set of static IPs.

Read More - HOWTO - Letsencrypt Certificates for pfSense

HOWTO - Letsencrypt Certificates for localhost


A few days ago I discovered * which is a neat service that allows you to access localhost with multiple hostnames allowing the creation of multiple development sites without having to use http://localhost/(site1|site2|site3). We all know that has some difficulties when it comes to moving those sites to production. Not all CMS’s and frameworks support an easy migration.

Read More - HOWTO - Letsencrypt Certificates for localhost

Generate Keycloak Access Tokens with Curl


I’ve been working more with Keycloak lately and I’m loving it. But one thing I wanted to do while testing is to generate access tokens easily. Today I wrote a small wrapper script and thought I should share.

Read More - Generate Keycloak Access Tokens with Curl

Logstash Hanging When Rebooting Ubuntu


Edit: 31/7/2022: I’m currently migrating all my logstash configurations to Vector , it has been much kinder to me than Logstash has ever been.

I maintain an ELK server running on Ubuntu 20.04 for testing. One issue I have faced is the Logstash service hanging on reboot. The server would not reboot and I end up having to power cycle.

Read More - Logstash Hanging When Rebooting Ubuntu

Detect if your Script is Running in CRON


In my previous post I discussed how I use a wrapper script to back up a fleet of servers.

Read More - Detect if your Script is Running in CRON

About Me

Dev gone Ops gone DevOps. Any views expressed on this blog are mine alone and do not necessarily reflect the views of my employer.

twitter linkedin