Skip to content

Instantly share code, notes, and snippets.

View copolycube's full-sized avatar
💭
I may be slow to respond.

Copolycube copolycube

💭
I may be slow to respond.
View GitHub Profile
version: '3.8'
services:
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
restart: always
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
@Himura2la
Himura2la / README-CodiMD-Restore.md
Last active April 25, 2024 13:05
CodiMD Backup and Restore
@ivorscott
ivorscott / docker-compose-traefik.yaml
Last active August 9, 2023 14:59 — forked from prayagsingh/docker-compose-traefik.yaml
Traefik with file provider and with letsencrypt and custom tls certs
# Providers :- discover the services that live on your infrastructure (their IP, health, ...)
# Entrypoints :- listen for incoming traffic (ports, ...)
# Routers :- analyse the requests (host, path, headers, SSL, ...). A router is in charge of connecting incoming requests to the services that can handle them.
# Services :- forward the request to your services (load balancing, ...). The Services are responsible for configuring how to reach the actual services that will eventually handle the incoming requests.
# Middlewares :- may update the request or make decisions based on the request (authentication, rate limiting, headers, ...)
version: "3.7"
networks:
version: '3.7'
services:
traefik_v2.0:
image: 'traefik:2.2'
container_name: traefik_v2
hostname: traefik_v2
ports:
- '443:443'
- '80:80'
- '8080:8080'
@snixon
snixon / security-group-cleanup.py
Last active August 25, 2022 18:08 — forked from TomRyan-321/security-group-cleanup.py
Fancy Security Group Cleanup
#!/usr/bin/env python
import os
import boto3
import argparse
import json
# `pip install -U PTable` will get you the right fork of PrettyTable
from prettytable import PrettyTable
from botocore.exceptions import ClientError
@dkt26111
dkt26111 / alert.rules.yml
Created June 6, 2019 18:32
High CPU usage alert rule for Prometheus
groups:
- name: example
rules:
# Alert for any cluster that has average CPU idle < 50%
- alert: HighUsage
expr: avg(irate(node_cpu_seconds_total{mode="idle"}[1m]) * 100) < 50
for: 1m
annotations:
summary: "High usage on {{ $labels.instance }}"
description: "{{ $labels.instance }} has a average CPU idle (current value: {{ $value }}s)"
@csereno
csereno / CloudWatchAgentConfig.json
Created October 1, 2018 20:35
AWS CloudWatch Agent configuration file example for Linux with standard /var/log/messages, secure, and yum logs
{
"agent": {
"metrics_collection_interval": 10,
"logfile": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log"
},
"metrics": {
"metrics_collected": {
"cpu": {
"resources": [
"*"
@nirbhabbarat
nirbhabbarat / aws_delete_ami_boto3.py
Created February 9, 2018 06:56
Delete/Deregister 30 days old AMI in AWS using boto3 and python
#!/usr/bin/env python
##### USE ON YOUR OWN RISK - THIS IS GOING TO DEREGISTER AMI OLDER THAN 30 DAYS
import boto3
from dateutil.parser import parse
import datetime
age = 30
aws_profile_name = 'prod'
def days_old(date):
get_date_obj = parse(date)
@nmagee
nmagee / retrieve-ec2-instance-types.sh
Last active November 25, 2019 12:26
Query the AWS Pricing API to get all currently available EC2 instance types
#!/bin/bash
curl https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.json | jq -r '.products[].attributes["instanceType"]' | sort -u | grep '\.'