Skip to content

Instantly share code, notes, and snippets.

View jkmart's full-sized avatar

J. Kerry Martin jkmart

  • Worcester, MA
View GitHub Profile
@jkmart
jkmart / restore-snapshots.sh
Created January 18, 2024 21:31
Re-create AWS EC2 volumes created in an EKS cluster from their snapshots and add PersistentVolume and PersistentVolumeClaim back to cluster
#!/bin/bash
## Command to get list of snapshots I need
# aws-vault exec wildfire -- aws ec2 describe-snapshots --owner self --output json \
# --filters Name=tag:KubernetesCluster,Values=main-prod-wf "Name=tag:kubernetes.io/created-for/pvc/name,Values=claim-*" \
# --query "Snapshots[?(StartTime>='2024-01-17T19:30:00')]" \
# | jq '.[] | .SnapshotId' \
# | sed 's/"//g' \
# > snap_list.txt
systemd:
units:
- name: format-ebs.service
command: start
contents: |
[Unit]
Description=Formats EBS /dev/xvdb volume
After=dev-xvdb.device
Requires=dev-xvdb.device
[Service]
0
@jkmart
jkmart / validate.sh
Created August 31, 2018 21:08
Terraform module repository validation check
#!/usr/bin/env bash
command -v terraform >/dev/null 2>&1 || { echo >&2 "Requires terraform bin to be on path; Aborting."; exit 1; }
# for each of the provider directories, validate sub-directory modules
for Module in ./**/*/; do
# Check if *.tf file exists in directory, to handle cases of multiple and empty submodule directories
tf_file=$(find ${Module} -maxdepth 1 -type f -name "*.tf" | head -n1)
@jkmart
jkmart / keybase.md
Created February 27, 2018 09:26
Keybase Identity Proof

Keybase proof

I hereby claim:

  • I am jkmart on github.
  • I am jkmart (https://keybase.io/jkmart) on keybase.
  • I have a public key ASDZlKynGW5I3OiBbdrKtRIFcA_qhCO37Oal7YNij58dmAo

To claim this, I am signing this object: