Skip to content

Instantly share code, notes, and snippets.

View RavuAlHemio's full-sized avatar

Ondřej Hošek RavuAlHemio

View GitHub Profile
@RavuAlHemio
RavuAlHemio / jpeg-markers.md
Last active May 4, 2025 22:02
descriptions of all JPEG marker types

JPEG marker types

Taken from ISO/IEC 10918-1:1994.

Most hexadecimal digits are written in uppercase; b is written in lowercase to reduce confusion of B with 8.

sequence length abbr description reference to standard
FF00 0 not a marker; actual 0xFF value in entropy-coded data segment §§ D.1.6, F.1.2.3
FF01 0 TEM temporary value used during arithmetic coding § D.1.6
@RavuAlHemio
RavuAlHemio / Cisco_N20-BKVM.kicad_sch
Created April 12, 2025 21:26
blade server KVM cable pinout
(kicad_sch
(version 20250114)
(generator "eeschema")
(generator_version "9.0")
(uuid "18d66037-9dd9-450e-b3ca-189463bf472c")
(paper "A4")
(lib_symbols
(symbol "Connector:DE15_Socket_HighDensity_MountingHoles"
(pin_names
(offset 1.016)
@RavuAlHemio
RavuAlHemio / alphaconv.html
Created March 28, 2025 10:46
web page for converting text into special-use Latin alphabets in Unicode
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
<title>Alphabet Converter</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="text/javascript">
// <![CDATA[
@RavuAlHemio
RavuAlHemio / split-reassemble-hls-dash.md
Last active March 28, 2025 07:56
Splitting and Reassembling HLS/DASH Audio and Video

Splitting and Reassembling HLS/DASH Audio and Video

You might have experienced the following: you are watching a video in your browser and audio and video both work fine, but when you pass the .m3u8 URL that you found in the page's source to a download tool, the download tool makes a veritable pig's breakfast out of it -- perhaps the video works but the audio doesn't, perhaps the audio is completely desynchronized from the video, perhaps the audio appears to interrupt the video.

The likely culprit is the encoding of each video fragment. .m3u8 is actually a playlist -- a list of individual files named fragments that should be played in sequence as if they were one big video. Normally, a fragment would start with some metadata (M) and then carry video (V) and audio (A) intermingled:

MMVVVAAVVVAAVVVAA...
@RavuAlHemio
RavuAlHemio / lw2midi.py
Created June 19, 2024 14:54
LittleWing MIDI resource to Standard MIDI Format file converter
#!/usr/bin/env python3
import binascii
import io
import struct
import sys
from typing import NamedTuple
class MidiEvent(NamedTuple):
time: int
@RavuAlHemio
RavuAlHemio / mikroe-click-ble-controller.md
Created August 12, 2023 18:44
MikroE BLE Click Boards usable as controller (master)
board product ID chip usable as controller?
BLE 2 Click MIKROE-1715 RN4020 no
BLE 3 Click MIKROE-2471 NINA-B1 yes?
BLE 4 Click MIKROE-3773 NINA-B312 yes?
BLE 5 Click MIKROE-4120 PAN1760A NRND?
BLE 6 Click MIKROE-4170 BlueNRG-M2 yes
BLE 7 Click MIKROE-3872 BGX13S22GA-V31 yes?
BLE 8 Click MIKROE-3674 ANNA-B112 yes?
BLE 9 Click MIKROE-4487 BGM220P yes?
@RavuAlHemio
RavuAlHemio / http_basic_cookie_auth.py
Last active May 21, 2024 14:30
update for Werkzeug 3.0 compatibility
@RavuAlHemio
RavuAlHemio / BaseTech_1602089.svg
Last active May 12, 2022 03:41
BaseTech telephone plug adapters (plugs are oriented towards the user!)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RavuAlHemio
RavuAlHemio / FritzBox_Adapter_058.svg
Last active February 13, 2024 20:08
FRITZ!Box Austrian/Swiss adapters (plugs are oriented towards the user!)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RavuAlHemio
RavuAlHemio / run.ps1
Last active May 2, 2022 06:26
automates inserting and removing USB drives backed by a VHDX image from a QEMU VM
& "C:\Program Files\qemu\qemu-system-i386.exe" `
-cpu pentium3 `
-m 1024 `
-vga cirrus `
-drive "if=ide,bus=0,unit=0,media=disk,file=w2k_de.qcow2" `
-drive "if=ide,bus=1,unit=0,media=cdrom" `
-device sb16 `
-device "usb-ehci" `
-device "usb-tablet" `
-qmp "tcp:127.0.0.1:6969,server,wait=off" `