Skip to content

Instantly share code, notes, and snippets.

View bdelacretaz's full-sized avatar

Bertrand Delacretaz bdelacretaz

View GitHub Profile
@bdelacretaz
bdelacretaz / camel.POST.groovy
Created June 14, 2012 15:40
Stanbol/Groovy/Camel experiment: dynamic enhancement chains
// WHAT'S THIS?
//
// This is a Stanbol/Groovy/Camel proof of concept: the goal is
// to define Stanbol content enhancement chains as flowchart-like
// structures from a script language. Intermediate results (as
// the detected language in this example) can be used to route
// the content being analyzed to different paths in the flowchart.
//
// Apache Camel is used as the flowchart execution engine.
//
@bdelacretaz
bdelacretaz / colorlogs
Created October 26, 2012 13:46
Colorize log files using ack - by @alexkli
#!/bin/bash
# colorize log files using ack - by @alexkli
# based on http://powdahound.com/2009/10/colorize-log-output-with-ack
cat - \
| ack --flush --passthru --color --color-match=red "^.*\*ERROR\*.*" \
| ack --flush --passthru --color --color-match=yellow "^.*\*WARN\*.*" \
| ack --flush --passthru --color --color-match=green "^.*\*INFO\*.*" \
| ack --flush --passthru --color --color-match=white "^.*\*DEBUG\*.*" \
| ack --flush --passthru --color --color-match=white "^.*\*TRACE\*.*"

Keybase proof

I hereby claim:

  • I am bdelacretaz on github.
  • I am bdelacretaz (https://keybase.io/bdelacretaz) on keybase.
  • I have a public key whose fingerprint is 5EFF 2565 85AC 5FB6 07F6 D46A 77B6 B69A 9E4D CC6B

To claim this, I am signing this object:

@bdelacretaz
bdelacretaz / gist:e8c75446918968bd7678
Last active August 29, 2015 14:05
How to let Docker containers running with boot2docker know the host mac's IP address
$ curl http://localhost:8000/works.txt
ok works
$ export IP=$(boot2docker ssh "set | grep SSH_CLIENT" | cut -d"'" -f2 | cut -d" " -f1)
$ docker run -e HOST_MAC=$IP busybox sh -c 'wget -q -O - http://$HOST_MAC:8000/works.txt'
ok works
@bdelacretaz
bdelacretaz / gist:dee49a174147e066b2b4
Created November 3, 2014 11:54
Sling patch for rev 1636322 that allows SlingSettingsService to start with launchpad 7
ndex: testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingSetupTest.java
===================================================================
--- testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingSetupTest.java (revision 1636322)
+++ testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingSetupTest.java (working copy)
@@ -16,6 +16,8 @@
*/
package org.apache.sling.paxexam.util;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+
@bdelacretaz
bdelacretaz / gist:03ece77da0a10741b8fb
Created November 7, 2014 08:43
Bruce Edge's debian package patch for Sling
diff --git a/launchpad/builder/pom.xml b/launchpad/builder/pom.xml
index 079cd92..2e216a8 100644
--- a/launchpad/builder/pom.xml
+++ b/launchpad/builder/pom.xml
@@ -65,6 +65,12 @@
Context path of the Sling web application
-->
<jetty.sling.context>/</jetty.sling.context>
+
+ <!--
# switch jdk on macosx
# thanks to @jreijn for the --version trick
# see http://blog.frd.mn/java-7-on-os-x-yosemite/ for Java7 install trick
export JAVA_HOME=`/usr/libexec/java_home --version $1`
export PATH=$JAVA_HOME/bin:$PATH
# this just confirms that we have the right JDK now
java -version
@bdelacretaz
bdelacretaz / patch
Created May 29, 2015 15:30
Oak query conversion, experimental patch
Index: oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeImpl.java
===================================================================
--- oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeImpl.java (revision 1682417)
+++ oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeImpl.java (working copy)
@@ -48,6 +48,10 @@
public Set<SelectorImpl> getSelectors() {
return Collections.singleton(selector);
}
+
+ public String getAncestorPath() {
Index: bundles/jcr/oak-server/pom.xml
===================================================================
--- bundles/jcr/oak-server/pom.xml (revision 1697914)
+++ bundles/jcr/oak-server/pom.xml (working copy)
@@ -41,7 +41,7 @@
WARNING make sure oak.version and sling.oak.server.version
are in sync with bundles/jcr/it-jackrabbit-oak
-->
- <oak.version>1.3.3</oak.version>
+ <oak.version>1.4-SNAPSHOT</oak.version>
@bdelacretaz
bdelacretaz / pompl
Created September 14, 2015 12:12
pompl script - generates a list of folders for mvn -pl
# Find all pom.xml files under specified path and generate a comma-separated
# list of their folder names, suitable for use with the mvn -pl option
find "$1" -name pom.xml | grep -v '/target/' | xargs -n1 dirname | awk '{ printf $1 "," }'