Skip to content

Instantly share code, notes, and snippets.

@joehack3r
joehack3r / gist:6117854
Created July 30, 2013 23:05
Updating DataDog alert field notify_no_data to false
#!/usr/bin/env ruby
require 'rubygems'
require 'uri'
require 'net/https'
require 'json'
api_key=''
app_key=''
uri = URI.parse("https://app.datadoghq.com")
@joehack3r
joehack3r / getS3BucketSize.py
Created July 14, 2014 04:14
Example Python for get S3 Bucket Size
#!/usr/bin/env python
# This is how I used to write Python scripts. I'm trying to improve:
# https://github.com/joehack3r/aws/blob/master/scripts/s3/getS3BucketSize.py
import argparse
import boto
# Arguments
parser = argparse.ArgumentParser(description='Calcualte S3 bucket size in GB')
@joehack3r
joehack3r / terminateAndScaleDownAsg.sh
Created January 16, 2015 04:05
Terminate instance and decrement capacity in ASG
#!/usr/bin/env bash
if [ -n "$1" ]; then
minutesBeforeTerminate=$1
else
minutesBeforeTerminate=1440
fi
decimal=0
secondsUptime=`awk {'print $1'} /proc/uptime`
@joehack3r
joehack3r / slack_delete_files.py
Created February 20, 2016 21:34
Delete .wav and .mp3 files from Slack
#!/usr/bin/env python
import re
import requests
import json
import calendar
from datetime import datetime, timedelta
_days_to_keep = 180
_token = ""
---
# Example hosts file for https-certificate-check lambda.
# https://github.com/joehack3r/aws/tree/master/lambdas/https-certificate-check
hosts:
- www.facebook.com
- www.google.com
- www.ssllabs.com
- www.verisign.com
- doesnotexist.foo
@joehack3r
joehack3r / kasa.txt
Created March 23, 2021 01:21
kasa light switch indicator status
sudo apt install python3-virtualenv
virtualenv kasa
source ~/kasa/bin/activate
pip3 install python-kasa
# Turn off indicator light
kasa --host 192.168.1.65 led 0
# Turn on indicator light
kasa --host 192.168.1.65 led 1