Skip to content

Instantly share code, notes, and snippets.

View k3karthic's full-sized avatar
💭
I may be slow to respond.

Karthic Kumaran k3karthic

💭
I may be slow to respond.
View GitHub Profile
@k3karthic
k3karthic / .terraformrc
Created May 9, 2021 00:12
Terraform Config
plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"
@k3karthic
k3karthic / gpg2keepass.py
Last active October 6, 2019 09:40
Convert password-store repo to keepass format
#!/usr/bin/env python
import sys
import gnupg
import pykeepass
from getpass import getpass
from pykeepass import PyKeePass
from os import walk
from os.path import isfile, join
@k3karthic
k3karthic / docker_rmi.sh
Created September 7, 2019 15:04
Remove all docker images with tag '<none>'
#!/usr/bin/env bash
docker images | grep '<none>' | awk '{ print $3 }' | xargs -I{} docker rmi {}
@k3karthic
k3karthic / docker_rmc.sh
Created September 7, 2019 15:04
Remove all docker containers
#!/usr/bin/env bash
docker ps -a | awk '{ print $1 }' | grep -v 'CONTAINER' | xargs -I{} docker stop {}
docker ps -a | awk '{ print $1 }' | grep -v 'CONTAINER' | xargs -I{} docker rm {}
@k3karthic
k3karthic / truncate_dynamodb.sh
Last active July 12, 2022 18:56
Truncate all keys in a dynamodb table
#!/bin/bash
TABLE_NAME=$1
# Get id list
aws dynamodb scan --table-name $TABLE_NAME | grep ID | awk '{ print $2 }' > /tmp/truncate.list
# Delete from id list
cat /tmp/truncate.list | xargs -IID aws dynamodb delete-item --table-name $TABLE_NAME --key '{ "id": { "S": "ID" }}'