Skip to content

Instantly share code, notes, and snippets.

View boffbowsh's full-sized avatar

Paul Bowsher boffbowsh

View GitHub Profile
@boffbowsh
boffbowsh / cve_2015_3226_fix.rb
Last active August 29, 2015 14:23
curl / wget this (retaining the name) into `config/initializers` to fix the CVE-2015-3226 vulnerability in Rails 3.2.22 apps
raise "Check monkey patch for CVE-2015-3226 is still needed" unless Rails::VERSION::STRING == '3.2.22'
module ActiveSupport
module JSON
module Encoding
private
class EscapedString
def to_s
self
end
end
#!/usr/bin/env perl
# This program is part of Percona Toolkit: http://www.percona.com/software/
# See "COPYRIGHT, LICENSE, AND WARRANTY" at the end of this file for legal
# notices and disclaimers.
use strict;
use warnings FATAL => 'all';
# This tool is "fat-packed": most of its dependent modules are embedded
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
Started by remote host 54.198.245.65
[EnvInject] - Loading node environment variables.
Building remotely on ci-slave-4.internal in workspace /home/jenkins/workspace/govuk_gds_sso_branches
Checkout:govuk_gds_sso_branches / /home/jenkins/workspace/govuk_gds_sso_branches - hudson.remoting.Channel@54d7ac37:ci-slave-4.internal
Using strategy: Default
Last Built Revision: Revision c6ec519b0b3fa60eb4bfe0d564d04b9bdec458b3 (origin/guidance-guarantee-programme-rails-5)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Commencing build of Revision b16375a2823d75f6f25d5170272bb6261f128907 (origin/guidance-guarantee-programme-rails-5)
Checking out Revision b16375a2823d75f6f25d5170272bb6261f128907 (origin/guidance-guarantee-programme-rails-5)

Keybase proof

I hereby claim:

  • I am boffbowsh on github.
  • I am boffbowsh (https://keybase.io/boffbowsh) on keybase.
  • I have a public key ASCh8rsxt3wMaPEYID-CbN86j-Ud2jc-IjeShrBCScJNvgo

To claim this, I am signing this object:

Started by remote host 54.83.125.94
[EnvInject] - Loading node environment variables.
Building remotely on ci-slave-4.internal in workspace /home/jenkins/workspace/govuk_gds_sso_branches
Checkout:govuk_gds_sso_branches / /home/jenkins/workspace/govuk_gds_sso_branches - hudson.remoting.Channel@3a430e0:ci-slave-4.internal
Using strategy: Default
Last Built Revision: Revision 4ef82dedd815f685e9711b8e256581adc6a91386 (origin/bearer-api-calls)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Commencing build of Revision 4ef82dedd815f685e9711b8e256581adc6a91386 (origin/bearer-api-calls)
Checking out Revision 4ef82dedd815f685e9711b8e256581adc6a91386 (origin/bearer-api-calls)
from sys import argv
from bs4 import BeautifulSoup
import requests
if __name__ == "__main__":
search = requests.get("https://www.gov.uk/api/search.json?q=%s&filter_format%%5B%%5D=answer" % argv[1])
for result in search.json()["results"]:
answer = requests.get("https://www.gov.uk%s" % result["link"])
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.3.1
-----> Installing dependencies using bundler 1.13.6
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/.......
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Using rake 11.2.2
Using PriorityQueue 0.1.2
schema_name body image format_display_type first_public_at change_note change_history tags withdrawn_notice archive_notice emphasised_organisations publish_time public_updated_at opening_date closing_date government political held_on_another_website_url national_applicability documents ways_to_respond public_feedback_publication_date public_feedback_detail public_feedback_documents final_outcome_publication_date final_outcome_detail final_outcome_documents slug title description quick_links query_response_time contact_form_links more_info_contact_form contact_type feature_on_homepage email_addresses more_info_email_address phone_numbers more_info_phone_number post_addresses more_info_post_address language related_mainstream_content alternative_scotland_url alternative_wales_url alternative_nothern_ireland_url collection_groups subscriber_list email_alert_type summary breadcrumbs govdelivery_title beta beta_message document_noun default_documents_per_page logo_path default_order filter reject facets format_nam
@boffbowsh
boffbowsh / Vagrantfile
Created March 19, 2017 16:52
A vagrantfile for starting a master + 2 node kubernetes cluster
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.provision "shell", inline: <<-SHELL
apt-get update && apt-get dist-upgrade -y && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
echo 'deb http://apt.kubernetes.io/ kubernetes-xenial main' > /etc/apt/sources.list.d/kubernetes.list