Skip to content

Instantly share code, notes, and snippets.

View samjsharpe's full-sized avatar

Sam J Sharpe samjsharpe

View GitHub Profile
[
{ "userName": "alphagov", "repo": "blinken" },
{ "userName": "alphagov", "repo": "boxes" },
{ "userName": "alphagov", "repo": "cdn-acceptance-tests" },
{ "userName": "alphagov", "repo": "ci-puppet" },
{ "userName": "alphagov", "repo": "cloudflare-configure" },
{ "userName": "alphagov", "repo": "fabric-scripts" },
{ "userName": "alphagov", "repo": "ghtools" },
{ "userName": "alphagov", "repo": "govuk_crawler_worker" },
{ "userName": "alphagov", "repo": "govuk_mirror-puppet" },
[
{
"userName": "gds-operations",
"repo": "puppet-auditd"
},
{
"userName": "gds-operations",
"repo": "puppet-graphite"
},
{
@samjsharpe
samjsharpe / users.rb
Last active August 29, 2015 13:56
List github enterprise users
#!/usr/bin/env ruby
require 'rubygems'
require 'rest-client'
require 'json'
require 'pp'
scheme="https"
hostname="github.gds/api/v3"
username="yourgheusername"
password="yourghepassword"
#!/bin/bash
PSKYSCAPE="SKYSCAPEPASSWORD"
USKYSCAPE="SKYSCAPEUSERNAME"
PGDS="GDSPASSWORD"
UGDS="GDSUSERNAME"
function skyscape {
echo $PSKYSCAPE | sudo openconnect --passwd-on-stdin -b -q -u $USKYSCAPE --authgroup=CLIENT-VPN1 --no-cert-check vpn2.skyscapecloud.com >/dev/null 2>&1
}
---
foo: "%{hiera('bar')}"
bar: "%{hiera('baz')}"
baz: "blah"
Enable Access for Assistive Devices (For Spectacle.app and Stay.app)
http://www.tekrevue.com/2013/06/25/how-to-enable-access-for-assistive-devices-in-os-x-mavericks/
@samjsharpe
samjsharpe / counter.awk
Created October 21, 2013 22:38
Quick script to parse a web log (in custom format) looking for three images (with|without|base)-js, counting the occurrences and spit out a report on the useragents that grabbed without-js. Usage: gawk -f counter.awk <logfile>
$7 ~ /(without|with|base)-js/ {
split($7,array,"-");
target_string=array[2];
split(target_string,array2,"/");
image=array2[2];
switch (image) {
case "with":
WITH+=1
break
case "without":
#!/usr/bin/env ruby
require 'fastly'
service_id = 'deadbeefdeadbeef'
fastly = Fastly.new(:api_key => 'deadbeefdeadbeefdeadbeef')
service = fastly.get_service(service_id)
latest_version = service.version