Skip to content

Instantly share code, notes, and snippets.

View sintezcs's full-sized avatar
🏠
Working from home

Alex Minakov sintezcs

🏠
Working from home
View GitHub Profile
@arianvp
arianvp / SSH_MACOS_SECURE_ENCLAVES.md
Last active December 9, 2025 20:57
Native Secure Enclaved backed ssh keys on MacOS

Native Secure Enclave backed ssh keys on MacOS

It turns out that MacOS Tahoe can generate and use secure-enclave backed SSH keys! This replaces projects like https://github.com/maxgoedjen/secretive

There is a shared library /usr/lib/ssh-keychain.dylib that traditionally has been used to add smartcard support to ssh by implementing PKCS11Provider interface. However since recently it also implements SecurityKeyProivder which supports loading keys directly from the secure enclave! SecurityKeyProvider is what is normally used to talk to FIDO2 devices (e.g. libfido2 can be used to talk to your Yubikey). However you can now use it to talk to your Secure Enclave instead!

@simonmesmith
simonmesmith / openai_streaming_with_functions.py
Last active June 11, 2025 12:50
Use OpenAI API streaming with functions
"""
This example shows how to use the streaming feature with functions.
"""
import json
import os
import sys
from collections.abc import Generator
from typing import Any, Dict, List
@artem78
artem78 / SymbianDev-en.md
Last active November 25, 2025 05:23
Developing for Symbian OS guide
@ancientGlider
ancientGlider / keenetic_auth.py
Last active November 3, 2025 11:26
Authentication for Keenetic routers for work with CLI via REST API (Python)
# -*- coding: utf-8 -*-
"""
Данные с адресом, логином, паролем хранятся в конфигурационном файле следующего вида:
[Router]
ip_addr = 192.168.1.1:8080
login = admin
passw = anyPassword
@tossmilestone
tossmilestone / Flake8.txt
Created March 30, 2018 06:55
Flake8 integrated with PyCharm
How to manually setup flake8 as PyCharm external tool
File / Settings / Tools / External Tools / Add
Name: Flake8
Program: $PyInterpreterDirectory$/python
Parameters: -m flake8 --max-complexity 10 --ignore E501 $FilePath$
Working directory: $ProjectFileDir$
Output Filters / Add
Name: Filter 1
@sintezcs
sintezcs / rate_limit.py
Last active February 16, 2017 07:41
Rate-limiting decorator
import threading
import time
def rate_limited(max_per_second):
lock = threading.Lock()
min_interval = 1.0 / max_per_second
def decorate(func):
last_time_called = time.perf_counter()