Skip to content

Instantly share code, notes, and snippets.

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

Stefan stefan2904

🚲
¯\_(ツ)_/¯
View GitHub Profile
@stefan2904
stefan2904 / lvextend
Last active March 23, 2024 22:19
how to extend your /home logical volume with LVM on ext4
% df -h
Filesystem Size Used Avail Use% Mounted on
/dev/dm-1 46G 14G 31G 31% /
udev 10M 0 10M 0% /dev
tmpfs 2.3G 9.2M 2.3G 1% /run
tmpfs 5.8G 232K 5.8G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 5.8G 0 5.8G 0% /sys/fs/cgroup
/dev/mapper/thinkbook-home 92G 55G 33G 63% /home
/dev/sda1 232M 35M 181M 16% /boot
@stefan2904
stefan2904 / speech.md
Last active April 5, 2023 01:07
The Alice and Bob After Dinner Speech

The Alice and Bob After Dinner Speech

given at the Zurich Seminar, April 1984, by John Gordon, by invitation of Professor James Massey

Good evening Ladies and Gentlemen.

There comes a time when people at a technical conference like this need something more relaxing. A change of pace. A shift of style. To put aside all that work stuff and think of something refreshingly different.

So let's talk about coding theory. There are perhaps some of you here tonight who are not experts in coding theory, but rather have been dragged here kicking and screaming. So I thought it would be a good idea if I gave you a sort of instant, five minute graduate course in coding theory.

@stefan2904
stefan2904 / FirefoxCookiesToEmacs.py
Last active March 30, 2023 15:56
Sync Firefox Cookies to Emacs' url-cookie (see also README below)
#!/usr/bin/env python3
# ~/.emacs.d/url/cookies
# https://github.com/borisbabic/browser_cookie3
# ;; A cookie is stored internally as a vector of 7 slots
# ;; [ url-cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE ]
from datetime import datetime
FROM debian:sid
RUN apt-get update
RUN apt-get install -y git make emacs
RUN git clone --depth 1 --branch release_9.5.5 https://git.savannah.gnu.org/git/emacs/org-mode.git org955
RUN git clone --depth 1 --branch release_9.6 https://git.savannah.gnu.org/git/emacs/org-mode.git org96
RUN cd org955 && make autoloads
RUN cd org96 && make autoloads
FROM debian:sid
RUN apt-get update
RUN apt-get install -y git emacs
RUN git clone --depth 1 --branch 0.4 https://github.com/toshism/org-super-links.git org-super-links-04
RUN git clone --depth 1 --branch fix-time-format https://github.com/akirak/org-super-links.git org-super-links-fix
ADD org-sl-test-04.el .
ADD org-sl-test-fix.el .
CMD ["bash"]
@stefan2904
stefan2904 / chaintest.py
Last active April 14, 2022 10:46
Python Requests Demo: How to handle a web server which serves a misconfigured TLS chain
import requests
# via https://whatsmychaincert.com/?webportal.stromnetz-graz.at
# "Generate the Correct Chain" + "Include Root Certificate"
# --> https://whatsmychaincert.com/generate?include_leaf=1&host=webportal.stromnetz-graz.at&submit_btn=Generate+Chain&include_root=1
CUSTOMSTORE='/tmp/webportal.stromnetz-graz.at.chained+root.crt'
print('without chain:')
try:
requests.get('https://webportal.stromnetz-graz.at/login')
@stefan2904
stefan2904 / generate.js
Last active March 31, 2022 13:07
Generate Ed25519 did:key in JSONWebKey format for usage in Hyperledger Aries
// using https://github.com/transmute-industries/did-key.js
// via https://www.npmjs.com/package/@transmute/did-key-ed25519
const main = async function() {
const k = await require('@transmute/did-key-ed25519').Ed25519KeyPair.generate({
secureRandom: () => {
return Buffer.from(
require('crypto').randomBytes(32),
'hex'
@stefan2904
stefan2904 / pinboard.py
Created January 10, 2022 21:10
Pinboard Orgmode "Importer", adapted from https://github.com/mathcass/pinboard-org
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
stefan2904 / podcasts1.md
Last active November 18, 2021 02:41
Podcasts #1 (public)

Stefan's Podcast List #1

Some random podcasts ... In some random order ...


Politk & Gesellschaft

Ganz offen gesagt

@stefan2904
stefan2904 / dir2org.sh
Created October 7, 2021 16:55
Convert directory of markdown files into orgmode heading
#!/bin/bash
# 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