Skip to content

Instantly share code, notes, and snippets.

View token_auth.py
from channels.auth import AuthMiddlewareStack
from channels.db import database_sync_to_async
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.http.cookie import parse_cookie
@database_sync_to_async
def get_user(token_key):
try:
View fields.py
# -*- coding: utf-8 -*-
import string
from django import forms
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
class BaseEncryptedField(models.Field):
View memo.py
#!/usr/bin/env python3
import random
import sys
"""
https://github.com/taikuukaits/SimpleWordlists/
The MIT License (MIT)
View _gui_create_invoice.sh
#!/bin/bash
function usage() {
echo -e "This script generates a LND invoice and prints the payment request"
echo -e ""
echo -e "Usage: $0 [-h|--help] [-v*|--verbose] [-a|--amt STRING] [-m|--memo STRING]"
echo -e ""
echo -e " -h, --help\t\tprint this help message"
echo -e " -v, --verbose\t\tbe more verbose"
echo -e " -a, --amt STRING\tAmount in Satoshi"
View _gui_check_invoice_payed.sh
#!/bin/bash
function usage() {
echo -e "This checks if a LND invoice has been payed using the rhash"
echo -e ""
echo -e "Usage: $0 [-h|--help] [-v*|--verbose] [-r|--rhash STRING]"
echo -e ""
echo -e " -h, --help\t\tprint this help message"
echo -e " -v, --verbose\t\tbe more verbose"
echo -e " -r, --rhash STRING\tthe payment hash of the invoice (as HEX not BASE64!)"
View 00infoLCD_wrapper_README.md

Setup

Install additional tools

sudo apt-get install unclutter xterm

Raspi-Config

View 00infoLCD_wrapper.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 00infoLCD_wrapper.py
import os
import tkinter as tk
import platform
COLOR = "black"
View gist:e8d3cd0fd90be6338ea5bd8c79b5c2e3
from O365 import Account, Connection, FileSystemTokenBackend, MSGraphProtocol, MSOffice365Protocol
import re
client_id = "<client_id>"
client_secret = "<client_secret>"
tenant_id = "<tenant_id>"
credentials = (client_id, client_secret)
View certutilpostreciver.py
#!/usr/bin/env python
# Exfiltrate a file from Windows Powershell over HTTP Post using certutil for
# Base64 conversion to avoid broken file due to text based post transmission.
#
# Requires
# pip install tornado
# Sample usage (exfiltrate flag.docx)
# python certutilpostreciver.py
View pdf-ocr.sh
#!/bin/bash
set -x
mkdir -p output
mkdir -p merge split tiff
find ./originals -type f -name '*.pdf' -exec sh -c '