Skip to content

Instantly share code, notes, and snippets.

View openfirmware's full-sized avatar

James Badger openfirmware

View GitHub Profile
@openfirmware
openfirmware / README.markdown
Created October 25, 2022 04:45
Proxmox Virtual Environment 7 on Raspberry Pi 3B

PVE 7 on RPi 3B

(Raspberry Pi OS Debian Bullseye)

This is useful for testing but the 3B sure is slow! Follow instructions at your own risk (and time) and no support is provided.

These instructions also include setup for SSH certificates and host certificates using a self-hosted Certificate Authority (step-ca). I also have a self-hosted zone (me.home.arpa) on my network to provide a local DNS. This process should also work with SSH keys.

Requirements

@openfirmware
openfirmware / README.markdown
Created February 18, 2021 18:45
Restoring Confluence Backups to a VM

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.

Requirements

  • A Confluence backup archive
  • A Linux Virtual Machine (Vagrant, VirtualBox, etc)
  • An Internet Connection (to get the Confluence trial license)
@openfirmware
openfirmware / README.md
Created November 18, 2019 22:25
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
openfirmware / README.markdown
Last active May 17, 2019 18:43
How to add a mask to a GeoTIFF using Photoshop

HOW TO CREATE A TRANSPARENT MASK ON A GEOTIFF

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
openfirmware / chat-overlay.css
Created April 27, 2019 21:15
CSS for OBS chat overlay
/**
* https://www.twitch.tv/popout/openfirmware/chat?darkpopout
*
* General Settings
*/
body {
color: #FFFFFF;
background: rgba(0,0,0,0) !important;
}
@openfirmware
openfirmware / recent.applescript
Created March 31, 2019 22:42
Open first recent folder (alphabetical sorted) in Finder
tell application "System Events" to tell process "Finder"
set frontmost to true
tell menu bar item "Go" of menu bar 1
click
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
openfirmware / readme.markdown
Created March 28, 2019 19:29
ST_MakeValid and other functions on libspatialite/GDAL on MacOS with Homebrew
$ 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
openfirmware / recipe.rb
Created December 13, 2018 17:06
Chef Bash Resource without mangling interpolated variables
# 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 icingaweb_user.name = '#{username}';"
EOH
sensitive true
@openfirmware
openfirmware / Nova.markdown
Last active November 14, 2018 07:56
Escape Velocity: Nova on MacOS High Sierra

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
openfirmware / instructions.md
Created November 7, 2018 06:07
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).