Skip to content

Instantly share code, notes, and snippets.

@ErmisCat
ErmisCat / Templater-Weekly-Note.md
Last active April 28, 2025 19:47
Obsidian Weekly Note Template
created tags aliases week year
<% tp.file.creation_date("YYYY-MM-DD HH:mm") %>
Weekly
<% tp.file.title %> Weekly Note
<% tp.date.now("YYYY-[W]ww", 0, tp.file.title, "[W]ww") %>
<% tp.date.now("YYYY", 0, tp.file.title, "[W]ww") %>

<%*

@ErmisCat
ErmisCat / .zsh_functions.sh
Created February 25, 2025 03:45
zsh movie quotes
function moviequote() {
local response
response=$(curl -s "https://quoteapi.pythonanywhere.com/random")
local quote
quote=$(echo "$response" | jq -r '.Quotes[].quote')
echo "\"$quote\""
}
@ErmisCat
ErmisCat / aws_regex_cheat_sheet
Created January 31, 2025 20:40 — forked from rams3sh/aws_regex_cheat_sheet
Common AWS Related Regex (AWS)
ARN Base Pattern :-
arn:<aws_parition>:<aws_service>:[<aws_region>]:<account_id>:<root | resource_type>:/<resource_name>[/<sub_resource_names>...]
i. <aws_partition>
Regex - (aws|aws-us-gov|aws-cn)
ii. <aws_service> - No fixed pattern
iii. <aws_region> - No fixed pattern
Most of the regions occur in combination of 2 letter followed by "-" followed by a combination of direction based word , followed by a "-" and then a digit.
@ErmisCat
ErmisCat / dmarc-report-converter.sh
Last active February 25, 2025 03:54
dmarc report xml to md
#!/bin/bash
# Check if the input file is provided
if [ -z "$1" ]; then
echo "Usage: $0 <input-xml-file>"
exit 1
fi
INPUT_FILE="$1"
OUTPUT_FILE="${INPUT_FILE%.xml}.md"
@ErmisCat
ErmisCat / .zshrc
Created July 22, 2024 22:09
Azure Devops: Create Card w/ parent + Create git branch to match
function add_ado_git_branch() {
local project="<project name>"
local title=$1
local description=$2
local org_url="https://dev.azure.com/<org name>"
local api_version="6.0"
local feature_id="<target feature id>" # (to link as parent to the created story)
local assigned_to="<Your Name in Azure Devops>"
local area="<org name>/<board name>"

Keybase proof

I hereby claim:

  • I am ErmisCat on github.
  • I am ermiscat (https://keybase.io/ermiscat) on keybase.
  • I have a public key whose fingerprint is 2681 D3F7 3641 1D00 E0D4 F1DC B414 0C93 B2BD DC7E

To claim this, I am signing this object:

@ErmisCat
ErmisCat / revoke.py
Last active June 20, 2018 22:57
Puppet AWS Auto Revoke script
#!/usr/bin/env python
# Guide + Original:
# http://www.systemsup.co.uk/automating-puppet-ssl-certificates-in-an-aws-autoscaling-environment/
#
# I use a different method for autosigning certificates, using csr_attributes w/ password OID
# I just needed a revocation method so I re-wrote this script to suit my needs.
# This script is crontab'd on the puppet master
# */5 * * * * /bin/python /scriptlocation/revoke.py us-east-1 SQSNAME >> /var/log/revoke.log
#
# Ermis Catevatis
@ErmisCat
ErmisCat / autoscale-sns.sh
Created June 14, 2018 19:49
AWS Autoscaling Group names exported to array, iterated and added to SNS Topic.
#!/bin/bash
AWSENV="sandbox"
SNSTOPIC="sandbox-autoscale"
REGION="us-east-1"
TOPICARN=$(aws-vault exec $AWSENV -- aws sns create-topic --name $SNSTOPIC --region $REGION | grep arn | cut -d'"' -f4)
AUTOSCALEARRAY=($(aws-vault exec $AWSENV -- aws autoscaling describe-auto-scaling-groups --region $REGION | grep AWSEBAutoScalingGroup | sort | uniq -u | cut -d'"' -f4 | grep stack | grep -v arn))
@ErmisCat
ErmisCat / jenkins-backup-s3
Created June 20, 2017 01:20
Backup Jenkins config to an S3 bucket.
#!/bin/bash
# MKDIR /backup
# git clone this script there
# SETUP CRONTAB:
# crontab -e
# PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin
# 0 0 * * * cd /backup && ./jenkins-backup-s3.sh
set -ex
@ErmisCat
ErmisCat / backup_github_to_s3.sh
Created June 15, 2017 18:22 — forked from petenelson/backup_github_to_s3.sh
Bash script: Backup GitHub Repos to S3
#!/bin/bash
DATE=$(date "+%Y-%m-%d")
GITHUB_OWNER=petenelson
BACKUPS_DIR=~/backups
TAR_FILE=github-repos-$DATE.tar.gz
S3_BUCKET=s3://github-offsite-backup
# Creates a directory if it doesn't exist
# $1: dir path