Skip to content

Instantly share code, notes, and snippets.

View scr34m's full-sized avatar
🏠
Working from home

Győrvári Gábor scr34m

🏠
Working from home
View GitHub Profile
@scr34m
scr34m / apcupsd.php
Created May 20, 2015 18:37
APC UPS status read over network
<?php
function htons($i)
{
return pack('n', $i);
}
function nstoh($d)
{
$length = unpack('n', $d);
return $length[1];
@scr34m
scr34m / crondiary
Created August 19, 2016 14:07
Cron wrapper for crondiary communication
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: CRONDIARY_JOB=<your job id> crondiary 'command'"
exit 1
fi
if [ -z "$API_KEY" ] && [ -e ~/.crondiary ]; then
API_KEY=`cat ~/.crondiary`
fi
@scr34m
scr34m / beanstalkd
Last active May 1, 2018 09:58
Munin beanstalkd plugin
#!/usr/bin/env python
import sys
import subprocess
def get_info(cmds):
toEcho = ""
for cmd in cmds:
toEcho += "%s\\\\r\\\\n" % cmd
@scr34m
scr34m / dns_dotroll.sh
Last active June 9, 2023 07:29
Acme.sh DNS API interface for Dotroll
#!/usr/bin/bash
# Dotroll domain api
# - api access values stored per domain, including migration from account stored values
# - zone data is POST-ed to avoid "414 Request-URI Too Large" errors
#
# Initially export values Dotroll_User and Dotroll_Password
# export Dotroll_User='<your.dotroll@user>'; export Dotroll_Password='<dotroll_api_password>'; acme.sh --issue --dns dns_dotroll -d <domain.tld> -d '*.<domain.tld>'
# Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
@scr34m
scr34m / ZOE-Widget.js
Created March 24, 2023 06:01 — forked from mountbatt/ZOE-Widget.js
Scriptable iOS widget that displays the status of your Renault ZOE on your iPhone and iPad.
/* Das Widget ist auf Grund von Beschwerden von Renault vorrübergehend entfernt */
/* Le widget a été temporairement supprimé suite à une plainte de Renault. */
/* The widget is temporarily removed due to complaints from Renault */
; 68 A0 00 90 adrp x8, #0x102620000
; 08 29 41 F9 ldr x8, [x8, #0x250]
; 09 81 04 91 add x9, x8, #0x120
[object_manager]
pattern=\x08(.){2}\xF9\x09\x81\x04\x91
value_0=adr:-4 ldr:0
; 68 A7 00 F0 adrp x8, #0x1021f0000
; 08 ED 40 F9 ldr x8, [x8, #0x1d8]
; 60 00 00 B4 cbz x8, loc_100d013e4
#!/usr/local/bin/python
import sys
import struct
if len(sys.argv)-1 < 1:
print('usage: {} <binary>'.format(sys.argv[0]))
sys.exit(1)
f = open(sys.argv[1], 'rb')
data = f.read()