Skip to content

Instantly share code, notes, and snippets.

View kchristensen's full-sized avatar

Kyle Christensen kchristensen

View GitHub Profile
@kchristensen
kchristensen / gist:9725241
Created March 23, 2014 16:07
Hot honey garlic wing sauce
1/3 c Sriracha
1/4 c coconut aminos (or Bragg's liquid aminos)
1 tsp grated ginger
3 cloves garlic (minced)
1 tbs melted ghee (or butter)
4-5 tbs honey (to taste)
Combine ingredients in a small sauce pan and reduce over low heat until it reaches your desired consistency
@kchristensen
kchristensen / check_dns_resolution.py
Last active January 3, 2016 07:28
Nagios DNS resolution health check
#!/usr/bin/env python
"""
Nagios check to test DNS resolution data pulled from Graphite
"""
import optparse
import logging
import requests
import sys
@kchristensen
kchristensen / check_haproxy_health.py
Last active August 31, 2021 23:07
Nagios Haproxy Health Check
#!/usr/bin/env python
import sys
import urllib2
if len(sys.argv) != 2:
print('USAGE: {0} <hostname>').format(sys.argv[0])
sys.exit(2)
try:
@kchristensen
kchristensen / php_watch.php
Last active April 18, 2016 20:45
Inotify example
<?php
$fd = inotify_init();
$watch_dir = '/tmp/';
$watch_email = 'kyle@crowdgather.com';
$new_files = array();
$last_event = time();
$interval = 10;
stream_set_blocking($fd, 0);
#!/bin/sh
# Edit in the commands you want to run
COMMAND="uptime"
unset CHAR PASS CONFIRM
echo -n "Enter webserver root password: "
while IFS= read -r -s -n1 CHAR
do
@kchristensen
kchristensen / gist:eb4bd6aa3200dafbe52d
Last active December 12, 2015 07:49
PHP Globals micro optimization
/*
foreach ($GLOBALS as $field => $value)
{
if (!in_array($field, array('_ENV', '_POST', '_GET', '_SERVER', '_FILES', '_REQUEST', 'GLOBALS', '_COOKIE')))
{
$data[$field] = $value;
}
}
*/