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 / deb-control.sh
Created May 14, 2012 18:17
For when you need to dive into a .deb and edit the control file.
#!/bin/bash
if [[ -z "$1" ]]; then
echo "Syntax: $0 debfile"
exit 1
fi
DEBFILE="$1"
TMPDIR=`mktemp -d /tmp/deb.XXXXXXXXXX` || exit 1
OUTPUT=`basename "$DEBFILE" .deb`.modified.deb
@jperras
jperras / gist:1770763
Created February 8, 2012 16:09 — forked from markstory/gist:1770613
jenkins json url for getting people who broke the build.
http://jenkins/view/Radiator/api/json?tree=jobs[name,color,buildable,healthReport[description,score,iconUrl],builds[culprits[fullName],changeSet[items[msg]]]]
@jperras
jperras / initialize.pp
Created January 17, 2012 19:25
Initialization puppet script for puppetmasterless puppet setup.
user { "git":
home => "/var/git",
ensure => present
}
file {
"/var/git":
ensure => directory,
owner => "git",
group => "git",
@jperras
jperras / omgwtfbbq.txt
Created January 17, 2012 15:34
Beer Wish List
- Any of the "Armand Seasonal" (Lente, Printemps, Hiver, Été)
- Any Westvleteren (the 12 being the best, but hardest to find)
- HORALs Oude Geuze Mega Blend
- Struiselensis
If none of the above are findable, then nearly any beer by Cantillon:
- Cantillon Blåbær Lambik
- Cantillon Kriek Lambic
- Cantillon Gueuze Lambic
@jperras
jperras / newsbeuter-3.diff
Created January 3, 2012 19:23
Newsbeuter patch #3 (ncurses)
diff --git a/src/controller.cpp b/src/controller.cpp
index 715f59e..c4a4012 100644
--- a/src/controller.cpp
+++ b/src/controller.cpp
@@ -38,7 +38,7 @@
#include <sys/stat.h>
#include <pwd.h>
-#include <ncursesw/ncurses.h>
+#include <ncurses.h>
@jperras
jperras / newsbeuter-2.diff
Created January 3, 2012 19:04
Newsbeuter patch #2
diff --git a/src/controller.cpp b/src/controller.cpp
index 34ca979..715f59e 100644
--- a/src/controller.cpp
+++ b/src/controller.cpp
@@ -855,7 +855,7 @@ void controller::notify(const std::string& msg) {
}
if (cfg.get_configvalue_as_bool("notify-beep")) {
LOG(LOG_DEBUG, "controller:notify: notifying beep");
- ::beep();
+ //::beep();
@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
@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 / 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 / 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