Skip to content

Instantly share code, notes, and snippets.

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 / 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
@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
_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 / 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
@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

# 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: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
@timmow
timmow / after
Created March 3, 2015 11:35
Dashboard queries before and after
[03-Mar-15 11:29:58] DEBUG [django.db.backends:79] (0.004)
SELECT c.relname
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r', 'v', '')
AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
AND pg_catalog.pg_table_is_visible(c.oid); args=None
[03-Mar-15 11:29:58] DEBUG [django.db.backends:79] (0.002) SELECT "django_content_type"."id", "django_content_type"."name", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."model" = 'logentry' AND "django_content_type"."app_label" = 'admin' ); args=('logentry', u'admin')
[03-Mar-15 11:29:58] DEBUG [django.db.backends:79] (0.001) SELECT "auth_permission"."content_type_id", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "django_content_type" ON ( "auth_permission"."content_type_id" = "django_content_type"."id" ) WHERE "auth_permission"."content_type

First, checkout a new branch of cf-terraform from vanilla_cf_prototype

git checkout vanilla_cf_prototype # from master
git checkout -b vanilla_cf_prototype_split

Then run the following -