Skip to content

Instantly share code, notes, and snippets.

View dkavanagh's full-sized avatar

David Kavanagh dkavanagh

View GitHub Profile
@dkavanagh
dkavanagh / awscreds.sh
Last active August 7, 2017 13:06
Get aws creds using 2FA and sign ssh key
#!/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
{
"StartAt": "Calculate",
"States": {
"Calculate": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:721404732763:function:DoMath",
"End": true
}
}
}
{
"first": "2",
"op": "*",
"second": "3"
}
{
"StartAt": "Calculate",
"States": {
"Calculate": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:721404732763:function:DoMath",
"ResultPath": "$.second",
"Next": "CalculateToo"
},
"CalculateToo": {
@dkavanagh
dkavanagh / gist:98c9b421421adc71a6fa7bab92cab964
Created October 24, 2017 16:38
simple state w/ retry/catch
{
"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": [
{
#!/usr/bin/env python
''' First, use https://api-ipv4.us-or.viasat.io/Users.html#list-users to download
user data to a file called users.json.
'''
import argparse
import json
def main():
''' Do the things