Skip to content

Instantly share code, notes, and snippets.

@scottchiefbaker
scottchiefbaker / prng-benchmark.ino
Last active March 5, 2025 21:44
Quicky benchmark to compare 32bit and 64bit PRNGs on an ESP32
#include <stdint.h>
static uint64_t s[8];
static uint32_t r[2];
static uint64_t sm;
static uint64_t fs[4];
// PCG uses a structure
typedef struct { uint64_t state; uint64_t inc; } pcg32_random_t;
pcg32_random_t rng;
@scottchiefbaker
scottchiefbaker / reencode
Last active August 25, 2024 21:36
FFMPEG reencode helper script
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dump::Color;
use File::Basename;
use Getopt::Long;
use JSON::PP;
use Cwd 3.75 qw(abs_path);
use Time::HiRes qw(time);
// https://github.com/rweather/arduinolibs/tree/master/libraries/Crypto
#include <SHA256.h>
#define HASH_SIZE 32 // Bytes
#define LED_PIN 2 // LED pin to blink while we crunch SHA256
#define debug 0
// SHA256 via C++ char strings (much faster than Arduino Strings)
char *sha256hex(const char *input, char *outhex) {
SHA256 hash;
import sys
# Make sure we have enough arguments to start
if len(sys.argv) != 3:
print("Usage: %s [base] [Sekrit Message]" % sys.argv[0])
exit()
# Print out the letter base, and build the dictionary
dict = {}
for i in range(1,27):
#!/usr/bin/perl
###################################################
# Scott Baker - 2008-03-06
# Released under the GPLV3
#
# A simple script to roll dice, or multiple dice
# Example: Roll two d20 and add 10
# ./dice_roll.pl 2d20+10
#
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dump::Color;
use Date::Parse;
###############################################################################
###############################################################################
@scottchiefbaker
scottchiefbaker / cbr2cbz
Created December 4, 2017 17:43
Convert .cbr to .cbz
#!/bin/bash
# Turn on super debug mode
#set -x
for i in "$@"
do
# Store the current directory
od=$PWD
#a=$(mktemp --directory) && cd $a
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dump::Color;
use Getopt::Long;
use JSON;
my ($all,$pretty,$create,$remove,$ssid,$site_id,$pwd);
#!/usr/bin/perl
use Data::Dump::Color;
use File::Basename;
use strict;
use warnings;
my @profiles = (
# VideoBW, AudioBW, VideoHeight