Skip to content

Instantly share code, notes, and snippets.

View atharrison's full-sized avatar

Andrew Harrison atharrison

  • Austin, TX
  • 08:15 (UTC -05:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am atharrison on github.
  • I am atharrison (https://keybase.io/atharrison) on keybase.
  • I have a public key whose fingerprint is 906F C6EF 8788 F56B 67A6 8840 BE17 1EA8 F2E9 358F

To claim this, I am signing this object:

@atharrison
atharrison / gist:467d6ce6a681daf841a6
Last active August 29, 2015 14:01
Rtanque Bot 1
class AthBot1 < RTanque::Bot::Brain
NAME = 'Andrew'
include RTanque::Bot::BrainHelper
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 1.0
SWITCH_CORNER_TICK_RANGE = (600..1000)
POWER_FACTOR = 1.0
def rng
@rng ||= Random.new
@atharrison
atharrison / gist:8851446
Created February 6, 2014 19:56
PagerDuty story

We've been using PagerDuty at Return Path for about a year now, to keep track of on-call schedules and alert only the right person on those pesky over-night outages. A few months ago I received an alert that one of our user shards was down (actually, I received many alerts, as the rippling effects made their way across the system). It was 3am, but I didn't have all the tools to solve this on my own, so had to resort to escalating to my manager.

We slogged through the issue together, isolating the shard, replacing the machine via the cloud, spinning everything back up, and watched as things recovered. Along the way, we revised our on-call triage page related to this issue. But that's not the best part. See, a month later, when I was back on-rotation again (I knew I was on-call because PagerDuty sent me a text earlier in the week), another shard went down at 3am. But this time there was no panic- simply groggy but calm assurance that I knew what I was doing and everything would be fine by morning (and it was).

@atharrison
atharrison / histogram.hive
Last active December 23, 2015 08:59
Using Apache Hive to generate Histogram data
-- TODO Cleanup, add documentation
select difference, count(distinct difference) from (
select size(split(subject, '[ ]')) - size(split(subject, '[ ]')) as difference from readrate where day=YYYYMMDD
) t1 group by difference order by difference limit 10;
select difference, count(difference) as total from (
select size(split(decoded_subject, '[ ]')) - size(split(subject, '[ ]')) as difference from readrate where day=YYYYMMDD limit 10) t1
group by difference;