Skip to content

Instantly share code, notes, and snippets.

View prasvats's full-sized avatar

Prashant Vats prasvats

View GitHub Profile
@prasvats
prasvats / S3LifeCycle.py
Created August 9, 2020 19:41
S3LifeCycle.py
import boto3
from botocore.exceptions import ClientError
session = boto3.Session(profile_name='tsample', region_name='ap-southeast-2')
client = session.client('s3')
try:
all_buckets = client.list_buckets()
policy_status = client.put_bucket_lifecycle_configuration(
Bucket='sample-compute-optimizer',
LifecycleConfiguration={
'Rules': [
@prasvats
prasvats / nginx_node
Created November 2, 2021 16:04
nginx_node
server {
listen 80;
location /
{
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}