Skip to content

Instantly share code, notes, and snippets.

Sébastien Stormacq sebsto

Block or report user

Report or block sebsto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sebsto
sebsto / lwa_blog_2.js
Created Jan 20, 2019
call LWA profile from alexa skill
View lwa_blog_2.js
const HelloWorldIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest' && handlerInput.requestEnvelope.request.intent.name === 'HelloWorldIntent';
},
async handle(handlerInput) {
const {
accessToken
} = handlerInput.requestEnvelope.context.System.user;
let speechText = '';
if (!accessToken) {
@sebsto
sebsto / lwa_blog.json
Created Jan 20, 2019
example alexa event
View lwa_blog.json
{
"session": {
"sessionId": "SessionId.7fc6aa11-8a2c-4f3f-a1ea-001569cd0035",
"application": {
"applicationId": "amzn1.echo-sdk-ams.app.fb2fc3e7-55e7-4f05-851e-7ad308a6b499"
},
"user": {
"userId": "amzn1.ask.account.AFP3ZWPOS2BGJR7OWJZ3DHPKMOMNWY4AY66FUR7ILBWANIHQN73QHMAHCTVTAHFPUV3WAFNGKBYW5LFUE2WV4CCGEISSPHBHCW5SCYJDL3DLWRRRBB4CQIP3X3PV65V2AYMMXSNFPKHPZJFVAH5AHKHDLAER67H3AHL4XBUU76XEH5BGDZZNGV5T6HHAGN6KGZI777J3VA7WGPA",
"accessToken": "Atza|IQEBLjAsAhRBk1-yYVTk9HhZEQnTGL9F3RHS5gIUG0rrerkVvpVTF5kIFWBvZIx7QtJCkzsRFRf1ZAIZeRz6FJwdeyQCLPEbqLnEKU-zQF4n9x76Dl24Rt7HiltefBilnDm0c2PZQP_IUBAzcm93CIDxsMYhEmW_Pr0Tm9tIrGzNzVntLgyiUeXmasL1bUOIv_om66ZVwd7urpyiJSoSbA-1NQ7O9AKC2qXMqvFpvFUBSvgCYoTyyAkOePN63FCaq9NJPYbJLuocqcuyGz9mygNqp9_mNRWRRzcoeSTxpUoa8LxW-IvVVFEA1omCfXmcVijEZA6nbi-EzheMG7fu1y0XNGPEy40Csq7H07wrSqksz9IDIUd4tmqiYsJpN4dxfoGddEauC3i4eLCvsg8gbu963CqqUQ3COxgrWKTsqX8AsT8FCFvmfW3IYfhCG6KuPw8qntBgAU-W9pW523lERQKLxzI07UHyMd2R-Fnaw8IWbBYFCbblwIJhf
@sebsto
sebsto / lwa_blog.js
Created Jan 20, 2019
example alexa skill handler
View lwa_blog.js
const HelloWorldIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest' && handlerInput.requestEnvelope.request.intent.name === 'HelloWorldIntent';
},
async handle(handlerInput) {
const {
accessToken
} = handlerInput.requestEnvelope.context.System.user;
let speechText = '';
if (!accessToken) {
View event.json
{
"Records": [{
"eventVersion": "2.0",
"eventSource": "aws:s3",
"awsRegion": "us-west-2",
"eventTime": "2014-11-27T21:08:30.487Z",
"eventName": "ObjectCreated:Put",
"userIdentity": {
"principalId": "AWS:ARxxxxxxxxxxSW:i-4fxxxxa5"
},
@sebsto
sebsto / event.json
Created Jan 20, 2019
CloudTrail Event JSON
View event.json
{
"Records": [{
"eventVersion": "2.0",
"eventSource": "aws:s3",
"awsRegion": "us-west-2",
"eventTime": "2014-11-27T21:08:30.487Z",
"eventName": "ObjectCreated:Put",
"userIdentity": {
"principalId": "AWS:ARxxxxxxxxxxSW:i-4fxxxxa5"
},
@sebsto
sebsto / gist:6441df09e97c4cbbd22b8ba313b8d642
Last active Aug 10, 2019
Amazon Linux 2 first boot on Virtual Box
View gist:6441df09e97c4cbbd22b8ba313b8d642
# Download the VDI from https://cdn.amazonlinux.com/os-images/latest/
# Doc is at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html
# Be sure you have config/meta-data and config/user-data ready as per the below
# change ec2-user's password to your password
$ cat config/meta-data
local-hostname: amazonlinux.onprem
# eth0 is the default network interface enabled in the image. You can configure
View gist:71c5e7765ca926f374b766d8e6fb37ff
aws ec2 get-console-screenshot --instance-id ID --query "ImageData" --output text > f; cat f | base64 -D > screen.jpg
@sebsto
sebsto / gist:9ec2476af3409f302610
Created Mar 23, 2016
Elastic Beanstalk HTTPS only, with Certificate Manager
View gist:9ec2476af3409f302610
option_settings:
"aws:elb:listener:443" :
ListenerProtocol : HTTPS
InstanceProtocol : HTTP
InstancePort : 80
SSLCertificateId : "arn:aws:acm:us-east-1:012345678912:certificate/917....853"
"aws:elb:listener:80" :
ListenerEnabled : false
@sebsto
sebsto / gist:67a43fc7fba1ff258560
Created Mar 5, 2016
Is your account using long EC2 IDs ?
View gist:67a43fc7fba1ff258560
# $ aws --version
# aws-cli/1.10.8 Python/2.7.11 Darwin/15.3.0 botocore/1.3.30
REGIONS=$(aws ec2 describe-regions --query 'Regions[].RegionName' --output text)
for R in $REGIONS ; do echo $R; aws ec2 describe-id-format --region $R --output text; done
@sebsto
sebsto / gist:eb48357f0bb24db8b2bf
Created Apr 28, 2015
Find all instances without a specific tag / with a specific tag
View gist:eb48357f0bb24db8b2bf
aws ec2 describe-instances --query 'Reservations[?Instances[?length(Tags[?Key==`Environment`]) == `0`]].Instances[].InstanceId'
aws ec2 describe-instances --query 'Reservations[?Instances[?Tags[?Key==`Environment`]]].Instances[].InstanceId'
You can’t perform that action at this time.