npm i
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # $ nohup python3 ./purge.py foo-bucket & | |
| import sys | |
| import boto3 | |
| # Take the bucket name from command line args | |
| BUCKET = sys.argv[1] | |
| s3 = boto3.resource('s3') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xray: | |
| cd /tmp \ | |
| && [ -d "./xray" ] || ( \ | |
| curl -O https://s3.dualstack.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-macos-3.x.zip \ | |
| && unzip -d xray aws-xray-daemon-macos-3.x.zip \ | |
| ) \ | |
| && cd xray \ | |
| && ./xray_mac -o -n us-west-2 | |
# create a test server with canned responses
const server: TestServer = new TestServer(new Response(500, payload), new Response(200, payload))
# wait for it to start
const url = await server.ready()
# use it
fetch(url).then(async res => console.log(await res.json()), console.error)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { STSClient, GetCallerIdentityCommand } from '@aws-sdk/client-sts'; | |
| new STSClient({}) | |
| .send(new GetCallerIdentityCommand({})) | |
| .then(console.log) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Glue } from 'aws-sdk' | |
| const glue = new Glue() | |
| const SourceDatabaseName = "tmp" | |
| const TargetDatabaseName = "ris-reporting" | |
| // begin async | |
| ;(async () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package equal_test | |
| import ( | |
| "testing" | |
| ) | |
| func TestMapOrder(t *testing.T) { | |
| for i := 0; i < 100; i++ { | |
| a := map[string]interface{}{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Example usage: | |
| // $ npm i @aws-sdk/client-glue | |
| // $ DATABASE_NAME=example-database npx ts-node ./purge.ts | |
| import * as AWS from "@aws-sdk/client-glue" | |
| const client = new AWS.Glue({}) | |
| const DatabaseName = process.env['DATABASE_NAME'] | |
| // begin async |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "strconv" | |
| "github.com/apache/arrow/go/v7/arrow" | |
| "github.com/apache/arrow/go/v7/arrow/array" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // usage: | |
| // $ AWS_PROFILE=foo AWS_REGION=us-east-1 go run . example-bucket 3 | |
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "os" | |
| "strconv" |