TIL = Things, or Today I Learned
An experiment in Learning in Public.
Julius Gamanyi
Software Developer and Architect and fan of Wardley Maps.
juliusgamanyi.com
About
Tags
Archive
RSS
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 GitH...
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/" $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&...
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]' ...
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"...
Ruby - use MSYS2 to install Ruby dev packages to build native extensions on Windows
Aim: Use MSYS2 to install the development packages Ruby needs to build native extensions on Windows. Why? because I found out that some Ruby gems must be build as native extensions. Without this s...
Babel - Client-side for ECMAScript modules and expressions
To play around with some tools I like, I need to learn React, welp! George Offley recommended this free beginner course for react because it combines theory and practice well: lots of projects to ...
Packer - setup with WinRM
Aim: Use HashiCorp's Packer and WinRM to automatically create a directory as an example. When that works, we're ready for [[Packer - setup local dev environment on Windows using Packer]] P...
AWS CLI for EventBridge - send event to EventBridge
Send an event to the default EventBus I'm assuming that permissions are properly setup. The hardest part was getting the correct Json structure. The Detail object contains a mixture of Js...
Powershell - Grant user access to Docker Pipe without Admin rights
Aim: able to run docker commands without Administrator privileges. Preparation for running docker commands in GitHub Actions that's running on Self-hosted runners. See [[GitHub Actions - ...
WinRM - setup and test on Windows laptop
WinRM is to Windows what SSH is to Linux. Aim: setup and test winrmon Windows 10 dev laptop. Why? I'd like to automate setting up my development tools with Packer. See TIL, [[Packer - setup l...
Packer - setup local dev environment on Windows using Packer
Aim: automate setting up my local dev environment on Windows using HashiCorp's Packer My laptop frequently breaks down. After having it repaired, I have to reinstall most programs I need for d...
AWS CLI - Trigger and poll Codepipeline
Some of the pipelines I work on deploy workloads in AWS using AWS CodePipeline. In another CI/CD tool, I'd like to use the aws cli to trigger a CodePipeline and periodically check if it succeed...
GitHub Actions - Self-hosted Windows Runners - enable docker build
Aim: able to run docker build in a GitHub Action that's running on Self-hosted runners. When running docker build as part of a step in a GitHub action, we're greeted with the error err...
Powershell on GitHub Actions - run Script as Admin on self-hosted Windows Runners
This came up when I wanted to run a powershell script with elevated Administrator privileges , sometimes on my dev latop and sometimes in a CI/CD process. Running a script as an Administrator like...
Git - Use gitattributes to control files' line endings
Use .gitattributes to control the line endings for files that are in the repository. The above settings are useful when working with others who use other Operating Systems, because each OS has its...
GitHub Actions - how to access GitHub Maven packages via GitHub actions
Steps: Add a Personal Access Token (PAT) to your GitHub Repository with permissions repo, workflow, read:packages Add that token as repository secret named GHA_MVN_PKGS_READ: Repository -&...
Python - Manage global packages with pipx
Python comes with many tools that help manage versions and dependencies. pyenv - manage Python versions virtual environments (like venv) that help isolate dependencies on a per project basis ...
GNU Make on Windows
Why use make in the first place? In our team, some use Windows while others use Mac and steps to run are in a Makefile. The CI/CD environment supports both Windows and Linux-based steps. I&...
Powershell - Troubleshoot Networking Issues
I spent most of this week on dealing with these 2 exceptions: Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request.&...
Powershell - Create Symbolic Link
Open PowerShell as Administrator, then run New-Item -ItemType SymbolicLink ` -Path "C:\Program Files\WindowsPowerShell\Modules\CustomHelperUtils" ` -Target "C:\path\to\gitrepos\uti...
Packer - locally validate template for EC2 that expects an environment variable
I was working on creating EC2 images using Packer. For that, there's the amazon-ebs Packer Builder to use. After checking that there's nothing wrong with the syntax, thanks to packer valid...
GitHub Actions - run workflows locally with act even for self-hosted runners
How do I quickly test github workflows on my local dev machine even for self-hosted runners? Write-up also at https://juliusgamanyi.com/2022/04/27/run-github-actions-workflows-locally-using-act I...
Linux - show OS details
I wanted to know what Operating System I'm using in order to use OS-specific utilities like [[Linux - Add user to sudoers]] Execute: $> cat /etc/os-release Output: -------OS Informa...
Linux - Create User
Create user with the command sudo useradd --create-home usery. What default values do they get? Execute: useradd -D Output HOME=/home/usery INACTIVE=-1 EXPIRE= SHELL=/bin/bash Docs: https://l...
Linux - Add user to sudoers
How do I enable a user, say userx, to run commands prefixed with sudo ? After running sudo as userx, I also don't want to enter a password. In CentOS, add the user to the wheel group. echo &q...
© Julius Gamanyi.