Skip to content

Instantly share code, notes, and snippets.

View techact's full-sized avatar

Suresh Rajasekaran techact

View GitHub Profile
@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"
@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 / 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 / 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 / README.md
Created October 4, 2017 13:03 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@techact
techact / .htaccess
Created October 20, 2017 16:29 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@techact
techact / GoDaddySSLHAProxy.md
Created January 5, 2018 09:54 — forked from sethwebster/GoDaddySSLHAProxy.md
Creating a PEM for HaProxy from GoDaddy SSL Certificate

GoDaddy SSL Certificates PEM Creation for HaProxy (Ubuntu 14.04)

1 Acquire your SSL Certificate

Generate your CSR This generates a unique private key, skip this if you already have one.

sudo openssl genrsa -out  etc/ssl/yourdomain.com/yourdomain.com.key 1024

Next generate your CSR (Certificate Signing Request), required by GoDaddy:

@techact
techact / awss3deleteolderthan.sh
Created September 1, 2020 04:31 — forked from daliborgogic/awss3deleteolderthan.sh
Delete files older than n in S3
#!/bin/bash
# Usage: . ./awss3deleteolderthan.sh [bucket] [path] "20 minutes ago"
endpoint="https://ams3.digitaloceanspaces.com"
aws s3 ls s3://$1/$2 --endpoint $endpoint --recursive | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -d"$createDate" +%s`
@techact
techact / k8s-bookmarks-CKA-CKAD.html
Created August 16, 2021 12:12 — forked from kksudo/k8s-bookmarks-CKA-CKAD.html
A useful kubernetes bookmarks || Certified Kubernetes Application (CKA): ProTips to pass exam 2021
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1616427741" LAST_MODIFIED="1617895617" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks bar</H3>
<DT><H3 ADD_DATE="1616428159" LAST_MODIFIED="1616428159">CKA special</H3>
@techact
techact / cka-bookmarks.html
Created August 16, 2021 12:24
cka-bookmarks
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1579618265" LAST_MODIFIED="1582022136" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Bar</H3>
<DL><p>