This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(':') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env.roledefs = { | |
'hosts' : ['foo', 'bar'], | |
'local' : [] | |
} | |
@task | |
@roles('hosts') | |
def export_dummies(): | |
run("rm -rf /tmp/exports") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import pyes | |
>>> conn = pyes.es.ES("localhost:9200") | |
>>> all = conn.scan(pyes.query.MatchAllQuery(), 'index', 'type') | |
>>> for a in all: | |
... hits = a['hits']['hits'] | |
... for hit in hits: | |
... conn.index(hit['_source'], 'new_index', 'type', hit['_id'], bulk=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [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" : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import with_statement | |
import os | |
import re | |
import shutil | |
import subprocess | |
import sys | |
import tempfile | |
import shlex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@announce @announce-all | |
Feature: Configure the dashboard | |
As a Jimdo employee | |
I want to configure my dashboard | |
so that I have all data relevant to me visible in one place | |
Scenario: Configure config.json | |
Given a "config.json" file with: | |
""" | |
[{"title":"Example", "url":"http://example.com"}, |