Skip to content

Instantly share code, notes, and snippets.

Swalloow /
Created May 18, 2018
Boto3 DynamoDB delete all items
import boto3
dynamodb = boto3.resource('dynamodb', 'region-name')
table = dynamodb.Table('table-name')
scan = table.scan(
'#k': 'name'
singledigit / cognito.yaml
Last active Jul 2, 2022
Create a Cognito Authentication Backend via CloudFormation
View cognito.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Type: String
Description: Unique Auth Name for Cognito Resources
# Creates a role that allows Cognito to send SNS messages
pahud /
Last active Jul 14, 2022
delete all aws log groups

specify the region

export AWS_DEFAULT_REGION=ap-northeast-1
aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | \
awk '{print $2}' | grep -v ^$ | while read x; do  echo "deleting $x" ; aws logs delete-log-group --log-group-name $x; done

only delete loggroup name starting with /aws/lambda

soheilhy /
Last active Aug 6, 2022
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers