Skip to content

Instantly share code, notes, and snippets.

Jehiah Czebotar jehiah

Block or report user

Report or block jehiah

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jehiah
jehiah / nsq_testing.go
Created Jun 13, 2016
Interface for testing nsq producers.
View nsq_testing.go
package nsqutils
import (
"sync"
"time"
"github.com/nsqio/go-nsq"
)
// Producer is an interface that nsq.Producer fulfills
View fetchtest.go
package main
import (
"bufio"
"errors"
"flag"
"fmt"
"net/http"
"os"
"sync"
@jehiah
jehiah / pivot_csv.py
Created Nov 30, 2015
Pivot a CSV table.
View pivot_csv.py
#!/usr/bin/env python
import sys
import csv
import tornado.options
from collections import defaultdict
def run():
data = defaultdict(dict)
columns = set()
@jehiah
jehiah / nsq.spec
Created Aug 20, 2015
example RPM specfile for nsq - http://nsq.io/
View nsq.spec
%define name nsq
%define version 0.3.6.alpha
%define release 1
%define path usr/local
%define __os_install_post %{nil}
%define github_account bitly
%define github_project nsq
%define clone_account bitly
%define commit 925f82a0fa7d6abe3652bb31c4834699a8b1c318
@jehiah
jehiah / disabled_nsq_reader.py
Created Jun 12, 2015
A pynsq Reader that polls for a file to transparently enable/disable
View disabled_nsq_reader.py
import os.path
import logging
import tornado.ioloop
from nsq import Reader as BaseReader
from nsq import run
class Reader(BaseReader):
def __init__(self, *args, **kwargs):
max_in_flight = kwargs['max_in_flight']
@jehiah
jehiah / nsq_testing.go
Created Jun 2, 2015
NSQ Producer testing abstraction
View nsq_testing.go
package nsqutils
import (
"sync"
"github.com/bitly/go-nsq"
)
// Producer is an interface that nsq.Producer fulfills
type Producer interface {
@jehiah
jehiah / check_recent_ts.sh
Created Mar 31, 2015
Monitor files for recent timestamps
View check_recent_ts.sh
#!/bin/bash
WARN="180"
CRITICAL="300"
USE_MODIFY_TIME=false # default to use the contents of the file
while [ "$1" != "" ]; do
param=${1%%=*}
value=${1#*=}
case $param in
@jehiah
jehiah / gist:237577c9a5843861a668
Created Feb 25, 2015
clear_nsqd_topics_and_channels.py
View gist:237577c9a5843861a668
#!/bin/env python2.7
"""
A script to clear out nsq topics and channels. This is particularly useful in dev for when
topics naturally backup, or when launching a producer with some time before a consumer exists
"""
import tornado.options
import tornado.httpclient
import logging
import json
import urllib
@jehiah
jehiah / libevent-1.4.14b-bitly2.patch
Created Jan 28, 2015
Bitly patches for libevent-1.4.14b
View libevent-1.4.14b-bitly2.patch
diff -urp libevent-1.4.14b-stable/configure libevent-1.4.14b-stable-fix/configure
--- libevent-1.4.14b-stable/configure 2010-06-20 09:06:18.000000000 -0400
+++ libevent-1.4.14b-stable-fix/configure 2012-05-09 15:14:09.000000000 -0400
@@ -2988,7 +2988,7 @@ fi
# Define the identity of the package.
PACKAGE=libevent
- VERSION=1.4.14b-stable
+ VERSION=1.4.14b-bitly2
You can’t perform that action at this time.