Skip to content

Instantly share code, notes, and snippets.

View bracki's full-sized avatar

Jan Brauer bracki

View GitHub Profile
@bracki
bracki / rvm2rbenv.txt
Created December 3, 2012 20:51 — forked from brentertz/rvm2rbenv.txt
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@bracki
bracki / client.rb
Created November 29, 2012 17:32
Simple client
require 'socket'
@functions = {
:ADD => lambda {|a, b| a + b},
:SUBTRACT => lambda {|a, b| a - b},
:MULTIPLY => lambda {|a, b| a * b}
}
def build_response(msg)
m = msg.split(':')
@bracki
bracki / fabfile.py
Created July 12, 2012 21:07
Run a task once, on the localhost only.
env.roledefs = {
'hosts' : ['foo', 'bar'],
'local' : []
}
@task
@roles('hosts')
def export_dummies():
run("rm -rf /tmp/exports")
@bracki
bracki / gist:2887329
Created June 7, 2012 08:06
Multi screen setups with disper - suitable for pair programming, conference talks, what not, needs NVIDIA graphic card
# Need to install disper, only works on NVIDIA
alias clone-screen='disper -c'
alias dual-screen='disper -e -t right -d DFP-1,DFP-0'
alias pair-screen='disper -c -d DFP-1,CRT-0'
alias single-screen='disper -s'
@bracki
bracki / bootstrap.sh
Created March 30, 2012 08:05
Simple bootstrap of virtualenv for Jenkins
#!/bin/bash
VENV="$WORKSPACE/.env"
if [ ! -e "virtualenv.py" ]; then
curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py
fi
if [ -d $VENV ]; then
echo "**> virtualenv exists"
else
echo "**> creating virtualenv"
python virtualenv.py $VENV
# [Mon Jan 16 11:23:14 2012] Protocol: http, Server: 192.168.5.10:9200
curl -XPUT 'http://127.0.0.1:9200/users/?pretty=1' -d '
{
"mappings" : {
"info" : {
"_all" : {
"type" : "string",
"analyzer" : "uax_url_email"
},
"properties" : {
@bracki
bracki / log
Created December 21, 2011 22:55
ElasticSearch via Thrift and Python
t
twitter][tweet][123], source[€]}]
org.elasticsearch.ElasticSearchParseException: Failed to derive xcontent from (offset=0, length=1): [-128]
at org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:147)
at org.elasticsearch.common.xcontent.XContentHelper.createParser(XContentHelper.java:49)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:428)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:414)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:302)
@bracki
bracki / lighty.conf
Created April 11, 2011 11:39
borkenness
var.projectdir = env.HOME + "/projects/transifex/transifex"
var.basedir = env.HOME + "/projects/transifex/lighttpd"
server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_extforward",
"mod_rewrite",
"mod_fastcgi",
@bracki
bracki / gist:843736
Created February 25, 2011 12:50 — forked from lentil/gist:810399
#!/usr/bin/env python
from __future__ import with_statement
import os
import re
import shutil
import subprocess
import sys
import tempfile
import shlex