Skip to content

Instantly share code, notes, and snippets.

View guenter's full-sized avatar

Tobi Knaup guenter

View GitHub Profile
@guenter
guenter / docker2marathon.py
Created March 11, 2016 04:53
Generate Marathon JSON from Docker images.
"""Generate Marathon JSON from Docker images.
Usage:
docker2marathon.py [options] <image>
docker2marathon.py (-h | --help)
Options:
--cpus=<shares> CPU shares for this app [default: 0.5]
--mem=<megabytes> MB of memory for this app [default: 256]
"""
@guenter
guenter / .bashrc
Created December 10, 2013 01:03
Show git branch in prompt
# Git
source /usr/local/etc/bash_completion.d/git-prompt.sh
if [ "$USER" = "root" ]; then
PS1='\e[1;31m[\u@\h \W[\033[34m\]$(__git_ps1 " (%s)")\[\033[00m\]\$\e[0m '
else
PS1='\u@\h \w$(__git_ps1 " (%s)")\$ '
fi
alias g='git'
alias gpr='git pull --rebase'
@guenter
guenter / using-twitter-commons-sample.sh
Created March 1, 2013 23:07
Using Twitter Commons sample app
# Clone the repo:
$ git clone git://github.com/airbnb/twitter-commons-sample.git
# Build using Maven:
$ mvn package
# Run:
$ bash run_local.bash
# Like a place:
package airbnb.cascading.sessions;
import cascading.flow.Flow;
import cascading.flow.FlowConnector;
import cascading.flow.hadoop.HadoopFlowConnector;
import cascading.pipe.Pipe;
import cascading.scheme.hadoop.TextLine;
import cascading.tap.SinkMode;
import cascading.tap.Tap;
import cascading.tap.hadoop.Hfs;
@guenter
guenter / gist:1424333
Created December 2, 2011 18:39
Lucene Facets Drill Down
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.facet.index.CategoryDocumentBuilder;
import org.apache.lucene.facet.index.params.DefaultFacetIndexingParams;
import org.apache.lucene.facet.index.params.FacetIndexingParams;
import org.apache.lucene.facet.search.DrillDown;
import org.apache.lucene.facet.search.FacetsCollector;
import org.apache.lucene.facet.search.params.CountFacetRequest;
import org.apache.lucene.facet.search.params.FacetRequest;
import org.apache.lucene.facet.search.params.FacetSearchParams;
@guenter
guenter / mysql_commands_i_always_forget.sql
Created September 1, 2010 15:58
MySQL commands I forget all the time
-- Reset the query cache
RESET QUERY CACHE;
-- Closes all open tables, forces all tables in use to be closed, and flushes the query cache.
FLUSH TABLES;
-- Show character set in use by client, server, etc.
SHOW VARIABLES LIKE 'character_set%';
@guenter
guenter / Node-and-Redis.json
Last active August 29, 2015 14:13
Prepare a cluster started with https://google.mesosphere.com for the Mesos DNS demo
{
"id" : "/mysite",
"apps": [
{
"id": "frontend",
"container": {
"type": "DOCKER",
"docker": {
"image": "superguenter/node-redis-demo",
"network": "HOST"
@guenter
guenter / velocity.md
Created September 15, 2014 19:24
velocity
@guenter
guenter / clean-github.js
Created April 29, 2014 21:57
Remove nav elements on github page to clean it up for PDF. Paste in your browser console.
$('.file-navigation, .repository-sidebar, .header, .pagehead, .breadcrumb, .commit, .meta, .site-footer').remove(); $('#files, .file').css({"background":"none", "border":"none"}); $('link').removeAttr('media');
diff --git a/configure.ac b/configure.ac
index c1de6d7..3197d00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -436,6 +436,13 @@ __EOF__
AC_DEFINE([MESOS_HAS_JAVA])
has_java=yes
+
+ # Test for Maven so we can build the jar