Skip to content

Instantly share code, notes, and snippets.

View bzed's full-sized avatar
🇺🇦
❤️ 🇩🇪 🇦🇹

Bernd Zeimetz bzed

🇺🇦
❤️ 🇩🇪 🇦🇹
View GitHub Profile
@bzed
bzed / ogn-client.py
Created July 12, 2023 10:47
OGN client example
#!/usr/bin/env python3
from ogn.client import AprsClient
from ogn.parser import parse, ParseError
def process_beacon(raw_message):
try:
f = False
#for i in ['FNT08DFBC', 'WALS:', 'FNT082300', 'DBG:', 'guggenth:', 'FNT065063']:
for i in ['FNT065063']:
@bzed
bzed / arp_scapy.py
Created March 23, 2023 16:11 — forked from santa4nt/arp_scapy.py
Some quick-n-dirty sample code and functions to manipulate ARP packets (for network filter testing).
from scapy.all import *
# change this to your test machine's MAC address
SELF_MAC = '00:0c:29:67:22:c2'
BCAST_MAC = 'ff:ff:ff:ff:ff:ff'
# this will send a PROBE ARP request packet to the supplied IP address argument
@bzed
bzed / grafana_telegram_bot.md
Created August 11, 2022 17:42 — forked from ilap/grafana_telegram_bot.md
Grafana Telegram Alert

Config Telegrambot for grafana's alerts.

1. Create bot

Open Telegram and search for @BotFather user and message them the following:

You
/newbot 

BotFather
@bzed
bzed / paperless-scan
Created May 11, 2022 20:07
HP scanner to Paperless CLI
#!/bin/bash
set -e
USER="username"
PAPERLESS_HOST="paperless.your.domain"
PASS="$(pass ${PAPERLESS_HOST}/${USER})"
URL="https://${PAPERLESS_HOST}/api/documents/post_document/"
API="Accept: application/json; version=2"
:~# /usr/bin/haproxyctl help
usage: /usr/bin/haproxyctl <argument>
where <argument> can be:
start : start haproxy unless it is already running
stop : stop an existing haproxy
restart : immediately shutdown and restart
reload : gracefully terminate existing connections, reload /etc/haproxy/haproxy.cfg
status : is haproxy running? on what ports per lsof?
configcheck : check /etc/haproxy/haproxy.cfg
nagios : nagios-friendly status for running process and listener
@bzed
bzed / wordle.py
Last active January 18, 2022 14:59
Solve wordle superfast
#!/usr/bin/python3
# THIS CODE IS A MESSY QUICK AND DIRTY HACK
# AND WON'T BE COMMENTED FURTHER :)
import re
from collections import OrderedDict
from operator import itemgetter
@bzed
bzed / export-smartvariables.py
Created August 31, 2021 07:33
Export foreman smartvariables to yaml / for hiera
#!/usr/bin/python3
import requests
import os
from pprint import pprint
import functools
import yaml
USERNAME='username'
PASSWORD='password'
@bzed
bzed / BinanceMarketCapPairList.py
Created May 27, 2021 21:51
MarketCap pairlist filter for freqtrade
"""
Binance Marketcap PairList provider
Provides dynamic pair list based on market cap
"""
import logging
import requests
from typing import Any, Dict, List
from cachetools.ttl import TTLCache
@bzed
bzed / haveibeenpwned.sh
Created January 18, 2019 10:50
haveibeenpwned password check
#!/bin/bash
echo -n "Enter Password: "
read p
sha=`echo -n "${p}" | sha1sum - | awk '{print $1}'`
sha_short=`echo -n "${sha}" | sed 's,^\(.....\).*,\1,'`
wget -q -O - "https://api.pwnedpasswords.com/range/${sha_short}" | grep -i "${sha}"
@bzed
bzed / ssl_c_pem.lua
Created January 9, 2019 12:15
haproxy pem formatted ssl client cert fetch - ssl_c_pem - like ssl_c_der
require("base64")
core.register_fetches("ssl_c_pem", function(txn)
local der = txn.f:ssl_c_der()
local wrap = ('.'):rep(64);
local envelope = "-----BEGIN %s-----\n%s\n-----END %s-----\n"
local typ = "CERTIFICATE";
der = base64.encode(data);
return string.format(envelope, typ, der:gsub(wrap, '%0\n', (#der-1)/64), typ);