Skip to content

Instantly share code, notes, and snippets.

View k3karthic's full-sized avatar

Karthic Kumaran k3karthic

View GitHub Profile
@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 / 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 / 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 / openpgp.md
Created May 28, 2021 11:51
Keyoxide Proof
@k3karthic
k3karthic / update_terraform.sh
Last active May 30, 2021 15:49
Update Terraform
#!/usr/bin/env bash
## Forked from https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' | # Pluck JSON value
tr -d 'v' # Remove v
}
@k3karthic
k3karthic / update_borg.sh
Created May 30, 2021 15:50
Update BorgBackup
#!/usr/bin/env sh
## https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' | # Pluck JSON value
tr -d 'v' # Remove v
}
@k3karthic
k3karthic / update_kotlin.sh
Created June 8, 2021 22:46
Update Kotlinc
!/usr/bin/env bash
## Forked from https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' | # Pluck JSON value
tr -d 'v' # Remove v
}
#!/usr/bin/env bash
## Forked from https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' | # Pluck JSON value
tr -d 'v' # Remove v
}
@k3karthic
k3karthic / .exrc
Created May 9, 2021 00:14
Rudimentary Vi Config
set number
set autoindent
set tabstop=4
set shiftwidth=4
@k3karthic
k3karthic / .terraformrc
Created May 9, 2021 00:12
Terraform Config
plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"