Skip to content

Instantly share code, notes, and snippets.

@Swalloow
Swalloow / dynamo_delete_all.py
Created May 18, 2018
Boto3 DynamoDB delete all items
View dynamo_delete_all.py
import boto3
dynamodb = boto3.resource('dynamodb', 'region-name')
table = dynamodb.Table('table-name')
scan = table.scan(
ProjectionExpression='#k',
ExpressionAttributeNames={
'#k': 'name'
}
@pahud
pahud / delete_all_awslogs.sh.md
Last active Aug 16, 2021
delete all aws log groups
View delete_all_awslogs.sh.md

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
soheilhy / nginxproxy.md
Last active Nov 24, 2021
How to proxy web apps using nginx?
View nginxproxy.md

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 example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

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