asdf and terraform (or vault or packer)

Using the asdf version manager to manage versions of various binaries like terraform, vault or packer is easily done by following the instructions below:

  1. Download and install asdf if you haven’t got it already (https://asdf-vm.com/#/core-manage-asdf)
  2. If you want to install the latest version of terraform for example do the following:

Renaming multiple files in linux

Problem

You would like to rename multiple files, replacing some text with something else (like replacing Pixies_The with Pixies).

Solution

Install the rename utility

and replace the text as follows

Get/Set platform information

To get or set in environment variables the platform information of a system you can use the following:

Taken from the installation instructions of the Operator SKD here: https://master.sdk.operatorframework.io/docs/installation/

Failed to start docker.service: Unit is masked

Problem

Trying to start the docker service after some upgrades fails with the following message:

Solution

It turns out that after upgrading or more specifically removing and then upgrading the docker installation in ubuntu (in this particular case in raspberry 4 with Ubuntu 20.04 installed), results in this error.

A search brings up the following:

https://forums.docker.com/t/failed-to-start-docker-service-unit-is-masked/67413

and from that the following bug post:

https://bugs.launchpad.net/ubuntu/+source/docker.io/+bug/1844894

So the solution is to run the following to be able to start the docker service (described in the first link above):

Getting detailed information about your Linux distribution

To be able to get a more detailed information about your current linux distribution, including the code names use the following:

Using strace for analyzing performance

There is a very nice example on the O’reilly ‘Linux Under The Hood’ training about using strace to compare performance of two commands that provide the same output but with different calls. The two different commands were: ls and echo *, that they both provide the listing of the current directory.

First using the strace with ls:

And using the same with echo *

So the difference in time is 0.00000 for the echo and 0.000601 for the ls.

Similarly the number of calls for the echo is 33, but ls is using 100.