Skip to content

Instantly share code, notes, and snippets.

View lboynton's full-sized avatar
😷
<img src=x onerror=alert(1)>

Lee Boynton lboynton

😷
<img src=x onerror=alert(1)>
View GitHub Profile
@tessro
tessro / redis-server
Created December 16, 2009 14:20
A CentOS initscript for Redis
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
@barinek
barinek / nagios xmpp check
Created January 7, 2010 02:18
nagios xmpp check
#! /usr/bin/env ruby
require 'rubygems'
require 'main'
require 'xmpp4r'
require File.dirname(__FILE__) + "/nagios_helpers"
class NoErrorsFoundInLogs < Exception;
end
@cowboy
cowboy / HEY-YOU.md
Last active May 16, 2024 13:31
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@cowboy
cowboy / pubsub-demo.js
Created December 16, 2010 20:04 — forked from rmurphey/pubsub-demo.js
Two approaches: "Traditional" vs Pub/Sub (via rmurphey)
// Note that this uses my Pub/Sub implementation, which is slightly different than
// phiggins' in that jQuery custom events are used, and as such the first event handler
// argument passed is the event object.
//
// jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery
// https://gist.github.com/661855
// The "traditional" way.
@senko
senko / onchange.sh
Last active July 14, 2023 07:54
OnChange - Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@bkimble
bkimble / gist:1365005
Last active May 2, 2024 01:27
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
@shevron
shevron / ZfClassmapTask.php
Created January 10, 2012 18:31
Zend Framework 2.0 style autoloader classmap generator task for Phing
<?php
/**
* Phing task to generate a Zend Framework style autoloader classmap file
*
* This task requires ZF 2.x to be in your include_path. You can run phing like
* so to enforce this:
*
* $ export PHP_COMMAND="php -d include_path=.:<path to zf library>:<path to pear>"
* $ phing ...
@anewusername1
anewusername1 / logstash.conf
Created January 13, 2012 20:04
logstash/graylog2 setup
input {
gelf { type => 'gelf' }
}
output {
mongodb {
host => '127.0.0.1'
database => 'rails_logs'
collection => "%{facility}"
}
}
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 1, 2024 14:11
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@jbottigliero
jbottigliero / gist:3955492
Created October 25, 2012 21:20
ejabber, BOSH, and StopheJS, Oh My(SQL)

ejabberd

####Server Ubuntu 10.04 LTS Lucid

##Process

Install ejabberd