Skip to content

Instantly share code, notes, and snippets.

View aslafy-z's full-sized avatar

Zadkiel Aharonian aslafy-z

View GitHub Profile
@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
@aslafy-z
aslafy-z / extract-subnet-playbook.yaml
Created May 18, 2023 13:58
Extract subnet list from a supernet with ansible
- hosts: localhost
vars:
supernet: "10.3.0.0/22"
subnet_cidr: 24
subnet_size: "{{ supernet | ipsubnet(subnet_cidr) }}"
subnet_list: []
tasks:
- set_fact:
subnet_list: "{{ subnet_list }} + ['{{ ip | ipsubnet(subnet_cidr, item) }}']"
with_sequence: "0-{{ subnet_size | int-1}}"
kind: Service
apiVersion: v1
metadata:
name: private
spec:
type: ExternalName
externalName: private.example.corp
ports:
- port: 443
protocol: TCP
@aslafy-z
aslafy-z / envoy.yaml
Last active May 11, 2023 17:28
Frontend to Kubernetes APIServer to re-encrypt traffic with a client trusted CA
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 443
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config: