Skip to content

Instantly share code, notes, and snippets.


James Badger openfirmware

View GitHub Profile
openfirmware / README.markdown
Created Feb 18, 2021
Restoring Confluence Backups to a VM
View README.markdown

Restoring Confluence Backups to a VM

Do you have a Zip archive backup of your Confluence install you want to restore to a VM? This process below will let you log in and access the content. This uses the Confluence and PostgreSQL docker images with Docker Compose to make sure you have the right versions.


  • A Confluence backup archive
  • A Linux Virtual Machine (Vagrant, VirtualBox, etc)
  • An Internet Connection (to get the Confluence trial license)
openfirmware /
Created Nov 18, 2019
Ruby tool to update the "Content-Length" in VCR test fixture "cassettes" to match the body length (it skips HEAD requests)

VCR Cassette Cleaner

I made this tool to update the Content-Length header to match the bytesize of the body response in VCR cassettes. This is only necessary when the body has been manually edited (usually done to reduce the size of the YAML fixture). While VCR has an option to automatically update the Content-Length header on-the-fly (it doesn't update the cassette itself), the option also affects HEAD requests and sets their Content-Length to 0 (issue). This tool will skip HEAD requests to avoid that.

This tool has only been tested with Ruby 2.6 and VCR 5.0.0.

openfirmware / README.markdown
Last active May 17, 2019
How to add a mask to a GeoTIFF using Photoshop
View README.markdown


This is useful for georeferenced images or GeoTIFF files that have black borders caused by re-projection or warping.

Georeference the image in QGIS, and export to a GeoTIFF (original.tif). Use Photoshop to open the GeoTIFF and select the area you want to mask; in the "Layers" palette switch to the "Channels" tab and select the Alpha channel (create one if it doesn't exist). Fill the masked area with "black" in the Alpha channel, as save as a new TIFF (export.tif). Don't bother with compression when exporting from Photoshop as we are about to convert the image again.

This TIFF won't have geodata, so we will use some command line tools from libgeotiff to fix that.

$ listgeo -no_norm "original.tif" > metadata.geo
openfirmware / chat-overlay.css
Created Apr 27, 2019
CSS for OBS chat overlay
View chat-overlay.css
* General Settings
body {
color: #FFFFFF;
background: rgba(0,0,0,0) !important;
openfirmware / recent.applescript
Created Mar 31, 2019
Open first recent folder (alphabetical sorted) in Finder
View recent.applescript
tell application "System Events" to tell process "Finder"
set frontmost to true
tell menu bar item "Go" of menu bar 1
click menu item "Recent Folders" of menu 1
click menu item 1 of menu 1 of menu item "Recent Folders" of menu 1
end tell
end tell
openfirmware / readme.markdown
Created Mar 28, 2019
ST_MakeValid and other functions on libspatialite/GDAL on MacOS with Homebrew
View readme.markdown
$ brew install liblwgeom
$ export LDFLAGS="-L/usr/local/opt/liblwgeom/lib"
$ export CPPFLAGS="-I/usr/local/opt/liblwgeom/include"
$ brew edit libspatialite
(add --enable-lwgeom to configure)
$ brew reinstall -s libspatialite
$ brew install -s gdal
openfirmware / recipe.rb
Created Dec 13, 2018
Chef Bash Resource without mangling interpolated variables
View recipe.rb
# Wrong way:
bash "Add Icinga Web 2 User" do
code <<-EOH
/usr/bin/psql -U icingaweb2 -d icingaweb2 -h localhost -p 5432 \
-c "INSERT INTO icingaweb_user (name, active, password_hash) \
VALUES ('#{username}', 1, '#{hash_pw}') ON CONFLICT (name) \
DO UPDATE SET password_hash = '#{hash_pw}' \
WHERE = '#{username}';"
sensitive true
openfirmware / Nova.markdown
Last active Nov 14, 2018
Escape Velocity: Nova on MacOS High Sierra
View Nova.markdown

Running EV Nova on MacOS High Sierra

[The game][EV Nova] does not seem to want to work out of the box, but it can still be done.

MacOS Mojave: The patch doesn't work unless you patch it under High Sierra first — see below.

Download EV Nova

Ambrosia SW's servers are still online, version 1.1.1 is the latest for Mac. Install it in /Applications.

openfirmware /
Created Nov 7, 2018
QEMU with Mac OS 9 guest *and working audio*

QEMU Mac OS 9 Instructions

Here is a short guide on how to build QEMU to run Mac OS 9 with working audio. These instructions work for MacOS High Sierra as the host OS, although with some tweaking they may run under Linux/Windows. You should be comfortable compiling software from source before attempting.

Clone QEMU fork

Adapted from instructions from Cat_7

You may need to install XCode and/or the XCode command line tools. If you do not have them, then this process may prompt you to install them (MacOS will do that).

openfirmware / README.markdown
Created Feb 20, 2018
TEAM Engine context.xml for Tomcat 9
View README.markdown

TEAM Engine context.xml for Tomcat 9

TEAM Engine has instructions for usage with Tomcat 7, however using it with Tomcat 9 requires some changes to the context.xml file to work. These changes may also work with Tomcat 8/8.5.

Install this file in webapps/teamengine/context.xml.