Skip to content

Instantly share code, notes, and snippets.

@ric03uec
ric03uec / installls.sh
Created February 2, 2014 09:24
install logstash
$ mkdir ~/lsdocker && cd ~/lsdocker
$ wget https://download.elasticsearch.org/logstash/logstash/logstash-1.3.3-flatjar.jar
$ mv logstash-1.3.3-flatjar.jar logstash.jar
@ric03uec
ric03uec / ls.conf
Last active August 29, 2015 13:55
lsconfig
input {
stdin {
type => "stdin-type"
}
}
output {
stdout { codec => rubydebug }
}
$ java -jar logstash.jar agent -f ls.conf
hello world
{
"message" => "hello world",
"@version" => "1",
"@timestamp" => "2014-02-02T09:47:17.232Z",
"type" => "stdin-type",
"host" => "<hostname>"
input {
stdin {
type => "stdin-type"
}
rabbitmq {
exchange => "rabbimq_exchange"
host => "172.17.0.2"
key => "key.exceptions"
queue => "queue.exceptions"
@ric03uec
ric03uec / ls.conf
Created February 2, 2014 10:19
logstash dockerfile
FROM ubuntu:12.04
MAINTAINER Devashish "[email protected]"
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
RUN locale-gen en_US en_US.UTF-8;
RUN dpkg-reconfigure locales;
RUN echo "debconf shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections;
@ric03uec
ric03uec / output
Last active August 29, 2015 14:02
python subprocess i/o redirection
$ ./runner.py
__NO_REDIRECTION_ON_PARENT__
------ executing main thread ----------
----- parent stdout --------
executing script 1
executing script 2
----- parent stderr --------
@ric03uec
ric03uec / find.py
Last active August 29, 2015 14:05
glob comparison
#!/usr/bin/python
import os, subprocess
import glob2
import glob
curr_dir = os.getcwd()
def initialize():
print("current directory: {0}".format(curr_dir))
init_cmd = "cd {0} && rm -rf testing && mkdir -p testing && touch testing/coverage.xml && echo 'coveragedata' >> testing/coverage.xml".format(curr_dir)
@ric03uec
ric03uec / client.out
Created September 25, 2014 18:08
libswarm local test(failed)
// cloned libswarm
// installed using: cd path/to/libswarm/ && make deps && go install github.com/ric03uec/libswarm/swarmd
// swarmd then present in $GOPATH/bin/
$ docker -H localhost:4243 ps
@ric03uec
ric03uec / haproxy.cfg
Last active August 29, 2015 14:12
haproxy configuration
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
user haproxy
group haproxy
daemon
defaults
@ric03uec
ric03uec / console
Created December 25, 2014 18:09
telnet into rabbitmq
$ telnet localhost 5672
Trying 127.0.0.1
Connected to localhost
Escape character is '^]'.
AMQP Connection closed by foreign host.