Skip to content

Instantly share code, notes, and snippets.

View ixs's full-sized avatar
👋

Andreas Thienemann ixs

👋
View GitHub Profile
@ixs
ixs / Makefile
Last active July 3, 2020 08:07
Makefile to drive ansible from a venv
# Makefile
SHELL = /bin/bash
PYTHON_EXE = python3
TOPDIR = $(shell git rev-parse --show-toplevel)
all: venv ## Build complete environment
help: # Display help
@awk -F ':|##' \
'/^[^\t].+?:.*?##/ {\
@ixs
ixs / tasmota-configure.sh
Last active January 31, 2022 16:44
Tasmota mass configuration
#!/bin/bash
#
# Do initial configuration of a SP111 plug on your local wifi
#
# Licensed under the GPLv3+
#
TEMPLATE='{"NAME":"SP111 v1.1","GPIO":[56,0,158,0,132,134,0,0,131,17,0,21,0],"FLAG":0,"BASE":45}'
function uriencode {
@ixs
ixs / keepass-recovery.py
Created May 28, 2020 09:56
Try multiple passwords to access a keepass database
#!/usr/bin/env python3
#
# Forgot the password for my keepass library. I knew the password
# was based on a certain scheme that encodes the year etc.
#
# Rather than trying it out by hand, have a program do it for me.
#
# Quick and dirty...
#
#!/bin/sh
set -euo pipefail
MAX_SYS_UID=499
MAX_SYS_GID=499
ORIG_MAX_SYS_UID=999
ORIG_MAX_SYS_GID=999
# For debugging, set to echo
@ixs
ixs / gist:139769412b68515fa3e11ebd13a5b3ce
Last active December 10, 2019 21:19
Vodafone USSD session.
root@GL-X750:~# picocom --echo /dev/ttyUSB2
picocom v1.7
port is : /dev/ttyUSB2
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
escape is : C-a
@ixs
ixs / document.load_client_injection.js
Created September 5, 2019 10:23
userscript adding the document.load() function in order to make legacy webinterfaces such as the Avocent PM3000 webinterface work again.
// ==UserScript==
// @name document.load client injection
// @namespace http://tampermonkey.net/
// @version 0.1
// @description The Avocent PM1000/2000/3000 PDU runs an old JavaScript interface that relies on the XMLDocument.fetch() function that has been removed. Emulate this.
// @description inject the document.load implementation into real page context.
// @author Andreas Thienemann <andreas@bawue.net>, based on a script from jnd@chromium.org, based on idea from gurreiro_fabio@yahoo.com.br
// @match http://172.16.10.64/*
// @match http://172.16.10.65/*
// @run-at document-start
@ixs
ixs / cimc-certgen.sh
Last active July 3, 2023 05:05
Cisco UCS CIMC/IMC Certificate Generator
#!/bin/bash
set -euo pipefail
#
# Use the Cisco IMC XML Interface to generate a CSR, use dehydrated to
# have this signed and upload the resulting cert back to the IMC.
# This script requires a working dehydrated setup, preferably using the
# DNS-01 ACME protocol.
#
@ixs
ixs / sample_milter.c
Created April 3, 2019 12:23
setmlreply test
/*
* Copyright (c) 2006 Proofpoint, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
* $Id: example.c,v 8.5 2013-11-22 20:51:36 ca Exp $
*/
@ixs
ixs / smtpd-multi-proxy.py
Created March 3, 2019 17:53
aio multi backend smtp proxy.
#!/usr/bin/python3
import asyncio
from aiosmtpd.controller import Controller
from aiosmtpd.smtp import SMTP
from pprint import pprint
import email
import smtplib
import string
import random
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# (c) Andreas Thienemann 2017
#
# Fail2Ban is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#