Skip to content

Instantly share code, notes, and snippets.

View fogti's full-sized avatar

Alain Emilia Anna Zscheile fogti

View GitHub Profile
@fogti
fogti / APC_Temp_ng_standalone.py
Last active January 29, 2021 13:53
APC/Schneider Electric UPS temperature to mqtt adapter cron script; License: ISC
#!/usr/bin/python3.9
import argparse
import paho.mqtt.publish as mqtt_pub
import requests
from urllib.parse import urljoin
parser = argparse.ArgumentParser()
parser.add_argument("host", help="connect to the host (APC) via HTTP")
parser.add_argument("user", help="with the given user")
@fogti
fogti / pxlf-client-Cargo.toml
Created December 27, 2020 22:55
a simple pixelflut client, draws circles...
[package]
name = "pxlf-client"
version = "0.1.0"
authors = ["Erik Zscheile <zseri.devel@ytrizja.de>"]
edition = "2018"
[dependencies]
fastrand = "1.4"
crossbeam-channel = "0.5"
@fogti
fogti / add_distfile.py
Created September 9, 2020 01:57
insert a distfile into a "filename-hash BLAKE2B 8" distfile tree
#!/usr/bin/python3
import filecmp
import hashlib
import os
import shutil
import sys
args = sys.argv[1:]
@fogti
fogti / yzesd-stresstest.sh
Created June 5, 2020 01:41
a simple yz-encsess2 stress test
#!/bin/bash
export RUST_LOG=debug
# source repo @ https://github.com/YZITE/encsess2
# git clone https://github.com/YZITE/encsess2
# cd encsess2
# cargo build --release
YZESD2PATH=... # should point at the path where the release binaries reside
echo "spawn server ..."
@fogti
fogti / ZSXPL.txt
Last active June 16, 2019 16:24
Zscheile Extensible Programming Language
ZSXPL -- Zscheile Extensible Programming Language
Types:
ptr shared_ptr<obj> 0x00
int int64_t 0x01
uint uint64_t 0x02
double double 0x03
stream int32_t(_fd) 0x04
string string 0x10
@fogti
fogti / zsdatab_01.cxx
Last active March 3, 2020 22:23
SQL repr in zsdatab API
#include <zsdatable.hpp>
#include <iostream>
int main() {
zsdatab::metadata mt(':');
mt += { "k", "w", "v" };
zsdatab::table tab(mt);
// insert something into table
///...
@fogti
fogti / inject.sh
Last active March 3, 2020 22:25
inject a shell script into another host and execute it (using dbclient)
DBCLIENT="$(which dbclient)"
[ -z "$INJECT_USERNAME" ] && INJECT_USERNAME="root"
[ -z "$INJECT_PASSWORD" ] && INJECT_PASSWORD="1q2w3e"
doremote() {
DROPBEAR_PASSWORD="$INJECT_PASSWORD" "$DBCLIENT" -y -y -A -l "$INJECT_USERNAME" "$INJECT_HOST" "$@"
}
inject_progr() {