Skip to content

Instantly share code, notes, and snippets.

@chrisgagne
chrisgagne / incidents.py
Last active March 14, 2020 15:53
Export descriptions and notes from PagerDuty into a CSV file.
# -*- coding: utf-8 -*-
# This script requires pygerduty: https://github.com/dropbox/pygerduty
# Given a start date and end date, this sample will export the description and
# notes from all incidents to a CSV file. The CSV file is formatted for use
# with Excel.
# This will export to incident_notes_[start date]_-_[end date].csv in the same
# directory that this script is located in.
# This would be most useful to join with a CSV file as exported from PagerDuty.
@rbranson
rbranson / gist:038afa9ad7af3693efd0
Last active September 29, 2016 17:44
Disaggregated Proxy & Storage Nodes

The point of this is to use cheap machines with small/slow storage to coordinate client requests while dedicating the machines with the big and fast storage to doing what they do best. I found that request coordination was contributing to about half the CPU usage on our Cassandra nodes, on average. Solid state storage is quite expensive, nearly doubling the cost of typical hardware. It also means that if people have control over hardware placement within the network, they can place proxy nodes closer to the client without impacting their storage footprint or fault tolerance characteristics.

This is accomplished in Cassandra by passing the -Dcassandra.join_ring=false option when the process is started. These nodes will connect to the seeds, cache the gossip data, load the schema, and begin listening for client requests. Messages like "/x.x.x.x is now UP!" will appear on the other nodes.

There are also some more practical benefits to this. Handling client requests caused us to push the NewSize of the heap up

@wadey
wadey / Makefile
Created December 5, 2013 19:14
Makefile for generating Go coverage reports for Jenkins (for projects containing multiple packages)
GO=$(firstword $(subst :, ,$(GOPATH)))
GOCOV=$(GO)/bin/gocov
GOCOVXML=$(GO)/bin/gocov-xml
# List of pkgs for the project
PKGS=$(shell go list ./...)
# Coverage output: coverage/$PKG/coverage.out
COVPKGS=$(addsuffix /coverage.out,$(addprefix coverage/,$(PKGS)))
@miketheman
miketheman / zook_grow.md
Created July 22, 2013 21:36
Adding nodes to a ZooKeeper ensemble

Adding 2 nodes to an existing 3-node ZooKeeper ensemble without losing the Quorum

Since many deployments may start out with 3 nodes and so little is known about how to grow a cluster from 3 memebrs to 5 members without losing the existing Quorum, here is an example of how this might be achieved.

In this example, all 5 nodes will be running on the same Vagrant host for the purpose of illustration, running on distinct configurations (ports and data directories) without the actual load of clients.

YMMV. Caveat usufructuarius.

Step 1: Have a healthy 3-node ensemble

@rcrowley
rcrowley / failover-lb-member.sh
Created May 24, 2012 00:42
How to use two Cloud Servers to make a decently available load balancer
#!/bin/sh
# Failover a member of a load balancer pair. If this Cloud Server is
# currently the primary, it becomes the secondary, and vice versa.
#/ Usage: failover-lb-member
set -e
usage() {
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
cscotta@ordasity:~/Desktop$ scala -cp mongo-2.7.0.jar Repro.scala
Inserting canary...
Inserting test data...
Paging through records...
Spotted the canary!
Updating canary object...
Spotted the canary!
Whoops, shipped the same order multiple times!
cscotta@ordasity:~/Desktop$