Skip to content

Instantly share code, notes, and snippets.


Stefan stefan2904

  • @IAIK, Graz University of Technology
  • Graz, Vienna & Koroška, Europe, Earth
  • Twitter @stefan2904
View GitHub Profile
stefan2904 /
Last active Apr 14, 2022
Python Requests Demo: How to handle a web server which serves a misconfigured TLS chain
import requests
# via
# "Generate the Correct Chain" + "Include Root Certificate"
# -->
print('without chain:')
stefan2904 / generate.js
Last active Mar 31, 2022
Generate Ed25519 did:key in JSONWebKey format for usage in Hyperledger Aries
View generate.js
// using
// via
const main = async function() {
const k = await require('@transmute/did-key-ed25519').Ed25519KeyPair.generate({
secureRandom: () => {
return Buffer.from(
import json
import sys
import requests
import codecs
from requests.utils import get_netrc_auth
TMP_FILE = '/tmp/pinboard.json' # May not exist in all platforms
default_params = {'format': 'json'}
stefan2904 /
Created Oct 7, 2021
Convert directory of markdown files into orgmode heading
# if [[ -d $PASSED ]]; then
# echo "$PASSED is a directory. Let's convert it."
# elif [[ -f $PASSED ]]; then
# echo "$PASSED is a file. Try md2org instead?"
# exit 2
# else
# echo "$PASSED is not valid?"
# exit 1
stefan2904 / demo.php
Created Jun 23, 2021
PHP: Check if property exists in decoded JSON (using strict types)
View demo.php
<?php declare(strict_types=1);
$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}';
$j = json_decode($json);
var_dump($j->a == NULL);
stefan2904 / courses.csv
Last active Jun 1, 2021
TU Graz courses (study year 2020/21)
View courses.csv
We can't make this file beautiful and searchable because it's too large.
BEA.01001PH,"Ästhetik, Kunst und visuelle Kultur (STEOP)",PH_Stmk
BEA.02001PI,Introduction to the subject specific professional field of ARTS Education,PPH_Graz
BEA.03001PH,Grundlagen bildnerischen Gestaltens I,PH_Stmk
BEA.05001PH,Grundlagen der Fachdidaktik,PH_Stmk
BEA.06001PH,Grundlagen bildnerischen Gestaltens II,PH_Stmk
BEA.07115UB,Introduction to Iconography,Uni Graz
BEB.01001PH,Grafik I,PH_Stmk
BEB.02001PI,Painting I,PPH_Graz
stefan2904 / studies.csv
Last active May 20, 2021
TU Graz Study Programme
View studies.csv
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 /
Created Jan 18, 2021
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
# See also:
stefan2904 /
Last active Oct 23, 2020 / batch exporter
# Get desktop-app (which includes CLI) from
#set -o xtrace
for ((page=0; page<NUM_PAGES; page++))