Skip to content

Instantly share code, notes, and snippets.

View wjlafrance's full-sized avatar
🐶
Wondering if Github is becoming a social network.

William LaFrance wjlafrance

🐶
Wondering if Github is becoming a social network.
View GitHub Profile
@wjlafrance
wjlafrance / prepare-film-scan-upload.clj
Last active April 22, 2024 19:29
Prepare to copy and zip JPG's and DNG's for upload to NAS fileshare
#!/usr/bin/env bb
(use '[clojure.string :as str])
(def sh-newline-indent " \\\n ")
(defn mk-file-list
[files]
(->> files
(partition 4 4 []) ; providing even an empty padding collection makes partition return non-full slices
@wjlafrance
wjlafrance / gpx.fmt
Last active February 19, 2023 09:20
Ingest GoPro videos, extract telemetry with exiftool, and merge/compress with ffmpeg
#------------------------------------------------------------------------------
# File: gpx.fmt
#
# Description: Example ExifTool print format file to generate a GPX track log
#
# Usage: exiftool -p gpx.fmt -ee3 FILE [...] > out.gpx
#
# Requires: ExifTool version 10.49 or later
#
# Revisions: 2010/02/05 - P. Harvey created
@wjlafrance
wjlafrance / arch486.md
Last active January 8, 2023 00:15
Install Arch Linux i486
  • Promox / QEMU VM, 512MB RAM, 128GB SCSI HD, 1 core pentium
  • IBM ThinkPad 600, 128MB RAM, 100GB ATA HD, 1 core pentium 2 (deschutes)

Begin by booting archlinux32-2021.07.16-i486.iso.

Partition the hard disk:

$ fdisk /dev/sda
@wjlafrance
wjlafrance / gist:7b8de2149bf66f64df543ba9c5c386ba
Created April 3, 2022 16:09
Samsung 970 EVO Plus worn out
# smartctl -a /dev/nvme0
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.13.19-2-pve] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: Samsung SSD 970 EVO Plus 250GB
Serial Number: redacted
Firmware Version: 2B2QEXM7
PCI Vendor/Subsystem ID: 0x144d
IEEE OUI Identifier: 0x002538
@wjlafrance
wjlafrance / install.md
Last active September 28, 2022 14:43
Install proxmox on NVMe drives with USB boot disk

I'm installing Proxmox on an HP ProLiant DL360p Gen8 server, which cannot boot from NVMe. The NVMe drives are each installed on single-slot M.2 adapters in the rear PCIe slots.

  1. Install Proxmox as "zfs raid1" (their installer uses wrong terminology) on two NVMe drives. Consider turning compression off. This Proxmox installation will be the actual instance that gets used, but is not currently bootable on this system.
  2. Re-run the installer and install Proxmox on a flash drive as a single-drive zfs pool. I used 16GB, not sure if 8GB will suffice.
  3. Reboot from the flash drive. This will load grub, but throw an error there are now two pools called rpool and one of them was last imported on another system. You'll be dropped into a BusyBox shell.
  4. Import the NVMe-based pool by id. Run zpool import to list available pools, find the pool with two NVMe drives, and run zpool import -f 123456. exit the BusyBox shell, and the system will now boot the Proxmox instance installed in step 1.
  5. Grab a Proxmox
@wjlafrance
wjlafrance / CovidVaccinationBestCounties.rb
Created November 26, 2021 18:06
Sorting Wisconsin counties by best vaccination rate
# https://www.dhs.wisconsin.gov/covid-19/data.htm#summary
require 'csv'
data = CSV.read("/home/lafrance/Downloads/COVID-19_Vaccination_Data_by_County.csv")
counties = {}
for line in data do
county = line[1]
onedose = line[3]
@wjlafrance
wjlafrance / QiChargerStand.scad
Created July 7, 2021 01:03
QiChargerStand.scad
phoneHeight = 165;
phoneWidth = 85;
crossarmSize = 8;
crossarmWidth = phoneWidth + crossarmSize * 2 + 2;
crossarmPosition = (phoneHeight - phoneWidth) / 2;
backWidth = 60;
backHeight = 135;
backDepth = 15;
(5185, 663, 0, 5185, 'Bot Developers -- Useful Information', 'n00blar', 'wingate2@hotmail.com', 1041519376, '68.47.226.6', 1, 0, '1048312800', 'This information is from a jump table called in the RecvThreadProc, my brother indulg traced and documented the packets! heh =p<br><br>[code]<br>// jump table called in RecvDataThread to identify the packet type<br><br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// PKT_GAMEDATA &nbsp; &nbsp; &nbsp; &nbsp;= 0x00<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// PKT_CLIENTREQ &nbsp; &nbsp; &nbsp; &nbsp;= 0x03<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// PKT_SERVERPING &nbsp; &nbsp; &nbsp;= 0x05<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// PKT_SELFPING &nbsp; &nbsp; &nbsp; &nbsp;= 0x06<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// PKT_KEEPALIVE &nbsp; &nbsp; &nbsp; &nbsp;= 0x07<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// PKT_CONNTEST &nbsp; &nbsp; &nbsp; &nbsp;= 0x08<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// PKT_CONNTEST2 &nbsp; &nbsp; &nbsp; &n
@wjlafrance
wjlafrance / gist:459d20eb6add423acf67805494d2bba8
Created September 29, 2020 21:10
FinaleBot_CheckRevision.swift
import Foundation
import CryptoSwift
enum CheckRevision {
enum CheckRevisionError: Error {
case formulaNotBase64
case formulaTooShort
case unparseableVersion
}
@wjlafrance
wjlafrance / oo.c
Created May 26, 2020 21:38
Object Oriented C Example
#import <stdio.h>
#import <stdlib.h>
typedef enum {
heart = 0,
spade = 1,
diamond = 2,
club = 3
} Suit;