Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

micolous micolous

💭
I may be slow to respond.
View GitHub Profile
@micolous
micolous / gist:753c172bb23af8a13f99f7677a7e79de
Created Sep 18, 2022
Yubikey Security Key C NFC trace with webauthn-rs
View gist:753c172bb23af8a13f99f7677a7e79de
% RUST_LOG=trace cargo run --example nfc_token_info --features nfc
Running `~/webauthn-rs/target/debug/examples/nfc_token_info`
2022-09-18T09:02:32.931534Z INFO webauthn_authenticator_rs::nfc: Using reader: "ACS ACR122U"
2022-09-18T09:02:32.931588Z INFO nfc_token_info::core: Using reader: NFCReader { reader_id: "ACS ACR122U" }
2022-09-18T09:02:32.933665Z TRACE webauthn_authenticator_rs::nfc: rdr_state: CHANGED | EMPTY
2022-09-18T09:02:32.933690Z INFO webauthn_authenticator_rs::nfc: Card removed
2022-09-18T09:02:39.505864Z TRACE webauthn_authenticator_rs::nfc: rdr_state: CHANGED | PRESENT
2022-09-18T09:02:39.508551Z TRACE webauthn_authenticator_rs::nfc: ATR: [3b, 8d, 80, 01, 80, 73, c0, 21, c0, 57, 59, 75, 62, 69, 4b, 65, 79, f9]
2022-09-18T09:02:39.508662Z TRACE webauthn_authenticator_rs::nfc: Parsed: Atr { protocols: [0, 1], t1: [128, 115, 192, 33, 192, 87, 89, 117, 98, 105, 75, 101, 121], storage_card: false, card_issuers_data: Some([89, 117, 98, 105, 75, 101, 121]), c
@micolous
micolous / flappy.js
Last active Jul 23, 2022
Flappy Birb (for Last Call BBS)
View flappy.js
"use strict";
/**
* @file Flappy Birb (for Last Call BBS)
* @version 1.2
* @copyright 2022 Michael Farrell
* @author Michael Farrell <micolous+git@gmail.com>
* @license Apache-2.0
*
* Changes:
*
View footswitch.ino
/*
Input Pull-up Serial + Debounce
This example demonstrates the use of pinMode(INPUT_PULLUP). It reads a digital
input on pin 2 and prints the results to the Serial Monitor.
The circuit:
- momentary switch attached from pin 2 to ground
- built-in LED on pin 13
@micolous
micolous / discord-midi-ptt.user.js
Created Dec 21, 2020
MIDI-controlled PTT in Discord
View discord-midi-ptt.user.js
// ==UserScript==
// @name Discord: MIDI controlled PTT
// @version 1
// @grant none
// @match https://discord.com/*
// ==/UserScript==
/*
* This listens for any MIDI device sending a "note on" or "note off" event,
* and rebinds this to F9.
View streamyard-keyboard-shortcuts.user.js
// ==UserScript==
// @name Streamyard: Keyboard Shortcuts
// @version 1.0
// @grant none
// @match https://streamyard.com/*
// ==/UserScript==
//
// Copyright 2020 Michael Farrell <micolous+git@gmail.com>
//
// Redistribution and use in source and binary forms, with or without
@micolous
micolous / glitch.sh
Last active Jan 15, 2020
"Does anyone know how to use xrandr" glitch slides using ffmpeg. #lca2020
View glitch.sh
#!/bin/bash
# "Does anyone know how to use xrandr" glitch slides using ffmpeg. #lca2020
# Author: Michael Farrell <micolous+git@gmail.com>
# License: BSD-2-Clause or CC-0 (your choice).
#
######
#
# For linux.conf.au in Gold Coast, Ruan (@xfxf) asked me to make a simple "smoosh / defrag"
# slide that would be displayed as a holding slide between talks. I made some others with some
# AV team "in-jokes"... :)
@micolous
micolous / build.gradle.kts
Created Oct 28, 2019
run pkgConfig in gradle config for Kotlin/Native
View build.gradle.kts
/**
* Runs `pkg-config`:
* https://github.com/JetBrains/kotlin-native/issues/1534#issuecomment-384894431
*/
fun runPkgConfig(
vararg packageNames: String,
cflags: Boolean = false,
libs: Boolean = false): List<String> {
val p = ProcessBuilder(*(listOfNotNull(
"pkg-config",
@micolous
micolous / promotion.md
Last active Sep 21, 2019
Promoting personal GitHub repositories to an organisation
View promotion.md

Promoting personal GitHub repositories to an organisation account

When a project gets big, it makes sense to "promote" the repository to an organisation account.

The nice thing about [transferring a repository][] is that GitHub automatically creates redirects for you.

But the problem is for the project's creator -- they should create their own fork of the repository to send pull requests. GitHub doesn't prompt you for a repository name, so this will remove all those redirects created earlier.

These instructions presume:

@micolous
micolous / README.md
Created Jul 6, 2019
Laser cut Xiaomi Mi Band 2 Charger
View README.md

Laser cut Xiaomi Mi Band 2 Charger

This is a quick file to let you build a Xiaomi Mi Band 2 charger with a laser cutter.

The design is licensed CC-BY-SA 4.0.

Materials:

  • 60mm x 30mm of 3mm thick Plywood. You can use some other lasercuttable material, as long as it's at least 2mm thick.
  • 3x1 right angle pin header, with 2.54mm spacing
@micolous
micolous / anon.txt
Created Nov 11, 2018
testing with RejsekortReader
View anon.txt
Dumping dumps/anonymt_dump-20120814.mfd:
CMI: {'CardSerialNumber': aa9035d8,
'CardSerialNumberCheckByte': d7,
'ManufacturerData': bitarray('0000100100001001000000000100010111010011110101011000111001100100000000000000001010011000'),
'CalculatedCardSerialNumberCheckByte': d7
}
TCCI: {'MADInfoByte': bitarray('0000000000000000'),
'CardVersion': Integer 4 (bitarray('000100')),
'CardProvider': PTA be00: Rejsekortet A/S,
'CardValidityEndDate': DateCompact: 6573 2014-12-31 bitarray('01100110101101'),