- On your laptop install and configure
package_cloud
CLI (login to package_cloud) - Run in a container, using here the target distro
docker run-v $(pwd):/data -it --rm ubuntu:16.04
#!/usr/bin/env python3 | |
import boto3 | |
from columnar import columnar | |
AsgClient = boto3.client("autoscaling") | |
r = AsgClient.describe_auto_scaling_groups() | |
headers = ["Dyn?", "AutoScalingGroupName", "MinSize", "MaxSize", "DesiredCapacity"] | |
fixed = [] | |
dynam = [] | |
for asg in r["AutoScalingGroups"]: |
W2RlZmF1bHRzXQpob3N0X2tleV9jaGVja2luZyA9IEZhbHNlCmZvcmtzID0gMTAKaW50ZXJwcmV0ZXJfcHl0aG9uID0gYXV0bwphbnNpYmxlX3B5dGhvbl9pbnRlcnByZXRlciA9IC91c3IvYmluL3B5dGhvbjMKCltzc2hfY29ubmVjdGlvbl0KcGlwZWxpbmluZz1UcnVlCiMgcmV0cmllcyA9IDEwCnNzaF9hcmdzID0gLUMgLW8gQ29udHJvbE1hc3Rlcj1ubyAtbyBDb250cm9sUGVyc2lzdD0zMDBzIC1vIENvbm5lY3RUaW1lb3V0PTMwcyAtbyBDb25uZWN0aW9uQXR0ZW1wdHM9MTUgLW8gU3RyaWN0SG9zdEtleUNoZWNraW5nPW5vIC1vIFVzZXJLbm93bkhvc3RzRmlsZT0vZGV2L251bGwKY29udHJvbF9wYXRoID0gL3RtcC9BUyUlQwo= |
-- Quick and Dirty script to get Redis'keys TTL distribution per hours | |
-- How to run it? | |
-- With a redis-cli: | |
-- `redis-cli -h my.redis.host.local --eval distribution.lua` | |
-- | |
local logtable = {} -- Array to store our logs, returned by the script, printed to the screen | |
-- A small log function | |
local function logit(msg) | |
logtable[#logtable+1] = msg | |
end |
#!/usr/bin/env python3 | |
from datetime import datetime | |
from icecream import ic | |
from kazoo.client import KazooClient | |
from multiprocessing import Pool | |
from pprint import pprint | |
import argparse | |
import logging | |
import random | |
import signal |
#!/usr/bin/env python3 | |
import os | |
import sys | |
import argparse | |
import logging | |
# Edit this function to change the behavior | |
def transformation(content): | |
content = content.decode('utf-8').replace('\u200c', '') |
103.253.144.0/22 | |
104.131.0.0/18 | |
104.131.128.0/20 | |
104.131.144.0/20 | |
104.131.160.0/20 | |
104.131.176.0/20 | |
104.131.192.0/19 | |
104.131.224.0/19 | |
104.131.64.0/18 | |
104.236.0.0/18 |
5.101.104.0/22 | |
5.101.108.0/24 | |
5.101.109.0/24 | |
5.101.110.0/24 | |
5.101.111.0/24 | |
5.101.96.0/21 | |
37.139.0.0/19 | |
45.55.0.0/19 | |
45.55.100.0/22 | |
45.55.104.0/22 |
5.101.104.0/22 | |
5.101.108.0/24 | |
5.101.109.0/24 | |
5.101.110.0/24 | |
5.101.111.0/24 | |
5.101.96.0/21 | |
37.139.0.0/19 | |
45.55.0.0/19 | |
45.55.100.0/22 | |
45.55.104.0/22 |
#!/usr/bin/env python3 | |
""" | |
Downloaded from https://gist.github.com/rams3sh/15ac9487f2b6860988dc5fb967e754aa | |
Craft a web request to the AWS rest API and hit an endpoint that actually works but isn't supported in the boto3 or AWS CLI | |
Based on https://gist.github.com/andrewmackett/5f73bdd29aeed4728ecaace53abbe49b | |
Usage :- python3 rds_log_downloader.py --region <region> --db <db_name> --logfile <log_file_to_download> --output <output_file_path> |