fix GPG screen or window too small error

I’ll spare you the details about what is GPG and how its used since there is little to no chance you might have stumbled upon this post if you didn’t know anything so far except how to fix the following error: Screen or window too small the solution First and foremost try to resize, maximize your terminal window. If that doesn’t work try to run the following commands: gpgconf --kill gpg-agent gpgconf --launch gpg-agent bottom line That’s it. Sometimes the GPG agent just needs a restart. ...

January 12, 2026

How to rename Terraform resources the easy way

You can find plenty of information online about renaming Terraform resources for various reasons: refactoring, fixing typos, updating naming conventions, etc. What I’ve noticed is that most people either recreate the resource, create a new one, or use the moved block which isn’t as intuitive or straightforward. But it’s 2026, and there’s a simpler command that lets you rename resources without destroying them. the command Let’s say we made a typo when creating an EC2 instance e.g.: ...

January 12, 2026

Terraform and scuffed chaos engineering

A few days back, I stumbled upon an interesting post (unfortunately I couldn’t find the original source) about deliberately destroying random Terraform resources, or so called chaos engineering if you will. the command terraform destroy -auto-approve -target "$(terraform state list | shuf -n 1)" You can add this command to a cron job and schedule it to run every Friday evening for some weekend excitement. For a more sophisticated approach, there’s Chaos Monkey - the chaos engineering tool developed by Netflix. But if you’re just getting started with chaos engineering, this scuffed one-liner might be a better (not safer for sure) entry point. ...

January 8, 2026

.env file and Docker Swarm

You may be disapointed as me to find out that .env file doesn’t work with Docker Swarm as it does with Docker Compose. This limitation can be frustrating, but there are some approaches. A quick fix lazy approach and a more secure one that includes Docker secrets. the quick fix lazy approach Navigate to your directory containing both .env and docker-compose.yml, then run: export $(cat .env) > /dev/null 2>&1; docker stack deploy <your_stack_name> --compose-file=docker-compose.yml This command reads your .env file and sets all secrets as env variables before deploying the stack. The security concern is really that the env variables become available to all processes launched from that shell session, not just Docker. Any script or command you run afterward could potentially read those env variables. ...

September 24, 2025

Prepare Docker compose config for Docker Swarm

Here’s a quick tip on how to convert docker-compose.yml file to a Docker Swarm mode ready file. the command Imma be straight to the point and share few commands to help you with converting a Docker Compose stack config to a Docker Swarm mode one: docker stack config --compose-file docker-compose.yml > swarm.yml To deploy it, run: docker stack deploy --compose-file swarm.yml my-service Notes: Replace my-service with your preferred stack name Use -c for shorthand for --compose-file .env file When your setup relies on .env file, you’ll need to export the variables before deployment since Docker Swarm doesn’t automatically load .env files: ...

September 24, 2025

Merge Terraform infra into a single file

A bit of shitposting today. These days everyone and their grandma are using infra as code or more likely Terraform to deploy infrastructure, whether its AWS, Azure, GCP, you name it. As time goes your infrastucture might get larger (or bloated if you will) and you’ll end up with spliting things up anyhow. But what happens if we just YOLO everything into a single .tf file? Just for fun. Here’s how to do it. ...

September 4, 2025

Check HTTP version supported with curl

To follow-up from the previous post being about curl, WebSockets and Nginx, now let’s see how to check HTTP versions supported by an endpoint with curl of course. the command We gonna test by fetching HEAD requests only (not GET) and that’s being done with passing the --head parameter or -I for the short version of it. This approach should be efficient enough since we only need the response headers to determine the HTTP version. ...

September 3, 2025

How to curl websockets and some nginx

We all know we could use curl anytime with HTTP requests but what about WebSockets? I was debugging a WebSocket the other day which was basically a Docker service sitting behind an Nginx reverse proxy so I figured I’d write it down. But, first of all, a bit of basics. http vs websockets HTTP is request and response. Stateless. You ask for something, the server responds, and that’s it. WebSockets are stateful. They create a persistent, two-way connection between your browser and the server on. Think of it like UDP but running on top of TCP and as part of the application layer lol. ...

September 2, 2025

Basic script for uptime checks in Python

Here’s a DIY script written in Python that will do uptime / healthchecks and notify you via Gmail. It’s a basic idea you could start with though. Sometimes you need a quick and dirty solution to monitor your services without setting up a full monitoring stack. Maybe you’re between monitoring solutions, need something for a side project, or just want a simple backup alerting mechanism. This Python script gives you basic uptime monitoring with Gmail notifications when things go sideways. ...

July 14, 2025

Docker Compose restart policies and healthchecks

If you’ve been digging into the rabbit hole of Docker Compose healthchecks and restart policies, or maybe got a bit confused by my previous posts, you’ve probably wondered: “Can I use restart policies to restart containers when they become unhealthy?” tldr: By default, nope, not out of the box. Yet, you can make it work by implementing some application logic to it. restart policies Currently there are 4 restart policies: ...

July 7, 2025