Skip to content

Instantly share code, notes, and snippets.

Sébastien Stormacq sebsto

View GitHub Profile
@sebsto
sebsto / appsync_tls_3.js
Created Jan 20, 2019
AppSync client creation with custom OKHTTP Client
View appsync_tls_3.js
// tm is the trust manager, code to instantiate this is skipped for brevity
// let's create our own OKHttpClient and configure it to use our custom SSLSocketFactory
val okHTTPClient = OkHttpClient.Builder().sslSocketFactory(TLSSocketFactory(), tm).build()
// Tell the builder to use our own OK HTTP client
appSyncBuilder.okHttpClient(okHTTPClient)
appSyncClient = appSyncBuilder.build()
@sebsto
sebsto / appsync_tls_2.js
Created Jan 20, 2019
appsync client creation by default
View appsync_tls_2.js
// initialize the AppSync client
val appSyncClient = AWSAppSyncClient.builder()
.context(applicationContext)
.awsConfiguration(AWSConfiguration(applicationContext))
.credentialsProvider(credentialsProvider)
.build()
@sebsto
sebsto / appsync_tls_1.sh
Created Jan 20, 2019
App Sync NMAP TLS
View appsync_tls_1.sh
$ nmap --script ssl-enum-ciphers <your_appsync_id>.appsync-api.eu-west-1.amazonaws.com
Starting Nmap 7.70 ( https://nmap.org ) at 2018-12-23 14:35 GMT
Nmap scan report for d7...33q.appsync-api.eu-west-1.amazonaws.com (13.xx.xx.43)
Host is up (0.033s latency).
Other addresses for d7...33q.appsync-api.eu-west-1.amazonaws.com (not scanned): 13.xx.xx.xx 13.xx.xx.xx 13.xx.xx.xx
rDNS record for 13.xx.xx.43: server-13-xx-xx-43.lhr62.r.cloudfront.net
Not shown: 998 filtered ports
PORT STATE SERVICE
80/tcp open http
@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 Feb 5, 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
You can’t perform that action at this time.