Skip to content

Instantly share code, notes, and snippets.

View M4GNV5's full-sized avatar

Jakob Löw M4GNV5

View GitHub Profile
@M4GNV5
M4GNV5 / luca-sms-bypass.js
Last active April 11, 2023 22:01
Bypass luca-app sms verify allowing users to test the app without a real phone number. Use responsibly
// Paste this into the js console of your browser whilst viewing the Luca webapp
(function() {
var originalFetch = fetch;
window.fetch = (url, options) => {
if(url === '/api//v3/sms/request') {
console.log('hooked fetch', url, options);
return Promise.resolve({
json: () => Promise.resolve({
challengeId: '00000000-0000-0000-0000-000000000000',
})
@M4GNV5
M4GNV5 / generate-lunch-slack-poll.py
Last active March 21, 2022 10:24
Generates a Message to ask where we take lunch today at THI. Uses Neuland App APIs
import requests
from datetime import datetime
def generate_meals_list(url):
data = requests.get(url).json()
today = datetime.now().strftime('%Y-%m-%d')
entries = [x for x in data if x["timestamp"] == today]
if len(entries) == 0:
return "keine Einträge :("
#!/bin/bash
function analyzeFileForDay
{
local dateStr=$(date '+%d/%b' --date="$1 day ago")
local count=$(grep "$dateStr" /mnt/docker-apps/traefik/logs/access.log* \
| grep '"proxy@docker"' \
| awk '{ print $1; }' \
| sort \
| uniq -c \
@M4GNV5
M4GNV5 / disassemble.py
Created October 4, 2023 08:56
TeamItaly CTF 2023 disassembler for challenge secure comparator
syscall_table = {
128: "getc",
127: "putc",
42: "sleepOrHalt",
}
# from checker.bin call table
call_table = {
0: 0x90,
1: 0x400,
@M4GNV5
M4GNV5 / node-red-node.js
Created June 9, 2024 21:58
smart home energy management
// output nodes: [miner on/off, ventilation target, temperature target, user message]
const enabled = global.get("enablePvHeating");
const minerEnabled = global.get("enablePvMining");
const roomTempLow = parseFloat(global.get("minTemperature"));
const pvPower = parseFloat(flow.get("pvPower"));
const temp = parseFloat(flow.get("insideTemperature"));
const tempToHouse = parseFloat(flow.get("toHouseTemperature"));
const ventTarget = parseFloat(flow.get("ventilationTarget"));
const minerStatus = flow.get("minerStatus");
@M4GNV5
M4GNV5 / pv-optimization.js
Created December 6, 2024 09:40
node-red node I am using for optimizing PV energy usage
// output nodes: [miner on/off, ventilation target, temperature target, user message]
const heatpumpEnabled = global.get("enablePvHeating");
const chargingEnabled = global.get("enablePvCharging");
const minerEnabled = global.get("enablePvMining");
const minTemperature = parseFloat(global.get("minTemperature"));
const dayMinTemperature = parseFloat(global.get("dayMinTemperature"));
let targetTemperature = parseFloat(global.get("targetTemperature"));
const forceVent = parseFloat(global.get("forceVent"));
const minerRunning = flow.get("minerRunning");
const evCharging = flow.get("evCharging");