Skip to content

Instantly share code, notes, and snippets.

View rjulian's full-sized avatar

Richard Julian rjulian

View GitHub Profile
@rjulian
rjulian / configure_ec2_instances.yaml
Created December 16, 2019 01:41
Way Three: Automatically Configure EC2 Instances
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates an event rule that detects CreateVpc and emails an administrator.
Parameters:
SecurityGroupId:
Type: String
SecurityGroupName:
Type: String
@rjulian
rjulian / s3_bucket_enforcement.yaml
Created December 16, 2019 01:39
Way Two: Enforce S3 Bucket Encryption (by Max Anderson)
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates an event rule that detects when S3 buckets are created or encryption is turned off, and turns encryption on.
Resources:
BucketMonitoringRule:
Type: AWS::Events::Rule
Properties:
Description: 'Cloudwatch event required to implement this rule.'
Name: 'DetectS3CreateAndUpdate'
@rjulian
rjulian / create_vpc_rule.yaml
Last active December 16, 2019 01:37
Way One: Notify Via Email
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates an event rule that detects CreateVpc and emails an administrator.
Resources:
CreateVPCRule:
Type: AWS::Events::Rule
Properties:
Description: 'Cloudwatch event required to implement this rule.'
Name: 'DetectCreateVpc'
@rjulian
rjulian / makerhq_sense_hue.py
Created June 22, 2016 21:39
A simple, fast program for interacting with the Raspberry Pi Sense HAT's joystick with the Philips Hue REST API
# A simple program to use the joystick of the Sense HAT with the Philips Hue's REST API
from sense_hat import SenseHat
from evdev import InputDevice, ecodes,list_devices
from select import select
import random
import time
import os
# Setting min and max brightness settings
@rjulian
rjulian / pir_sensor.py
Last active June 10, 2016 21:56
Simple PIR sensor program for raspberry Pi.
import RPi.GPIO as GPIO
import datetime
import time
GPIO.setmode(GPIO.BCM)
GPIO_PIR = 21
GPIO.setup(GPIO_PIR,GPIO.IN)
Current_State = 0
Previous_State = 0
try:
print "Waiting for PIR to settle ..."