Skip to content

Instantly share code, notes, and snippets.

@ErmisCat
ErmisCat / gist:c1cc3fab06ddc8cb7ecd26466347bc4e
Created November 16, 2016 23:42 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ErmisCat
ErmisCat / beanstalk.tf
Created May 3, 2017 18:04 — forked from veqryn/beanstalk.tf
Beanstalk Terraform Module
#--------------------------------------------------------------
# This module creates all resources necessary for a beanstalk
# application and environment
#--------------------------------------------------------------
variable "env_name" {}
variable "vpc_id" {}
variable "beanstalk_solution_stack_name" {}
variable "beanstalk_private_subnets" {}
variable "beanstalk_public_subnets" {}
resource "aws_iam_instance_profile" "beanstalk_service" {
name = "beanstalk-service-user"
roles = ["${aws_iam_role.beanstalk_service.name}"]
}
resource "aws_iam_instance_profile" "beanstalk_ec2" {
name = "beanstalk-ec2-user"
roles = ["${aws_iam_role.beanstalk_ec2.name}"]
}
@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
@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 / 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 / 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

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 / .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>"
@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"