Skip to content

Instantly share code, notes, and snippets.

View morungos's full-sized avatar

Stuart Watt morungos

View GitHub Profile
@morungos
morungos / php-fpm-proxy.js
Last active August 27, 2021 23:49
Run a proxy to a php-fpm server for testing php applications
const express = require('express');
const morgan = require('morgan');
const path = require('path');
const fastCgi = require('fastcgi-client');
const log4js = require("log4js");
const logger = log4js.getLogger();
logger.level = "debug";
const args = require('minimist')(process.argv.slice(2));
@morungos
morungos / restrict-default-route
Created May 5, 2019 20:53
Handy default route rule for debian
#!/bin/bash
## Only the DHCP server talking to eth0 is allowed to give us a default
## route. Other interfaces only get local-segment configuration.
case ${interface} in
enp0s8)
;;
*)
unset new_routers
;;
esac
@morungos
morungos / gist:c12d2c1e0f11238f505b664d8048bedf
Created November 13, 2018 16:20
Stuart's script for grabbing MySQL data over ssh and dumping into sqlite3
ssh aps1.cluster.turalt.com mysqldump --complete-insert --compatible=ansi --no-create-db --no-create-info --ignore-table=turalt.knex_migrations --ignore-table=turalt.knex_migrations_lock --skip-opt -uturalt -pturalt turalt | sed -e 's/\\\"/"/g' | sed -e "s/\\\'/''/g" > ~/compatible-ansi.sql
rm dev.sqlite3
npx knex migrate:latest
sqlite3 dev.sqlite3
sqlite> begin transaction;
sqlite> .read /Users/stuart/compatible-ansi.sql
sqlite> commit;
sqlite> .quit
@morungos
morungos / .block
Last active June 22, 2018 20:41 — forked from NPashaP/.block
Comparison to d3.chord
license: gpl-3.0
@morungos
morungos / .block
Created August 9, 2017 14:24 — forked from mbostock/.block
Bullet Charts
license: gpl-3.0
@morungos
morungos / audit.yml
Created June 15, 2017 15:03
Ansible plays to build a table of pushed deployments
---
- name: "Local action: Mark the deployment"
local_action: shell echo '|' `git log -n1 | grep -E "^commit"` '|' {{inventory_hostname}} '|' `date` '|' `whoami` '|' >> deploy.md
run_once: yes

Keybase proof

I hereby claim:

  • I am morungos on github.
  • I am morungos (https://keybase.io/morungos) on keybase.
  • I have a public key ASCd1oTZKTv3xw9lQKbNRRAD7l40-Z_S-1hawBYo4Tk_wgo

To claim this, I am signing this object:

--- WordNet-3.0/src/stubs.c 2007-01-04 12:47:55.000000000 -0500
+++ WordNet-3.0.1/src/stubs.c 2014-05-15 15:05:32.000000000 -0400
@@ -40,8 +40,7 @@ int wn_findvalidsearches (ClientData cli
char *morph;
int pos;
if (argc != 3) {
- interp -> result =
- "usage: findvalidsearches searchword partofspeechnum";
+ Tcl_SetResult(interp, "usage: findvalidsearches searchword partofspeechnum", TCL_DYNAMIC);
return TCL_ERROR;
@morungos
morungos / gist:9420347
Created March 7, 2014 21:20
Recursively search a directory of compressed XML files for something, using parallel stuff for performance
find . -name '*.xml.gz' -print0 | sort -z | xargs -r0 -I "{}" -P 4 sh -c "gzip -d -c {} | grep --label={} -H 1229467"
@morungos
morungos / gist:8866319
Last active August 29, 2015 13:56
Stuart's OSX plist for MongoDB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.mongodb.mongod</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mongodb/bin/mongod</string>