Skip to content

Instantly share code, notes, and snippets.

View micolous's full-sized avatar
💭
I may be slow to respond.

micolous micolous

💭
I may be slow to respond.
View GitHub Profile
@micolous
micolous / anon.txt
Created November 11, 2018 05:31
testing with RejsekortReader
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'),
@micolous
micolous / teensy_steno.ino
Created May 26, 2018 10:00
Teensy steno (tx bolt protocol)
// teensy_steno
// Michael Farrell <micolous+git@gmail.com>
//
// This implements the TX Bolt protocol. It works with Teensy LC, but should work
// with other Arduino compatibles (once you fix touch inputs).
//
// This version supports arbitrary keymaps, so you don't need to wire the keyboard
// the same as the TX Bolt protocol. This should make scanning around twice as fast.
//
// This uses a "touch" sensitive pin (18) for the number bar.
@micolous
micolous / stripey.html
Last active January 23, 2018 06:04
repro opsis issue?
<html>
<head>
<style type="text/css">
html {
background: repeating-linear-gradient(
90deg,
#000,
#000 2px,
#fff 2px,
@micolous
micolous / greencard_reader.py
Created January 29, 2017 13:21
Prototype reader for Greencard (TAS) card dumps.
#!/usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; tab-width: 2 -*-
"""
greencard_reader.py
Prototype reader for Greencard (TAS) card dumps.
See https://github.com/micolous/metrodroid/wiki/Greencard for format details.
Copyright 2017 Michael Farrell <micolous+git@gmail.com>
Note: This loads the entire file into memory blindly. Do not use on large file
@micolous
micolous / myway_reader.py
Created December 21, 2016 07:23
Prototype reader for MyWay card dumps.
#!/usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; tab-width: 2 -*-
"""
myway_reader.py
Prototype reader for MyWay (ACT) card dumps.
See https://github.com/micolous/metrodroid/wiki/MyWay for format details.
Copyright 2016 Michael Farrell <micolous+git@gmail.com>
Note: This loads the entire file into memory blindly. Do not use on large file
@micolous
micolous / tfnsw_api.json
Created April 24, 2016 15:35
Swagger API for the Transport for NSW Open Data portal.
{
"info": {
"version": "1.0",
"license": {
"url": "https://creativecommons.org/licenses/by/4.0/legalcode",
"name": "CC-BY-4.0"
},
"title": "Transport for NSW Open Data API"
},
"paths": {
#!/bin/sh
ffmpeg -y \
-f v4l2 \
-input_format mjpeg \
-i /dev/video0 \
-framerate 25 \
-video_size 640x360 \
-s 1280x720 \
-c:v rawvideo -c:a pcm_s16le \
-pix_fmt yuv420p \
@micolous
micolous / gocard.py
Last active September 12, 2023 14:16
Requires mfoc dump in mfc format (1 kilobyte)
import argparse, struct, base64, datetime
MODES = {
1: 'Value-add machine',
4: 'Bus',
5: 'Train',
18: 'Ferry',
}
STATIONS = {
from abbreviations import abbreviations
from sys import argv
import re
# get all the commandline text
in_str = ' '.join(argv[1:]).upper()
# compile a regular expression for each of the stations, do this only on startup, because it is slow (~240 ms)
abb_re = {}
for k, v in abbreviations.iteritems():
@micolous
micolous / preferences
Created April 3, 2014 07:03
blocking nodejs in debian
# /etc/apt/preferences
Package: nodejs
Pin: origin ""
Pin-Priority: -1
Package: nodejs-*
Pin: origin ""
Pin-Priority: -1