Skip to content

Instantly share code, notes, and snippets.

View flavio's full-sized avatar

Flavio Castelli flavio

View GitHub Profile
### Keybase proof
I hereby claim:
* I am flavio on github.
* I am flavio (https://keybase.io/flavio) on keybase.
* I have a public key whose fingerprint is AD5B 286B FC09 361A F047 7FA0 B017 C183 7D5F 0D40
To claim this, I am signing this object:
[vagrant@kubernetes-minion-1 ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
01d6ba720de3 docker-registry.in.da.house/brendanburns/php-redis:latest "/bin/sh -c /run.sh" 19 minutes ago Up 19 minutes k8s_php-redis.7723b593_15f6c1f2-53d8-11e4-968e-0800279696e1.etcd_15f6c1f2-53d8-11e4-968e-0800279696e1_0086b796
168a289c3f2d kubernetes/pause:latest "/pause" 20 minutes ago Up 20 minutes 0.0.0.0:8000->80/tcp k8s_net.a7c18396_15f6c1f2-53d8-11e4-968e-0800279696e1.etcd_15f6c1f2-53d8-11e4-968e-0800279696e1_ac4d51dd
8f37f90998eb docker-registry.in.da.house/brendanburns/redis-slave:latest "/bin/sh -c /run.sh" 22 minutes ago Up 22 minutes k8s_slave.1b352a7a_acd07d76-53d7-11e4-968e-0800279696e1.etcd_acd07d
@flavio
flavio / logger_example
Created May 26, 2014 10:06
Simple way to share a logger across a bunch of files without using a global variable
require 'forwardable'
require 'singleton'
require 'logger'
module Silvio
class Logger
include Singleton
extend Forwardable
def_delegators :@logger, :debug, :info, :warn, :error, :fatal
[debug] api.go:933 Calling POST /containers/create
2014/02/12 15:50:14 POST /v1.9/containers/create
[/var/lib/docker|a9ecaa15] +job create()
[debug] deviceset.go:191 registerDevice(202, 6897316605f23e395b4abcf63071f507bb15488f28b07a363671d9f243006624-init)
[debug] deviceset.go:212 activateDeviceIfNeeded(6897316605f23e395b4abcf63071f507bb15488f28b07a363671d9f243006624-init)
[debug] deviceset.go:191 registerDevice(203, 6897316605f23e395b4abcf63071f507bb15488f28b07a363671d9f243006624)
[debug] deviceset.go:212 activateDeviceIfNeeded(6897316605f23e395b4abcf63071f507bb15488f28b07a363671d9f243006624)
[debug] deviceset.go:790 [devmapper] UnmountDevice(hash=6897316605f23e395b4abcf63071f507bb15488f28b07a363671d9f243006624 path=/var/lib/docker/devicemapper/mnt/6897316605f23e395b4abcf63071f507bb15488f28b07a363671d9f243006624)
[debug] deviceset.go:795 [devmapper] Unmount(/var/lib/docker/devicemapper/mnt/6897316605f23e395b4abcf63071f507bb15488f28b07a363671d9f243006624)
[debug] deviceset.go:800 [devmapper] Unmount done
@flavio
flavio / aufs_crash.log
Created September 4, 2013 12:56
Relevant part from /var/log/messages
This file has been truncated, but you can view the full file.
2013-09-04T13:13:42.279434+02:00 roesti kernel: [11570.686358] aufs aufs_migratepage:666:mergesolv[17456]: This operation is not supported. Please report this application to aufs-users ML.
2013-09-04T13:13:42.279460+02:00 roesti kernel: [11570.686364] CPU: 0 PID: 17456 Comm: mergesolv Tainted: G O 3.10.10-3.g8038aea-desktop #1
2013-09-04T13:13:42.279463+02:00 roesti kernel: [11570.686365] Hardware name: LENOVO 6458C98/6458C98, BIOS 7LETC1WW (2.21 ) 07/01/2008
2013-09-04T13:13:42.279465+02:00 roesti kernel: [11570.686367] ffffffff815d1a65 000000000000007d ffffffffa0a90d7f ffff880082cc6b50
2013-09-04T13:13:42.279468+02:00 roesti kernel: [11570.686371] ffffffff81169dea 0000000000000001 ffffffff81174055 ffffea00041bf448
2013-09-04T13:13:42.279470+02:00 roesti kernel: [11570.686374] 0000000000000001 ffffea00038186b0 ffffffff81177030 ffffea00038186b0
2013-09-04T13:13:42.279473+02:00 roesti kernel: [11570.686377] Call Trace:
2013-09-04T13:13:42.279475+02:00 roesti kernel: [11570.686390] [<ffffffff81004
/tmp/python-build.20130722162116.21155 ~
Python-2.6.8/
Python-2.6.8/.hg_archival.txt
Python-2.6.8/README
Python-2.6.8/Makefile.pre.in
Python-2.6.8/Python/
Python-2.6.8/Python/bltinmodule.c
Python-2.6.8/Python/thread_foobar.h
Python-2.6.8/Python/asdl.c
Python-2.6.8/Python/getargs.c
/tmp/python-build.20130722120128.14436 ~
Python-2.6.8/
Python-2.6.8/.hg_archival.txt
Python-2.6.8/README
Python-2.6.8/Makefile.pre.in
Python-2.6.8/Python/
Python-2.6.8/Python/bltinmodule.c
Python-2.6.8/Python/thread_foobar.h
Python-2.6.8/Python/asdl.c
Python-2.6.8/Python/getargs.c
@flavio
flavio / group_logs.rb
Created April 17, 2013 10:24
Small ruby script made for my friend Renato
#!/usr/bin/env ruby
groups = Hash.new{|h,k| h[k] = []}
File.read('foo').lines.each do |line|
ip = line.split(/\s+/).first
next if ip.empty? || ip.nil?
root = ip.split('.')[0,2].join('.')
groups[root] << line.chomp
end
@flavio
flavio / CMakeLists.txt
Created December 17, 2012 11:16
libsolv Bug
PROJECT (bug)
CMAKE_MINIMUM_REQUIRED (VERSION 2.4)
FIND_LIBRARY(LIBSOLV_LIBRAY NAMES libsolv solv
HINTS "${LIBSOLV_INSTALL}/lib" "${LIBSOLV_INSTALL}/lib64")
FIND_PATH(LIBSOLV_INCLUDE NAMES solver.h
HINTS "${LIBSOLV_INSTALL}/include/solv")
{ "data" : [ [ 0, 25, 88, 0, 50, 0, 0, 1, 5 ], [ 0, 44, 156, 0, 50, 0, 0, 2, 30 ], [ 0, 51, 181, 0, 50, 0, 0, 3, 50 ], [ 0, 58, 205, 0, 50, 0, 0, 4, 55 ], [ 0, 69, 244, 0, 50, 1, 0, 5, 50 ], [ 0, 75, 266, 0, 50, 1, 0, 6, 50 ], [ 0, 78, 276, 0, 50, 1, 0, 7, 50 ], [ 0, 85, 301, 0, 50, 1, 0, 8, 50 ], [ 0, 90, 319, 0, 50, 1, 0, 9, 50 ], [ 0, 91, 323, 0, 50, 2, 0, 10, 50 ], [ 0, 93, 330, 0, 50, 2, 0, 11, 50 ], [ 0, 94, 333, 0, 50, 2, 0, 12, 50 ], [ 0, 94, 333, 0, 50, 2, 0, 13, 50 ], [ 0, 95, 337, 0, 50, 2, 0, 14, 50 ], [ 0, 95, 337, 1, 50, 3, 0, 15, 50 ], [ 0, 95, 337, 1, 50, 3, 0, 16, 50 ], [ 0, 95, 337, 1, 50, 3, 0, 17, 50 ], [ 0, 94, 333, 1, 50, 3, 0, 18, 50 ], [ 0, 94, 333, 1, 50, 3, 0, 19, 50 ], [ 0, 93, 330, 1, 50, 4, 0, 20, 50 ], [ 0, 93, 330, 1, 50, 4, 0, 21, 50 ], [ 0, 93, 330, 1, 50, 4, 0, 22, 50 ], [ 0, 92, 326, 1, 50, 4, 0, 23, 50 ], [ 0, 93, 330, 1, 50, 4, 0, 24, 50 ], [ 0, 94, 333, 1, 50, 5, 0, 25, 50 ], [ 0, 94, 333, 2, 50, 5, 0, 26, 50 ], [ 0, 94, 333, 2, 50, 5, 0, 27, 50 ], [ 0, 95, 337, 2, 50, 5,