Skip to content

Instantly share code, notes, and snippets.

YubiKey for FIDO2 Auth on WSL2 (Ubuntu)

What?

I got my hands on a new YubiKey 5 over the weekend. For those unaware, this is a pretty well-known security key which provides options for hardware authentication using a variety of different protocols (e.g. FIDO2, OpenPGP etc.). I was keen to try this out for authenticating with GitHub and also handling SSH credentials when accessing servers I'm running on my local network.

The problem however, is that I'm a pretty heavy WSL (Ubuntu) user and needed something which plays well in that environment. I didn't think about it too much when I initially ordered the YubiKey, but worked out over the weekend that getting a USB device (particularly a security key) to play nicely with WSL, isn't exactly straight forward. So, I did a write-up of the steps I ended up taking for others (or myself) to refer back to.

References

#!/bin/bash
# Check if the database path is provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 /path/to/your/database.sqlite"
exit 1
fi
# Use the first argument as the database file path
DB_PATH="$1"
@estevecastells
estevecastells / script.js
Last active April 6, 2025 19:36
Use Google Gemini API in Spreadsheets
/**
* Generate content using the Gemini API with a hardcoded API key.
* @param {string} prompt - The text prompt to generate content.
* @return {string} The generated text from the API.
*/
function generateGeminiContent(prompt) {
const API_KEY = 'API_KEY'; // Replace with your actual API key
const API_URL = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-001:generateContent?key=' + API_KEY;
const requestBody = {
@puzzlepeaches
puzzlepeaches / get-tenant-name.yaml
Created July 28, 2024 13:29
Get O365 tenant name using autodiscover.
# nuclei -t get-tenant-name.yaml -u acme.com -jsonl -or -silent -nm -ot | jq -r '."extracted-results"'[]
id: o365-tenant-name
info:
name: Office 365 Tenant Name Discovery
author: ed
severity: info
description: Discovers the tenant name for a given Office 365 domain using the Autodiscover service.
requests:
@thomasbachem
thomasbachem / Open in Google Meet Chrome App.md
Last active February 19, 2026 22:36
Always open Google Meet links in Google Meet Chrome app on macOS

Open Google Meet links in Google Meet Chrome app on macOS by default

I you prefer to have Google Meet links automatically open in the official Google Meet Chrome app on Mac with its own Dock icon instead of in a browser tab, this is the way to go:

Step 1: Setup Chrome App

Install the official Google Meet Chrome web app by:

  1. Navigating to meet.google.com
  2. Then either clicking on the install icon (computer screen with downward arrow) in Chrome's address bar or on "" ▸ "Save and share""Install page as app"

Step 2: Create AppleScript Proxy App

- Server
//Enable Shadow RDP
Windows Registry Editor Version 5.00
; Allow full control without user's permission for RDP shadowing
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]
"Shadow"=dword:00000002
"DisableShadowConsent"=dword:00000001
//Firewall rules
@unixzii
unixzii / ForceEnablingXcodeLLM.md
Last active June 7, 2026 10:06
A guide to force enabling Xcode LLM feature on China-SKU Macs.

Introduction

Apple restricted the access to Xcode LLM (Predictive code completion) feature on China models of Mac. This guide provides a way to bypass that restriction. It's verified on macOS 15.0 Beta (24A5264n), but there is no guarentee that it will always work on later macOS versions.

Prerequisites

  • Xcode is installed and run at least once.
  • SIP debugging restrictions are disabled (via csrutil enable --without debug command in recovery mode).

Disclaimer

@Kyle-Ye
Kyle-Ye / iPhone Mirroring.md
Last active March 16, 2026 23:38
Launch iPhone Mirroring.app on macOS 15 Beta 1
@rtrouton
rtrouton / Sequoia-compatible Macs (regex)
Created June 12, 2024 20:58 — forked from talkingmoose/Sequoia-compatible Macs (regex)
Regex looks for all Mac models compatible with macOS Sequoia. May not be up-to-date with newly released models.
https://www.apple.com/macos/macos-sequoia-preview/
Published Date: June 10, 2024
Verification: https://regex101.com/r/bNOMXz/2
1) Exact regex — Matches major model identifier numbers based on Apple's knowledge base article (more accurate):
^(Mac(1[345]|BookPro1[5-8]|BookAir(9|10)|Pro7)|iMac(Pro1|(19|2[01]))|Macmini[89]),\d+$
2) Current or higher regex — Matches model identifiers based on Apple's knowledge base article and may match higher versions before this regex is updated (more future-proof).
@talkingmoose
talkingmoose / Sequoia-compatible Macs (regex)
Last active August 30, 2025 21:44
Regex looks for all Mac models compatible with macOS Sequoia. May not be up-to-date with newly released models.
https://www.apple.com/macos/macos-sequoia/
Published Date: June 10, 2024
Updated November 8, 2024
Updated May 28, 2025
Verification: https://regex101.com/r/bNOMXz/10
1) Exact regex — Matches major model identifier numbers based on Apple's knowledge base article (more accurate):
^(Mac(1[3-6]|BookPro1[5-8]|BookAir(9|10)|Pro7)|iMac(Pro1|(19|2[01]))|Macmini[89]),\d+$