Skip to content

Instantly share code, notes, and snippets.

View dave-malone's full-sized avatar

Dave Malone dave-malone

  • Amazon Web Services
  • Tampa, FL
View GitHub Profile
/* eslint-disable func-names */
/* eslint quote-props: ["error", "consistent"]*/
/**
* This sample demonstrates a simple skill built with the Amazon Alexa Skills
* nodejs skill development kit.
* This sample supports multiple lauguages. (en-US, en-GB, de-DE).
* The Intent Schema, Custom Slots and Sample Utterances for this skill, as well
* as testing instructions are located at https://github.com/alexa/skill-sample-nodejs-fact
**/
@dave-malone
dave-malone / aws_s3_presign.sh
Last active January 9, 2018 21:11
Bash function that wraps the AWS cli to help make it easier to generate presign urls
aws_s3_presign(){
if [ -z "$1" ]; then
echo "1st arg is the key for the s3 object to presign, and may not be empty"
return
fi
if [ -z "$2" ]; then
echo "2nd arg is the number of days that the presigned url is valid for, and may not be empty"
return
fi
@dave-malone
dave-malone / cloudformation_s3_serverside_encryption.yml
Created February 6, 2018 03:48
CloudFormation snippet to enable server side encryption by default on an s3 bucket
StaticAssetsS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-encrypted-bucket
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
VersioningConfiguration:
Status: Enabled
'use strict'
/* This list may be incomplete or outdated! It may be best to integrate with an external service to obtain these values */
const eu_country_codes = ['BE','BG','CZ','DK','DE','EE','IE','EL','ES','FR','HR','IT','CY','LV','LT','LU','HU','MT','NL','AT','PL','PT','RO','SI','SK','FI','SE','UK']
const us_origin_domain = 'ec2-54-166-49-18.compute-1.amazonaws.com'
const eu_origin_domain = 'ec2-34-244-9-66.eu-west-1.compute.amazonaws.com'
/* This is an origin request function */
exports.handler = (event, context, callback) => {
@dave-malone
dave-malone / aws-freertos-greengrass-setup.md
Last active June 22, 2023 21:07
AWS FreeRTOS to Greengrass Core setup

Requirements

This project was built with the following requirements in mind:

  • RaspberryPi 3
  • Espressif ESP32 DevKitC
  • AWS account with access to AWS IoT
  • Windows or OSX based machine
  • Python 2.7
@dave-malone
dave-malone / aws-iot-greengrass-core-raspberrypi.md
Last active March 6, 2022 19:23
AWS IoT Greengrass Core running on RaspberryPi
@dave-malone
dave-malone / aws-iot-thing-esp32.md
Last active February 2, 2023 11:01
Install Amazon FreeRTOS on an ESP32 and make it a "thing"
@dave-malone
dave-malone / basicPubSub.py
Last active August 6, 2018 12:44
IoT basic pub sub sample modified to use a temperature sensor attached to the GPIO: aws-iot-device-sdk-python/samples/basicPubSub/basicPubSub.py
'''
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
@dave-malone
dave-malone / cloud-native-demo-steps.md
Last active November 28, 2018 21:48
Steps taken during the live coding demonstration delivered at the AWS User Group
@dave-malone
dave-malone / ds18b20-basicPubSub.py
Created August 9, 2018 19:33
AWS IoT Python program to send data from a DS18B20 sensor to AWS IoT Core
'''
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*