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 / mds2midi.py
Last active April 12, 2024 00:05
MDS to standard MIDI file converter
#!/usr/bin/env python3
#
# MDS to standard MIDI file converter
#
# see also http://www.vgmpf.com/Wiki/index.php?title=MDS
#
import argparse
import io
import struct
from typing import BinaryIO, List, Optional
@RavuAlHemio
RavuAlHemio / exmp3.py
Created May 9, 2014 09:02
find and extract MP3 files from a binary file
#!/usr/bin/env python3
from math import floor
import struct
mp3_bit_rates = {
0b0001: 32000,
0b0010: 40000,
0b0011: 48000,
0b0100: 56000,
0b0101: 64000,
@RavuAlHemio
RavuAlHemio / FritzBox_Adapter_058.svg
Last active February 13, 2024 20:08
FRITZ!Box Austrian/Swiss adapters (plugs are oriented towards the user!)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RavuAlHemio
RavuAlHemio / Restoring an utterly destroyed DFSR-replicated SYSVOL from backup.md
Last active January 29, 2024 10:24
Steps to restore an utterly destroyed DFSR-replicated SYSVOL from backup

Restoring an utterly destroyed DFSR-replicated SYSVOL from backup

Warning: this is not official Microsoft documentation and some of these steps might not actually be supported.

This guide is provided "as is", without warranty of any kind, express or implied. In no event shall the authors or copyright holders be liable for any claim, damages or other liability arising from, out of or in connection with applying the steps outlined in this guide.

When to use

@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 / payne.c
Created July 14, 2018 19:29
Max Payne 2 .ras file encryption/decryption algorithm
#include <stdint.h>
#include <stdio.h>
static uint8_t ror8(uint8_t input, size_t rot_bits)
{
uint8_t rot = (uint8_t)(rot_bits % (sizeof(input) * 8));
return (input >> rot) | (input << ((sizeof(input) * 8) - rot));
}
static uint8_t rol8(uint8_t input, size_t rot_bits)
@RavuAlHemio
RavuAlHemio / Encrypt-SpanishWord.ps1
Last active October 12, 2022 09:19
encrypt and decrypt Spanish Wordle solutions
[CmdletBinding()]
Param (
[Parameter(Position=1,Mandatory=$true)]
[string]
$Word,
[Parameter(Position=2)]
[byte[]]
$FixedSalt
)
@RavuAlHemio
RavuAlHemio / BaseTech_1602089.svg
Last active May 12, 2022 03:41
BaseTech telephone plug adapters (plugs are oriented towards the user!)
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" `