Skip to content

Instantly share code, notes, and snippets.

View dawud's full-sized avatar
😸
:(){ :|: & };:

David Sastre Medina dawud

😸
:(){ :|: & };:
View GitHub Profile

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

Using Ansible SSH transport with GSSAPI in FreeIPA.
```
[root@master ~]# cat my-hosts
[mymachines]
master.ipa.test
[root@master ~]# id ansible
id: ‘ansible’: no such user
[root@master ~]# kinit admin
Password for [email protected]:
@joseluisq
joseluisq / resize_disk_image.md
Last active July 3, 2025 12:56
How to resize a qcow2 disk image on Linux

How to resize a qcow2 disk image on Linux

This example takes olddisk.qcow2 and resizes it into newdisk.qcow2, extending one of the guest's partitions to fill the extra space.

1. qcow2 format

1.1. Verify the filesystems of olddisk.qcow2

@rsciriano
rsciriano / opentherm.yaml
Last active July 21, 2023 21:31
Code of a device, created with ESPHome, to integrate an OpenTherm boiler with Home Assistant
substitutions:
devicename: opentherm
upper_devicename: Opentherm
esphome:
name: $devicename
platform: ESP8266
board: d1_mini_lite
arduino_version: '2.7.2'
platformio_options:
@TinyExplosions
TinyExplosions / machineconfig.sh
Last active May 28, 2020 13:59
This is taken directly from Jorgen Dahle Naess' work to open the machine config daemon log for a certain host,
#!/bin/bash
mcdlog(){
host=$1
ns=openshift-machine-config-operator
podname=$(oc get pods -o wide --no-headers -n ${ns}| grep ${host} | egrep ^machine-config-daemon | awk '{ print $1 }')
oc logs -f ${podname} -c machine-config-daemon -n ${ns}
}
mcslog(){
@MaxXor
MaxXor / btrfs-guide.md
Last active July 7, 2025 23:06
Btrfs guide to set up an LUKS-encrypted btrfs raid volume with included maintenance & recovery guide

Encrypted Btrfs storage setup and maintenance guide

Initial setup with LUKS/dm-crypt

This exemplary initial setup uses two devices /dev/sdb and /dev/sdc but can be applied to any amount of devices by following the steps with additional devices.

Create keyfile:

dd bs=64 count=1 if=/dev/urandom of=/etc/cryptkey iflag=fullblock
chmod 600 /etc/cryptkey
@robbmanes
robbmanes / global_ip_list.stp
Last active May 14, 2019 08:05
A SystemTap script listing all currently assigned IP addresses in all networking namespaces
/*
* global_ip_list.stp
* Author: Robert Thomas Manes <[email protected]>
*
* With special thanks to Sterling Alexander and Kyle Walker.
*
* This systemtap script lists all currently assigned IP addresses in
* all network namespaces on the system in which it is run.
*
* It is currently only tested on Red Hat Enterprise Linux 7.
@kontez
kontez / freeotp_backup.md
Created January 4, 2018 14:27 — forked from jleclanche/freeotp_backup.md
A guide to back up and recover 2FA tokens from FreeOTP (Android)

Backing up and recovering 2FA tokens from FreeOTP

Backing up FreeOTP

Using adb, create a backup of the app using the following command:

adb backup -f freeotp-backup.ab -apk org.fedorahosted.freeotp
@Konfekt
Konfekt / gist:d950f03c33eb31a7422e3f23d160ba6f
Created October 20, 2017 12:26
markdown source to convert to man page for pandoc-crossref
% PANDOC-CROSSREF(1)
% Nikolay Yakimov
% October 2017
# pandoc-crossref
pandoc-crossref is a pandoc filter for numbering figures, equations, tables and cross-references to them.
Input file (like [demo.md][demo-md]) can be converted into [html][html], [latex][latex], [pdf][pdf], [md][md] or other formats.
@halberom
halberom / ansible.cfg
Last active January 23, 2020 06:56
ansible - custom filters to test type
[defaults]
filter_plugins = plugins/filter
test_plugins = plugins/test