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 | |
import gzip | |
import io | |
import os | |
import tarfile | |
from pathlib import Path | |
import hashlib | |
from securetar import ( | |
SECURETAR_MAGIC, | |
SecureTarFile, |
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 | |
import argparse | |
import asyncio | |
import logging | |
from typing import Any, Optional, cast | |
from zeroconf import IPVersion, ServiceInfo, ServiceStateChange, Zeroconf, ServiceListener | |
from zeroconf.asyncio import AsyncServiceBrowser, AsyncServiceInfo, AsyncZeroconf |
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/env python3 | |
import binascii | |
import sys | |
MESHCOP_TLV_TYPE = { | |
"CHANNEL": 0, | |
"PANID": 1, | |
"EXTPANID": 2, | |
"NETWORKNAME": 3, |
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
// enum CommissioningStage with numeric values | |
// from | |
// https://github.com/project-chip/connectedhomeip/blob/v1.2.0.1/src/controller/CommissioningDelegate.h | |
enum CommissioningStage : uint8_t | |
{ | |
kError = 0, | |
kSecurePairing = 1, ///< Establish a PASE session with the device | |
kReadCommissioningInfo = 2, ///< Query General Commissioning Attributes, Network Features and Time Synchronization Cluster | |
kReadCommissioningInfo2 = 3, ///< Query SupportsConcurrentConnection, ICD state, check for matching fabric |
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/sh | |
# (c) 2023 Stefan Agner | |
# This scripts attempts to clear corrupted Docker overlay2 storage metadata | |
# which can be left over after a power failure. | |
# See also: https://github.com/moby/moby/issues/42964 | |
# | |
# Typically the error message when attempting to pull the image for which | |
# corrupted layers are in the storage looks like: | |
# failed to register layer: error creating overlay mount to /mnt/data/docker/overlay2/6ee02298ee75a4f96e77f90551673cb700f29867f9ad1c4e20b8c816bfcf0735/merged: too many levels of symbolic links |
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/sh | |
# | |
# IO monitoring for Linux | |
# | |
# Taken from armbianmonitor | |
# https://github.com/armbian/build/blob/master/packages/bsp/common/usr/bin/armbianmonitor | |
# Adjusted to rely on diskstats only. | |
# | |
MonitorIO() { |
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
"""GLEDOPTO GL-C-006P device.""" | |
from zigpy.profiles import zha | |
from zigpy.quirks import CustomDevice | |
from zigpy.zcl.clusters.general import ( | |
Basic, | |
GreenPowerProxy, | |
Groups, | |
Identify, | |
LevelControl, | |
OnOff, |
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/sh | |
DT_BOOTLOADER_TS=${DT_BOOTLOADER_TS:-/proc/device-tree/chosen/bootloader/build-timestamp} | |
BOOTLOADER_CURRENT_VERSION=$(printf "%d" "0x$(od "${DT_BOOTLOADER_TS}" -v -An -t x1 | tr -d ' ' )") | |
date -u "-d@${BOOTLOADER_CURRENT_VERSION}" |
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/sh | |
# Getting Elgato Wave:3 Microphone input "unstuck" on Linux & Pulseaudio | |
# Replace <card-name> with your microphones card name (check "pacmd list-cards") | |
# It looks something like "usb-Elgato_Systems_Elgato_Wave_3_<serial>-00" | |
pacmd set-card-profile alsa_card.<card-name> output:analog-stereo | |
pacmd set-card-profile alsa_card.<card-name> input:mono-fallback |
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 aiohttp | |
import asyncio | |
async def work(i: int): | |
#print(f"start working on {i}") | |
for i in range(50): | |
pass | |
async def main(): | |
tasks = [] |
NewerOlder