Skip to content

Instantly share code, notes, and snippets.

View DavidGriffith's full-sized avatar

David Griffith DavidGriffith

View GitHub Profile
@DavidGriffith
DavidGriffith / bootable-flash.txt
Created March 17, 2017 04:21
Debian installer on a USB key with a writable file system.
Debian installer on a USB key with a writable file system.
I couldn't find a concise article about creating a Debian installer USB
key with a writable file system, so here is my take. This assumes you
have an available Linux system. Note that some old BIOSes might not
happily boot USB drives created in this way.
* Install the packages syslinux dosfstools mbr
* Insert the thumb drive and find the device using dmesg
* Install a Master Boot Record to the drive (install-mbr /dev/sdX)
#!/bin/sh
# This script changes instances of <actor, Action> to <Action, actor> so
# that the current Inform6 compiler can compile test programs using the
# Inform6 Library between commits
# 9abf2dd82318ad5406ee2f171462e8c7ed596e5b and
# 5426af94aa57ade55ba7928f4eed6e47b314f0ca inclusive.
# To reverse this, just do "git checkout -f verblibm.h"
@DavidGriffith
DavidGriffith / fortune.pl
Created June 23, 2014 09:29
A simple way to serve up fortunes on a webpage.
#!/usr/bin/perl -w
# This script picks a fortune out of a fortune file and prints it.
# We start by counting the number of fortune separators there are in the file
# '%'. Pick a random number from zero to the number of separators found.
# Then rewind the file and count out that many separators.
# Next we load the upcoming fortune into a string, making sure not
# load the trailing separator, if there is one. Then print.
# This script is optimized for memory usage.
@DavidGriffith
DavidGriffith / eps2svg.sh
Created March 6, 2013 07:35
EPS to SVG vector command line image converter
#!/bin/sh
# eps2svg: EPS to SVG vector command line image converter
# David Griffith <davidgriffith@acm.org>
# Created March 30, 2009 and released into the public domain
# The programs pstoedit and skencil are required.
EXT="svg"
USAGE="usage: eps2svg [-v] input.eps [output.svg]\n -v verbose mode"
@DavidGriffith
DavidGriffith / isbn2bib.pl
Last active August 20, 2022 12:16
Reads ISBN numbers from a file, checks them for validity, fetches the corresponding data from isbndb.com, then outputs a BibTeX file with all fields set accordingly. An API key from isbndb.com is required; see NOTES below.
#!/usr/bin/env perl
# David Griffith <davidgriffith@acm.org>
# isbn2bib version 0.4
# Copyright December 11, 2010
#
use strict;
use warnings;