Skip to content

Instantly share code, notes, and snippets.

View wader's full-sized avatar
🦫

Mattias Wadman wader

🦫
View GitHub Profile
@wader
wader / Dockerfile
Created March 13, 2025 11:51
alpine rust local key crash (failed reproduction)
# docker build --platform linux/amd64 --progress=plain .
FROM alpine:3.21.0
RUN apk add --no-cache \
coreutils \
rust cargo cargo-c \
bash \
build-base
@wader
wader / mediainfo_diff_aac_samples.md
Last active January 27, 2025 12:56
How diff AAC samples using mediainfo

Clone https://github.com/jlesage/docker-mediainfo

Apply patch to make mediainfo dump full AAC samples for --Details=1

diff --git a/src/mediainfo/build.sh b/src/mediainfo/build.sh
index 4183259..2de6c8d 100755
--- a/src/mediainfo/build.sh
+++ b/src/mediainfo/build.sh
@@ -79,6 +79,8 @@ rm -r \
     /tmp/MediaInfoLib/Project/zlib \
2024-12-13T12:32:29.7823319Z Current runner version: '2.321.0'
2024-12-13T12:32:29.7877465Z ##[group]Operating System
2024-12-13T12:32:29.7878963Z Ubuntu
2024-12-13T12:32:29.7879748Z 22.04.5
2024-12-13T12:32:29.7880653Z LTS
2024-12-13T12:32:29.7881427Z ##[endgroup]
2024-12-13T12:32:29.7882327Z ##[group]Runner Image
2024-12-13T12:32:29.7883517Z Image: ubuntu-22.04
2024-12-13T12:32:29.7884420Z Version: 20241211.1.0
2024-12-13T12:32:29.7886235Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20241211.1/images/ubuntu/Ubuntu2204-Readme.md
@wader
wader / radix.jq
Last active November 28, 2024 16:27
# based on fq's to/from radix code https://github.com/wader/fq format/math/radix.jq
# Usage:
# $ jq -n -L . 'include "radix"; "fe" | from_radix(16)'
# 254
# $ jq -n -L . 'include "radix"; 254 | to_radix(16)'
# "fe"
def from_radix($base; $table):
( if type == "string" | not then error("cannot from_radix convert: \(.)") end
| split("")
@wader
wader / main.go
Created October 6, 2024 08:54
caddy main
package main
import (
caddycmd "github.com/caddyserver/caddy/v2/cmd"
// plug in Caddy modules here
_ "github.com/caddyserver/caddy/v2/modules/standard"
)
func main() {
FROM ubuntu:noble
RUN apt-get update
RUN apt install -y build-essential \
pkg-config \
autoconf \
libtool \
wget \
sqlite3 libsqlite3-dev \
git
RUN wget "https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-1.7.1.tar.gz" &&\
FROM ubuntu:noble
RUN apt-get update
RUN apt-get install -y build-essential pkg-config sqlite3 libsqlite3-dev libjq-dev git
RUN git clone https://github.com/Florents-Tselai/liteJQ.git
RUN cd liteJQ && make && make test
package network
import (
"encoding/json"
"os"
"path/filepath"
"strconv"
"sync"
"time"
@wader
wader / player
Last active November 10, 2023 12:08
jupyter notebook bash kernel audio and video player helper script
#!/bin/sh
# Usage in cell to autoplay and loop:
# ffmpeg ... && ./player -al test.mp4
# -a for autoplay
# -l for loop
# -m for mute
# -w <width> for video player width
# -h <height> for video player height
TAGS="controls"
{
"descriptions": [
[
6,
"header",
"GIF89a"
],
[
2,
"width",