Skip to content

Instantly share code, notes, and snippets.

@timmow
timmow / gist:15e0d69acca67bebc627
Created March 2, 2015 16:06
Profiling Python
GDS Profiling Python
pip install grpof2dot
pip install graphviz
gprof2dot -f pstats /tmp/-1422538070.52.profile | dot -Tpng -o output.png
How to create a .profile file in /tmp:
Add the following de
# linux containers from scratch
different to virtual machines
full os in container has some gotchas
containers are transparent
host os sees process from within container
@timmow
timmow / gist:1403c18f5ecd7d4b70eb
Created November 17, 2014 17:12
velocity day 1 notes

Steve Shorrck - Life after human error

"someone did something someone else thinks is wrong"

Examples of headlines blaming human error

"Hal 9000 explanation" - not completely telling the truth

lots of examples of words used in failure situations

@timmow
timmow / tcpdump output
Created November 10, 2014 12:49
node AAAA lookups
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
12:48:09.785378 IP (tos 0x0, ttl 64, id 31267, offset 0, flags [DF], proto UDP (17), length 60)
172.27.1.11.59292 > 8.8.8.8.53: [bad udp cksum 0xbd6f -> 0x9911!] 12994+ AAAA? www.google.com. (32)
12:48:09.798648 IP (tos 0x0, ttl 44, id 10954, offset 0, flags [none], proto UDP (17), length 88)
8.8.8.8.53 > 172.27.1.11.59292: [udp sum ok] 12994 q: AAAA? www.google.com. 1/0/0 www.google.com. [4m59s] AAAA 2a00:1450:400c:c0a::93 (60)
12:48:09.798932 IP (tos 0x0, ttl 64, id 53453, offset 0, flags [DF], proto UDP (17), length 60)
172.27.1.11.45605 > 8.8.8.8.53: [bad udp cksum 0xbd6f -> 0x661b!] 39754+ A? www.google.com. (32)
12:48:09.819764 IP (tos 0x0, ttl 44, id 10955, offset 0, flags [none], proto UDP (17), length 156)
8.8.8.8.53 > 172.27.1.11.45605: [udp sum ok] 39754 q: A? www.google.com. 6/0/0 www.google.com. [3m13s] A 64.233.167.105, www.google.com. [3m13s] A 64.233.167.147, www.google.com. [3m13s] A 64.233.167.1
_everyLittleHelps: function (data) {
return _.map(data, function (dataset) {
dataset['values'] = [];
dataset['values'] = _.omit(dataset, ['values', 'channel']);
console.log('tmp');
console.log(dataset);
return dataset;
});
@timmow
timmow / gist:efa0e6463b1e1f1a0af2
Last active August 29, 2015 14:02
~/.vagrant.d/Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider :virtualbox do |vb, override|
vb.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2"]
end
config.vm.synced_folder ".", "/vagrant", type: "rsync"
end
@timmow
timmow / command.sh
Created May 19, 2014 09:48
Changes in multiple repos
for i in $(find .. -name '*collector*' -type d -depth 1 -not -path '../performanceplatform-collectors'); do echo "\n\n\n\n\n\n\n$i\n"; (cd $i; git --no-pager log --oneline --merges --since="21/4/2014" --color=always;) done | less -FXRS

What we want in CF

Dry run option

Its a bit scary to run an update option on a stack and potentially have all your running instances destroyed and replaced - would be good to have a dry run option

Ref / Fn::GetAtt works outside of current stack

@timmow
timmow / node.pp
Created February 28, 2014 11:37
Use a fact instead of ENC
node default {
include $::puppet_class_set_from_fact
}
pt-kill --interval 2 --kill --busy-time 40 --match-command Query --victims all -v