Skip to content

Instantly share code, notes, and snippets.

View cpanato's full-sized avatar
🧿

Carlos Tadeu Panato Junior cpanato

🧿
View GitHub Profile
@saschagrunert
saschagrunert / kubernetes-verify.sh
Created December 1, 2022 14:13
Verifying Kubernetes binary artifacts
#!/usr/bin/env bash
set -euox pipefail
TAG=v1.26.0-rc.1
URL=https://dl.k8s.io/release/$TAG/bin/linux/amd64
BIN=kubectl
for EXT in "" .sig .cert; do
FILE=$BIN$EXT
curl -sSfL --retry 3 --retry-delay 3 $URL/$FILE -o $FILE
@jimangel
jimangel / README.md
Last active April 24, 2024 19:13
Enable audit logging on a kind cluster

Enable auditing on KinD

TODO

  • Use a webhook vs. file backend (maybe cloudrun?)
  • This might only be possible if Docker is running as root - need to test

Config

Make a temporary directory to host files to be mounted in KinD.

FROM debian:10
RUN apt-get update && apt-get install -y wget gnupg
RUN echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ /' \
> /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
RUN wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_10/Release.key -O- |\
apt-key add -
RUN apt-get update && apt-get install -y podman
RUN sed -i 's/driver = ""/driver = "vfs"/' /etc/containers/storage.conf
@hoegaarden
hoegaarden / README.md
Last active August 7, 2019 16:18
screenshot & upload failing testgrid boards

Running

# using defaults:
#   BOARDS: sig-release-master-blocking sig-release-master-upgrade
#   STATES: FAILING
./shot.sh
#!/usr/bin/env bash
set -e
set -o pipefail
kubectl proxy &
proxy_pid="$!"
trap 'kill "$proxy_pid"' EXIT
for ns in $(kubectl get namespace --field-selector=status.phase=Terminating --output=jsonpath="{.items[*].metadata.name}"); do
@gserrano
gserrano / errou.sh
Created November 29, 2018 17:03
echo ascii ERROU art
echo -n $'\E[31m'
echo ' -hNNNNNNNNNNNNNNNNNNNNNNNNmdo` '
echo ' .hNNNNNNNNNNNNNNNNNNNNNNNNNNNNNms.. '
echo ' `mNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNmm- '
echo ' /dNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNms` '
echo ' .hNNNNNNmmdmmNmmmmdNdyo+sdmNNNNNNNNNNNNNNh. '
echo ' `hNNNNdo:--...-....::.....--:/sdNNNNNNNNNNmo. '
echo ' `hNNNNs----.````````````````..---yNNNNNNNNNNNy` '
echo ' yNNmm+-----.`````````````````..---/ymNNNNNNNNNh` '
echo ' :NNNN+----..``````````````````....--:hmNNNNNNNNN+ '
export IMAGE=gcr.io/k8s-testimages/kubekins-e2e:latest-master
docker run --privileged -it --rm -v /mydata/docker-graph:/docker-graph -v $(pwd):/workspace/scripts --entrypoint=/bin/bash $IMAGE -c /workspace/scripts/run-test.sh
@caruccio
caruccio / migrate-pv-to-zone.sh
Last active April 17, 2024 20:13
Migrate EBS Volume based PVs across AWS availability zones
#!/bin/bash
if [ $# -lt 6 ]; then
echo "Usage: $0 [source-namespace] [source-pvc-name] [target-namespace] [target-pvc-name] [target-aws-zone] [target-pv-name] [kind/workload=None]"
echo "Clone EBS, PV and PVC from source to target. Will stop kind/workload if defined."
exit
fi
set -eu
@benjamincharity
benjamincharity / autonomous.txt
Last active May 17, 2024 22:47
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower (also reportedly fixes incorrectly reported heights).
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these
> steps thoroughly.
Reset Steps:
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
3. Release both buttons.
4. Press the down buttons until the desk beeps one more time or 20 seconds pass.
@danieldreier
danieldreier / create_ca.rb
Created August 10, 2014 17:53
Generate dummy SSL certs using the certificate_authority gem
#!/usr/bin/env ruby
require 'certificate_authority'
# Generate root_cert CA using example code at https://github.com/cchandler/certificate_authority
root_cert = CertificateAuthority::Certificate.new
root_cert.subject.common_name= "Dummy CA Root Certificate"
root_cert.serial_number.number=1
root_cert.key_material.generate_key
root_cert.signing_entity = true
signing_profile = {"extensions" => {"keyUsage" => {"usage" => ["critical", "keyCertSign"] }} }