Skip to content

Instantly share code, notes, and snippets.

Brandon Galbraith brandongalbraith

  • North America
Block or report user

Report or block brandongalbraith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View _MicroService Proxy Gateway Solutions.md

MicroService Proxy Gateway Solutions

Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.

Github Star Trend:

Github Star History for Kong vs traefik vs fabio vs caddy vs Zuul

This is just a picture of this link from March 2, 2019

Originally, I had included some other solution

@brandongalbraith
brandongalbraith / gist:8453fc83e52e82b92792c8d322f44de6
Created Jan 26, 2019 — forked from garyrh/gist:2a373cc5a097433471fa
Shell function that returns how many captures the Wayback Machine lists for a page/domain
View gist:8453fc83e52e82b92792c8d322f44de6
function ia-check() {
echo $(curl -s -m60 "https://web.archive.org/web/*/$(echo "$*" | sed 's# #%20#g;s#/$#/\*#')" |
head -c10KB |
grep -m1 -Poi "(Saved <strong>\d+ time(s)?)|((\d+,)*\d+ URLs have been captured for this domain)|(Page cannot be crawled or displayed due to robots\.txt)|(This URL has been excluded from the Wayback Machine)|(Wayback Machine doesn&apos;t have that page archived)|(504 Gateway Time-out)" |
sed "s#&apos;#'#g;s#<strong>##")
}
View aws_mfa.py
import os
import getpass
import boto3
os.environ['AWS_ACCESS_KEY_ID'] = ... # your accounts access key
os.environ['AWS_SECRET_ACCESS_KEY'] = ... # your accounts secret
client = boto3.client("sts")
token = getpass.getpass("Enter MFA token -> ")
# Exchange permanent key/secret for temporary ones
@brandongalbraith
brandongalbraith / pocket_exporter.py
Created Nov 6, 2018 — forked from jasonrdsouza/pocket_exporter.py
Export archived article data from Pocket
View pocket_exporter.py
'''This script can be used to export data from Pocket (getpocket.com)
Uses include migrating to a different "read it later" service, saving
specific articles to another service, backing up your reading history,
and more.
Currently it can be used to export links and metadata for archived
articles with a given tag, which are more recent than a given timestamp.
An example use case is to export all articles you have tagged as
"to-export", which are newer than 10 days old. The timestamp functionality
@brandongalbraith
brandongalbraith / detect-private-browsing.js
Created Apr 3, 2018 — forked from cou929/detect-private-browsing.js
Detect private browsing mode (InPrivate Browsing or Incognito).
View detect-private-browsing.js
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
@brandongalbraith
brandongalbraith / aws-s3-bucket-policy-tls-kms-enforcement.json
Last active Mar 8, 2018
AWS S3 Bucket Policy: Require TLS for data transport, enforce object encryption using any KMS key
View aws-s3-bucket-policy-tls-kms-enforcement.json
{
"Version": "2012-10-17",
"Id": "PolicyIdentifierGUIDgoesHere",
"Statement": [{
"Action": "s3:*",
"Effect": "Deny",
"Principal": "*",
"Resource": "arn:aws:s3:::<bucketname>",
"Condition": {
"Bool": {
View tubeup-bootstrap.sh
#!/bin/bash
# Install
# curl https://gist.githubusercontent.com/brandongalbraith/872ffca09d7c40b1550e6ca1ead1989f/raw/ab758a14827ea53470386b515fda8bdac30d38bc/tubeup-bootstrap.sh | bash
# Instructions
# https://github.com/bibanon/tubeup/blob/master/README.md
sudo apt-get -y update # apt likes to be fresh
sudo apt-get -y install libav-tools ffmpeg python3-pip git jq # tubeup deps
@brandongalbraith
brandongalbraith / fr-set-down.py
Created Feb 20, 2018 — forked from zmwangx/fr-set-down.py
Python script to download entire photosets (original quality) on Flickr. #flickr
View fr-set-down.py
#!/usr/bin/env python
import subprocess
import sys
# pip install flickrapi
# project home: http://stuvel.eu/flickrapi
import flickrapi
api_key = '00000000000000000000000000000000' # obtain your api key at http://www.flickr.com/services
@brandongalbraith
brandongalbraith / osx_ramdisk.sh
Created Jan 14, 2018 — forked from jnschulze/osx_ramdisk.sh
Move Chrome, Safari and iTunes Cache to Ramdisk.
View osx_ramdisk.sh
#!/bin/bash
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB
#DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864`
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152`
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK
CACHEDIR="/Volumes/RamDiskCache/$USER"
View street-sweeper
#!/usr/bin/env bash
#
# Clean up an instance so packer can bake an AMI from it.
#
# Copyright 2017, Jiff Inc
# License: Apache 2.0
set -o pipefail
if [ ! -z "${DEBUG}" ]; then
You can’t perform that action at this time.