Skip to content

Instantly share code, notes, and snippets.

View emsearcy's full-sized avatar

Eric Searcy emsearcy

  • 03:11 (UTC -08:00)
View GitHub Profile
@emsearcy
emsearcy / simple_redis_sentinel.php
Last active November 14, 2017 21:59
Simple PHP Redis Sentinel master request
<?php
/*
* Parse RESP (REdis Serialization Protocol)
*/
function read_resp($fp = null) {
// File descripter to the Redis server connection
// (static to limit recursion stack size)
static $conn = null;
if (!$conn) $conn = $fp;
@emsearcy
emsearcy / drupal-solrcloud-4.x.patch
Created October 30, 2015 23:04
SolrCloud changes for Drupal Apache Solr Common Configuration
--- a/conf/4.x/solrconfig.xml
+++ b/conf/4.x/solrconfig.xml
@@ -64,13 +64,6 @@
<lib dir="./lib" />
-->
- <!-- A dir option by itself adds any files found in the directory to
- the classpath, this is useful for including all jars in a
- directory.
- -->
@emsearcy
emsearcy / queuemove.md
Last active March 22, 2018 23:11
Simple queue move for RT tickets that have been classified as spam by SpamAssassin.

Basics

  • Description:
    • On Create move tagged spam
  • Condition:
    • On Create
  • Action:
    • User Defined
  • Template:
    • Global template: Blank
  • Stage:
@emsearcy
emsearcy / autoreply.md
Last active March 22, 2018 23:14
Replacement for default RT Autoreply scrip to squelch spam confirmation.

Basics

  • Description:
    • On "ham" Create Autoreply To Requestors
  • Condition:
    • User Defined
  • Action:
    • Autoreply To Requestors
  • Template:
    • Global template: Autoreply
@emsearcy
emsearcy / rotatembox.py
Created December 5, 2012 01:21
Mailman rotate mbox archive maintenance script
#!/usr/bin/python
#
# Eric Searcy
# github.com/emsearcy
"""Split out prior year archives to "rotate" the mbox.
This script is intended to be run as a bin/withlist script, i.e.
% bin/withlist -l -r rotatembox listname
@emsearcy
emsearcy / serializerepairdb.php
Last active August 12, 2021 09:37
Fix PHP serialized data in database after string REPLACE
<?php
// Script to fix serialized strings directly with DB access
$host = '';
$db = '';
$user = '';
$pass = '';
$table = '';
$column = '';
@emsearcy
emsearcy / check_conntrack
Created June 7, 2012 00:46
Nagios conntrack table monitor
#!/usr/bin/env perl
#
# Script to check netfilter conntrack usage
# https://gist.github.com/gists/2885777
# emsearcy@osuosl.org
#
# Usage: check_conntrack -w WARN_USED% -c CRIT_USED%
#
# Returns:
# UNKNOWN if no conntrack support found