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
PairFunction<String, String, String> keyFunc = | |
new PairFunction<String, String, String>() { | |
public Tuple2<String, String> call(String x) { | |
return new Tuple2<String, String>(x.split(" ")[0], x.split(" ")[1]); | |
} | |
}; | |
JavaPairRDD<String, String> pairRDD = inputRDD.mapToPair(keyFunc); |
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
JavaPairRDD<String, String> pairRDD = | |
inputRDD.mapToPair(x-> new Tuple2<String,String>(x.split(" ")[0], x.split(" ")[1])); |
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
#!/bin/bash | |
# Author: Julien Simon <[email protected]> | |
# ECS tool in the spirit of ecs-cli :) | |
# default cluster should be configured : ecs-cli configure | |
if [ -z $1 ] | |
then | |
echo "ecs-find services : list services running on the current cluster" |
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
#!/bin/bash | |
# Author: Julien Simon <[email protected]> | |
# Connect to a Redshift cluster using psql | |
if ([ -z $1 ] || [ -z $2 ] || [ -z $3 ]) | |
then | |
echo "Usage: psqlRedshift CLUSTER_NAME DATABASE_NAME USER_NAME" | |
exit |
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
AWS re:Invent 2014 | (MBL202) NEW LAUNCH: Getting Started with AWS Lambda | |
https://www.youtube.com/watch?v=UFj27laTWQA | |
AWS re:Invent 2015 | (DEV203) Amazon API Gateway & AWS Lambda to Build Secure and Scalable APIs | |
https://www.youtube.com/watch?v=ZBxWZ9bgd44 | |
AWS re:Invent 2015 | (DVO209) JAWS: The Monstrously Scalable Serverless Framework | |
https://www.youtube.com/watch?v=D_U6luQ6I90 | |
https://github.com/serverless/serverless |
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 os, boto3 | |
defaultRegion = 'us-east-1' | |
defaultUrl = 'https://polly.us-east-1.amazonaws.com' | |
def connectToPolly(regionName=defaultRegion, endpointUrl=defaultUrl): | |
return boto3.client('polly', region_name=regionName, endpoint_url=endpointUrl) | |
def speak(polly, text, format='mp3', voice='Brian'): | |
resp = polly.synthesize_speech(OutputFormat=format, Text=text, VoiceId=voice) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os, boto3 | |
defaultRegion = 'us-east-1' | |
defaultUrl = 'https://polly.us-east-1.amazonaws.com' | |
def connectToPolly(regionName=defaultRegion, endpointUrl=defaultUrl): | |
return boto3.client('polly', region_name=regionName, endpoint_url=endpointUrl) |
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
*** | |
*** Inscrivez vous aux webinaires 2017 : https://attendee.gotowebinar.com/register/7239291589398918401 | |
*** | |
Webinaire "Présentation des principaux services AWS" : | |
https://www.youtube.com/watch?v=FC--jteXU_8 | |
http://www.slideshare.net/JulienSIMON5/presentation-des-services-aws | |
Webinaire "Modèle de sécurité AWS" : | |
https://www.youtube.com/watch?v=1QeKH-5nTIc |
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
CREATE EXTERNAL TABLE IF NOT EXISTS gdelt.events ( | |
`globaleventid` INT,`day` INT,`monthyear` INT,`year` INT,`fractiondate` FLOAT, | |
`actor1code` string,`actor1name` string,`actor1countrycode` string,`actor1knowngroupcode` string, | |
`actor1ethniccode` string,`actor1religion1code` string,`actor1religion2code` string, | |
`actor1type1code` string,`actor1type2code` string,`actor1type3code` string, | |
`actor2code` string,`actor2name` string,`actor2countrycode` string,`actor2knowngroupcode` string, | |
`actor2ethniccode` string,`actor2religion1code` string,`actor2religion2code` string, | |
`actor2type1code` string,`actor2type2code` string,`actor2type3code` string, | |
`isrootevent` BOOLEAN,`eventcode` string,`eventbasecode` string,`eventrootcode` string, | |
`quadclass` INT,`goldsteinscale` FLOAT,`nummentions` INT,`numsources` INT,`numarticles` INT,`avgtone` FLOAT, |
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
-- Count total events | |
SELECT COUNT(*) as nb_events FROM gdelt.events; | |
nb_events | |
440374991 | |
-- Find the number of events per year | |
SELECT year, | |
COUNT(globaleventid) AS nb_events | |
FROM gdelt.events |