Skip to content

Instantly share code, notes, and snippets.

View adamstrawson's full-sized avatar

Adam Strawson adamstrawson

  • SequenceHQ
  • Brighton
View GitHub Profile
@adamstrawson
adamstrawson / envoyfilter.yaml
Created April 21, 2022 13:35
Ory Oathkeeper
---
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: oathkeeper
namespace: istio-ingress
spec:
workloadSelector:
(function() {
'use strict';
console.log("Starting");
setInterval(function(){
var i;
var button=document.getElementsByClassName("refreshNow");
for (i = 0; i < button.length; i++) {
button[i].click();
console.log("Refreshing: "+i)
}
@adamstrawson
adamstrawson / httpResponse.sh
Last active December 28, 2015 10:39
Simple bash script to get HTTP response times
#!/bin/bash
CURL="/usr/bin/curl"
echo -n "Enter Url to test: "
read url
URL="$url"
result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL`
IFS=':' read -a times <<< "${result}"
@adamstrawson
adamstrawson / gist:4959209
Last active December 13, 2015 18:58
DRBD & mkfs: Wrong medium type while trying to determine filesystem size

DRBD & mkfs: Wrong medium type while trying to determine filesystem size

Issue

On a freshly created DRBD block device, mkfs throws an error:

[adam@data01 ~] mkfs.ext4 /dev/drbd0
mke2fs 1.41.12 (17-May-2010)
mkfs.ext4: Wrong medium type while trying to determine filesystem size
@adamstrawson
adamstrawson / gist:4045095
Created November 9, 2012 10:41
Cucumber Example
Feature: Division
In order to avoid silly mistakes
Cashiers must be able to calculate a fraction
Scenario: Regular numbers
* I have entered 3 into the calculator
* I have entered 2 into the calculator
* I press divide
* the result should be 1.5 on the screen
@adamstrawson
adamstrawson / gist:2309256
Created April 5, 2012 08:44
Find all symlinks in directory
find /shares/build/ -type l -exec ls -l {} \;
@adamstrawson
adamstrawson / gist:2290961
Created April 3, 2012 10:42
Search string in recursive dir and append to file.
find . -exec grep -lr --exclude="*\.svn*" "SEARCH STRING" {} >> filename.txt \;