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 / 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 / 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'
#![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 / 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,
@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 / encode-video.zsh
Last active June 1, 2021 13:47
Wrapper around my mostly-used-part of ffmpeg ...
#!/usr/bin/env zsh
set -e
FFMPEG="$HOME/Downloads/ffmpeg-4.2.1-amd64-static/ffmpeg"
CRF=20
VCODEC=libx264
PRESET=
DEBUG=x
FORCE=()
@fritschy
fritschy / cryptsetup-with-luks2-and-integrity-demo.sh
Created April 20, 2020 13:08 — forked from MawKKe/cryptsetup-with-luks2-and-integrity-demo.sh
dm-crypt + dm-integrity + dm-raid = awesome!
#!/usr/bin/env bash
#
# Author: Markus (MawKKe) ekkwam@gmail.com
# Date: 2018-03-19
#
#
# What?
#
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
#
@fritschy
fritschy / not-so-smallpt-min.rs
Last active April 16, 2020 15:42
Not so smallpt rust port...
#![allow(non_snake_case)] use std::{collections::HashMap as HM,f64::consts::*,io
::Write,ops::*, sync::mpsc::channel, thread::spawn,time::Instant as I};enum S{U(
f64,usize,Vec<V3>),F}#[derive(Copy, Clone)]#[repr(C)]struct V3(f64,f64,f64);impl
Add for V3{type Output=Self; fn add(self,o:Self)->Self{V3(self.0+o.0,self.1+o.1,
self.2+o.2)}}impl Sub for V3{type Output=Self;fn sub(self,o:Self)->Self{V3(self.
0-o.0,self.1-o.1,self.2-o.2)}}impl Mul<f64>for V3{type Output=Self;fn mul(self,o
:f64)->Self{V3(self.0*o,self.1*o,self.2*o)}} impl Mul for V3{type Output=Self;fn
mul(self,o:Self) -> Self{V3(self.0*o.0,self.1*o.1,self.2*o.2)}} impl Rem for V3{
type Output=Self; fn rem(self,o:Self)->Self{V3(self.1*o.2-self.2*o.1,self.2*o.0-
self.0*o.2,self.0*o.1-self.1*o.0,)}} impl V3{ fn norm(self)->Self{self*(1./self.
@fritschy
fritschy / reddit-stuff.js
Last active March 11, 2020 09:29
Unsave/Unlike reddit posts JS snippet
// Paste to firefox js console
// Source: https://stackoverflow.com/a/59443772
// XXX unsave posts
const delay = ms => new Promise(res => setTimeout(res, ms));
(async () => {
for (const a of document.querySelectorAll('.link-unsave-button > a, .comment-unsave-button > a')) {
a.click();
await delay(300);
}
@fritschy
fritschy / fxlib.h
Created January 9, 2020 08:04 — forked from holubv/fxlib.h
CASIO fx-9860G SDK Library (with documentation) https://edu.casio.com/
/*****************************************************************/
/* */
/* CASIO fx-9860G SDK Library */
/* */
/* File name : fxlib.h */
/* */
/* Copyright (c) 2006 CASIO COMPUTER CO., LTD. */
/* */
/*****************************************************************/
#ifndef __FXLIB_H__