Skip to content

Instantly share code, notes, and snippets.

@Romern
Romern / whatsapp_override_dismiss.js
Created February 11, 2024 19:03
Frida script to use WhasApp after the login has failed. This way messages can still be read even if the whatsapp login has been transfered
Java.enumerateClassLoaders({
onMatch: function(loader){
Java.classFactory.loader = loader;
// Hook the class if found, else try next classloader.
try{
//Override OnDismiss, so we can dismiss the login error dialog without the app closing
LoginFailedDialogFragment = Java.use("com.whatsapp.DisplayExceptionDialogFactory$LoginFailedDialogFragment");
LoginFailedDialogFragment.onDismiss.implementation = function() {};
}catch(error){
@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
@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 / 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 / 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 / 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 / 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 / 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 / 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 / MoodleParser.java
Created June 4, 2021 17:03
old moodle parser
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.jsoup.nodes.Attributes;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.io.IOException;
import java.nio.file.Files;
import java.util.*;