Skip to content

Instantly share code, notes, and snippets.

View pwfcurry's full-sized avatar
😺

Patrick Curry pwfcurry

😺
View GitHub Profile
@pwfcurry
pwfcurry / setupMocha.js
Created March 27, 2018 17:17
Using babel, jsdom and sinonChai with intellij/gulp
// Used to run mocha tests within intellij. Provide "--require setupMocha" to mocha to use this
require("babel/register");
var chai = require("chai");
var sinonChai = require("sinon-chai");
var jsdom = require("jsdom").jsdom;
global.document = jsdom("");
global.window = document.defaultView;
Object.keys(document.defaultView).forEach((property) => {
if (typeof global[property] === "undefined") {
@pwfcurry
pwfcurry / gist:13353a416a3b0cde5cacf98bfe30680d
Created November 27, 2017 13:55
check host is listening on port
nc -zv hostname port
nc -l -p 9000 -c "nc 127.0.0.1 10353"
// "forward" 10353 to 9000 so it can be accessed externally
@pwfcurry
pwfcurry / process_count.sh
Last active August 18, 2017 11:56
track open files and processes
#!/bin/bash
while(true)
do
echo `date`, `ps -Al | wc -l 2>&1`, `lsof -u jenkins | wc -l 2>&1` | tee -a ./process_count.log
sleep 1
done