Skip to content

Instantly share code, notes, and snippets.

@Romern
Romern / downloadL2p.sh
Last active June 29, 2021 09:07
Downloads all materials from l2p using curl and wget
#!/bin/bash
USER="AB12345"
PASS="hunter2"
echo "Getting courses..."
COURSES=$(curl -s --ntlm -u "${USER}:${PASS}" https://www3.elearning.rwth-aachen.de/l2p/foyer/SitePages/PastCourses.aspx | grep -oE "https://www[0-9].elearning.rwth-aachen.de/(ws|ss)[0-9]{2}/[0-9]{2}(ws|ss)-[0-9]*")
echo "Recursively download all courses using wget..."
while IFS= read -r c
@Romern
Romern / app.js
Created August 1, 2021 14:54
Short nodejs script which dumps all menus for lieferando restaurants in your area, and python script which puts them crudely into a csv file for eaier inspection.
import {inspect} from 'util';
import {Takeaway, TakeawayConfig} from 'takeaway';
(async () => {
try {
const plz = "52080";
const coordLNG = '50.7';
const coordLAT = '6.0';
// Initialize configuration
@Romern
Romern / Dockerfile
Created August 12, 2021 10:02
Dockerfile for verifiable-image-redacting
FROM rust:slim-buster
RUN apt-get update
RUN apt-get install -y \
wget unzip curl \
build-essential cmake git libgmp3-dev libprocps-dev python-markdown libboost-all-dev libssl-dev pkg-config libopencv-dev
# install verifiable image redacting library with workaround for now (see https://github.com/snp-labs/verifiable-image-redacting/issues/1 )
RUN git clone https://github.com/Romern/verifiable-image-redacting \
&& cd verifiable-image-redacting \
@Romern
Romern / gambleLink.py
Created September 2, 2021 15:19
simple web app which serves as a link shortener, which can give another link based on chance
@Romern
Romern / scan.sh
Last active April 8, 2022 11:52
Script to poll for the buttons on a scanner and run a script if pressed. Currently just checks if any button is pressed, but could be easily adjustable.
#!/bin/bash -e
FOLDER="/home/roman/Scanned/"
PORT="$(lsusb | grep CanoScan | pcregrep -o1 "Bus ([0-9]*)")"
DEVICE="$(lsusb | grep CanoScan | pcregrep -o1 "Device ([0-9]*)")"
SCANBD_DEVICE="genesys:libusb:${PORT}:${DEVICE}"
scanimage --format jpeg -d ${SCANBD_DEVICE} --source Flatbed --resolution 300 -o /tmp/scan.jpg
@Romern
Romern / README.md
Created February 18, 2023 12:52
wp6003 BLE to MQTT and integration for home assistant

ble2mqtt was very unstable for me and I only use the wp6003 sensor anyway, so I wrote this small python script. based on https://github.com/zu2/wp6003 add configuration.yaml to home assistants configuration.yaml.

Requirements: bleak paho click

@Romern
Romern / README.md
Created April 19, 2023 16:32
socks 2 http proxy

Relays all TCP traffic to a HTTP proxy. Useful for using Burp and Android, my setup:

@Romern
Romern / base64.ps
Created August 14, 2023 20:55
base64 encoder in postscript
/base64EncodingTable [
(A) (B) (C) (D) (E) (F) (G) (H) (I) (J)
(K) (L) (M) (N) (O) (P) (Q) (R) (S) (T)
(U) (V) (W) (X) (Y) (Z) (a) (b) (c) (d)
(e) (f) (g) (h) (i) (j) (k) (l) (m) (n)
(o) (p) (q) (r) (s) (t) (u) (v) (w) (x)
(y) (z) (0) (1) (2) (3) (4) (5) (6) (7)
(8) (9) (+) (/)
] def
@Romern
Romern / svgpdfpolzglot.svg
Last active April 5, 2025 07:52
svg pdf polyglot imagemagick/ghostscript mit command execution
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Romern
Romern / embedfile.ps
Last active November 3, 2023 15:27
PostScript function to embed files in a PDF easily using pdfmark (by defaults dumps /tmp/* ) (e.g. ```gs -sDEVICE=pdfwrite -o foo.pdf embedfile.ps```). Python script extracts the files.
%!PS
%%%%%%%%%%%%%%%%%%%Helper Functions
% (a) (b) -> (ab)
/concatstrings { exch dup length
2 index length add string
dup dup 4 2 roll copy length
4 -1 roll putinterval
} bind def