This file contains 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
using System; | |
using Autofac; | |
using NUnit.Framework; | |
using MassTransit; | |
namespace ServiceBusSpike.Sandbox | |
{ | |
public class ServiceMessage | |
{ | |
public int Id { get; set; } |
This file contains 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
This is how you create empty commit (it won't have any file changes, but still has message, who, when &c.) I think this can be used to start empty pull requests. | |
git commit -m "what?" --allow-empty |
This file contains 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
# timing func | |
import time | |
import logging | |
def log_timing(func): | |
def inner(*args, **kwargs): | |
t1 = time.time() | |
res = func(*args, **kwargs) | |
t2 = time.time() | |
logging.getLogger().debug('%s took %0.3f ms' % (func.func_name, (t2-t1)*1000.0)) | |
return res |
This file contains 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/sh | |
RED=`echo '\x1b[31m'` | |
GREEN=`echo '\x1b[32m'` | |
CYAN=`echo '\x1b[34m'` | |
RESET=`echo '\x1b[0m'` | |
MAGENTA=`echo '\x1b[35m'` | |
python -m unittest discover $@ 2>&1 | sed "s/.*[oO][kK]$/$GREEN&$RESET/" \ | |
| sed "s/.*ERROR$/$MAGENTA&$RESET/" \ |
This file contains 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 | |
import sys | |
terse = "-t" in sys.argv[1:] or "--terse" in sys.argv[1:] | |
for i in range(2 if terse else 10): | |
for j in range(30, 38): | |
for k in range(40, 48): | |
if terse: | |
print "\33[%d;%d;%dm%d;%d;%d\33[m " % (i, j, k, i, j, k), | |
else: |
This file contains 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 | |
if [ $# -lt 1 ]; then | |
SIZE="2048" | |
else | |
SIZE=$1 | |
fi | |
echo "export HADOOP_HEAPSIZE=${SIZE}" >> /home/hadoop/conf/hadoop-user-env.sh |
This file contains 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
merlin.local ~> $ nsq_to_file --topic=test --output-dir=/tmp --lookupd-http-address=127.0.0.1:4161 | |
2012/12/20 15:42:16 starting AsyncHandler go-routine | |
2012/12/20 15:42:16 lookupd addr 127.0.0.1:4161 | |
2012/12/20 15:42:16 LOOKUPD: querying http://127.0.0.1:4161/lookup?topic=test | |
2012/12/20 15:42:16 [merlin.local:4150] connecting to nsqd | |
2012/12/20 15:42:17 ERROR: failed to connect to nsqd (merlin.local:4150) - dial tcp merlin.local:4150: i/o timeout | |
2012/12/20 15:42:46 old new test.merlin.2012-12-20_15.log | |
2012/12/20 15:42:46 opening /tmp/test.merlin.2012-12-20_15.log | |
2012/12/20 15:44:20 LOOKUPD: querying http://127.0.0.1:4161/lookup?topic=test | |
2012/12/20 15:44:20 [merlin.local:4150] connecting to nsqd |
This file contains 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
merlin.local ~> $ nsq_to_file --nsqd-tcp-address=127.0.0.1:4150 --topic=test | |
2012/12/20 21:00:09 starting AsyncHandler go-routine | |
2012/12/20 21:00:09 [127.0.0.1:4150] connecting to nsqd | |
2012/12/20 21:00:09 old new test.merlin.2012-12-20_21.log | |
2012/12/20 21:00:09 opening /tmp/test.merlin.2012-12-20_21.log | |
2012/12/20 21:00:09 syncing 1 records to disk | |
2012/12/20 21:00:39 syncing 51 records to disk | |
2012/12/20 21:00:39 [127.0.0.1:4150] received heartbeat from nsqd | |
This file contains 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
start = | |
compoundExp | |
/ exp | |
op = | |
equals | |
/ logicalOp | |
/ stringOp |
This file contains 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
1. change `/etc/init/sfsvscan.conf` and add `limit nofile 32000 32000` | |
2. change `/etc/security/limits.conf` and add | |
`* hard nofile 40960` | |
`* soft nofile 40960` | |
3. confirm by adding `-Des.max-open-files=true` to run file of elasticsearch |
OlderNewer