Skip to content

Instantly share code, notes, and snippets.

#!/usr/local/bin/powershell -File
<#
.EXAMPLE
~/scripts/Get-MyCommits.ps1 | pbcopy
Commits since 4 am today copied to Mac OS clipboard
.EXAMPLE
~/scripts/Get-MyCommits.ps1 "5/1" "6/1" "Commits in May" -ShowDates
@n8v
n8v / check_facebook_friends.js
Created September 21, 2012 09:17
Sample Nagios plugin to check # of Facebook friends.
#!/usr/bin/env node
/* -*- js2 -*- */
var util = require('util');
/* ************************************************************* */
// Set up classes to support Range objects. Ported from
// Nagios::Plugin::Range. See named functions below.
// TODO: Modularize properly/idiomatically.
@n8v
n8v / check_site_ux.js
Created September 15, 2012 07:18
Nagios plugin example using Phantomjs headless webkit browser through the nice Casperjs API
#!/usr/local/bin/casperjs
/* js2 */
var casper = require('casper').create({
// iphone5 fullscreen portrait: 1136-by-640
viewportSize: {
width: 640,
height: 1136
}
});
@n8v
n8v / check_stuff.js
Created September 15, 2012 06:21
Example Nagios plugin using Node.js
#!/usr/bin/env node
/* -*- js2 -*- */
/* ************************************************************* */
// Set up classes to support Range objects. Ported from
// Nagios::Plugin::Range. See named functions below.
// TODO: Modularize properly/idiomatically.
/*
* Represents a Nagios plugin range object.
@n8v
n8v / check_backup.pl
Created September 14, 2011 23:16
Nagios Plugin for checking a backup file for existence, age and size.
#!/usr/bin/perl
### check_backup.pl
# By Nathan Vonnahme, Sept 2011
# An example for "Writing Custom Nagios Plugins in Perl" at the Nagios
# World Conference North America 2011.
# I. Prologue
@n8v
n8v / check_tap.pl
Created June 2, 2011 21:49
Nagios Plugin for checking Test Anything Protocol (TAP) output
#!/usr/local/bin/perl
### check_tap.pl
# By Nathan Vonnahme, n8v at users dot sourceforge dot net, June 2 2011
# Allows Nagios to check the output of anything that emits Test Anything
# Protocol.
# See http://en.wikipedia.org/wiki/Test_Anything_Protocol