Skip to content

Instantly share code, notes, and snippets.

View patcon's full-sized avatar

Patrick Connolly patcon

View GitHub Profile
#!/usr/bin/env ruby
#
# this is a special meta-check. It runs ping checks against all hosts in
# the /endpoints API and sends individual results directly to sensu-client via
# the udp/3030 client socket. this is different from the normal sensu check model
# where individual scripts run and their exit status and output is used to create
# a single event.
#
# the reason for this check is to be able to dynamically ping a list of hosts
# without the race conditions and timing issues involved with creating individual
@patcon
patcon / README.md
Created July 26, 2013 19:00
Idea: Create tool to convert Know Your Company emails into word clouds

KYC Word Cloud Generator

Know Your Company is a service being piloted by 37signals, which aims to help employees at medium sized businesses stay connected. It sends regular weekly emails, to which reply is optional. These emails ask either stand-up-type questions or fun get-to-know-one-another questions, and later compile them into a nice message and sends it out to everyone.

Sometimes these emails are too long, and so it seems helpful to create a word cloud that can be posted to a company network, such as Yammer.

This gist will log the ideation until a real repo is created, if this happens at all.

#!/bin/bash
# Setup and start Sauce Connect for your TravisCI build
# This script requires your .travis.yml to include the following two private env variables:
# SAUCE_USERNAME
# SAUCE_ACCESS_KEY
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
#
# Curl and run this script as part of your .travis.yml before_script section:
# before_script:
#!/bin/bash
# Setup and start Sauce Connect for your TravisCI build
# This script requires your .travis.yml to include the following two private env variables:
# SAUCE_USERNAME
# SAUCE_ACCESS_KEY
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
#
# Curl and run this script as part of your .travis.yml before_script section:
# before_script:
/*!
* jQuery Cycle Plugin (with Transition Definitions)
* Examples and documentation at: http://jquery.malsup.com/cycle/
* Copyright (c) 2007-2012 M. Alsup
* Version: 2.9999.81 (15-JAN-2013)
* Dual licensed under the MIT and GPL licenses.
* http://jquery.malsup.com/license.html
* Requires: jQuery v1.7.1 or later
*/
;(function($, undefined) {
#!/bin/sh
VERSION=0.8.18
PLATFORM=linux
ARCH=x86
PREFIX="$HOME/node"
mkdir -p "$PREFIX" && \
curl http://nodejs.org/dist/v$VERSION/node-v$VERSION-$PLATFORM-$ARCH.tar.gz \
| tar xzvf - --strip-components=1 -C "$PREFIX"
#!/bin/bash
# Setup and start Sauce Connect for your TravisCI build
# This script requires your .travis.yml to include the following two private env variables:
# SAUCE_USERNAME
# SAUCE_ACCESS_KEY
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
#
# Curl and run this script as part of your .travis.yml before_script section:
# before_script:
@patcon
patcon / Capfile
Last active December 12, 2015 06:28
Explanation of how to deploy drupal sites to vagrant VM (Ariadne specifically)
require 'drush_deploy'
module UseScpForDeployment
def self.included(base)
base.send(:alias_method, :old_upload, :upload)
base.send(:alias_method, :upload, :new_upload)
end
def new_upload(from, to, options = {})
old_upload(from, to, options.merge!(:via => :scp))
@patcon
patcon / gist:4588103
Last active December 11, 2015 10:38
Quick tutorial for booting a new Rackspace server with OpenStack's Nova client (CLI).
  1. Install easy_install python package manager [Ref]:

     sh setuptools-0.6c9-py2.4.egg --prefix=~
    
  2. Install Rackspace CLI based on OpenStack Nova:

     easy_install rackspace-novaclient
    
  3. Export envvars (or in .bash_profile if you'd like) [Ref]:

@patcon
patcon / Description.md
Created November 1, 2012 17:54
Using sox CLI tool to gather metrics on ambient volume in room

Running this on OSX, so need to install sox first:

brew install sox

Then paste this file somewhere, and run it in the background with:

bash monitor-audio-levels.sh

As of right now, it only add a character to /tmp/threshold-tally.txt for every 5-second interval where volume exceeds the arbitrary "3" threshold. Would be really useful to timestamp each, and convert to JSON that we can send to a custom leftronic.com dashboard widget, and get a rough idea of how much of the day a room's volume exceeds a given threshold.