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 February 20, 2018 22:49
TEAM Engine context.xml for Tomcat 9

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.

@openfirmware
openfirmware / td-agent.conf
Created November 28, 2017 20:52
Fluentd configuration for matching ElasticSearch 1.3 logfiles
# Will match multi-line errors, as the first line will be a timestamp
# and only sometimes will there be additional lines with Java
# stacktraces.
# We use the timekey from the log file and trust it, but discard the
# fractional seconds — they don't parse for me, but that may be due
# to a different version of Ruby.
#
# The following fields will be parsed:
# - time: timestamp
# - loglevel: INFO, WARN, etc.
@openfirmware
openfirmware / gist:aa923580de4511144e8f59d3cb112236
Created October 26, 2017 17:45
tilestrata-vtile-raster test configuration results
I tested various configurations of `tilestrata-vtile-raster` to see which ones passed tests as I try to track down an issue where tile buffer size does not seem to be applied.
tested configurations that pass:
mapnik 3.5.14
tilestrata 2.0.2
tilestrata-vtile 0.5.3
tilestrata-vtile-raster 0.5.0
mapnik 3.5.14
@openfirmware
openfirmware / prerender.sh
Created September 12, 2017 18:44
Script to automate render_list from mod_tile/renderd. It will generate tiles for all or some renderd styles, rendering one zoom level at a time.
#!/bin/bash
set -e
RENDER_BIN="/usr/local/bin/render_list"
# Default Options
ALL_STYLES=1
CATCH_SIGPIPE=1
CONFIG="/etc/renderd.conf"
RENDER_OPTS=()
#!/bin/bash
set -e
# openstreetmap-tiles-update-expire will either initialize a replication system
# or run a replication to sync the OSM master database to a local database.
#
# Run openstreetmap-tiles-update-expire with a single argument in YYYY-MM-DD
# format to initialize the replication system to sync from that date. If you
# just did an osm2pgsql import, then use the date of the planet file as your
@openfirmware
openfirmware / zfs-backup-readme.md
Created December 13, 2016 17:31
Snapshot and backup a ZFS filesystem to a secondary pool

ZFS Backup Script

I use this script to backup a ZFS filesystem used for PostgreSQL and OpenStreetMap data. The script creates a new snapshot with the current date (YYYY-MM-DD), estimates the size between this snapshot and the previous snapshot, then transfers the snapshot to a secondary backup pool using ZFS send. The progress of the transfer is displayed with pv.

This script will not destroy snapshots. It will print out the destroy command if you want to remove the old snapshot from the primary pool to free up space.

This was created for ZFS on Linux; BSD users may have to replace some of the tools.

Requirements

@openfirmware
openfirmware / info.md
Created August 23, 2016 23:52
Read from a serial port, print to screen and file with ISO timestamp with milliseconds

Run this, changing path to serial for your setup:

$ ruby read.rb /dev/cu.usbmodem1411

Output will be appended to serial.log in the current directory. Use control-C to exit. Connection will also be terminated if Arduino resets.

@openfirmware
openfirmware / renderd.conf
Created June 6, 2016 17:32
Upstart config for controlling renderd on Ubuntu 14.04 LTS
description "renderd"
start on started-postgresql
stop on stopped-postgresql
respawn
setuid www-data
setgid www-data
pre-start script
@openfirmware
openfirmware / nginx-site.conf
Created May 2, 2016 18:08
nginx proxy to VLC HTTP stream to add CORS headers
server {
listen 8000;
server_tokens off;
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
@openfirmware
openfirmware / check_replag.sh
Created July 27, 2015 20:12
Nagios-compatible script for reporting the replag of a mod_tile tile server
#!/bin/bash -e
# check_replag Nagios plugin for monitoring mod_tile replag value
# Copyright (c) 2015
# Written by James Badger
# Released under the GNU Public License
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or