Skip to content

Instantly share code, notes, and snippets.

View tdewin's full-sized avatar

tdewin

View GitHub Profile
@tdewin
tdewin / oc-python
Last active May 15, 2026 15:07
oc-python
#!/usr/bin/env python3
# Ported via vibe coding
import argparse
import subprocess
import sys
import os
import base64
@tdewin
tdewin / Istio-commands.sh
Last active May 20, 2026 14:46
bookinfo-policies
# show proxies
istioctl proxy-status
# info
PROXY=$(istioctl proxy-status | grep inside | cut -f1 -d" ")
istioctl proxy-config all $PROXY
istioctl proxy-config secret $PROXY
@tdewin
tdewin / Makefile
Last active May 11, 2026 09:26
gather-insights ( MIT LICENSE, VAGUELY TESTED, BE CAREFUL, NO WARRANTY, FOR DEMO ENV ONLY)
CONFIG_FILE = cloud.openshift.com.json
DATA_DIR = insights-data
PYTHON = venv/bin/python3
gather:
$(PYTHON) gather-kubernetes-api.py
upload:
@if [ -n "$(BUNDLE)" ]; then \
ARCHIVE="$(BUNDLE)"; \
else \
@tdewin
tdewin / download-all-images-in-browser-console.js
Created December 17, 2025 10:46
download-all-images-in-browser-console.js
//download all images with class name icon or whatever you select
//requires emulate user gesture checkbox in safari to run
//set timeout seems to be required to get safari to download all individual icons
let icons = document.getElementsByClassName("icon")
for (let i=0;i<icons.length;i++) {
setTimeout(() => {
let alocal = document.createElement("a")
alocal.setAttribute("download","")
alocal.setAttribute("href",icons[i].getAttribute("src"))
alocal.click();
@tdewin
tdewin / _Veeam V13 Automation.md
Last active September 10, 2025 13:20
VeeamSoftwareAppliance on Fedora with virsh

This is a set of script to automatically deploy some of the components via KVM/virsh

Tested on Fedora 42

@tdewin
tdewin / data-orig.patch
Last active July 23, 2025 08:51
Patch for pikchr adding "data-orig-name" and "data-orig" to box and text for easier post parsing; patch pikchr.y ../data-orig.patch
--- pikchr.y.orig
+++ pikchr.y
@@ -433,6 +433,7 @@
/* Forward declarations */
static void pik_append(Pik*, const char*,int);
+static void pik_append_data_orig(Pik*,PObj*);
static void pik_append_text(Pik*,const char*,int,int);
static void pik_append_num(Pik*,const char*,PNum);
static void pik_append_point(Pik*,const char*,PPoint*);
@tdewin
tdewin / gpx-to-svg.py
Created June 16, 2025 20:29
Converst gpx to Inkscape sag
#!/usr/bin/env python3
# eg 50.84,4.35 is a gps coordinate in brussels . vw/vh is the amount of degrees. eg 0.06 => around 6km. It is the left lower corner as in the north space degrees go up if you move north (but in svg it is the other way around)
# ./loopgpx.py -vy 50.84 -vx 4.35 -vw 0.06 -vh 0.06 -width 1000 -height 1000 "file1.gpx" "file2.gpx" "file3.gpx" > map-of-multiple-loops.svg
# it uses print instead of propper xml tree building cause well hmm, i'm lazy and this should work as well if you don't use exotic file names
import sys
import argparse
import xml.etree.ElementTree as ET
@tdewin
tdewin / val-deploy.mermaid.mmd
Last active May 27, 2025 09:34
Veeam Agent for Linux Deployment options
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tdewin
tdewin / pbqr.sh
Created February 13, 2025 08:50
Create a qr code from Mac clipboard (pbpaste). Uses Inkscape barcode tool.
#!/bin/zsh
tmp="$HOME/tmp"
mkdir -p $tmp
inks="/Applications/Inkscape.app/Contents/Resources/"
cd $inks
qrpath="share/inkscape/extensions/render_barcode_qrcode.py"
python3="bin/python3"
@tdewin
tdewin / kubernetes.vimrc
Last active July 23, 2024 11:01
VIM shortcuts
"when you use > or < on a V[isual] selected text, shift 2 spaces
set shiftwidth=2
"makes space no tabs
set expandtab
"put 2 spaces for a tab
set tabstop=2
"indicates lines and character location
set ruler