View netbox_webhook_listener.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac | |
from apiflask import APIFlask | |
import logging | |
from flask import request | |
from apiflask import Schema, abort | |
from apiflask.fields import String, Dict, DateTime, UUID | |
APP_NAME = "netbox-webhook-listener" | |
WEBHOOK_SECRET = "secret" |
View teampass_shell_exporter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Teampass Shell Exporter | |
// Written by Maximilian Thoma 2022 | |
// Variables | |
// ************************************************** | |
// Path to sources directory of teampass | |
$path = "/var/www/html/sources"; | |
// Salt from teampass-seckey.txt | |
$salt = "<salt>"; |
View install_docker.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GREEN="\e[32m" | |
ENDCOLOR="\e[0m" | |
echo -e " ${GREEN}Welcome to Docker-CE installer for Ubuntu 18.04/20.04/22.04 ...${ENDCOLOR} " | |
echo -e " ${GREEN}---------------------------------------------------------------${ENDCOLOR} " | |
echo -e " ${GREEN}You will be asked for your sudo password if set.${ENDCOLOR} " | |
echo -e " ${GREEN}>>> Get repo update ...${ENDCOLOR} " |
View flask_oidc_check_resource_access.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# flask_oidc_check_resource_access.py | |
# Written by Maximilian Thoma 2022 | |
# Visit https://www.lanbugs.de | |
# Free to use for everyone, without any warranty :-) | |
# | |
# Manual / Remarks | |
# I use it together with flask-oidc and Keycloak to give permission to API endpoint only to defined role. | |
# Its a wrapper function you can use together with @oidc.accept_token |
View ripe_cidr.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# ---------------------------------------------------------------------------------------------------------------------- | |
# Ripe CIDR list generator with country filter | |
# -------------------------------------------- | |
# Version 1.0 | |
# Written by Maximilian Thoma 2022 | |
# | |
# Parts used from: https://github.com/FireFart/network_info | |
# Only python3 required, no additional libraries |
View gitea_webhook_auth.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from flask import Flask, request, abort | |
from pprint import pprint | |
import json | |
import hmac | |
app = Flask(__name__) | |
@app.route("/", methods=['POST']) |
View mail_with_attachment.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://stackoverflow.com/questions/3362600/how-to-send-email-attachments | |
import smtplib | |
from pathlib import Path | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.base import MIMEBase | |
from email.mime.text import MIMEText | |
from email.utils import COMMASPACE, formatdate | |
from email import encoders |
View SQLiteToMemory.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# SQLiteToMemory | |
# Python class to load sqlite3 database to memory and back to file | |
# Written by Maximilian Thoma 2019 | |
# Version 0.1 | |
# | |
import sqlite3 |
View read_postfix_db.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from bsddb3 import db | |
filename = "/var/spool/postfix/plesk/virtual.db" | |
target = "smtp:[backend_plesk_server]:25" | |
postfix_db = db.DB() | |
postfix_db.open(filename, None, db.DB_HASH, db.DB_DIRTY_READ) |
View transport_generator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import mysql.connector | |
cnx = mysql.connector.connect(user='psa_readonly', password='securepassword', host='127.0.0.1', database='psa') | |
target = "smtp:[plesk_beckend_server.xxxx.xxx]:25" | |
buffer = "" |
NewerOlder