Skip to content

Instantly share code, notes, and snippets.

View reckenrode's full-sized avatar

Randy Eckenrode reckenrode

View GitHub Profile
@reckenrode
reckenrode / ffxiv-movies
Last active December 5, 2021 23:34
Copies the Bink-encoded movies from the FF XIV Mac client into a CrossOver bottle
#!/bin/dash
# Copyright © 2021 Randy Eckenrode
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@reckenrode
reckenrode / copyApplications.nix
Last active July 19, 2021 04:25
Copy applications into ~/Applications on Darwin
{ config, lib, pkgs, ... }:
{
home.activation = {
copyApplications = let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
@reckenrode
reckenrode / lan.network
Last active January 10, 2021 19:35
Network configuration
[Network]
Address=192.168._.1/24 # IPv4 address of my router
IPv6PrefixDelegation=yes # Use both delegated and static prefixes
IPMasquerade=true # Enable NAT for IPv4
[IPv6PrefixDelegation]
OtherInformation=yes # Advertise that other information is available via DHCPv6
RouterLifetimeSec=1200 # Specify a router lifetime, so the device advertises itself as one
DNS=_link_local # Advertise the link-local address as the DNS server
Domains=domain.example.com # Advertise DNS search domains
@reckenrode
reckenrode / Dockerfile
Last active November 8, 2020 06:12
Dockerfile for Foundry VTT
# syntax = docker/dockerfile:1.1-experimental
FROM alpine:latest AS build
ARG FOUNDRY_VERSION
RUN apk add --update --no-cache --update curl
RUN --mount=type=secret,id=foundry \
curl https://foundryvtt.com -c cookies.txt && \
curl -v https://foundryvtt.com/auth/login/ -b cookies.txt -c cookies.txt \
@reckenrode
reckenrode / dhcpcd.conf
Created November 2, 2020 05:10
dhcpcd and radvd configuration
denyinterfaces igb1
clientid 01:<macaddress>
persistent
# vendorclassid is set to blank to avoid sending the default of
# dhcpcd-<version>:<os>:<machine>:<platform>
vendorclassid
option domain_name_servers, domain_name, domain_search
@reckenrode
reckenrode / gen.fs
Last active April 12, 2020 01:04
OSE encounter/treasure generation (F# vs. Ruby)
open FsRandom
let inline tryParse a =
let mutable r = Unchecked.defaultof<'a>
if (^a: (static member TryParse: string * ^a byref -> bool) (a, &r))
then Some r
else None
type Stock =
Empty | Monster | Special | Trap
on("chat:message", (msg) => {
const cmdName = "sroll";
const params = msg.content.splitArgs();
const cmd = params.shift().substring(1);
if(msg.type === "api" && cmd === cmdName) {
const to_whom = msg.who.split(" ")[0];
const char_obj = findObjs({"type": "character", "name": msg.who})[0];
if (char_obj === undefined) {
sendChat(`player|${msg.playerid}`, `/w ${to_whom} To send secret rolls, you must be using a character. Please switch to your character.`);
@reckenrode
reckenrode / filter-reserved-addreses-ipv4.conf
Created January 14, 2020 03:12
Unbound configuration to filter reserved addresses
server: # IPv4
private-address: 198.18.0.0/15 # Benchmarking
private-address: 255.255.255.255/32 # Broadcast
private-address: 0.0.0.0/8 # Current network
private-address: 192.0.0.0/24 # IETF protocol assignments
private-address: 192.0.2.0/24 # IETF TEST-NET-1
private-address: 198.51.100.0/24 # IETF TEST-NET-2
private-address: 203.0.113.0/24 # IETF TEST-NET-3
private-address: 224.0.0.0/4 # IP multicast
private-address: 169.254.0.0/16 # Link-local
@reckenrode
reckenrode / reverse.fs
Created August 3, 2019 19:10
Unicode-aware string reverse in F#
open System.Text
open System
open ICU4N.Text
let reverse (str: string) =
if str.Length <= 0 then
str
else
let span = str.AsSpan ()
let breaks = seq {
[package]
name = "ability-scores"
version = "0.1.0"
authors = ["Randy Eckenrode <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rand = "0.7"