Skip to content

Instantly share code, notes, and snippets.

View Riebart's full-sized avatar

Mike Riebart

View GitHub Profile
@Riebart
Riebart / gist:d29cc07c828282d7d30a750a71a138ad
Created June 25, 2025 03:07
Getting the video and image data from a USB infrared camera
# Quirks source: https://forums.raspberrypi.com/viewtopic.php?t=376245
ffmpeg -input_format yuyv422 -video_size 256x196 -i /dev/video0 -pix_fmt yuyv422 -f rawvideo - | ffplay -pixel_format gray16le -video_size 256x196 -f rawvideo -i - -vf 'signalstats, split [main][secondary]; [main] normalize=smoothing=10, format=pix_fmts=rgb48, pseudocolor=p=inferno
sudo nano /etc/modprobe.d/uvcvideo.conf
#type: options uvcvideo quirks=0x02
#ctrl + x then enter to save
#reboot
#check that it worked with : cat /sys/module/uvcvideo/parameters/quirks
#should read as "2"
#then have a crack at it, should work :)
@Riebart
Riebart / encoding_options.json
Last active September 27, 2023 21:44
Generate a matrix of ffmpeg commands from a set of inputs.
{
"hevc_nvenc": {
"preset": [
"p7"
],
"tune": [
"hq"
],
"rc:v": [
"vbr"
@Riebart
Riebart / track_stuff.sh
Last active September 19, 2023 15:50
Some basic network monitoring scripts
#!/bin/bash
# Perform some basic DNS, TCP, TLS, and ICMP testing targeting a remote endpoint or two,
# to spot transient issues you'd normally miss in 5-minute aggregate date
#
# DNS-TCP pings are emitted as a CSV to stdout, floodping is emitted to stderr
# Example of how to run it and capture both outputs.
# NOTE: In the stderr redirect target shell, the stdout gets captured by the stdout subshell,
# so we need to foce that to stderr.
@Riebart
Riebart / README.md
Last active September 18, 2023 16:24
Proxy a Yubikey or smart card through from Windows to WSL2 with just socat.

HowTo Use

Windows

  • Install gnupg for Windows from gnupg.org (NOT GP4Win, the regular one).
  • Plug in your Yubikey, and run gpg --card-status, and make sure it emits some useful output about the card.

WSL1

We need WSL1 to act as the network proxy between the Windows TCP litening assuan socket, which is only on localhost, and a tcp socket listening on a host port that we can access from WSL2.

@Riebart
Riebart / test_ask.cpp
Created September 4, 2022 16:46
A simple test of ASK between two threads using a volatile incrementing global between them
#include <stdio.h>
#include <thread>
#include <random>
#include <stdint.h>
#include <utime.h>
#include <unistd.h>
#include <atomic>
float READ_NOISE_RATIO = 0.0;
int32_t swap_write_count = 0;
@Riebart
Riebart / contentdump.py
Created November 2, 2021 13:40
Brief mitmdump module for dumping content of responses to a file, and keeping track of what files are which URIs in a map JSON.
"""
Mitmdump extension script that can be used to dump content to disk in a way that can be processed after the fact by arbitrary tools.
"""
import time
import uuid
import json
import os.path
from mitmproxy import http
@Riebart
Riebart / ffmpeg_multitrack_audio.sh
Created October 19, 2021 17:41
ffmpeg Record multichannel audio from multiple sources to a single file
#!/bin/bash
# get device names from: ffmpeg -list_devices true -f dshow -i dummy
ffmpeg \
-f dshow -ac 1 -i audio="Audio Input Device A" \
-f dshow -ac 1 -i audio="Audio Input Device B" \
-ac 2 -filter_complex "[0:a][1:a]amerge[outA]" -map "[outA]:a" multitrack_out.wav
@Riebart
Riebart / test_ciphers.sh
Created October 2, 2021 00:42
Remote SSL Cipher Test
#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=$1
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]}
@Riebart
Riebart / gs_pdf_squash.sh
Created June 7, 2021 20:48
Squashing a PDF with ghostscript
#!/bin/bash
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf PDFsam_merge.pdf