Skip to content

Instantly share code, notes, and snippets.

View coderobe's full-sized avatar
🎩
i know a thing or two about a thing or two

Mara Robin B. coderobe

🎩
i know a thing or two about a thing or two
View GitHub Profile
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# ffmpeg_sparse_parallel_merge_test.rb
#
# test sparse transcoding by:
# 1. Splitting the input into sparse jobs of N target segments
# 2. Running those sparse jobs in parallel
# 3. Using a safe merge strategy:
@coderobe
coderobe / ffmpeg_sparse_transcode_test.rb
Last active May 18, 2026 11:26
Experiments on whether sparse FFmpeg HLS/fMP4 transcodes preserve enough information to be able to splice segments from separate runs together cleanly.
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# ffmpeg_sparse_transcode_test.rb input_audio [--verbose]
#
# Check whether sparse FFmpeg HLS/fMP4 transcodes preserve enough timing
# information to splice segments from separate runs together.
#
@coderobe
coderobe / ircd-interrogate.rb
Last active May 23, 2026 13:26
interrogate remote irc networks to gather ircv3 capabilities and ISUPPORT bits
#!/usr/bin/env ruby
# USAGE: ruby ircd-interrogate.rb example.com:6697
require 'socket'
require 'openssl'
server, port = ARGV.first.split(":")
port = 6697 if port.nil?
nick = "testnick#{rand(1000)}"
@coderobe
coderobe / pinetime-glasgow.md
Last active December 3, 2024 23:36
swd flash pinetime bootloader with glasgow, macbook, and piece of wire found on ground (100% smokeless)

tl;dr

glasgow run swd-openocd --port A --pin-swclk 1 --pin-swdio 0 -V 3.3 tcp:localhost:2222
I: g.device.hardware: generating bitstream ID 98da97a3ebd449ef3ef7991939c4b823
I: g.cli: running handler for applet 'swd-openocd'
I: g.applet.interface.swd_openocd: port(s) A voltage set to 3.3 V

I: g.applet.interface.swd_openocd: socket: listening at tcp:localhost:2222

@coderobe
coderobe / underhanded-curl.rb
Last active May 23, 2026 13:27
experimental curl | bash detection and script injection
require 'socket'
require 'timeout'
# Start a TCP server on port 8080
server = TCPServer.new('0.0.0.0', 8080)
puts "Server is running on port 8080..."
# Increase the pipe buffer size significantly (e.g., 3MB)
PIPE_BUFFER_SIZE = 3 * 1024 * 1024 + 1024 # 3MB + 1KB
@coderobe
coderobe / soundcloud-scrub-fix.js
Created March 23, 2024 20:20
enables scrubbing through long tracks on soundcloud without having to be logged in
// ==UserScript==
// @name Soundcloud scrub fix
// @namespace https://coderobe.net/
// @version 0.1
// @description enables scrubbing through long tracks on soundcloud without having to be logged in
// @author Mara Broda (coderobe)
// @match https://soundcloud.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=soundcloud.com
// @grant none
// ==/UserScript==
@coderobe
coderobe / yt-playlist-total-length.js
Last active March 23, 2024 20:28
get total content play time of a youtube playlist in seconds
// open a playlist, or Watch Later (https://www.youtube.com/playlist?list=WL)
// run. doesn't work? that means the playlist is truncated. scroll all the way down and try again.
// output is in seconds. divide by 3600 for fractional hours.
ytInitialData[b="contents"]["twoColumnBrowseResults"+(i="Renderer")]
.tabs[0]["tab"+i]
.content["sectionList"+i][b][0]["itemSection"+i][b][0][(g="playlistVideo")+"List"+i][b]
.reduce((N,y,_,a)=>a[(z=y[g+i]).videoId]??=N+=+z.lengthSeconds,0)
// authors: coderobe, ilbelkyr
@coderobe
coderobe / crgl.cr
Created January 26, 2024 16:32
basic ray tracing in crystal, renders to terminal. (2020)
#!/usr/bin/env crystal
TERM = `stty size`.split(" ").map { |x| x.to_i }
WIDTH = TERM.last
HEIGHT = TERM.first - 3
FOV = 45.0
MAX_DEPTH = 6
struct Vec3
@coderobe
coderobe / glsh.sh
Last active May 23, 2026 13:27
"shadertoy" lite, software-rendered in bash & bc
#!/usr/bin/env bash
# This program was written by Mara Broda (coderobe) in 2020
printf "\033c"
trap "tput cnorm" EXIT
trap "exec bash "$(readlink -f "$0")"" SIGWINCH
tput civis
echo "starting bc coproc"
@coderobe
coderobe / gleis6.sh
Last active November 16, 2023 14:04
Renders mp4 to the demo format used by DB FIA passenger information displays - https://twitter.com/coderobe/status/1724915339513716922
#!/bin/bash
# Check if the input argument (MP4 file) is provided
if [ "$#" -ne 1 ]; then
echo "coderobe's gleis6.sh <3"
echo "Usage: $0 <inputfile.mp4>"
exit 1
fi
# Input MP4 file