{
"message" => "hello world",
"@version" => "1",
"@timestamp" => "2014-04-22T23:03:14.111Z",
"type" => "stdin",
"host" => "hello.local"
}
# Create a user land file for testing. | |
# dd if=/dev/urandom of=/tmp/urandom bs=1M count=10 | |
# | |
# urandom-reads.py infile threads | |
# Examples: | |
# time python2.6 urandom-reads.py /tmp/urandom | |
# time python2.6 urandom-reads.py /dev/urandom | |
# | |
# R to generate a plot of the read time distribution at each level of concurrency | |
# rdt = read.csv("output.csv", header=F) |
<?php | |
/** | |
* Database connection test script for WordPress | |
* | |
* Parses the wp-config.php file for DB connection information and tests | |
* a mysql connection to the DB server and selection of the database. | |
* Errors will be reported. Attempts will be made to repair table errors. | |
* | |
* Place this file in the same directory as wp-config.php | |
* |
convert image.png -resize 40 txt:-|sed -E 's/://;s/\( ? ?//;s/, ? ?/,/g;s/\)//;s/([0-9]+,[0-9]+,[0-9]+),[0-9]+/\1/g;s/255/254/g;/mage/d'|awk '{print $1,$2}'|sed -E 's/^0,[0-9]+ /print "echo;tput setaf "\;/;s/^[0-9]+,[0-9]+ /print "tput setaf ";/;s/(.+),(.+),(.+)/\1\/42.5*36+\2\/42.5*6+\3\/42.5+16/'|bc|sed 's/$/;echo -n " ";/'|tr '\n' ' '|sed 's/^/tput rev;/;s/; /;/g;s/$/tput sgr0;echo/'|bash
$ knife ssh -m "...every host in the network..." "sudo netstat -nutap" -a hostname > meganetstat.txt | |
$ python | |
>>> from collections import Counter as C | |
>>> HS = "...every host in the network...".split() | |
>>> ip = lambda s: s.split(":")[0] | |
>>> xs = [map(ip, [x[0], x[4], x[5]]) for x in [x.strip().split() for x in open("meganetstat.txt").readlines() if "tcp" in x] if len(x)>=6] | |
>>> ipmap = [(h, C([x[1] for x in xs if x[0] == h])) for h in HS] | |
>>> ipmapx = dict([(sorted([(x,y) for (x,y) in ip[1].items() if x.startswith("10.")], key=lambda t: -t[1])[0][0], ip[0]) for ip in ipmap]) | |
>>> sorted(C(map(ipmapx.get, [x[2] for x in xs if x[2].startswith("10.")])).items(), key=lambda t: t[1]) |
source s_nginx_20 { pipe("/srv/logs/access.log" program_override("nginx-access-log")); }; | |
source s_nginx_21 { pipe("/srv/logs/error.log" program_override("nginx-error-log")); }; | |
filter f_nginx_20 { match("nginx-access-log" value("PROGRAM")); }; | |
filter f_nginx_21 { match("nginx-error-log" value("PROGRAM")); }; | |
destination d_remote { tcp("central.syslog", port(514)); }; | |
log { source(s_nginx_20); filter(f_nginx_20); destination(d_messages); }; | |
log { source(s_nginx_21); filter(f_nginx_21); destination(d_messages); }; |
#cargo, docker hub without docker, how to
18 Jan 2015
###Background
I have been using linux containers for almost 2 years now. It started during an internship at Applidget, a startup in Paris. My job was to integrate linux containers technology in their private PaaS. At this time, there where no doubt, the technology to use was LXC. One week or so after I started digging into LXC, one of my co-worker talked to me about this new thing called docker. He told me "isn't it what you are supposed to do during your internship ?". And it was kind of it.
At this time I already highlighted a big challenge of containers in PaaS: creation time. Waiting for bundle install
to complete is already long enough to have to wait for another 40 secondes to create a container :). Docker landed just in time !
# this forces dpkg not to call sync() after package extraction and speeds up install | |
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup | |
# we don't need and apt cache in a container | |
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache |