Skip to content

Instantly share code, notes, and snippets.

View jperras's full-sized avatar
💨
what what is this where am I

Joël Perras jperras

💨
what what is this where am I
View GitHub Profile
@jperras
jperras / elasticsearch.json
Created May 14, 2011 21:22
elasticsearch.json
{
"cluster": {"name": "testcluster"},
"cloud": {
"aws": {
"access_key": "<redacted>",
"secret_key": "<redacted>"
}
},
"discovery": { "type": "ec2" },
"index": {
@jperras
jperras / ec2.pp
Created June 14, 2011 20:29
EC2 Puppet utilities
# ec2utils: puppet recipes for use with Amazon's Elastic Compute Cloud (and
# associated services)
#
# Copyright 2009 Flock, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
<!DOCTYPE html>
<head><title>Scroller demo</title></head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var i = 0;
setInterval(function() {
var max_elements = 10;
@jperras
jperras / pre-commit
Created November 17, 2011 04:00 — forked from spulec/pre-commit
Yipit Pre-commit Hook
#!/usr/bin/env python
import os
import re
import subprocess
import sys
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')
CHECKS = [
" Statusline
hi User1 guifg=#eea040 guibg=#222222
hi User2 guifg=#dd3333 guibg=#222222
hi User3 guifg=#ff66ff guibg=#222222
hi User4 guifg=#a0ee40 guibg=#222222
hi User5 guifg=#eeee40 guibg=#222222
set laststatus=2
set statusline=
set statusline +=%1*\ %n\ %* "buffer number
@jperras
jperras / pretty.sh
Created November 22, 2011 20:36
Mass prettification of JSON files.
for f in `find . -path "*.json"`; do python -mjson.tool $f $f.output && mv $f.output $f; done
@jperras
jperras / twitter-tornado.py
Created December 5, 2011 16:33
Tornado Twitter Streaming Example
from tornado.httpclient import HTTPClient, HTTPRequest
import simplejson
def handle_tweet_stream(response):
try:
# Print the parsed twitter stream.
print simplejson.loads(response)
except ValueError:
return
print
@jperras
jperras / post-receive.sh
Created December 22, 2011 21:05
A git post-receive hook for making puppet suck less.
#!/bin/sh
echo "[NOTICE] *** Starting post-receive hook."
cd /etc/puppet
unset GIT_DIR
git fetch origin
if [ "$?" -ne "0" ]; then
@jperras
jperras / stfl.diff
Created January 3, 2012 18:24
STFL diff for OS X compatibility.
diff --git a/Makefile b/Makefile
index d481e68..0f8b4de 100644
--- a/Makefile
+++ b/Makefile
@@ -22,12 +22,12 @@ include Makefile.cfg
export CC = gcc -pthread
export CFLAGS += -I. -Wall -Os -ggdb -D_GNU_SOURCE -fPIC
-export LDLIBS += -lncursesw
+export LDLIBS += $(LDFLAGS) -lncurses -liconv
@jperras
jperras / newsbeuter-1.diff
Created January 3, 2012 19:03
Newsbeuter patch #1
diff --git a/config.sh b/config.sh
index 21d8d04..0b0c44c 100755
--- a/config.sh
+++ b/config.sh
@@ -80,3 +80,5 @@ check_pkg "libcurl" || check_custom "libcurl" "curl-config" || fail "libcurl"
check_pkg "libxml-2.0" || check_custom "libxml2" "xml2-config" || fail "libxml2"
check_pkg "stfl" "" "--static" || fail "stfl"
all_aboard_the_fail_boat
+echo "CXXFLAGS+=$CPPFLAGS" >> config.mk
+echo "LDFLAGS+=$LDFLAGS" >> config.mk