Home
Julius Gamanyi
Cancel

Shell Terminal - save credentials in env var

Sometimes I need to save credentials in an environment variable that I can later use in a script. # prompt for user for username. read -s -p "Enter username: " SECRET_USER # User types the usernam...

Packer - Debug log vs debug mode

When it comes to troubleshooting HashiCorp’s Packer builds, Packer offers 2 ways: More detailed logging that’s activated by setting the PACKER_LOG environment variable to a value that’s not "" nor...

GitHub Actions - setup-actions use versions preinstalled on runner

tl;dr setup-actions uses versions preinstalled on a self-hosted runner. If a version is specified in the GitHub Actions workflow yml file but it’s not preinstalled on the self-hosted runner, then ...

Git grafts - merge history of multiple repos

Intention I’m currently learning CSS through Josh Comeau’s excellent course, CSS for JS. Each module has workshops/exercises that we work through. Each of these is a git repository on GitHub. My w...

Powershell - web requests for file downloads

How do I download a remote file via an API that also expects an auth Token? $DownloadedFile = "C:\tmp\filename.zip"; $Url = "https://path/" $TOKEN = "supers3crettoken" $headers = @{ 'Accept'...

Powershell - check hash of downloaded file

When downloading files, such as those attached to a github release, most have hashes. After downloading the file, how do I check that the hash of a file I’m downloading is valid? An example I’ll u...

jq - Access array index in a loop

If your json contains a list of objects, jq allows you to access such elements using an array index filter jq '.[index]' someData.json. But the value index is static, say jq '.[2]' someData.json. ...

GitHub Actions - Reusable Workflows

I followed the documentation (https://docs.github.com/en/actions/using-workflows/reusing-workflows) to create workflows that can be reused by other workflows. My difficulty in following the docs w...

AWS CLI - Store and Retrieve Json from AWS Parameter Store

Using the AWS CLI, how do I store Json in AWS Parameter Store? And how do I retrieve it? Assuming you have the necessary AWS permissions set up: open your terminal/command shell navigate to ...

jq - Update value in json with variable

I use jq for reading and filtering json on the command line. Given the json below, I’d like to update the value of b to be 30. jq offers the update assignment, |=, for this. { "a": { "b": 1...