Skip to content

Instantly share code, notes, and snippets.

View techact's full-sized avatar

Suresh Rajasekaran techact

View GitHub Profile
@techact
techact / delete-ami
Created October 4, 2017 12:59 — forked from elasticdog/delete-ami
Deregister an Amazon Machine Image (AMI) and delete its corresponding root device snapshot
#!/usr/bin/env bash
#
# delete-ami
#
# A script to deregister an Amazon Machine Image (AMI) and
# delete its corresponding root device snapshot.
#
##### Functions
@techact
techact / snapshots.py
Created October 4, 2017 12:55 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots - this script generates csv raport about snapshot usage
import re
import boto3
import csv
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
def get_snapshots():
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots']
@techact
techact / celery.sh
Created September 12, 2017 07:09 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@techact
techact / get_days_from_given_date.sh
Last active September 12, 2017 07:05
Bash Date
#!/bin/bash
given_date="2016-09-21T10:28:41"
echo "$[$[$(date +%s)-$(date -d ${given_date} +%s)]/60/60/24] days"