Install binfmt if ls /proc/sys/fs/binfmt_misc/qemu*
returns nothing:
docker run --privileged --rm tonistiigi/binfmt --install all
Verify that it worked, you should see stuff by running ls /proc/sys/fs/binfmt_misc/qemu*
#!/bin/bash | |
# This script diffs the content of two container images | |
# USAGE: ./diff-container-images.sh <registry>/<repo> <tag1> <tag2> | |
# strict mode | |
set -euo pipefail | |
registry_repo=$1 | |
tag1=$2 |
mkfifo /tmp/pcap.fifo
# Note: DO NOT use the -it option with exec!
kubectl exec deploy/some-pod -c istio-proxy -- bash -c "sudo tcpdump -s0 -U -n -i eth0 -w - " > /tmp/pcap.fifo
wireshark -k -i /tmp/pcap.fifo
I keep tripping up because I forget to add --hidden
and use *
instead of **
:
rg --hidden --glob='**/.github/**' <PATTERN>
With the kitty terminal, you can send desktop notifications with the following (example taken from the kitty docs):
printf '\x1b]99;i=1:d=0;Hello world\x1b\\'
printf '\x1b]99;i=1:d=1:p=body;This is cool\x1b\\'
For details about how this works is here.
export def --wrapped aws [...rest]: nothing -> list<any> { | |
if ($rest | last) == "help" { | |
^aws ...$rest | |
} else { | |
^aws --output json ...$rest | from json | get-first | |
} | |
} | |
export def "get-first" []: record -> any { | |
let input = $in |
I'm migrating karpenter to version v0.32.x and I need to verify if there are some machines left that might not have been migrated to nodepools.
Note
I have a none context that I select to "turn off" kubectl. I need to filter it out.
To create this context, I used the following command: kubectl config set-context none
let machines = ^kubectl config view
The cool thing about this script is that it uses par-each
to run the aws commands in parallel and collecting the results. Do you know how hard that is to do in bash?!
Warning
This script assumes that you have 1 profile entry for each AWS account of the form <account alias>/aws-read-only
.
Adapt as needed.
aws configure list-profiles | grep aws-read-only | lines | par-each {|profile|
#!/bin/bash | |
# Strict mode | |
set -euo pipefail | |
if [ $# -ne 3 ]; then | |
echo "Usage: $0 <helm_release_name> <old_api_version> <new_api_version>" | |
exit 1 | |
fi |