Skip to content

Instantly share code, notes, and snippets.

View charliejllewellyn's full-sized avatar

charliejllewellyn charliejllewellyn

View GitHub Profile
import subprocess as sub
import boto3
import os
def getObj():
os.chdir('/tmp')
s3 = boto3.resource('s3')
s3.meta.client.download_file('cjl-chelt-hack', 'masterbuilder.jpg', 'masterbuilder.jpg')
p = sub.Popen(['file', 'masterbuilder.jpg'],stdout=sub.PIPE,stderr=sub.PIPE)
output, errors = p.communicate()
AWSTemplateFormatVersion: 2010-09-09
Parameters:
ExampleParam:
Type: String
Default: test1
Description: Project name that will be used to name and identify resoures that are created
ExampleParam2:
Type: test2
Description: Project name that will be used to name and identify resoures that are created
exports.handler = (event, context, callback) => {
// TODO implement
var https = require('https');
var options = {
host: 'bus.miller.cm',
port: 443,
path: '/api/heslington-hall',
def create_entityjob(mediaUrl, Key, DataAccessRoleArn):
client = boto3.client('comprehend')
response = client.start_entities_detection_job(
InputDataConfig={
'S3Uri': mediaUrl,
'InputFormat': 'ONE_DOC_PER_FILE'
},
OutputDataConfig={
'S3Uri': output_bucket
},
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "comprehend:*",
"Resource": "*"
},
{
def complete(event):
response = {
"dialogAction": {
"type": "ElicitSlot",
"message": {
"contentType": "PlainText",
"content": "Your application status has been updated as: " + getDynamoData(event) + ". Thank you for your call, goodbye."
},
"intentName": "callDescription",
"slots": {
import boto3
import pandas as pd
from sagemaker import get_execution_role
role = get_execution_role()
bucket='cjl-temp-dub'
data_key = 'enron_emails/Enron emails.csv'
data_location = 's3://{}/{}'.format(bucket, data_key)
#df = pd.read_csv(data_location, skiprows=1000, nrows=2000)
import re
#from email.parser import HeaderParser
import email
import json
import operator
client = boto3.client('firehose')
client2 = boto3.client('comprehend')
DataSet = []
jdbc:postgresql://deng-pub-immersion-day.cofepwz7osto.eu-west-1.rds.amazonaws.com:5432/sportstickets
https://402560573366.signin.aws.amazon.com/console
jdbc:postgresql://deng-pub-immersion-day.cofepwz7osto.eu-west-1.rds.amazonaws.com:5432/sportstickets