Skip to content

Instantly share code, notes, and snippets.

View grantc's full-sized avatar

Grant Croker grantc

View GitHub Profile
@grantc
grantc / function.js
Created May 9, 2018 06:56 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
@grantc
grantc / haproxy.cfg
Created November 13, 2017 15:44 — forked from thisismitch/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@grantc
grantc / renice-audio.sh
Last active April 18, 2017 11:04 — forked from redolent/renice-audio.sh
Fix Bluetooth Audio on Mac
#!/bin/bash
list="$(
sudo ps -A \
| grep -iE '([h]ear|[f]irefox|[c]hrome|[b]lue|[c]oreaudiod)' \
| cut -c 1-90
)"
pids=$( cut -c 1-6 <<< "$list" )
@grantc
grantc / cppunit.patch
Created November 21, 2012 09:13 — forked from peoplemerge/java.env
Zookeeper RPM spec for CentOS 5.x/6.x, including python bindings
--- src/c/configure.ac.orig 2012-11-21 10:30:09.966335111 +0100
+++ src/c/configure.ac 2012-11-21 10:30:45.536188378 +0100
@@ -22,27 +22,6 @@
AC_CONFIG_HEADER([config.h])
# Checks for programs.
-AC_ARG_WITH(cppunit,
- [ --without-cppunit do not use CPPUNIT])
-
-if test "$with_cppunit" = "no" ; then