Skip to content

Instantly share code, notes, and snippets.

@garethr
garethr / bootstrap.sh
Created March 8, 2012 15:12
Bootstrap
#!/bin/bash
set -e
case `uname -m` in
x86_64) ARCH="amd64" ;;
*) ARCH="i386" ;;
esac
DESTINATION=~/govuk
RUBY_PACKAGE="https://gds-packages.s3.amazonaws.com/pool/ruby-1.9.2-p290_${ARCH}.deb"
@garethr
garethr / gist:2029440
Created March 13, 2012 15:34
new laptops

Brief instructions for taking a new OS X build and adding just enough development tools.

Install homebrew, a package manager.

/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

Update the brew catalogue and install a few likely needed tools, including the compiler toolchain.

brew update

brew install autoconf automake wget git

@garethr
garethr / gist:2158731
Created March 22, 2012 14:46
A vague plan for the evening before puppetcamp
@garethr
garethr / install-graphite-ubuntu-10.04.sh
Created April 7, 2012 22:00 — forked from MikeGrace/install-graphite-ubuntu-10.04.sh
Install Graphite 0.9.9 on Ubuntu 10.04
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Updated by Gareth Rushgrove (http://morethanseven.net)
# Last tested & updated 8th April 2012
####################################
sudo apt-get update
sudo apt-get upgrade
@garethr
garethr / gist:2336682
Created April 8, 2012 11:19
Government Digital Service - Web Operations Role

We're looking for systems administrators and software developers of all levels interested in a predominantly web operations role. You will...

  • Work with developers to optimise existing application and to design new ones
  • Support production web applications and infrastructure
  • Participate in stand-ups, planning sessions and retrospectives
  • Design, build and run systems for application deployment, systems orchestration and configuration management
  • Encourage everyone (developers, delivery managers, product owners) to think about how new applications will be run and maintained
  • Be an integral part of growing a multi-disciplinary operations team
  • Contribute to designing internal processes needed in the running of a high performance development and operations organisation
@garethr
garethr / open-source-guidelines.md
Last active December 19, 2015 05:59
A set of basic guidelines for publishing Open Source code in a way that makes engaging with it easier.

This document describes a set of rules and principles for publishing Open Source code that we explicitly intend to support.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this document are to be
interpreted as described in RFC 2119.

Projects MUST:

  • Include a README
@garethr
garethr / rkhunter-librato.py
Created September 16, 2013 09:57
Example of parsing the rkhunter output in Python, and creating metrics for each check in Librato Metrics.
rkhunter --check --nocolors --no-mail-on-warning --skip-keypress --no-summary | rkhunter-librato.py
@garethr
garethr / nmap-rspec.rb
Last active July 20, 2020 18:27
Example nmap scan of the monitorama.eu website written as an rspec test
tarting Nmap 6.40 ( http://nmap.org ) at 2013-11-15 09:36 GMT
Nmap scan report for monitorama.eu (141.101.116.49)
Host is up (0.012s latency).
Other addresses for monitorama.eu (not scanned): 141.101.117.49
PORT STATE SERVICE
20/tcp filtered ftp-data
21/tcp filtered ftp
22/tcp filtered ssh
23/tcp filtered telnet
25/tcp filtered smtp
@garethr
garethr / verbs.attack
Last active December 23, 2015 04:19
Demonstration of using gauntlt with the curl adaptor to check http responses to various methods
Feature: Evaluate responses to various HTTP methods.
Background: # verbs.attack:3
Given "curl" is installed # gauntlt-0.1.2/lib/gauntlt/attack_adapters/curl.rb:1
And the following profile: # gauntlt-0.1.2/lib/gauntlt/attack_adapters/gauntlt.rb:3
| name | value |
| hostname | google.com |
Scenario Outline: Verify server responds correctly to various HTTP methods # verbs.attack:9
When I launch a "curl" attack with: # gauntlt-0.1.2/lib/gauntlt/attack_adapters/curl.rb:5
@garethr
garethr / rkhunter-librato-test.py
Created September 16, 2013 16:52
Example nose based unit test against librato metrics API
>> nosetests -v rkhunter-librato-test.py
rkhunter-libratoo-test.test_beastkit_not_installed ... ok
----------------------------------------------------------------------
Ran 1 test in 1.585s
OK