Skip to content

Instantly share code, notes, and snippets.

View cwarden's full-sized avatar

Christian G. Warden cwarden

View GitHub Profile
@cwarden
cwarden / Misc.pm.patch
Created February 22, 2012 01:04
logitech media server fix for git annex
--- /usr/share/perl5/Slim/Utils/Misc.pm
+++ /usr/share/perl5/Slim/Utils/Misc.pm
@@ -857,7 +857,9 @@
$target = ($target =~ /^\// ? $target : catdir($dirname, $target));
if (-f $target) {
- return 0 if $target !~ $validRE;
+ # ignore the extension for symlinks. allows use of git annex repos
+ # cwarden@xerus.org - 2012-02-06
+ # return 0 if $target !~ $validRE;
#!/bin/bash
# Upload arbitrary files as a github gist using gisty.
# Returns a bitly link to the gist.
GIST_DIR="$HOME/git/gists"
BITLY_USER=$USER
BITLY_KEY=$(cat $HOME/.bitly_key)
x=$(tempfile)

Starting logstash like this:

java -jar /tmp/logstash-1.1.0-monolithic.jar agent -f mylogstash.conf -- web --backend elasticsearch:///?local 2>&1 | tee logstash.out
$ curl http://localhost:9200/
{
 "ok" : true,
@cwarden
cwarden / gist:1705587
Created January 30, 2012 17:37 — forked from jedi4ever/gist:1704761
Puppet puzzle : parametrized classes - common logic
#First class = role web (calls logstash::common to setup directory structure)
class logstash::web(
$version = '1.1.0beta8'
) {
if !defined(Class['logstash::common']) {
class {'logstash::common':
version => $version
}
}
}
@cwarden
cwarden / README
Created January 30, 2012 00:26
A demonstration of a jquery/ajax bug in the GhostRec javascript library
For jQuery 1.4, GhostRec sets up the beforeSend ajax function such that it
reopens the XMLHttpRequest connection. This causes the headers to be reset,
including the Content-Type header. The Content-Type is changed from
application/x-www-form-urlencoded to application/xml. This results in an
invalid form submission since the content of the POST is not actually XML.
Test this on a subdomain of ghostrec.com as that is the domain associated with
1161.js.
curl 'http://localhost:8080/pentaho/content/cda/doQuery?path=/Test1/test.cda&dataAccessId=test&userid=joe&password=password'
should return 1 in the resultset
curl 'http://localhost:8080/pentaho/content/cda/doQuery?path=/Test2/test.cda&dataAccessId=test&userid=joe&password=password'
should return 2 in the resultset
@cwarden
cwarden / cachemanager.hbm.xml
Created January 18, 2012 18:26
prevent duplicate cron entries for CDA queries
<properties name="unique_cron_entries" unique="true">
<property name="cdaFile" not-null="true" type="string">
<column length="254" name="cdaFile" not-null="true"/>
</property>
<property name="dataAccessId" not-null="true" type="string">
<column length="254" name="dataAccessId" not-null="true"/>
</property>
<property name="userName" type="string">
<column name="uname"/>
</property>
class mod::config($param) {
}
class mod::uses_config {
# Why hasn't $mod::config been evaluated yet?
$var = $mod::config::param
notify { $var: }
}
Class['mod::config'] -> Class['mod::uses_config']
class first {
tag('doot')
}
class second {
if tagged(first) {
warning('first tag found')
} else {
warning('first tag not found')
}