This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syscall_table = { | |
128: "getc", | |
127: "putc", | |
42: "sleepOrHalt", | |
} | |
# from checker.bin call table | |
call_table = { | |
0: 0x90, | |
1: 0x400, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 :(" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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', | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------- Linux system info ---------------- | |
Distro: Debian | |
Release: stretch | |
Kernel: 4.9.0-8-amd64 | |
---------------- DisplayLink info ---------------- | |
Driver version: 5.1.26 | |
DisplayLink service status: up and running |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function optimized func(i1 : int) : int | |
incoming_reg(i1, rdi) | |
.L: | |
i3 = 42 | |
l5 = retrieve_frame_pointer | |
outgoing_reg(i3, rsi) | |
outgoing_reg(l5, rdi) | |
call child | |
.L: | |
return_reg(i8, rax) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Ord | |
import Data.List | |
import Data.Function | |
dice n = [1..n] | |
combinations xs ys = concat $ map (\y -> map (\x -> x : y) xs) ys | |
diceCombinations n k = foldr (combinations) (map return diceN) (replicate (k - 1) diceN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remote debugging using /dev/ttyUSB0 | |
0x40094624 in invoke_abort () at /home/jakob/git/Open-Vehicle-Monitoring-System-3/env/esp-idf/components/esp32/panic.c:139 | |
139 *((int *) 0) = 0; | |
(gdb) back | |
#0 0x40094624 in invoke_abort () at /home/jakob/git/Open-Vehicle-Monitoring-System-3/env/esp-idf/components/esp32/panic.c:139 | |
#1 0x400947ee in abort () at /home/jakob/git/Open-Vehicle-Monitoring-System-3/env/esp-idf/components/esp32/panic.c:148 | |
#2 0x4010504e in __assert_func ( | |
file=0x3f412e80 "/home/jakob/git/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c", | |
line=10700, func=<optimized out>, failedexpr=0x3f41308c "nc->send_mbuf.len >= len") | |
at ../../../.././newlib/libc/stdlib/assert.c:63 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
printf "#include <stdio.h>\n" > /tmp/cppmacro.c | |
while [ $# -gt 1 ]; do | |
printf "#include <$1.h>\n" >> /tmp/cppmacro.c | |
shift | |
done | |
printf "int main()\n{\n\tprintf(\"%%d\\\\n\", $1);\n\treturn 0;\n}" >> /tmp/cppmacro.c | |
gcc -D_GNU_SOURCE /tmp/cppmacro.c -o /tmp/cppmacro |
NewerOlder