Skip to content

Instantly share code, notes, and snippets.

View commuterjoy's full-sized avatar

Matt Chadburn commuterjoy

View GitHub Profile
# should see 'desktop'
curl -siA 'GuardianAnywhere' http://www.theguardian.com/profile/justinmccurry/rss | grep X-GU-Platform
# should see truncated feeds from 'next-gen-router'
curl -siA 'GoogleBot' http://www.theguardian.com/profile/justinmccurry/rss | grep X-GU-Platform
curl -siA 'Firefox' http://www.theguardian.com/profile/justinmccurry/rss | grep X-GU-Platform
2 GET /uk-news/scotland+tone/news/rss HTTP/1.1
2 GET /unitedstates/rss HTTP/1.1
2 GET /world/barackobama/rss HTTP/1.1
2 GET /world/japan/2011/nov/23/rss HTTP/1.1
3 GET /books/books%20tone/news/rss HTTP/1.1
3 GET /commentisfree/commentisfree+society/mentalhealth/rss HTTP/1.1
3 GET /environment/comment/rss HTTP/1.1
3 GET /global-development/global-development+environment/fair-trade/rss HTTP/1.1
3 GET /music/classicalmusicandopera+tone/livemusicreview/rss HTTP/1.1
3 GET /music/music%20tone/albumreview/rss HTTP/1.1
FAIL,404,http://beta.theguardian.com/artanddes/commentisfree/rss,
FAIL,404,http://beta.theguardian.com/artanddesign/artanddesign+tone/blogpost/rss,
FAIL,404,http://beta.theguardian.com/artanddesign/camera-club-blog+tone/blogpost/rss,
FAIL,404,http://beta.theguardian.com/artanddesign/mostviewed/rss,
FAIL,404,http://beta.theguardian.com/artanddesign/pablo-picasso+tone/blogpost/rss,
FAIL,404,http://beta.theguardian.com/best-of-the-forums/rss,
FAIL,404,http://beta.theguardian.com/books/bestbooks+tone/blogpost/rss,
FAIL,404,http://beta.theguardian.com/books/biography/2002/dec/17/rss,
FAIL,404,http://beta.theguardian.com/books/books%2Btone/news/rss,
FAIL,404,http://beta.theguardian.com/books/books%2Btone/reviews/rss,
@commuterjoy
commuterjoy / gist:9770897
Created March 25, 2014 20:43
Rome RSS errors
! @6hk87e8mf - Internal server error, for (GET) [/profile/sukhdev-sandhu/rss] ->
play.api.Application$$anon$1: Execution exception[[IllegalDataException: The data "'Possessed' by his subjects … Philip Hoare. Photograph: Andrew Sutton for the Guardian." is not legal for a JDOM character content: 0xf is not a legal XML character.]]
at play.api.Application$class.handleError(Application.scala:293) ~[frontend-facia.jar:1-SNAPSHOT]
at play.api.DefaultApplication.handleError(Application.scala:399) [frontend-facia.jar:1-SNAPSHOT]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$12$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:165) [frontend-facia.jar:1-SNAPSHOT]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$12$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:162) [frontend-facia.jar:1-SNAPSHOT]
Caused by: org.jdom.IllegalDataException: The data "'Possessed' by his subjects … Philip Hoare. Photograph: Andrew Sutton for the Guardian." is not legal for a JDO
@commuterjoy
commuterjoy / test.md
Created March 20, 2014 20:41
Engineering manager technical test

Feature switch system

In the presentation tier of the website we want the ability to turn features on and off outside of release cycles.

I think we'll have around 150 switches.

Can you please outline a system that does that?

Please ask as many questions you need to clarify the requirements.

@commuterjoy
commuterjoy / 404s - Googlebot
Last active August 29, 2015 13:57
404s on NGW from 2014-03-18
1 Googlebot/2.1;
1 /world/2011/mar/23/us-soldier-admits-killing-afghans)
1 /values
1 /travel/2010/jan/30/india-northern-kerala-hills-spice%20
1 /theguardian/page/fromthearchive1980s/rss
1 /sustainable-business/grounds-sustainability-coffee-energy-fuel-polluti_1
1 /sport/www.theguardian.com/sport/2012/dec/09/flemenstar-peter-casey-cheltenham-festival
1 /sport/london-2012-olympics-blog/2011/mar/24/guardian.co.uk
1 /society/2014/jan/15/exercise-fatigue-m%E2%80%A6
1 /science/2008/may/24/controversiesinscience.guardianhayfestival,
@commuterjoy
commuterjoy / gist:9640570
Created March 19, 2014 12:23
Grep the nginx from all of the routers
gu ec2 list | grep PROD | grep router | tr -s ' ' | cut -d " " -f 5 | xargs -I % echo 'ssh ec2-user@% "sudo cut -d , -f 3,4 /var/log/nginx/access.log | grep html | grep -v oas"'
@commuterjoy
commuterjoy / get__repos.sh
Created March 11, 2014 12:19
Clone all an organisation's GitHub repositories
# usage ./get__repos.sh | /bin/sh
org=https://api.github.com/orgs/Financial-Times/repos?per_page=100
[email protected]:Financial-Times/%.git
curl -s $org | ruby -e "require 'json';JSON.parse(STDIN.read).each{|r|puts r['name']}" | xargs -I % echo "git clone --progress $clone_url"
@commuterjoy
commuterjoy / domains
Last active August 29, 2015 13:56
Guardian domains in the Apache RED database - 2562 regex, 862 domains
abroadtalk.guardian.co.uk
adinfo-guardian.co.uk
adinfo-guardian.co.uktemp
ads.guardian.co.uk
ads.guardianunlimited.co.uk
adviceunlimited.co.uk
answersunlimited.co.uk
archive.guardian.co.uk
arts.guardian.co.uk
arts.theguardian.com
@commuterjoy
commuterjoy / consumer.js
Last active August 29, 2015 13:56
I needed to add 2 million http redirects to a AWS dynamo db table ...
var kue = require('kue')
, stream = require('stream')
, AWS = require('aws-sdk')
, queue = kue.createQueue()
, debug = false
, util = require('util')
, log = function (msg) {
if (debug) console.log(message)
};