Skip to content

Instantly share code, notes, and snippets.

View thom-vend's full-sized avatar
🤿

Thom'H thom-vend

🤿
  • Auckland, New Zealand
  • 03:01 (UTC +12:00)
View GitHub Profile
-- 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
W2RlZmF1bHRzXQpob3N0X2tleV9jaGVja2luZyA9IEZhbHNlCmZvcmtzID0gMTAKaW50ZXJwcmV0ZXJfcHl0aG9uID0gYXV0bwphbnNpYmxlX3B5dGhvbl9pbnRlcnByZXRlciA9IC91c3IvYmluL3B5dGhvbjMKCltzc2hfY29ubmVjdGlvbl0KcGlwZWxpbmluZz1UcnVlCiMgcmV0cmllcyA9IDEwCnNzaF9hcmdzID0gLUMgLW8gQ29udHJvbE1hc3Rlcj1ubyAtbyBDb250cm9sUGVyc2lzdD0zMDBzIC1vIENvbm5lY3RUaW1lb3V0PTMwcyAtbyBDb25uZWN0aW9uQXR0ZW1wdHM9MTUgLW8gU3RyaWN0SG9zdEtleUNoZWNraW5nPW5vIC1vIFVzZXJLbm93bkhvc3RzRmlsZT0vZGV2L251bGwKY29udHJvbF9wYXRoID0gL3RtcC9BUyUlQwo=
#!/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"]:

How to mirror rsyslog official .deb repo to packagecloud

Requirements

  1. On your laptop install and configure package_cloud CLI (login to package_cloud)
  2. Run in a container, using here the target distro
docker run-v $(pwd):/data -it --rm ubuntu:16.04