Skip to content

Instantly share code, notes, and snippets.

View klausbrunner's full-sized avatar

Klaus Brunner klausbrunner

View GitHub Profile
@klausbrunner
klausbrunner / web.xml
Created December 6, 2013 07:00
web.xml used with cditest, patched weld on jetty-9.1.[01]
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<listener>
<listener-class>org.jboss.weld.environment.servlet.BeanManagerResourceBindingListener</listener-class>
</listener>
<listener>
@klausbrunner
klausbrunner / asset_template.json
Last active December 11, 2015 04:48
Elasticsearch issue with phonetic plugin and index templates (stored in config). Tested with elasticsearch-analysis-phonetic 1.1.0 and 1.2.0 on both Linux and Windows on ES 0.19.12 and 0.20.2. Summary: it works without using a template, it works with a template added through the template API, but consistently fails with a template that is stored…
{
"asset_template": {
"template": "*",
"settings": {
"analysis": {
"filter": {
"metaphone_filter": {
"replace": false,
"encoder": "doublemetaphone",
"type": "phonetic"
@klausbrunner
klausbrunner / pullall.py
Last active December 10, 2015 22:29
Pull all the Mercurial repos listed in the TortoiseHg registry. Convenient if you're tracking lots of repositories.
#!/usr/bin/env python
"""
Pull all the Mercurial repos listed in the TortoiseHg registry, in parallel.
Convenient if you're tracking lots of repositories.
"""
from __future__ import print_function
import subprocess
@klausbrunner
klausbrunner / varnishncsa-request-time-vs-master.patch
Last active October 13, 2015 09:37
Add %D to log complete request time (beginning to end) in varnishncsa. Patches against varnish master & 3.0.3.
diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 0b039b6..10664c7 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -39,6 +39,7 @@
* %l Client user ID as reported by identd (always "-")
* %u User ID if using HTTP authentication, or "-"
* %t Date and time of request
+ * %D time from beginning to completion of request
* %r Request line
@klausbrunner
klausbrunner / findhash.py
Created June 1, 2015 15:18
Finding commits by SHA-1 hash on Github repos forked from a given root repo.
""" Finding commits by SHA-1 hash on Github. This is a simple
brute-force search for a specific usecase: you assume that the commit is
within all repos forked from a certain root repo within the past n days.
This may result in many calls to the GitHub API, which in turn may result
in GitHub's rate limiter kicking in and forcing you to take a break. You
have been warned.
Built with Python 3.4 and github3.py 0.9.4.
"""
@klausbrunner
klausbrunner / curltest.sh
Created October 7, 2014 08:21
Elasticsearch boolean multifield silently ignored #6587
curl -XGET 'http://localhost:9200/'
#{
# "status" : 200,
# "name" : "Spider-Man",
# "version" : {
# "number" : "1.3.2",
# "build_hash" : "dee175dbe2f254f3f26992f5d7591939aaefd12f",
# "build_timestamp" : "2014-08-13T14:29:30Z",
# "build_snapshot" : false,
# "lucene_version" : "4.9"