Skip to content

Instantly share code, notes, and snippets.

View polyrand's full-sized avatar

Ricardo Ander-Egg polyrand

View GitHub Profile
@polyrand
polyrand / SSH_MACOS_SECURE_ENCLAVES.md
Created November 23, 2025 21:35 — forked from arianvp/SSH_MACOS_SECURE_ENCLAVES.md
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!

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

import contextlib
from functools import wraps
import cProfile
from typing import Optional
import io
import pstats
import time
from pathlib import Path
from functools import wraps
@polyrand
polyrand / build.py
Last active November 17, 2022 12:15
Small static site builder script using Jinja, Tailwind CSS (with example to download JS libraries)
from jinja2 import Environment, FileSystemLoader, select_autoescape
from pathlib import Path
import shutil
import tempfile
import subprocess
import os
if "tailwindcss" not in os.listdir():
import binascii
import sqlite3
import collections
import math
import re
RE_SPLIT = re.compile(r'[^A-Za-z0-9_]+')
def tokenize(s):
# this is super basic and should be replaced with a real tokenizer
@polyrand
polyrand / README.md
Last active July 19, 2021 18:47
ripgrep jupyter notebooks

Save nbread somewhere in your $PATH and give it permissions with chmod +x nbread

Add the following alias to your shell:

alias rgnb="rg --pre nbread --pre-glob '*.ipynb' --type-add 'ipynb:*.ipynb' -tipynb"

Now you can run rgnb sqlite to search for "sqlite" in all your *.ipynb files.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@polyrand
polyrand / LICENSE.md
Last active January 24, 2021 20:29
drwn.io LICENSE

License

Ricardo Ander-Egg (the “Licensor”) grants you an on-going, non-exclusive license to use the Drawings (the “License”).

An individual license grants permission to the Licensee to access and use the Drawings (the “Individual License”).

A team license grants permission to all Employees and Contractors of the Licensee to access and use the Drawings (the “Team License”).

You can:

@polyrand
polyrand / LICENSE.md
Last active January 22, 2021 13:03
Excalidraw.art License

DISCLAIMER

This License is currently being reviewed and may be updated any time. The changes made to this License have immediate effect after its update.

TL;DR

You can use the Drawings for whatever you want except redistributing or reselling them in any of their forms, separated or packaged.

You can use them for unlimited End Products, either paid or free, for unlimited End Clients, as long as the End Product is not directly related or in competition with the Drawings and/or excalidraw.art.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.