This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Creates an event rule that detects CreateVpc and emails an administrator. | |
Parameters: | |
SecurityGroupId: | |
Type: String | |
SecurityGroupName: | |
Type: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ..." |