Skip to content

Instantly share code, notes, and snippets.

View fritschy's full-sized avatar

Marcus Borkenhagen fritschy

  • Black Forest, Germany
View GitHub Profile
@fritschy
fritschy / openssl-helper.sh
Created August 25, 2020 06:28
openssl one liners
# generate 2048 bit RSA private key (protected by DES3)
openssl genrsa -des3 -out private.pem 2048
# same generation w/o DES3
openssl genrsa -out private.pem 2048
# convert PEM to DER
openssl rsa -in private.pem -pubout -outform DER > public.der
# generate (self signed) certificate (e.g. for use in webservers)
@fritschy
fritschy / mampf.rs
Last active October 24, 2020 09:38
Mampf, a minimal nom-inspired parser combinator implementation.
// An experiment to better understand nom's implementation and ideas
#[derive(Debug)]
pub enum ErrorKind {
ParseError,
EncodingError,
Take,
TakeUntil,
Integer,
Verify,
#![allow(unused_must_use)]
use std::fmt::Display;
use std::ops::{Add, Sub};
use std::str::FromStr;
#[derive(Copy, Clone)]
struct Stdio {}
impl<T: Display> Add<T> for Stdio {
@fritschy
fritschy / pwned-passwd.py
Created January 27, 2022 16:37
Check if password is pwned
#!/usr/bin/env python3
import hashlib
import sys
import getpass
import urllib.request
import re
class colors:
red='\033[91m'
@fritschy
fritschy / download.sh
Created March 28, 2024 12:28
Download Cixin Liu: Trisolaris-Trilogie - Sci-Fi Hörspiel-Serie | WDR
wget -ct0 -O1_die-drei-sonnen-1-12-rotes-ufer_3094375_56747683.mp3 https://wdrmedien-a.akamaihd.net/medp/ondemand/weltweit/fsk0/309/3094375/3094375_56747683.mp3
wget -ct0 -O1_die-drei-sonnen-2-12-geheime-forschung_3094376_56747802.mp3 https://wdrmedien-a.akamaihd.net/medp/ondemand/weltweit/fsk0/309/3094376/3094376_56747802.mp3
wget -ct0 -O1_die-drei-sonnen-3-12-das-verhoer_3094381_56747875.mp3 https://wdrmedien-a.akamaihd.net/medp/ondemand/weltweit/fsk0/309/3094381/3094381_56747875.mp3
wget -ct0 -O1_die-drei-sonnen-4-12-ein-countdown_3094415_56748078.mp3 https://wdrmedien-a.akamaihd.net/medp/ondemand/weltweit/fsk0/309/3094415/3094415_56748078.mp3
wget -ct0 -O1_die-drei-sonnen-5-12-trisolaris_3094418_56748116.mp3 https://wdrmedien-a.akamaihd.net/medp/ondemand/weltweit/fsk0/309/3094418/3094418_56748116.mp3
wget -ct0 -O1_die-drei-sonnen-6-12-seltsame-ereignisse_3094423_56748315.mp3 https://wdrmedien-a.akamaihd.net/medp/ondemand/weltweit/fsk0/309/3094423/3094423_56748315.mp3
wget -ct0 -O1_die-drei-sonnen-7-12-das
@fritschy
fritschy / flatpak-fuse.py
Last active April 13, 2025 21:40
Fuse filesystem that exposes runners for all installed flatpak applications
#!/usr/bin/env python3
import os, errno, stat, sys
import copy
import fuse
from subprocess import run, PIPE
from time import time
fuse.fuse_python_api = (0, 2)
@fritschy
fritschy / kill_on_drop.rs
Created April 6, 2026 14:20
Rust std::process::Child kill on drop
use std::{
ops::{Deref, DerefMut},
process::{Child, Command},
};
struct KillOnDrop(Child);
impl Drop for KillOnDrop {
fn drop(&mut self) {
let _ = self.0.kill();