Skip to content

Instantly share code, notes, and snippets.

View makkes's full-sized avatar
🤓
My voice is my passport. Verify me!

Max Jonas Werner makkes

🤓
My voice is my passport. Verify me!
View GitHub Profile
@makkes
makkes / grafana-dashboard-k8s-provisioning.md
Created October 28, 2024 09:37
Grafana Dashboard as ConfigMaps
  1. Navigate to the dashboard in Grafana
  2. Click blue "Share" button at the top
  3. Select the "Export" tab
  4. Click on "View JSON"
  5. Click "Copy to Clipboard"
  6. Create a new file in your repository and copy the following snippet into it:
apiVersion: v1
kind: ConfigMap
@makkes
makkes / decrypt_payload.py
Last active June 3, 2024 08:38
Decrypt AES encrypted data using a key in turn encrypted using RSA 256
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES, PKCS1_v1_5
from Crypto.Random import get_random_bytes
import base64
import sys
import zlib
def decrypt(session_key, privkey_fname, payload_fname, out_fname):
import requests
import datetime
import numpy as np
import os
import json
import sys
repo = "weaveworks/weave-gitops" # Replace with the name of the repository
access_token = "<access_token>" # Replace with your GitHub access token
@makkes
makkes / code.mmd
Last active September 5, 2022 14:04
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env bash
#
# A silly little kubectl plugin helping you become more intimate with your Kubernetes
# cluster.
#
# 1. Download the file
# 2. Put it somewhere within your `$PATH`
# 3. Make it executable
# 4. `kubectl im-feeling-lucky`
import cv2 as cv
import time
delay = 5
if __name__ == "__main__":
cap = cv.VideoCapture("/dev/video2")
if not cap.isOpened():
print("Cannot open camera")
exit(1)

Keybase proof

I hereby claim:

  • I am makkes on github.
  • I am makkes (https://keybase.io/makkes) on keybase.
  • I have a public key whose fingerprint is 0981 E8F0 11B0 8926 D25B E530 EB52 5E0F 02B5 2140

To claim this, I am signing this object:

@makkes
makkes / main.go
Created May 15, 2019 09:20
SSH remote execution and SCP
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"path"
"sync"
@makkes
makkes / props.sh
Last active February 8, 2019 09:02
Read properties files in Bash
read_props() {
local key
if [[ ! -r $1 ]] ; then
echo file $1 not readable
exit 1
fi
while IFS='=' read -r key value
do
if [[ -z ${key} ]] || [[ "${key}" =~ ^# ]] ; then
continue
@makkes
makkes / gist:44675a0ef9c61aa88283
Last active August 29, 2015 14:07
wrtc DataChannel test
var wrtc = require('wrtc');
var pcs = [],
done = [],
MAX_PCS = 30;
pcoptions = {
iceServers: []
};