Skip to content

Instantly share code, notes, and snippets.

View mikeybob's full-sized avatar
:octocat:

Mike DemonDad mikeybob

:octocat:
  • Demonlab Network
  • Edinburgh
  • 00:48 - 1h ahead
View GitHub Profile
@rjoffray
rjoffray / chatGpt.md
Created February 15, 2023 21:42
Chat GPT code writing

Chat GPT

Question

write code using node.js that implements all of the esc/pos language to print a receipt including a logo, a list of items with prices, a tag line and a barcode

Chat GPT

Here's an example code using Node.js that implements ESC/POS language to print a receipt:

@elsholz
elsholz / get_thermal_printer_info.md
Last active April 30, 2025 20:38
Find out the values you need to know to connect a thermal printer via USB from a python script.

Find EP-Ids and Device ID of Thermal Printer by name

When using the Python Library python-escpos to use a thermal printer via usb, you need the device id, vendor id, endpoint out id, and endpoint in id.

Finding these values took me some time, so here is a script that automates the process.

All you need to supply to the script is the name of the printer device. Find it out by running lsusb with the printer disconnected. Then connect the printer and run lsusb again. Look out for the device that has been added and remember its name (or some part of it, doesn't really matter).

Run ./get_thermal_printer_info.sh "device name" and there you'll find the values you need to create the escpos.printer.Usb object.

@artizirk
artizirk / gnupg_scdaemon.md
Last active April 22, 2025 18:10
OpenPGP SSH access with Yubikey and GnuPG

NB: This document describles a 'Old-School' way of using Yubikey with SSH

Modern OpenSSH has native support for FIDO Authentication. Its much simpler and should also be more stable with less moving parts. OpenSSH also now has support for signing arbitary files witch can be used as replacement of gnupg. Git also supports signing commits/tags with ssh keys.

Pros of FIDO

  • Simpler stack / less moving parts
  • Works directly with ssh, ssh-add and ssh-keygen on most computers
  • Simpler
  • Private key can never leave the FIDO device

Cons of FIDO

#!/usr/bin/ruby
# Script creating a disk img from a compiled ignition config read from stdin
# Based on https://github.com/coreos/vagrant-ignition/blob/master/lib/vagrant-ignition/action/IgnitionDiskGenerator.rb
# See https://github.com/coreos/bugs/issues/1573
require 'zlib'
# Note: gpt and gpt2 are the primary and secondary headers respectively
class IgnitionDiskGenerator
@gomfunkel
gomfunkel / elgato-eve.md
Last active October 29, 2024 19:01
Elgato Eve HomeKit Services & Characteristics

Elgato Eve HomeKit Services & Characteristics

A work in progress collection of proprietary and as of yet undocumented HomeKit characteristics and their UUIDs used by Elgato Eve.

This list is not including all Eve accessories available and some services and characteristics still make no sense to me. If you have anything to contribute, please leave a comment. There is no guarantee that the information listed below is correct.

Elgato Eve Energy (Firmware Revision 1.3.1;466)

Service - Characteristic UUID R W Type Description