Skip to content

Instantly share code, notes, and snippets.

Avatar
🐳

Kratik Jain k4kratik

🐳
View GitHub Profile
View CF-Stack-with-TTL.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Schedule automatic deletion of CloudFormation stacks
# Advance way to customize our Parameters inputs, looks very good to the users :)
Metadata:
License: Apache-2.0
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
View generate-cron-expression-for-aws-cloudwatch-events.py
from datetime import datetime, timedelta
def deletion_time(ttl):
print("[DEBUG] The Current Time is: ",datetime.now())
delete_at_time = datetime.now() + timedelta(minutes=int(ttl))
print("[DEBUG] This Will be deleted at: ",delete_at_time)
hh = delete_at_time.hour
mm = delete_at_time.minute
yyyy = delete_at_time.year
month = delete_at_time.month
@k4kratik
k4kratik / docker-image-check.sh
Last active May 22, 2021
Script to find if your Docker image with the specific tag exists or not. Check the blog at https://blog.virtualk.xyz/check-docker-image.
View docker-image-check.sh
function DockerImageCheckFunction() {
# you can comment all the DEBUG echo statements, there are here just for info.
DHUB_TOKEN=$(curl -sSLd "username=${DOCKER_HUB_USERNAME}&password=${DOCKER_HUB_PASSWORD}" https://hub.docker.com/v2/users/login | jq -r ".token")
echo "[DEBUG] [$(date)] Token is: $DHUB_TOKEN"
echo
echo "[DEBUG] [$(date)] Hitting the endpoint: https://hub.docker.com/v2/repositories/${DOCKER_REPO}/tags/${DOCKER_TAG}/"
REPO_RESPONSE=$(curl -sH "Authorization: JWT $DHUB_TOKEN" "https://hub.docker.com/v2/repositories/${DOCKER_REPO}/tags/${DOCKER_TAG}/")
echo
@k4kratik
k4kratik / kratik-zoho-login.md
Last active Oct 12, 2020
Instructions on How to use k4kratik/zoho Docker Image to Automate your login on Zoho People.
View kratik-zoho-login.md

To make this work as expected, provide these three Environments correctly and then you are good to go!

  1. ENV1 - your email - Plain text
  2. ENV2 - your password - Base64 encoded
  3. ZOHO_NOTIFY_WEBHOOK - Webhook, where you want to send notifications - Plain Text

I have tried with Webhook URL of one of my room on Google Chat.

So for setting up you env, do this -