Skip to content

Instantly share code, notes, and snippets.

View ipl31's full-sized avatar
🎯
Focusing

Ken Caruso ipl31

🎯
Focusing
View GitHub Profile
@ipl31
ipl31 / gist:153727
Created July 23, 2009 23:27
Maven2 settings.xml to override url for ALL repos
<settings>
<mirrors>
<mirror>
<id>Local raven mirror or proxy</id>
<name>corp</name>
<url>http://maven:8081/artifactory/repo</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>
@ipl31
ipl31 / gist:153730
Created July 23, 2009 23:28
maven2 settings.xml file to override "central" repo url
<settings>
<mirrors>
<mirror>
<id>Local raven mirror or proxy</id>
<name>corp</name>
<url>http://maven:8081/artifactory/repo</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>
@ipl31
ipl31 / Gmetric_count_dir_listings
Created November 20, 2010 17:19
Ruby Gmetric example that counts dir listings and sends them to a ganglia cluster
#Simple ganglia gmetric plugin using the gmetric gem.
#Counts entries in a dir and reports them to the ganglia cluster using
#the gmetric ruby gem
require 'rubygems'
require 'gmetric'
#Tmax indicates freshness, if TN(seconds since metric was updated) exceeds tmax then ganglia will expect a new value
#Dmax indicates how long an old metric should be retained
#decsripitions taken from http://monami.sourceforge.net/tutorial/ar01s06.html
tmax = 60
@ipl31
ipl31 / yql.rb
Created January 23, 2011 19:45
quick and dirty ysql query function, returns json
def yql_query_json(query)
api_query = CGI.escape(query)
url = "http://query.yahooapis.com/v1/public/yql?q=#{api_query}&format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env"
json_results = open(url) {|f| f.read}
results = JSON.parse(json_results)
end
@ipl31
ipl31 / gunicorn
Created December 5, 2011 07:57 — forked from suda/gunicorn
Gunicorn init.d script (debian/ubuntu)
#!/bin/sh
### BEGIN INIT INFO
# Provides: gunicorn
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the gunicorn server
# Description: starts gunicorn using start-stop-daemon
@ipl31
ipl31 / supervisord.sh
Created December 5, 2011 08:01 — forked from danmackinlay/supervisord.sh
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@ipl31
ipl31 / post.php
Created February 6, 2012 06:10
Simple php script to write http posts to a file for debugging
<?php $stamp = time();
$filename = '/tmp/post-'.$stamp.'.txt';
file_put_contents($filename, file_get_contents('php://input'));
?>
@ipl31
ipl31 / decode.py
Created February 6, 2012 06:13
python script that takes url encoded data in a file and decodes it
#!/usr/bin/env python
import urllib
encoded_filename = urllib.quote('post.txt')
decoded_filename = 'post.txt.decode'
source = open(encoded_filename)
dest = open(decoded_filename, 'w')
decoded_data = urllib.unquote_plus(source.read())
print decoded_data
dest.write(decoded_data)
@ipl31
ipl31 / install-graphite-ubuntu-11.10.sh
Created February 6, 2012 23:39
Install Graphite 0.9.9 on Ubuntu 11.10
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# Forked from: http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Ubuntu 11.10 Oneiric Ocelot
# Last tested & updated 10/14/2011
####################################
sudo apt-get update
sudo apt-get dist-upgrade
[10828.903050] XFS: Internal error XFS_WANT_CORRUPTED_GOTO at line 1508 of file /build/buildd/linux-3.0.0/fs/xfs/xfs_alloc.c. Caller 0xffffffffa02cd137
[10828.903053]
[10828.903164] Pid: 5374, comm: nova-compute Tainted: G C 3.0.0-12-generic #20-Ubuntu
[10828.903167] Call Trace:
[10828.903198] [<ffffffffa02f61af>] xfs_error_report+0x3f/0x50 [xfs]
[10828.903212] [<ffffffffa02cd137>] ? xfs_free_extent+0xd7/0x120 [xfs]
[10828.903225] [<ffffffffa02cab28>] xfs_free_ag_extent+0x528/0x730 [xfs]
[10828.903238] [<ffffffffa02cd137>] xfs_free_extent+0xd7/0x120 [xfs]
[10828.903252] [<ffffffffa02dd084>] xfs_bmap_finish+0x164/0x1b0 [xfs]
[10828.903269] [<ffffffffa02fd399>] xfs_itruncate_finish+0x159/0x3a0 [xfs]