Skip to content

Instantly share code, notes, and snippets.

View BenjaminHerbert's full-sized avatar

Benjamin Herbert BenjaminHerbert

View GitHub Profile
javascript: (function() {
var id;
var descr;
var a = document.querySelector('#ghx-detail-issue .ghx-group .ghx-key dl.ghx-detail-list dd a');
if (a) {
/*side details*/
id = a.textContent;
descr = document.querySelector('#ghx-detail-issue .ghx-group .ghx-detail-summary dl.ghx-detail-list dd.ghx-detail-description').textContent;
} else if (a = document.getElementById("key-val")) {
/*full page details*/
@BenjaminHerbert
BenjaminHerbert / index.md
Created January 23, 2020 16:21
Restic Backups

Restic

Ich bin schon länger auf der Suche nach einem guten und verschlüsselten Backup.

Initalisieren des Repos

Einmalig setzen

RESTIC_REPOSITORY=<ordner>
restic init --repo RESTIC_REPOSITORY
@BenjaminHerbert
BenjaminHerbert / index.md
Last active April 11, 2020 10:35
Hoerbert - Skripte

Hoerbert - bespielen

Script zum Kopieren

Aktualisiert im April 2020 - hiermit kopiere ich mir mittlerweile alle CDs nacheinander als MP3 und FLAC. https://github.com/aebaack/abcde-auto-cd-ripper

CD kopieren

Ich kopiere mir zuerst meine CD als MP3 und behalte die WAV-Dateien.

@BenjaminHerbert
BenjaminHerbert / index.md
Created November 26, 2019 14:54
Kubernetes Auth Token Dekodieren OIDC
kubectl config view --minify -o json | jq -r '.users[0].user."auth-provider".config."id-token"' | tr '.' '\n' | sed -n 2p | base64 -d | jq '.'
@BenjaminHerbert
BenjaminHerbert / webradio.txt
Created November 4, 2019 21:16
Alte Webradioliste
http://streams.br-online.de/bayern1_2.m3u
http://streams.br-online.de/bayern2_2.m3u
http://streams.br-online.de/bayern3_2.m3u
http://streams.br-online.de/bayernmobil_2.m3u
http://streams.br-online.de/bayern4klassik_2.m3u
http://streams.br-online.de/b5aktuell_2.m3u
http://streams.br-online.de/b5plus_2.m3u
http://streams.br-online.de/jugend-radio_2.m3u
http://mp3-live.dasding.de/dasding_m.m3u
http://mp3-live.dasding.de/dasdingraka01_m.m3u
@BenjaminHerbert
BenjaminHerbert / Fail.java
Created October 24, 2019 15:58
Java - Generate variable Length Stacktrace
public class Fail {
public static void main(String[] args) {
recurse(Integer.parseInt(args[0]));
}
public static void recurse(int num) {
if (num <= 1) {
throw new RuntimeException("This is a stacktrace");
}
recurse(num-1);
}
@BenjaminHerbert
BenjaminHerbert / index.md
Last active October 18, 2021 15:53
Kubernetes-Kram

JWT Token zerlegen

kubectl config view --minify -o json | jq -r '.users[0].user."auth-provider".config."id-token"' | tr '.' '\n' |  head -2 | tail -1 | base64 -d | jq '.'

Azure AKS-Token zerlegen

kubectl config view --minify -o json | jq -r '.users[0].user."auth-provider".config."access-token"' | tr '.' '\n' |  head -2 | tail -1 | base64 -d | jq '.'
DECLARE
stmt VARCHAR2(2000);
constr_name VARCHAR2(30);
BEGIN
SELECT CONSTRAINT_NAME INTO constr_name
FROM USER_CONS_COLUMNS
WHERE table_name = 'YOUR_TABLE' AND
column_name = 'YOUR_CONSTRAINED_COLUMN';
stmt := 'ALTER TABLE YOUR_TABLE DROP CONSTRAINT '|| constr_name;
EXECUTE IMMEDIATE(stmt);