★ XY problem

When asking questions or filing bugs / feature requests in the internet, I often refer to these two invaluable resources: ...

June 23, 2024 · 122 words · Thiago Perrotta

Rename files in bulk

Whenever the files are in the same directory, vidir from moreutils is the best interactive tool. If files are scattered across multiple directories, consider using the rename utility from util-linux. ...

June 19, 2024 · 45 words · Thiago Perrotta

Sleep forever

The following commands will make the shell sleep indefinitely: ...

June 15, 2024 · 34 words · Thiago Perrotta

Bcrypt-hash a password

Given the password correct horse battery staple, we would like to bcrypt-hash it. XKCD Courtesy of Randall Munroe ...

June 6, 2024 · 65 words · Thiago Perrotta

★ Github actions workflow

This post exemplifies an efficient workflow to shorten the edit-refresh loop when dealing with github actions. ...

May 28, 2024 · 366 words · Thiago Perrotta

Terraform: AWS deployment to random availability zones

A common scenario: there’s a new deployment you would like to roll out to AWS. Let’s say you pick “us-east-1” as your cloud region. There are multiple availability zones within it: us-east-1a us-east-1b us-east-1c us-east-1d us-east-1e us-east-1f Suppose you want to pick two of them for your service/app, and you don’t particularly care about which one. How to proceed? ...

May 21, 2024 · 240 words · Thiago Perrotta

Adding a healthcheck to chartmuseum in AWS Fargate

Assume that you have a Chartmuseum container running in AWS Fargate. Chartmuseum is a repository for helm charts. AWS Fargate is an Amazon service to run containers (“serverless”), being part of ECS (Elastic Container Service). Problem statement: Add a container healthcheck to the chartmuseum task definition associated with the container. ...

May 17, 2024 · 165 words · Thiago Perrotta

Pritunl log in via CLI

Pritunl is an Enterprise Distributed OpenVPN server. In order to run its client on macOS, an .app is provided. However, using it to log in every day is quite tedious. Let’s automate it so that we can connect to the VPN with a single command. ...

May 7, 2024 · 264 words · Thiago Perrotta

Be aware that your public SSH keys can reveal your identity

If you have a GitHub account configured with SSH, your public keys are available at https://github.com/$USERNAME.keys. For example, mine: https://github.com/thiagowfx.keys And then let’s say you also use your full name on GitHub. ...

May 3, 2024 · 214 words · Thiago Perrotta

Shell text substitution

I learned a neat shell trick this week. In both bash and zsh you can use the circumflex / caret (^) symbol to find & replace a word from the previous command. Usage: ^prev^next. It’s best illustrated with examples: ...

April 7, 2024 · 104 words · Thiago Perrotta