Skip to content

Instantly share code, notes, and snippets.

View aslafy-z's full-sized avatar

Zadkiel AHARONIAN aslafy-z

View GitHub Profile

Dex: encode Oauth2Client CRD name

Source dexidp/dex#1606 (comment)

Dex OAuth2Client CRD metadata.name field should match spec.id and spec.name but needs a special encoding.

Generate it with:

wget https://gist.github.com/aslafy-z/c7e6cc1e2efb15b33fe497e4adbbf6f5/raw/dex-encode-crd-name.go
@aslafy-z
aslafy-z / kustomization.yaml
Created June 19, 2024 15:09
online-boutique
kind: Kustomization
namespace: online-boutique
resources:
- https://github.com/GoogleCloudPlatform/microservices-demo//kustomize/base?ref=6af73dcf7fe1ca653d95ae7a29e12faf8cf02964
components:
- https://github.com/GoogleCloudPlatform/microservices-demo//kustomize/components/non-public-frontend?ref=6af73dcf7fe1ca653d95ae7a29e12faf8cf02964
- https://github.com/GoogleCloudPlatform/microservices-demo//kustomize/components/without-loadgenerator?ref=6af73dcf7fe1ca653d95ae7a29e12faf8cf02964
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
@aslafy-z
aslafy-z / descheduler-grafana-dashboard.json
Created April 12, 2024 15:21
Very rough Kubernetes descheduler Grafana dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
{
"streams": [
{
"stream": {
"container": "controller",
"container_id": "cec7f4ad43cf5d883a04d6a612e65fb6429ea671b7757ef0643b74a20511a666",
"fluentd_host": "logging-operator-logging-fluentd-1",
"host": "ci01-a3np-ingress-wan-a-vmss000000",
"namespace": "nginx-ingress-wan",
"pod": "nginx-ingress-wan-controller-86656594b5-bd7qb",
@aslafy-z
aslafy-z / -repro-kyverno-random-test-results-v1.9-v1.10.md
Last active November 22, 2023 20:32
Repro for Kyverno random test results on v1.9-v1.10

Reproduction for Kyverno random test results on v1.9-v1.10

git clone https://gist.github.com/aslafy-z/4be51cb23e7a40ee5e288ab2ad85f1a6
cd 4be51cb23e7a40ee5e288ab2ad85f1a6
sh run.sh
@aslafy-z
aslafy-z / autokey-netskope-login.py
Last active November 20, 2023 18:12
AutoKey script to relogin with Netskope client
# Displays the information of the next window to be left-clicked
import time
import datetime
nsClientWindowName = "Netskope Client"
username = ""
password = ""
def window_wait_loose_focus(title, timeOut=0):
waited = 0
@aslafy-z
aslafy-z / retry.sh
Last active October 26, 2023 15:27
Bash Retry helper that supports stabilization
#!/usr/bin/env bash
function _retry () (
if [ $# -lt 1 ]; then
echo >&2 "usage: $0 <command> [max] [min] [step] [timeout]"
return
fi
cmd=$1
max=${2:-10}
@aslafy-z
aslafy-z / generate-csr.sh
Created July 13, 2023 14:38
generate-csr.sh
#!/usr/bin/env bash
# Generate a CSR for a list of subject alt names
set -e -o pipefail
if [ -z "$1" ]; then
echo "Usage: $0 <common name> [subject alt names]"
exit 1
fi
@aslafy-z
aslafy-z / system-sleep-xhci.sh
Created May 31, 2023 06:11 — forked from ioggstream/system-sleep-xhci.sh
Disable broken xhci device before suspend and avoid freeze.
#!/bin/sh
#
# This script should prevent the following suspend errors
# which freezes the Dell Inspiron laptop.
#
# Put it in /usr/lib/systemd/system-sleep/xhci.sh
#
# The PCI 00:14.0 device is the usb xhci controller.
#
# kernel: [67445.560610] pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16