Adding Mermaid diagrams to Hugo

I used Chart.js charts on one of my Hugo blogs for few years already. Recently I needed to add few diagrams and I started glueing them in Chart.js but then I found that Hugo supports GoAT and Mermaid diagrams. They’re not working out of the box, but it’s easy to extend. Much easier than my custom shortcodes. I tried to follow up the instruction1 but failed. After few minutes I found slightly simpler solution....

2024-02-25 · 2 min · timor
[Photo by Antony Trivet](https://www.pexels.com/photo/herd-of-blue-wildebeest-walking-in-savanna-6053000/)

How I stopped worrying and loved the GNU Make and Makefiles

First contact with make When I was invited for my first job interview in the IT, I’ve been asked such question: How would you typically build a program from sources, what commands will you use? I answered: It’s obvious: ./configure make make install Those times belong to the past now and not many programmers use GNU Make1 nowadays. Try asking this question and you will see disgust at best. For many it’s the fist contact with make and often the last one, but not for me 😉...

2024-02-16 · 9 min · timor

Keeping Docker afloat - Best practices for patching and deprecating images

Intro One of the biggest benefits of Docker images is their immutability. Once they’re built, they don’t change. Built once, would work forever… That’s how nightmares of security guys starts 🤣 We have then two contradictory concepts: flowchart LR id1(Keep it stable) <---> id2(Keep is up to date and secure) For day to day work, usually first concept wins. You want your builds stable and try to avoid tempting distractions of upgrading log4j to latest version… Who knows what might break....

2024-02-09 · 7 min · timor
AI generated

How to run x86-64 Docker images on Apple's MacBook with M1/M2/M3 CPU

Working with Docker environments amid diverse architectures, like Apple’s arm64 and x86-64/AMD64, presents challenges. I’ve encountered the clash between my Mac’s M1 arm64 architecture and my x86-centric server workloads. The solution? Just use DOCKER_DEFAULT_PLATFORM 1 2. Just run in the terminal: Enforce platform for all commands export DOCKER_DEFAULT_PLATFORM=linux/amd64 With this command, Docker enforces x86 architecture by default on commands supporting --platform parameter, streamlining workflows and sparing the need for repetitive --platform specifications....

2024-02-06 · 1 min · timor

Extreme Ownership

Extreme OwnershipHow U.S. Navy SEALs Lead and Win Authors: Jocko Willink, Leif Babin amazon.pl The book is a compelling and practical leadership guide co-authored by Jocko Willink and Leif Babin, both former Navy SEAL officers. The book revolves around the central theme of taking absolute responsibility for every aspect of one’s life and leadership role. Through gripping combat stories from their SEAL experiences, the authors illustrate key principles such as accountability, decisiveness, and humility....

2024-02-05 · 1 min · timor

My pre-commit config for Hugo blog

I love blogging with Hugo and I have two blogs already that use it. The good thing about static sites is that you have all the data in the files. You can optimize them locally, batch process, amend, etc. Powerful templating engine allows to quickly pre fill documents in the format I like. I have some steps in the Makefile for things like image optimization, but I often don’t remember to run them 😃...

2024-01-29 · 2 min · timor

Tuning PipeWire for best audio quality on Ubuntu

TL;DR If you’re not interested in the “story of my life”, go directly to “Tuning PipeWire” section. I’m not an audiophile, but I spent whole days in the headphones and I like when sound sounds good. I like slight bass boost, which adds this kick to the melody, but won’t overwhelm me after an hour of listening. I like when high tones are clear, but I get annoyed if they’re too strong....

2024-01-28 · 8 min · timor
[Generated by AI](https://www.bing.com/images/create/potrzebujc499-obrazek-dla-posta-na-blogu-o-temacie3a-g/1-65b520c6d817444ea0a5f4ed3dd8843a?id=QFgGAr6fEgEMEJSm0T45XQ%3d%3d&view=detailv2&idpp=genimg&FORM=GCRIDP&mode=overlay)

Git hacks - a set of my favorite git aliases

I use Git a lot, even writing this article i will commit text few times. There’s a set of aliases I rely on daily and they’re first I add in new place. Some Git commands are unnecessarily verbose. You can make your life much easier with bash-completions, but if you write it tens of times per day, it’s anyway a lot of typing… and I’m a lazy man 😄 Simple status/log checks git s s = status --short --branch --untracked-files Shows a short, branch-focused status with untracked files....

2024-01-27 · 6 min · timor
[Photo by Ann H](https://www.pexels.com/photo/blue-tape-measure-on-yellow-surface-10894941/)

Checking compressed size of Docker image

One day, I was looking for some gains to improve the startup time for Jenkins agents. We run them as containers and because images are quite big, I was thinking about cutting the size, by cutting less frequently used features. I was looking for the metrics I could use to decide which changes are most valuable. I could think about two: download time and startup time. Together they combine to the gap between the request to start agent and the moment you can start to use it....

2024-01-24 · 2 min · timor
[Photo by olia danilevich](https://www.pexels.com/photo/two-men-looking-at-a-laptop-4974920/)

How to interview DevOps candidates?

A little bit of sour-sweet memories I’ve been in many job interviews. Few as a candidate but many more as a Technical Leader or Hiring Manager. There are many questions I’ve been asked and many tests I passed. I remember one test, where I had to install and configure Apache Tomcat on a Virtual Machine, under Windows (which I don’t use for years), without access to internet. There were more traps there, like some files in the locations where Tomcat is normally installed were blocked for write with chattr immutable attribute....

2024-01-23 · 8 min · timor