Skip to content

Instantly share code, notes, and snippets.

View bdelacretaz's full-sized avatar

Bertrand Delacretaz bdelacretaz

View GitHub Profile
@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: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

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 / 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\*.*"
@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.
//