Skip to content

Instantly share code, notes, and snippets.

View dc2447's full-sized avatar

David Campbell dc2447

View GitHub Profile

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

<Plugin curl_json>
<URL "http://<%= hostname %>:9200/_cluster/health?pretty=true">
Instance "elasticsearch"
<Key "number_of_nodes">
Type "counter"
</Key>
<Key "number_of_data_nodes">
Type "counter"
</Key>
<Key "active_primary_shards">
@dc2447
dc2447 / hot tables
Created September 13, 2013 09:35
checking for hot tables in Postgres
seller=# select relname,seq_tup_read,n_tup_ins from pg_stat_all_tables order by seq_tup_read desc limit 10;
@dc2447
dc2447 / replicaton delay
Last active December 22, 2015 23:39
Check for Postgres streaming replication delay
SELECT SUBSTRING(cast (NOW() - pg_last_xact_replay_timestamp() as text)
from 0 for 9) AS replication_delay
@dc2447
dc2447 / gist:5030860
Created February 25, 2013 16:07
Short Bash Script to get the replication delay on Postgres
#!/bin/bash
echo -n "Replication delay on ${HOSTNAME}: "
psql -tA -Upostgres -c 'SELECT NOW() - pg_last_xact_replay_timestamp() AS replication_delay'
@dc2447
dc2447 / gist:3335119
Created August 12, 2012 22:50
Test if an asset is faster or slower from the Akamai cache
curl -A -s -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' "http://images.apple.com/ipad/images/product_title.png" -o /dev/null
@dc2447
dc2447 / gist:3335099
Created August 12, 2012 22:47
akamai - Test if an asset is cached TCP_HIT or uncached TCP_MISS
curl -s -I -H "Pragma: akamai-x-cache-on" http://images.apple.com/ipad/images/product_title.png | grep X-Cache: