Skip to content

Instantly share code, notes, and snippets.

@riptl
riptl / k8s_decode_secret.py
Created October 21, 2020 13:59
Python script to convert a Kubernetes secret file containing base64-encoded "data" entries to plain text "stringData" entries.
#!/usr/bin/env python3
from base64 import b64decode
import os
import sys
import yaml
if os.isatty(sys.stdin.fileno()):
print("Usage: ./decode_secret.py < secret.yaml", file=sys.stderr)
sys.exit(1)
@riptl
riptl / _RMCP01_SYMBOLS.md
Last active January 7, 2021 03:25
Mario Kart Wii RMCP01 symbols [2020-10-15]

My crude attempt at mapping out the symbols in Mario Kart Wii PAL (RMCP01). These symbols are not cleaned up yet and contain dupes.

  • Minimum function size: 24 bytes
  • Search space: 0x80000000..0x8088F400
  • Matches: 1343 (RVL) + 773 (NW4R) + 738 (RevoEX) + 651 (RVLDWC)
  • Unique addresses: 1178 (RVL) + 447 (NW4R) + 651 (RevoEX) + 624 (RVLDWC)
@riptl
riptl / remove_last_line.go
Created October 3, 2019 14:46
Go script to efficiently truncate the last line of a file. Use it when that 750GB NDJSON dump aborts in the middle of a write.
// remove_last_line efficiently truncates the last line of a file, preserving the final newline.
package main
import (
"bytes"
"flag"
"fmt"
"os"
)
@riptl
riptl / coins.json
Last active April 11, 2019 22:53
SLIP-44 to JSON
[
{
"index": 0,
"hex": "0x80000000",
"symbol": "BTC",
"name": "Bitcoin",
"link": "https://bitcoin.org/"
},
{
"index": 2,
@riptl
riptl / parseNimiqExtraData.js
Created March 17, 2019 12:05
Parse Nimiq Extra Data
function parseExtraData(extraData) {
try {
const nullSep = extraData.indexOf(0);
if (nullSep == -1)
return null;
const nameBin = extraData.slice(0, nullSep);
const name = Nimiq.BufferUtils.toAscii(nameBin);
const addrBin = extraData.slice(nullSep + 1, nullSep + 21);
const addr = new Nimiq.Address(addrBin);
return {
@riptl
riptl / nimiq_measure.html
Last active February 26, 2019 00:04
Nimiq Words Measurement for address naming concept
<html>
<head>
<title>Nimiq Word Width Measurement</title>
<style>
@font-face {
font-family: 'Muli SemiBold';
src: url("http://ftb.terorie.com/muli-semibold.woff2");
}
#textSpan {
@riptl
riptl / rtorrent_xmlrpc.txt
Created October 18, 2018 13:55
rtorrent XMLRPC methods
system.listMethods
system.methodExist
system.methodHelp
system.methodSignature
system.multicall
system.shutdown
system.capabilities
system.getCapabilities
add_peer
and
@riptl
riptl / keybase.md
Last active September 29, 2018 19:43
keybase.io verification
{
  "body": {
    "key": {
      "eldest_kid": "01203138ce4b55f668614a28ffb222aab364e44de94f98af9448e2d453c2ba9241d30a",
      "host": "keybase.io",
      "kid": "01203138ce4b55f668614a28ffb222aab364e44de94f98af9448e2d453c2ba9241d30a",
@riptl
riptl / rip_arm.py
Created July 26, 2018 04:45
download ARM PDFs
#!/usr/bin/env python3
# by terorie, 2018
# sorry ARM
import os
import requests
import lxml.html
import shutil
DUMP_DIR = 'armpdf'
@riptl
riptl / byteslicer.go
Created May 20, 2018 19:14
deserialize byte slices
package bufferutils
import "encoding/binary"
var bin = binary.BigEndian
type ByteSlicer struct {
Buf []byte
Ptr int
}