Skip to content

Instantly share code, notes, and snippets.

View lightpriest's full-sized avatar

Or Cohen lightpriest

  • Melio Payments
  • Israel
View GitHub Profile
@lightpriest
lightpriest / remove-everyone.py
Last active December 13, 2015 20:38
Remove "Everyone" permission from every key on a S3 bucket.
# Remove "Everyone" from every key on a S3 bucket.
#
# Environment variables (see boto for more information): AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
#
# -b, --bucket: The bucket to scan.
# -l, --log: Only log level is INFO, to list the keys being checked and changed.
#
# Run: remove-everyone.py -b BUCKET -l INFO
import argparse, boto, logging
@lightpriest
lightpriest / sensu-freshness_threshold-checker.rb
Last active August 29, 2015 14:17
Sensu freshness_threshold checker
#!/usr/bin/env ruby
# A small daemon-like script that looks for checks with "freshness_threshold" attribute and applies it.
# Meant to be used with a process supervisor like runit, so it just fails if exception occurs.
require 'eventmachine'
require 'json'
require 'net/http'
require 'sensu/transport'
require 'sensu/settings'