Skip to content

Instantly share code, notes, and snippets.

@barrydobson
barrydobson / demo.md
Last active August 5, 2021 14:06
Istio Traffic Shifting

Istio Demo

Install minikube following instructions here

minikube config set cpus 2
minikube config set memory 8192
minikube config set disk-size 50g
minikube start --vm=true
@barrydobson
barrydobson / patch.sh
Last active June 16, 2021 12:49
Patch circle Yaml
#!/usr/bin/env bash
set -Eeo pipefail
patch=$(cat <<EOF
cGFyYW1ldGVyczoKICBhcHBsaWNhdGlvbi1uYW1lOgogICAgZGVzY3JpcHRpb246ICJOYW1lIG9m
IGFwcGxpY2F0aW9uIGZvbGRlciBpbiBhcHBzIHJlcG8iCiAgICB0eXBlOiBzdHJpbmcKICAgIGRl
ZmF1bHQ6ICJhcHBuYW1lIiAjIyBDSEFOR0UgTUUKCmV4ZWN1dG9yczoKICB0b3RlLWV4ZWN1dG9y
OgogICAgZG9ja2VyOgogICAgICAtIGltYWdlOiBnaGNyLmlvL3RoZXRvdGUvY2ljZC10b29sczpj
aXJjbGVjaS1nby1sYXRlc3QKICAgICAgICBhdXRoOgogICAgICAgICAgdXNlcm5hbWU6ICRDSVJD
TEVfUFJPSkVDVF9VU0VSTkFNRQogICAgICAgICAgcGFzc3dvcmQ6ICRHSENSX1RPS0VOCgpqb2Jz

Keybase proof

I hereby claim:

  • I am barrydobson on github.
  • I am barrydobson (https://keybase.io/barrydobson) on keybase.
  • I have a public key ASCLF5Wsrhgyju3AE8QsDjaH44iZ1RYZxwoXKDA3_VgpaAo

To claim this, I am signing this object:

@barrydobson
barrydobson / ubuntu-run.sh
Created July 5, 2020 18:39
Run an Ubuntu container in kubernetes
kubectl run -i --tty --rm debug --image=ubuntu --restart=Never -- bash
@barrydobson
barrydobson / git.sh
Last active June 23, 2020 07:19
GIT submodules
# Add a submodule tracking master
git submodule add -b <branch> <repo> <name>
# Update a submodule
git submodule update --remote
# Update a submodule from a parent repo
cd path/to/submodule
git add <files>
git commit -m "comment"
@barrydobson
barrydobson / install-docker-compose.sh
Created July 10, 2019 08:24
Install Docker & Docker-Compose on WSL
# Install Python and PIP.
sudo apt-get install -y python python-pip
# Install Docker Compose into your user's home directory.
pip install --user docker-compose
@barrydobson
barrydobson / env-name.cfg.yml
Created August 23, 2016 07:23
Sample AWS Elastic Beanstalk Environment configuration file
AWSConfigurationTemplateVersion: 1.1.0.0
EnvironmentTier:
Type: Standard
Name: WebServer
SolutionStack: 64bit Amazon Linux 2016.03 v2.1.0 running Docker 1.9.1
EnvironmentConfigurationMetadata:
Description: Configuration for my application.
DateCreated: '1461754412000'
DateModified: '1463744634'
Tags:
@barrydobson
barrydobson / decoratorConstruction.js
Last active December 2, 2015 07:44
Example of wrapping a source in multiple decorators
var result = decorator3(decorator2(decorator1(source(someArgs), someOtherArgs), moreArgs), evenMoreArgs, andThenSome);
@barrydobson
barrydobson / applyTax.js
Created December 1, 2015 14:26
A sample modifier to apply tax information to a set of room rates
var Promise = require('bluebird');
module.exports = function create(taxService) {
function addTaxInformation(id, roomRates) {
return Promise.each(roomRates, function (roomRate) {
return taxService.getTaxInformation(id, roomRate.total.price)
.then(function (taxInformation) {
if (taxInformation) {
roomRate.total.priceBeforeTax = taxInformation.priceBeforeTax;
roomRate.taxes = taxInformation.taxBreakdown;
@barrydobson
barrydobson / roomRateSouceChain.js
Last active December 1, 2015 14:27
Our implementation of the room rate source chain. It executes the source, then runs through all the modifiers
var Promise = require('bluebird');
module.exports = function roomRateSourceChain(originalSource, modifiers) {
return {
getRoomRates: function () {
var originalArguments = [].slice.call(arguments);
return originalSource.apply(null, originalArguments)
.then(function (roomRates) {
originalArguments.unshift(roomRates);
return Promise.reduce(modifiers, function (resultsFromPrevious, modifier) {