Skip to content

Instantly share code, notes, and snippets.

View morungos's full-sized avatar

Stuart Watt morungos

View GitHub Profile
@morungos
morungos / .block
Last active June 22, 2018 20:41 — forked from NPashaP/.block
Comparison to d3.chord
license: gpl-3.0
@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 / 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 / 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));