Skip to content

Instantly share code, notes, and snippets.

View stand-sure's full-sized avatar

Christopher J. Anderson stand-sure

View GitHub Profile
@stand-sure
stand-sure / open-prs.sh
Created May 2, 2025 14:19
Lists open PRs under a root directory where the URL matches a pattern (useful for filtering to just one org)
#!/usr/bin/env bash
# open-prs.sh
__gh=/opt/homebrew/bin/gh
__jq=/opt/homebrew/bin/jq
while IFS= read -r -d '' dir
do
dir=$(dirname "$dir")
cd "$dir" || continue
@stand-sure
stand-sure / get-vault-keys.sh
Created April 24, 2025 19:13
script to get and decode vault unseal keys (bankvaults)
#!/usr/bin/env bash
BUCKET=abc/def
REGION=us-east-1
PROFILE=my_profile
for key in "vault-root" "vault-unseal-0" "vault-unseal-1" "vault-unseal-2" "vault-unseal-3" "vault-unseal-4"
do
aws s3 cp s3://${BUCKET}/${key} . --profile "$PROFILE" --region "$REGION"
#! /bin/bash
# Make a copy of your existing config
cp ~/.kube/config ~/.kube/config.bak
# Merge the two config files together into a new config file
KUBECONFIG=~/.kube/config:/path/to/new/config kubectl config view --flatten > /tmp/config
# TEST
@stand-sure
stand-sure / AsyncLazy.cs
Created December 3, 2020 20:24
Async version of Lazy<T>
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
//// inspired by Stephen Toub's https://devblogs.microsoft.com/pfxteam/asynclazyt/
/// <summary>
/// Provides support for async lazy initialization.
/// </summary>
/// <typeparam name="T">Specifies the type of element being lazily initialized.</typeparam>
@watfordgnf
watfordgnf / NatsServiceCollectionExtensions.cs
Created February 27, 2019 16:12
NATS from ASP.Net Core DI
using System;
using NATS.Client;
namespace Microsoft.Extensions.DependencyInjection
{
/// <summary>
/// Provides extension methods for NATS registration with ASP.Net Core DI
/// </summary>
public static class NatsServiceCollectionExtensions