This file contains hidden or 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 requests | |
import psutil | |
import time | |
# A small function to calculate updtime. | |
def seconds_elapsed(): | |
return time.time() - psutil.boot_time() | |
requests.post( |
This file contains hidden or 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
{ | |
"event": "sendSleep", | |
"url": "https://[yourendpoint].execute-api.us-east-1.amazonaws.com/prod/ParticleSleepV1", | |
"requestType": "Post", | |
"headers": { | |
"x-api-key" : "[yourapikey]" | |
}, | |
"json": { | |
"name": "{{SPARK_EVENT_NAME}}", | |
"data": "{{SPARK_EVENT_VALUE}}", |
This file contains hidden or 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
from __future__ import print_function | |
import logging | |
import boto3 | |
from datetime import * | |
from boto3.dynamodb.conditions import Key, Attr | |
# enable basic logging to CloudWatch Logs | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) |
This file contains hidden or 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
// Make sure to include the spcial library for the internet button | |
#include "InternetButton/InternetButton.h" | |
// Create a Button named b. It will be your friend, and you two will spend lots of time together. | |
InternetButton b = InternetButton(); | |
int ledOldPos = 0; | |
char ledPosTrust[5]; | |
int moveCount = 0; | |
int loopCount =0; |
This file contains hidden or 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
from __future__ import print_function | |
import json | |
import boto3 | |
import logging | |
#setup simple logging for INFO | |
logger = logging.getLogger() | |
logger.setLevel(logging.ERROR) |
This file contains hidden or 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
from __future__ import print_function | |
import urllib | |
import urllib2 | |
import xml.etree.ElementTree | |
import logging | |
#enable basic logging to CloudWatch Logs | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) |
This file contains hidden or 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 boto3 | |
import logging | |
import json | |
import gzip | |
import urllib | |
import time | |
from StringIO import StringIO | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) |
This file contains hidden or 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 boto3 | |
import logging | |
import json | |
import gzip | |
from StringIO import StringIO | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
client = boto3.client('firehose') |
This file contains hidden or 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 boto3 | |
import logging | |
from datetime import * | |
#setup simple logging for INFO | |
logger = logging.getLogger() | |
logger.setLevel(logging.WARNING) | |
#define the connection | |
ec2 = boto3.resource('ec2', region_name="us-west-2") |
This file contains hidden or 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 boto3 | |
import logging | |
#setup simple logging for INFO | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
#define the connection | |
ec2 = boto3.resource('ec2') |
NewerOlder