Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Programming...

Michael Franzl michaelfranzl

💭
Programming...
View GitHub Profile
@michaelfranzl
michaelfranzl / install_neovim.sh
Created May 13, 2020
Download, compile and install newest neovim for the local user
View install_neovim.sh
INSTALL_DIR=$HOME/progs
git clone git@github.com:neovim/neovim.git
cd neovim
# Install prerequisites listed by https://github.com/neovim/neovim/wiki/Building-Neovim#build-prerequisites
sudo apt install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip
CMAKE_BUILD_TYPE=Release CMAKE_INSTALL_PREFIX=$INSTALL_DIR CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR" make
@michaelfranzl
michaelfranzl / generate-self-signed-certificates-cfssl
Created Apr 30, 2020
Generate self-signed certificates using cfssl
View generate-self-signed-certificates-cfssl
#!/bin/bash
# apt install -y golang-cfssl
echo '{"CN":"CA","key":{"algo":"rsa","size":2048}}' | \
cfssl gencert -initca - | \
cfssljson -bare ca -
echo '{"signing":{"default":{"expiry":"100000h","usages":["signing","key encipherment","server auth","client auth"]}}}' > ca-config.json
@michaelfranzl
michaelfranzl / login
Created Apr 17, 2020
Friction-less login to a tmux session on a suspended host
View login
#!/bin/bash
# Copyright 2020 Michael Karl Franzl
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@michaelfranzl
michaelfranzl / verify-gpg-paperkey.sh
Created Sep 10, 2019
Verify, automate and integrate gpg and paperkey
View verify-gpg-paperkey.sh
#!/bin/bash
# This script asserts the correctness of the program `paperkey`
# by David Shaw. [1] It also exemplifies the automation and integration
# of `gpg` and `paperkey`.
#
# If the program exits with code 0, then the test (see `function main`)
# was successful.
#
# Developed for gpg (GnuPG) version 2.2.12 and paperkey version 1.6.
@michaelfranzl
michaelfranzl / gpg-automate-full-generate-ec-keys.sh
Created Sep 10, 2019
Automate GPG to generate a Curve25519 primary key, and Curve25519 subkeys for signing, encrypting and authenticating.
View gpg-automate-full-generate-ec-keys.sh
#!/bin/bash
# Automate GPG to generate a Curve25519 primary key,
# and Curve25519 subkeys for signing, encrypting and authenticating.
#
# Developed for gpg (GnuPG) 2.2.12.
#
# Copyright (c) 2019 Michael Karl Franzl
#
# Copying and distribution of this file, with or without modification,
@michaelfranzl
michaelfranzl / gstreamer-compilation-debian.md
Last active Jan 17, 2018
Compilation of GStreamer, and as many plugins as possible, from upstream git sources, on Debian 9 (Stretch)
View gstreamer-compilation-debian.md

The following shell commands install GStreamer for an unprivileged user, not system-wide. Adapt INSTALLDIR for your purposes. The GStreamer binaries will be installed into $INSTALLDIR/bin. Normally you would set INSTALLDIR to your home directory (you need to specify it as an absolute path). Consider adding $INSTALLDIR/bin to your PATH environment variable. After installation, check the outputs of which gst-launch-1.0 and gst-launch-1.0 --version, to see if you are using the correct binaries.

All following shell commands should be run as an unprivileged user, with the exception of apt-get install's. I have included installation instructions of as many external dependencies as possible to maximize the number of GStreamer plugins built. You may want to use only a subset of them. I may have forgotten some external dependencies, in which case the compilation should not fail, but simply the corresponding plugin skipped. Check the last output lines of each autogen.sh run to see which plugins will

@michaelfranzl
michaelfranzl / phantom.py
Created Oct 16, 2017
Simple but fully scriptable headless QtWebKit browser using PyQt5 in Python3, specialized in executing external JavaScript and generating PDF files. A lean replacement for other bulky headless browser frameworks.
View phantom.py
#!/usr/bin/python3
"""
# phantom.py
Simple but fully scriptable headless QtWebKit browser using PyQt5 in Python3,
specialized in executing external JavaScript and generating PDF files. A lean
replacement for other bulky headless browser frameworks.