Skip to content

Instantly share code, notes, and snippets.

View russau's full-sized avatar

Russ Sayers russau

View GitHub Profile
BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n')
echo $BUCKET_NAME > bucket-name.txt
aws s3 mb s3://$BUCKET_NAME
echo "Enter your cluster name: "
echo $CLUSTER_NAME > cluster-name.txt
russau /
Last active August 22, 2023 01:42
Async aioboto3 from lambda
import asyncio
import aioboto3
session = aioboto3.Session()
async def main():
async with session.client("ec2") as ec2:
tasks = await asyncio.gather(
# see a list of API versions here:
import boto3
versions = ["2014-09-01",
View curl sig v4
keys=($(aws sts assume-role --role-arn "arn:aws:iam::012345678912:role/ec2-readonly-role" \
--role-session-name session1 \
--query "[Credentials.AccessKeyId,Credentials.SecretAccessKey,Credentials.SessionToken]" \
--output text))
export AKI=${keys[1]} ; export SAK=${keys[2]} ; export ST=${keys[3]}
curl '' \
--aws-sigv4 aws:amz:ap-southeast-2:ec2 \
--user "${AKI}:${SAK}" \
View cmd-eks.go
package main
import (
b64 "encoding/base64"
awsconfig ""
from pynput import keyboard
from pynput.keyboard import Key
import subprocess
file1 = open('clipboard.txt', 'r')
lines = file1.readlines()
controller = keyboard.Controller()
def copyAndPasta(command):
russau /
Last active October 26, 2021 02:41
Extract Certificate from Vaccination QR

Getting my head around the QR codes in the International COVID-19 Vaccination Certificate. This will run in a ubuntu:20.04 container.

  • zbarimg decodes the QR
  • sed replaces out the non-json I don't want
  • jq gets the certificate from the json
  • tr convert from base64url to base64
  • openssl to dump the certificate
import boto3
import json
import sys
# Create SQS client
sqs = boto3.client('sqs')
queue_url = ''
russau / Function.cs
Created March 14, 2021 23:42
.NET debugging lambda
View Function.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Amazon.Lambda.Core;
// Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class.