Skip to content

Instantly share code, notes, and snippets.

View charltonstanley's full-sized avatar

Charlton Stanley charltonstanley

View GitHub Profile
@charltonstanley
charltonstanley / AWS4-Request-Signer.ps1
Created November 2, 2023 04:47 — forked from kalihman/AWS4-Request-Signer.ps1
Powershell AWS4 Signer for STS GetCallerIdentity Action
# Define Helper Functions
function Get-Sha256Hash ($StringToHash) {
$hasher = [System.Security.Cryptography.SHA256]::Create()
$Hash = ([BitConverter]::ToString($hasher.ComputeHash([Text.Encoding]::UTF8.GetBytes($StringToHash))) -replace '-','').ToLower()
Write-Output $Hash
}
function ConvertTo-SortedDictionary($HashTable) {
$SortedDictionary = New-Object 'System.Collections.Generic.SortedDictionary[string, string]'
foreach ($Key in $HashTable.Keys) {
@charltonstanley
charltonstanley / terraform_dynamic_resource_loops.md
Last active August 18, 2023 04:01 — forked from BennyG93/terraform_dynamic_resource_loops.md
How to produce dynamic resources in terraform 12 from 2 lists

Producing dynamic resources in Terraform 12 from 2 lists

Now that Terraform 12 has been released and iterated on a few times, the highly anticipated for_each argument has officially been integrated directly inside the resource and data blocks. Allowing for the creation of dynamic blocks.

This for_each resource loop accepts any map or set to produce its dynamic set of resources.

e.g.

@charltonstanley
charltonstanley / gpg_git_signing.md
Last active July 7, 2022 00:08 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ git config --global tag.forcesignannotated "true" ([OPTIONAL] every annotated tag (git tag -a) will now be signed.)
  7. $ git config --global tag.gpgSign "true" ([OPTIONAL] every tag will be signed.)
  8. $ echo "Some content" >> example.txt
@charltonstanley
charltonstanley / A-Cloud-Guru_Kubernetes-the-Hard-Way_Lesson-7.6_Setting-up-the-Kubernetes-Scheduler_Addendum.md
Last active January 3, 2022 20:51
An addendum to the A Cloud Guru "Kubernetes the Hard Way" course lesson titled "Setting up the Kubernetes Scheduler". This addendum covers some modifications that need to be made to some of configuration files that are configured when setting up the k8s scheduler, while using a more recent version than specified in the course.

Introduction

This is an addendum to the A Cloud Guru "Kubernetes the Hard Way" course lesson titled "Setting up the Kubernetes Scheduler". This addendum covers some modifications that need to be made to some of commands that need to be executed when setting up the k8s scheduler using a more recent version than specified in the course.

Details

Course: Kubernetes the Hard Way Lesson: 7.6 Lesson Title: Setting Up the Kubernetes Scheduler Binary Version: I was using version 1.23.1 of the kube-apiserver, kube-controller-manager, kube-scheduler, and kubectl binaries.

Keybase proof

I hereby claim:

  • I am charltonstanley on github.
  • I am cstanley (https://keybase.io/cstanley) on keybase.
  • I have a public key ASAXhvuUSLTK33XMMH0CVfJfGToiUXeIpzKak6Td5T0fSwo

To claim this, I am signing this object:

@charltonstanley
charltonstanley / openpgp.txt
Created September 19, 2017 04:13
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:5d006bf9837902dfdf276a9ba968ddedf7cf0a95]
@charltonstanley
charltonstanley / openpgp.txt
Created September 19, 2017 04:13
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:5d006bf9837902dfdf276a9ba968ddedf7cf0a95]
@charltonstanley
charltonstanley / openpgp.txt
Created September 19, 2017 04:13
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:5d006bf9837902dfdf276a9ba968ddedf7cf0a95]