Skip to content

Instantly share code, notes, and snippets.

@hsiboy
hsiboy / FDX-B.md
Created September 26, 2024 15:11
Python script for FDX-B 15-digit, ISO-compliant Pet microchips

The script processes a raw HEX string input (representing an FDX-B transponder) and extracts relevant fields, such as the header, identification code, country code, data block status, animal application indicator, CRC checksum, and extended data block.

Key Features:

  1. Dynamic Imports: It dynamically imports required libraries (binascii, argparse, termcolor), displaying errors if any library is missing.
  2. HEX Processing: It converts the input HEX string into binary and extracts the fields following the FDX-B protocol structure.
  3. Manufacturer Lookup: Based on the country code, it enriches the output by displaying the manufacturer's name (if available).
  4. Colorful Output: Uses the termcolor library to colorize the output fields for better readability.
  5. Error Handling:
    • If no HEX string is passed, it displays a usage guide and prompts the user to provide valid input.
  • If an invalid HEX string is passed, it catches the error and prints a helpful message.

Cute Sparkles

These cool and girly glitters come with lots of flowers, hearts, bows and ribbons! These decorations can suit all sorts of happy and soft aesthetic moods ~ ✨(◕▿◕✿)

✧・゚: *✧・゚:*    *:・゚✧*:・゚✧
.・゜゜・  ・゜゜・.
。・゚゚・  ・゚゚・。
༶•┈┈⛧┈♛ ♛┈⛧┈┈•༶
✧༺♥༻∞  ∞༺♥༻✧

*✿❀ ❀✿*

@hsiboy
hsiboy / fuses.ino
Created July 13, 2023 16:14
Automated Fuse Tester - for testing automative fuses using an arduino
/*
/ You'll need to adjust the current reading code based on the specific sensitivity of your ACS758 model.
/ Remember to adjust `ACS758_SENSITIVITY` based on the specific ACS758 model you're using.
/ The `readCurrent()` function reads the current sensor output and converts it to current based on the sensor sensitivity.
/
/ It's necessary to map the analog voltage reading based on your specific power source and voltage divider setup.
/ The code provided here assumes a 5V power supply for the Arduino, and that the voltage divider reduces the maximum
/ voltage of 15V to within 0-5V for the ADC. The specifics will depend on the actual resistors used in the voltage divider.
/ The Aref pin is supplied with 4.3v from a preecision zenner diode.
/
@hsiboy
hsiboy / dump1090LCD.py
Created July 5, 2023 10:07
Scrapes the json from dump1090 and pushes the info to an LCD display connected via RS232
import json
import serial
# Configure the serial port
ser = serial.Serial('/dev/ttyUSB0', 9600) # Replace '/dev/ttyUSB0' with the correct serial port and baud rate
# Parse the JSON data from Dump1090
def parse_dump1090_data(json_data):
aircraft_data = json.loads(json_data)
for aircraft in aircraft_data:
TTS25ESYS
RolandEC
@4cj
@4bz
@4.z
msTpj
@4bTp
@4bj)
mvTpm
@4^@
These are some findings during my trip down the rabbit hole that is a replacement for the Iomega Zip drive in the Roland SP-808 and SP-808ex samplers.
INQUIRY
The INQUIRY command may be used by a host computer to determine the configuration of the ATAPI Block
Device. ATAPI Block Devices respond with information that includes their type and specification level and
may include the vendor’s identification, model number and other useful information.
SP-808 sends "ATAPI INQUIRY", but does not read allocated data and sends "IDENTIFY PACKET DEVICE" next.
@hsiboy
hsiboy / banners.md
Last active September 15, 2022 16:22

                        RAE COMPUTING LTD - PRIVATE

      !! WARNING : You have accessed a  private Computer system !!
   You are required to have a personal authorisation from the System
   administrator before you use this system and you are strictly limited
   to the use set out in that written authorisation. Unauthorised access
   or use of this system is prohibited. Unauthorised access to or misuse
   of a computer constitutes an offence under the Computer Misuse Act 1990.
@hsiboy
hsiboy / read_floppy.vb
Created April 16, 2022 21:02
read from a floppy drive using native visual basic (calling kernel32)
'Ripped from a post by Dragon <[email protected]> 2003
' - Also thanks to the KPD-Team and Arkadiy Olovyannikov
'
Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function SetFilePointer Lib "kernel32" (ByVal hFile As Long, ByVal lDistanceToMove As Long, lpDistanceToMoveHigh As Long, ByVal dwMoveMethod As Long) As Long
Private Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long, ByVal lpOverlapped As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
@hsiboy
hsiboy / write_floppy.vb
Created April 16, 2022 20:58
Write to a floppy disk using native visual basic (calling kernel32)
'Ripped from a post by The Dragon (Alexander) 2003
'This code is free to use but pls contact me when you use or like it
'This only works under NT/2k/XP (all NT based OS's I think)
'u can contact me for support
'[email protected]
Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
xTS25ESYS
RolandEC
[[Section Address:
SONG0000VS2
.
..
SCSI Check..