Skip to content

Instantly share code, notes, and snippets.

@s3u
s3u / gist:7625fcee4ee53919a95cfcaede3f75dd
Created January 12, 2026 18:36
ECR Inventory REAMD
# ECR Image Inventory Script
A comprehensive Python tool for analyzing Docker images in Amazon ECR repositories, showing which images are currently in use by ECS services and which are candidates for cleanup.
## 🎯 Purpose
Managing ECR repositories can be challenging when you have multiple services and frequent deployments. This script helps you:
- **Identify which images are actively used** by ECS services and task definitions
- **Find cleanup candidates** based on age and usage patterns
@s3u
s3u / ecr-inventory.py
Last active January 12, 2026 19:03
ECR Inventory Analysis
#!/usr/bin/env python3
"""
ECR Image Inventory and Cleanup Script for AWS ECS Environments
A comprehensive tool for analyzing Docker images in Amazon ECR repositories,
showing which images are currently in use by ECS services and which are
candidates for cleanup. Now includes safe garbage collection functionality.
Features:
- Analyzes ECS services, task definitions, and CodeDeploy deployments
@s3u
s3u / install-pyspark-on-mac.md
Last active August 23, 2017 15:25
Installing pyspark on Mac Sierra
brew install apache-spark
python3 -m venv .venv
source .venv/bin/activate
pip install pyspark

Then update your hostname in /etc/hosts.

@s3u
s3u / vol-agent.py
Created December 31, 2014 02:17
vol-agent
import sys
import subprocess
import requests
import os
# The purpose of this script is to find look for unmounted volumes, and mount them. If a volume is unitialized, it
# will initialize as ext4.
#
# The simplest way to run this is via cron. Use the following crontab entry
#
@s3u
s3u / images.md
Last active August 29, 2015 13:56

Mouting an Image for Modifications

Mount the image. If the iamge is QEMU QCOW2 image, do the following.

sudo modprobe nbd max_part=63
sudo qemu-nbd -c /dev/nbd0 ~/precise-server-cloudimg-amd64
sudo mount /dev/nbd0p1 /mnt/myimage

Then you can change image contents from /mnt/myimage, or through chroot /mnt/myimage. Add a /var/lib/cloud/scripts/per-instance script to this image.

@s3u
s3u / openacademy-projects.md
Last active January 3, 2016 13:09
OpenAcademy OpenStack Project - List of problems
  1. Multi-factor authentication for Keystone
  • Define an API extension to Keystone
  • Inject an API extension into Keystone
  • Create a default implementation
  • Write unit tests
  • Extend the CLI
  • Add an extension to Horizon
  1. Access keys for Keystone including the user experience
  • Define an API extension to Keystone
  • Inject an API extension into Keystone
@s3u
s3u / OpenStack.md
Last active December 27, 2015 15:29

OpenStack

OpenStack is one of the largest and leading open source projects to build and operate public or private clouds. OpenStack provides a set of APIs for provisioning and managing basic cloud constructs like compute (virtual machines), network (shared or private networks, floating IPs, load balancers etc.), and storage (block and object storage) along with additional layers to build and operate on-demand self-service cloud platforms. OpenStack is used now-a-days by several public cloud providers such as Rackspace, HP as well as by many organizations to provide on-premise private clouds.

Contributing to this project will give developers, first, an opportunity to learn the fundamental building blocks of cloud, the challenges of operating at scale, and second, how to collaborate in a distributed setup to build open source software.

Objectives

Short term objective of this project is to to setup a working OpenStack deployment on a virtual machine and then use OpenStack APIs or command-line interfaces

@s3u
s3u / gist:3148816
Created July 20, 2012 05:13
Pipelining settings in Firefox
user_pref("network.http.pipelining", true);
user_pref("network.http.pipelining.aggressive", true);
user_pref("network.http.pipelining.maxrequests", 6);
@s3u
s3u / gist:3078273
Created July 9, 2012 19:07
diffs to cluster2
diff --git a/lib/monitor.js b/lib/monitor.js
index a47bd7e..e4a0f1d 100644
--- a/lib/monitor.js
+++ b/lib/monitor.js
@@ -28,8 +28,7 @@ var Monitor = module.exports = function Monitor(options) {
this.options = options || {port: 8081, stats: {}, path: '/'};
this.stats = this.options.stats;
- var app = express.createServer();
-
@s3u
s3u / gist:2973367
Created June 22, 2012 15:13
Another test for timeout
var http = require('http');
var options = {
host: 'localhost',
port: 3000,
method: 'HEAD',
headers: {
'connection': 'keep-alive'
},
path: '/'