Skip to content

Instantly share code, notes, and snippets.

David Kavanagh dkavanagh

Block or report user

Report or block dkavanagh

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 gist:98c9b421421adc71a6fa7bab92cab964
{
"Comment": "A Hello World example of the Amazon States Language using a Pass state",
"StartAt": "HelloWorld",
"States": {
"HelloWorld": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:721404732763:function:WaitForFive",
"End": true,
"Retry": [
{
View gist:4dea1df6725d61561c6d12eeee28a7f8
{
"StartAt": "Calculate",
"States": {
"Calculate": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:721404732763:function:DoMath",
"ResultPath": "$.second",
"Next": "CalculateToo"
},
"CalculateToo": {
View gist:b31191ff4e14984d3bd76b59caea6141
{
"StartAt": "Calculate",
"States": {
"Calculate": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:721404732763:function:DoMath",
"End": true
}
}
}
@dkavanagh
dkavanagh / awscreds.sh
Last active Aug 7, 2017
Get aws creds using 2FA and sign ssh key
View awscreds.sh
#!/bin/bash
# run: awscreds.sh <mfa-code>
# works on OS X, replace path to key on last line
awsmfaf $1
sshca-sign-user-key
ssh-add -D;ssh-add /Users/dakavanagh/.ssh/id_rsa2
@dkavanagh
dkavanagh / configure-globus-access.sh
Last active Oct 11, 2016
This script creates an OIDC Provider and associated access role to support Globus login
View configure-globus-access.sh
#!/bin/bash
# This script will install an openid connect provider and configure a role using
# awscli tools
#
export CLOUD_HOSTNAME=b-01.autoqa.qa1.eucalyptus-systems.com
# from euca2ools init file, take these values from the user section:
# key-id = AKIAALACHD3QZP6E5COF
# secret-key = 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
# account-id = 000257694698
# and insert them below
@dkavanagh
dkavanagh / decodetest.java
Created Sep 13, 2016
performance testing guava and apache commons-codec base64 decoding.
View decodetest.java
import com.google.common.io.BaseEncoding;
import org.apache.commons.codec.binary.Base64;
public class decodetest {
public static void main(String [] args) {
String encoded = "eyJub25jZSI6bnVsbCwiYXRfaGFzaCI6InNSS0t4akRna2pPd3p1d25BUDBjbEx0NlRsaTh0T3VJb1c2T3lZWTJfZTAiLCJhdWQiOiI2NTkwNjdlYy05Njk4LTQ0YTgtODhlYS1kYjMxZTA3MTQ0N2EiLCJzdWIiOiI2ZjNhMTdkNC01MzhlLTQ0MzEtODg5Yi1mNjFhZWExNWNmMGMiLCJleHAiOjE0NzMzNjk1NzAsImlzcyI6Imh0dHBzOi8vYXV0aC5nbG9idXMub3JnIiwiaWF0IjoxNDczMTk2NzcwLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJka2F2YW5hZ2hAZ21haWwuY29tIiwiZW1haWwiOiJka2F2YW5hZ2hAZ21haWwuY29tIiwibmFtZSI6IkRhdmlkIEthdmFuYWdoIn0";
//String encoded = "xGB5hkL_VueWstXijYZ8FgtKPD9ZwvlYCcqLswY3qf4-Dm5ZLz67MS9uUhzwHzMwVi_1J-d5BzZvZhbqP_6AboRX4RM4gkTrkjZJMLFVbqsDdU6FnljevlDCpcca_y2XvnZYV9xa_-ugbnaT6CL6opsBfOhXCWJqkKU2Ajw6I087FHIq4XGl7yP2LUEalZqnLpIOD4vJ-Mm9MSHJmtRxKqmF-keDZulc17hY5jeOTdPVWdVWxQY1c-TqZstkIVFS9Xl4rX--A73nV1VWEILTqNXBpoUMC2c8KgmoCfsdk0KBER7hCztmtkY3o633LDZR-aHUxpSvXQjMgua2aAXnOQ==";
long start = Syste
@dkavanagh
dkavanagh / dual-pwm.ino
Created Jun 10, 2016
Dual Pwm controller w/ display
View dual-pwm.ino
/*
This sketch illustrates how to use an arduino to provide 2 PWM signals for motor
controllers. The LCD display shows the values as driven by pot inputs. It also has
the ability to lock the two outputs to the left input pot.
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
@dkavanagh
dkavanagh / gen_metric_data.sh
Created Jan 11, 2016
Generate some custom metric data for testing
View gen_metric_data.sh
#!/bin/bash
while true
do
euwatch-put-data --metric-name RequestCount --namespace dak --dimensions "User=dak" --timestamp `date +%Y-%m-%dT%H:%M:%SZ` -v `expr $RANDOM / 2500`
sleep 5
done
@dkavanagh
dkavanagh / reqgen-scale.cfn
Created Nov 13, 2015
Setup request generator for eucaconsole for scale testing. Each instance in scaling group generates 100 users sessions.
View reqgen-scale.cfn
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Deploy request generator for console with Autoscaling.",
"Parameters" : {
"ImageId" : {
"Description" : "The ID of the image to use for the console",
"Type" : "String",
"ConstraintDescription" : "Must be the ID of a CentOS 7 image on the cloud."
You can’t perform that action at this time.