Skip to content

Instantly share code, notes, and snippets.

@arianvp
arianvp / SSH_MACOS_SECURE_ENCLAVES.md
Last active December 9, 2025 01:32
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!

@gavine99
gavine99 / proton-vpn-wireguard-downloader.py
Last active September 13, 2025 20:27
create proton wireguard vpn configurations
# Linux recipe:
# python3 -m venv proton-vpn-wireguard-downloader
# pushd proton-vpn-wireguard-downloader
# wget {{ zip url for this gist }} -O proton-vpn-wireguard-downloader.zip
# wget "https://github.com/ProtonVPN/python-proton-core/archive/refs/tags/v0.2.0.zip" -O python-proton-core-0.2.0.zip
# wget "https://github.com/ProtonVPN/python-proton-vpn-logger/archive/refs/tags/v0.2.1.zip" -O python-proton-vpn-logger.0.2.1.zip
# wget "https://github.com/ProtonVPN/python-proton-vpn-api-core/archive/refs/tags/v0.32.2.zip" -O python-proton-vpn-api-core.0.32.2.zip
# unzip -j proton-vpn-wireguard-downloader.zip
# unzip python-proton-core-0.2.0.zip
# unzip python-proton-vpn-logger.0.2.1.zip
@samsonjs
samsonjs / MovieExportSession.swift
Created June 21, 2024 05:39
Weird AVAssetExportSession sendable error in Swift 6
import AVFoundation
import Combine
import OSLog
private let log = Logger.forType(MovieExportSession.self)
actor MovieExportSession {
let composition: AVComposition
let audioMix: AVAudioMix?
@linucksrox
linucksrox / docker-compose.yml
Created November 21, 2023 18:49
Unifi Network Application 8.0.7 with mongodb - docker-compose.yml
version: '3.7'
services:
unifi-db:
image: docker.io/mongo:latest
container_name: unifi-db
volumes:
- ./data:/data/db
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
@ansarizafar
ansarizafar / macos-app-icon.md
Created October 16, 2023 04:04 — forked from jamieweavis/macos-app-icon.md
How to create an .icns macOS app icon
@beader
beader / InfiniteTabView.swift
Last active August 9, 2025 18:32
Infinite Scrollable TabView using SwiftUI
//
// ContentView.swift
// InfinityTabView
//
// Created by beader on 2022/10/9.
//
import SwiftUI
struct ContentView: View {
@rmorey
rmorey / gen.sh
Created August 17, 2021 19:58
List of Uniform Type Identifiers
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep uti: | cut -c 29- | sort | uniq > utis.txt
@gullyn
gullyn / flappy.html
Last active November 19, 2025 15:40
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@haxrob
haxrob / covidsafe-cert-pin.md
Last active April 29, 2020 10:31
Modify certificate pinning for Australia Government Covidsafe Android Application
  1. Ensure your certificate for the MITM application is in PEM format. For example, Burp Suite generates the certificate in DER, so in this case, to convert from DER to PEM:
openssl x509 -inform der -in cacert.der -out cacert.pem

Note this certificate needs to also be installed on the Android device. Android expects DER format with the file extension .crt. If in doubt, consult google.com.

  1. Extract all three APKs. To avoid issues, -r is used.
apktool d -f -r au.gov.health.covidsafe.apk
apktool d -f -r config.xxhdpi.apk
@alexpaul
alexpaul / DataToURL.swift
Created April 15, 2020 01:11
Convert persisted Data to a temporary URL to configure an AVPlayer for video playback.
import AVFoundation
extension Data {
func convertToURL() -> URL {
let tempURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("video").appendingPathExtension("mp4")
do {
try self.write(to: tempURL, options: [.atomic])
} catch {
print()
}