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 |
Sometimes in the course of your job you might need to approve a bunch of pull requests that were automatically created.
The gh
cli is a handy tool to simplify this process.
In this example we'll approve all pull requests in the Foo
org that request you as a reviewer and contains autoscaling
:
for PR_URL in $(gh search prs org:Foo --review-requested @me --state open autoscaling --json url --jq ".[].url"); do
echo $PR_URL
To install zscaler on Pop!_OS 22.04, download the connector from the admin zscaler site by clicking the Client Connector link on the sidebar, then clicking Client Connector App Store, New Releases, Linux and download 1.4.0.105.
Before installing, you must temporarily replace your /etc/os-release file:
cd /etc
sudo mv os-release os-release.old
sudo cat <<EOF >> os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"