Skip to content

Instantly share code, notes, and snippets.

@chris-moreton
chris-moreton / ComposerToranInjection.php
Last active August 29, 2015 14:07
Will inject the location of a Toran proxy server to an existing composer.json and composer.lock file.
<?php
define('TORAN_SERVER', 'toran.local');
$json = file_get_contents('composer.json');
$obj = json_decode($json);
if (!property_exists($obj, 'repositories')) {
$obj->repositories = [];
}
<?php
$packs = [];
$swaps = [];
const ATTEMPTS = 5000;
const CARDS_PER_PACK = 5;
const TOTAL_UNIQUE_STICKERS = 680;
const COST_PER_PACK = 50;
const COST_PER_MULTIPACK = 275;
@chris-moreton
chris-moreton / gist:8967a5ed4e205df43b8a0e40f84a5056
Created November 15, 2016 10:06
Goals League Rules Meeting
I would like to get all Captains to read through this. Any feedback would be welcome. This is not set in stone until Monday 14th November after we have heard some feedback.
As discussed in a Goals Wimbledon, Referees Meeting which took place on Friday 28th October.
Review of League Rules

| P--k F---- | D--- S--- o- t-- M--- | | D---d B---- | R--e a-- F--- o- Z---- S--r-u-- | | Q---- | A N---- a- t-- O---- | | T-- B--t--s | S-r----- P-p---- L---l- H-a--s C--- B--d | | M---l--- | B-- o-t o- H--l | | F---t---- M-- | R--o--- | | N-r--n- | N------n- | | T-- C---h | L----- C--l--- | | T-- S--t-s | T-- Q---- I- D-a- | | O-s-- | D--------- M---- |

HOWTO: Installing Vault On an AWS Ubuntu EC2 server

This is quick howto for installing vault on AWS Linux, mostly to remind myself. At the end of this tutorial, you'll have a working vault server, using s3 for the backend, self signed certificates for tls, and supervisord to ensure that the vault server is always running, and starts on reboot.

Setting up S3

First things first, let's set up an s3 bucket to use as the storage backend for our s3 instance.

  1. From the AWS Mangement Console, go to the S3 console.

  2. Click on the Create Bucket button

@chris-moreton
chris-moreton / tagger.php
Created May 9, 2018 09:33
Increase the version of the latest tag on the current git branch and push the tag.
<?php
/***********************************************************
Hacky script to increase the version of the latest tag
on the current branch and push the tag. Assumes a simple
SemVer tag of the format vx.x.x
************************************************************/
$usage = 'Usage: php tag.php [major|minor|patch]' . PHP_EOL;
if (count($argv) != 2) {
@chris-moreton
chris-moreton / ElasticSearchSpringConfigurationForCloudFoundry.java
Last active July 30, 2018 09:26
Configuration class for using the Searchly Elasticsearch service on Pivotal Web Services (Cloud Foundry), defaulting to localhost:9200 when running locally.
package com.netsensia.directorzone;
import java.util.Base64;
import org.apache.http.Header;
import org.apache.http.HttpHost;
import org.apache.http.message.BasicHeader;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
@chris-moreton
chris-moreton / Vagrantfile
Created September 7, 2018 20:09
Vagrant file for SSCS box
Vagrant.configure("2") do |config|
config.vm.box = "netsensia/xenial64sscs"
config.vm.hostname = "myprecise.box"
config.vm.network :private_network, ip: "192.168.0.42"
config.ssh.username = "ubuntu"
config.ssh.password = "vagrant"
config.vm.network "forwarded_port", guest: 3000, host: 7001
config.vm.network "forwarded_port", guest: 3451, host: 7002
@chris-moreton
chris-moreton / concourse-vault.md
Last active April 1, 2019 11:07
Using Concourse and Hashicorp Vault for a pipeline for private repositories
@chris-moreton
chris-moreton / gpush.sh
Last active May 4, 2019 10:51
Bash function to push all changes to your Git repo from any subdirectory
# A simple function that shows the changed files relative to the root, asks if you want to
# commit all the changes, and then commits and pushes with a given commit messasge.
#
# Usage gpush "This is a commit message"
function gpush() {
RETURN_CMD="cd $PWD"
while [ ! -d ".git" ]
do