Skip to content

Instantly share code, notes, and snippets.

View synodriver's full-sized avatar
🙃

synodriver

🙃
  • /dev/null
View GitHub Profile
@synodriver
synodriver / lualoader.py
Last active February 27, 2026 12:33
import lua pkgs from py
# -*- coding: utf-8 -*-
import sys
from importlib.abc import Loader, MetaPathFinder
from importlib.machinery import ModuleSpec
from pathlib import Path
from types import ModuleType
try:
from lupa.lua import LuaRuntime
except ImportError:
@synodriver
synodriver / config.yaml
Created November 18, 2025 13:11
config for meshtisticd works on orangepi zero 3 with Debian 12
### Many device configs have been moved to /etc/meshtasticd/available.d
### To activate, simply copy or link the appropriate file into /etc/meshtasticd/config.d
### Define your devices here using Broadcom pin numbering
### Uncomment the block that corresponds to your hardware
### Including the "Module:" line!
Lora:
# Default to auto-detecting the module type
# This will be overridden by configs from config.d
# _ _ ____ ____
# / \ _ __(_) __ _|___ \ | _ \ _ __ ___
# / _ \ | '__| |/ _` | __) | | |_) | '__/ _ \
# / ___ \| | | | (_| |/ __/ | __/| | | (_) |
# /_/ \_\_| |_|\__,_|_____| |_| |_| \___/
#
# https://github.com/P3TERX/Aria2-Pro-Docker
#
# Copyright (c) 2020-2021 P3TERX <https://p3terx.com>
#
# -*- coding: utf-8 -*-
import asyncio
from siokcp.asyncio import open_kcp_connection
async def cb(reader, writer: asyncio.StreamWriter):
data = await reader.read(10)
print(data)
writer.write(data)
await writer.drain()
writer.close()
#!/usr/bin/env python3
import asyncio
import hashlib
import json
from re import findall
from typing import Tuple
import httpx
from fastapi import Body, FastAPI
from fastapi.responses import JSONResponse
"""
Copyright (c) 2008-2022 synodriver <[email protected]>
"""
import asyncio
from enum import IntEnum
from typing import List, Literal, Optional
class NotAvailable(Exception):
pass
# -*- coding: utf-8 -*-
import os
if os.name == "nt":
import ctypes
from ctypes import wintypes
import msvcrt
INVALID_HANDLE_VALUE = -1
@synodriver
synodriver / hash.py
Created February 18, 2024 07:01
hash folder
import argparse
import hashlib
import os
import sys
from concurrent.futures import ThreadPoolExecutor
from typing import IO
def hash_filename(filename: str, chunk_size=2 * 10 * 6) -> str:
md = hashlib.md5()
with open(filename, "rb") as f:
@synodriver
synodriver / vp.supp
Last active July 8, 2023 11:02
use valgrind to check cython
#
# This is a valgrind suppression file that should be used when using valgrind.
#
# Here's an example of running valgrind:
#
# cd python/dist/src
# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \
# ./python -E ./Lib/test/regrtest.py -u gui,network
#
# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER
"""
Copyright (c) 2008-2023 synodriver <[email protected]>
"""
import asyncio
import os
import sys
import threading
import time
from threading import Thread
from typing import Dict, Tuple