Skip to content

Instantly share code, notes, and snippets.

View GauntletWizard's full-sized avatar

Ted Hahn GauntletWizard

View GitHub Profile
@GauntletWizard
GauntletWizard / wall_drawing_273.scad
Created October 10, 2018 01:44
Wall Drawing 273 SCAD
// Wall Drawing 273 is an art piece by Sol LeWitt.
// This open source implementation is by Ted Hahn.
// This is generative art - Your viewing of it will be different than mine. I have included the positions of the walls because I am lazy and have not gotten around to making those random too, but the art on those walls is unique - You will not see the same image I did.
// draftlines is the number of lines to draw from each side.
draftlines = 10;
// The line module draws a 2d line from start to end, where start and end are [x, y] pairs.
module line (start, end, width=.1) {
echo("start=", start, "end=", end);
# List current version of a go get installed package
# For bazel, I need the munged name, it's github location, and current HEAD.
git -C "$(go list -f '{{.Dir}}' gopkg.in/yaml.v2)" rev-parse HEAD
git -C "$(go list -f '{{.Dir}}' gopkg.in/yaml.v2)" remote get-url origin
go list -f "{{range .Deps}}{{.}} {{end}}" | xargs go list -f "{{if not .Standard}}{{.ImportPath}} {{end}}" | xargs bazel run //:gazelle -- update-repos
@GauntletWizard
GauntletWizard / alllogs.sh
Last active March 13, 2024 18:51
Kubernetes tools
#!/bin/bash
# Script to
# Relies on non-standard programs - ts(moreutils)
set -eux -o pipefail
labels="${1:-}"
if [[ $labels = "-h" ]] || [[ $labels = "--help" ]]
then
### What version of rules_go are you using?
0.18.1
### What version of gazelle are you using?
0.15.0
### What version of Bazel are you using?
apiVersion: apps/v1
kind: Deployment
metadata:
name: init-demo
spec:
template:
spec:
hostNetwork: true
containers:
- name: nginx
git fetch
for deployment in $(kubectl get deployment -o name) ; do
local sha=$(kubectl get “$deployment” -o json |jq -r '.spec.template.spec.containers[].image | capture(".*:(?<sha>.*)")| .sha’);
count=$(git rev-list --count “${SHA}..origin/master”) ;
echo $deployment is $count revisions behind master (at $sha)
done
CREDS=$(aws sts assume-role --role-arn "arn:aws:iam::${ACCOUNT}:role/${ROLE}" --role-session-name="${USER}")
docker run -ti --rm --name prowler --env "AWS_ACCESS_KEY_ID=$(echo $CREDS | jq -r .Credentials.AccessKeyId)" --env "AWS_SECRET_ACCESS_KEY=$(echo $CREDS | jq -r .Credentials.SecretAccessKey)" --env "AWS_SESSION_TOKEN=$(echo $CREDS | jq -r .Credentials.SessionToken)" toniblyx/prowler:latest -f us-west-2
@GauntletWizard
GauntletWizard / Notes
Last active March 14, 2020 01:12
Debugging go-fuse osx
Hello fails, memfs works. ZipFS also fails, for same reason. I think it has to do with how access is working? Going to try implementing access and see how works.
Implementing NodeAccesser on Hello makes the FS work. WTF. Even a meaningless one.
auuaaagguuuauaccuucccagguaacaaaccaaccaacuuucgaucucuuguagaucuguucucuaaacgaacuuuaaaaucuguguggcugucacucggcugcaugcuuagugcacucacgcaguauaauuaauaacuaauuacugucguugacaggacacgaguaacucgucuaucuucugcaggcugcuuacgguuucguccguguugcagccgaucaucagcacaucuagguuucguccgggugugaccgaaagguaagauggagagccuugucccugguuucaacgagaaaacacacguccaacucaguuugccuguuuuacagguucgcgacgugcucguacguggcuuuggagacuccguggaggaggucuuaucagaggcacgucaacaucuuaaagauggcacuuguggcuuaguagaaguugaaaaaggcguuuugccucaacuugaacagcccuauguguucaucaaacguucggaugcucgaacugcaccucauggucauguuaugguugagcugguagcagaacucgaaggcauucaguacggucguaguggugagacacuugguguccuugucccucaugugggcgaaauaccaguggcuuaccgcaagguucuucuucguaagaacgguaauaaaggagcugguggccauaguuacggcgccgaucuaaagucauuugacuuaggcgacgagcuuggcacugauccuuaugaagauuuucaagaaaacuggaacacuaaacauagcagugguguuacccgugaacucaugcgugagcuuaacggaggggcauacacucgcuaugucgauaacaacuucuguggcccugauggcuacccucuugagugcauuaaagaccuucuagcacgugcugguaaagcuucaugcacuuuguccgaacaacuggacuuuauugacacuaagagggguguauacugcugccgugaacaugagcaugaaauugcuugguacacggaacguucugaaaagagcuaugaauugcagaca