Sort values as version numbers using the sort command

Earlier today, I was listing the releases in a GitHub repo: 1 2 3 4 5 6 7 8 9 10 11 $ gh release list --limit 10 | awk -F ' ' '{print $2}' 8.12.2 8.12.1 7.17.18 7.17.17 8.12.0 8.11.4 8.11.3 7.17.16 8.11.2 7.17.15 The GitHub CLI returns the release in chronologica order, which makes perfercly sense for releases. However, I needed them version order, so I tried my old friend sort:...

March 8, 2024 · 2 min · 245 words · Maurizio Branca

Install a custom integration package into a cluster on Elastic Cloud

I need to install a development version of an integration package into a cluster running on Elastic Cloud. Build Build the package using elastic-package and copy the .zip file in a safe place: 1 2 3 4 5 6 7 8 9 10 11 12 # # If you don't already have it, clone the Elastic Agent # integrations repo: # # git clone git@github.com:elastic/integrations.git # cd packages/kubernetes elastic-package build cp ....

January 19, 2024 · 1 min · 161 words · Maurizio Branca

How to replace an external Go dependency with a local copy

The Problem You’re using a great open source library in your project, and then, one day, you find yourself thinking: “Oh, wouldn’t be great if the author just added a tiny little log statement in that function?”. Yeah, it really would, this would allow me to trace the value of that variable or try a small change. What can you do: fork the library? Nope. Don’t do that. Replace it! You can temporarily replace the original module with a local copy, changing one line in your go....

February 5, 2021 · 2 min · 220 words · Maurizio Branca