Skip to content

Instantly share code, notes, and snippets.

View bzub's full-sized avatar

bzub bzub

View GitHub Profile
@bcardiff
bcardiff / list-deps.cr
Last active May 29, 2024 17:37
List binary dependencies to build a minimal docker image from scratch
unless ARGV.size > 0
puts " Missing executable file argument"
puts " Usage (in a Dockerfile)"
puts " RUN crystal run ./path/to/list-deps.cr -- ./bin/executable"
exit 1
end
executable = File.expand_path(ARGV[0])
unless File.exists?(executable)
@rohshall
rohshall / bspwmrc
Last active November 8, 2022 23:40 — forked from jinyeow/bspwmrc
Config files related to bspwm and panel (lemonbar)
#! /bin/sh
xrandr.sh
sxhkd &
xcompmgr &
$HOME/bin/panel &
bspc monitor LVDS-1 -d 1 2 3 4 5
bspc monitor HDMI-2 -d 6 7 8 9 0
@ernoaapa
ernoaapa / list-failing-pods.sh
Last active June 19, 2024 10:50
Script to list all Kubernetes Pods what are NOT ready
#!/bin/sh
#
# Print Pods which are Pending or not Ready for some reaosn
#
kubectl get pods --all-namespaces -o go-template='{{ range $item := .items }}{{ range .status.conditions }}{{ if (or (and (eq .type "PodScheduled") (eq .status "False")) (and (eq .type "Ready") (eq .status "False"))) }}{{ $item.metadata.name}} {{ end }}{{ end }}{{ end }}'
@rawc0der
rawc0der / crd2jsonschema.sh
Last active September 18, 2024 14:42
Extract openapi JSON schema from Kubernetes CRD manifest
#!/bin/bash
# Small utility function based on yq to extract openAPIV3Schema from CRD
# example: crd2jsonschema.sh ./crd-alertmanager.yaml
set -e
function crd2jsonschema() {
set -e
local xkgroup="x-kubernetes-group-version-kind"
local document="$1"
local openAPIV3Schema=$(mktemp -u)