Home
Julius Gamanyi
Cancel

AWS SSM - Send commands to run on remote Windows EC2 Instance

Aim Recently, I wanted to execute commands from my local machine (even a CI machine) on a remote Windows EC2 instance. In other words, send a bunch of commands that get executed on a remote EC2 in...

GitHub Actions - Packer error NoCredentialProviders

Problem: Packer shows aws.Config.CredentialsChainVerboseErrors When running Packer within GitHub Actions, I saw this error: ==> amazon-ebs.ami_name: Stopping the source instance... amazon-...

GitHub Actions - Python with Custom Package Index

Aim: build python code that pulls packages from a custom pypy (Python Package Index). And pushes own packages to that private index. Add to git repo In the git repo, add the following: Add th...

Powershell - prefer WebClient for downloads not Invoke-WebRequest

When downloading files in PowerShell, using .NET’s WebClient is way faster than using Invoke-WebRequest. Recently, downloading a 1.5GB file using Invoke-WebRequest took about 20 minutes. For the s...

GitHub Actions - pass list to bash for processing

Set list in a GitHub Actions workflow. And pass it to bash for processing. name: my workflow on: workflow_dispatch: . . . jobs: jobA: # . . . steps: - name: Print Lis...

Bash - save curl response code and body in variables

Save curl httpcode and response in variables for further processing. Found via https://unix.stackexchange.com/a/572434 #!/bin/bash URL="https://example.com" response=$(curl --silent --write-out ...

Bash and curl - pass variables to curl

I often call curl in a bash script. How do I pass variables that I’ve set in bash as arguments to curl’s command line option, say --data? Below is an example without variables. curl \ --header ...

Bash - declare and loop over array

How to declare an array and loop over it? # declare array: https://www.gnu.org/software/bash/manual/html_node/Arrays.html declare -a myArray=("Linux Mint" "Fedora" "Red Hat Linux" "Ubuntu" "Debian...

Docker - use tools on host in container

My docker container doesn’t have a tool (e.g., telnet) installed. How do I run that tool without installing it in the container? That tool (say, telnet) is already available on the host. nsenter a...

Ansible reads from KeePass

For small projects, I’d still like to handle their credentials carefully while keeping the effort small. Since KeePass is a low-effort Password Manager, why not get automation tools to read creden...