Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@thurask
thurask / README.md
Last active April 9, 2024 01:28
Automatic SSL Certificates for OctoPrint with Step and HAProxy

Automatic SSL Certificates for OctoPrint with Step and HAProxy

I wanted to use HTTPS with my OctoPrint setup so I set up a local certificate authority with Step, which you will need for this guide to work. Much of this is based on guides from both HAProxy and Step, combined with some elbow grease on my end to adapt them for my particular setup. Assuming you have both the local certificate authority and a working instance of HAProxy 2.6 or newer (whatever's in Debian stable right now) already set up, read on:

0. SSH into your OctoPrint machine or whatever else is running HAProxy

1. Bootstrap the client:

step ca bootstrap --ca-url https://YOUR_CA_AUTHORITY --fingerprint THE_FINGERPRINT_FROM_THE_CA_AUTHORITY
PRD-63116-001/nPRD-63116-003/nPRD-63116-005/nPRD-63116-007/nPRD-63116-009/nPRD-63116-010/nPRD-63116-013/nPRD-63116-017/nPRD-63116-020/nPRD-63116-021/nPRD-63116-027/nPRD-63116-033/nPRD-63117-003/nPRD-63117-011/nPRD-63117-015/nPRD-63117-019/nPRD-63117-023/nPRD-63117-025/nPRD-63117-027/nPRD-63117-028/nPRD-63117-029/nPRD-63117-041/nPRD-63117-703/nPRD-63117-704/nPRD-63118-001/nPRD-63734-001/nPRD-63734-002/nPRD-63763-001/nPRD-63764-001/n
import sys
import tclcheck as t
def prd_center():
for i in range(63116, 63771):
curef = "PRD-{0}-001".format(i)
try:
ctxt = t.check(sess, serid, curef)
except SystemExit:
pass
@thurask
thurask / gbuds_checker.py
Last active July 27, 2023 19:33
Check latest firmware version of Galaxy Buds (R170), Galaxy Buds Plus (R175)
#!/usr/bin/env python3
import requests
try:
from defusedxml import ElementTree # pip install defusedxml
except (ImportError, AttributeError):
from xml.etree import ElementTree
def main(indevice):
@thurask
thurask / waveshare_relay_server.py
Last active June 26, 2023 22:26
Waveshare Pico Relay board web server for Pico W MicroPython
import json
import machine
import neopixel
import network
import os
import socket
import time
# WaveShare Pico Relay B board
#!/usr/bin/env python3
"""Check Microsoft Edge Chromium webdriver."""
import argparse
import io
import os
import shutil
import subprocess
import zipfile
import requests
import argparse
import concurrent.futures
import os
import subprocess
GITFOLDER = "C:\\git"
def filterer(infx):
#!/usr/bin/env python3
"""Rip APKs en masse using ADB. Requires ADB debug connection to be set up before running!!!"""
import argparse
import os
import subprocess
def _get_device_info(tid):
devinfo = subprocess.run(["adb", "devices", "-l"], capture_output=True)
try:
#!/usr/bin/env python3
import gzip
import os
import shutil
import subprocess
import tarfile
import zipfile
from defusedxml import ElementTree
import yaml
@thurask
thurask / ssecheck.cpp
Created September 26, 2021 12:29 — forked from hi2p-perim/ssecheck.cpp
Check SSE/AVX instruction support.
/*
Check SSE/AVX support.
This application can detect the instruction support of
SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, and AVX.
*/
#include <iostream>
#ifdef _MSC_VER
#include <intrin.h>
#endif