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 / solr4_.py
Created August 16, 2024 08:46
A munin-monitoring solr plugin to work with python3
#!/usr/bin/env python
"""
=head1 NAME
solr4_ - Solr 4.* munin graph plugin
=head1 CONFIGURATION
Plugin configuration parameters:
#!/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()
; 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
@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 */
@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 / 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 / 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 / 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 / zeromq_wire_protocol.php
Last active July 6, 2019 20:57
raw zeromq wire protocol in php
<?php
// ZMTP/2.0 http://rfc.zeromq.org/spec:15
// ZMTP/1.0 http://rfc.zeromq.org/spec:13
$fp = fsockopen("127.0.0.1", 5559, $errno, $errstr, 1);
if (!$fp) {
return;
}
stream_set_timeout($fp, 0, 500);
@scr34m
scr34m / keybase.md
Created February 25, 2015 06:18
keybase.md

Keybase proof

I hereby claim:

  • I am scr34m on github.
  • I am scr34m (https://keybase.io/scr34m) on keybase.
  • I have a public key whose fingerprint is C18E 6363 58DE EF8A 5DEE 909F 86B8 A589 3469 E5B4

To claim this, I am signing this object: