This tutorial will install:
This file contains hidden or 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 json, random, time | |
from multiprocessing import Process | |
candidates = json.load(open('candidates.json','r')) | |
total_of_candidates = len(candidates) | |
# people in sequence X district in parallel = total of voting | |
people_in_sequence = 3 | |
district_in_parallel = 3 |
This file contains hidden or 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 json, random | |
# load candidates file | |
candidates = json.load(open('candidates.json','r')) | |
# numbers of candidates | |
total_of_candidates = len(candidates) | |
# generate a random number | |
voting = random.randint(1,total_of_candidates) | |
# get the name of chosen candidate (array starts with zero) | |
chosen = candidates[voting-1] |
This file contains hidden or 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
[ | |
"Alice Stark", | |
"Bruno Arryn", | |
"Casie Tully", | |
"Desmond Greyjoy", | |
"Eliane Tarly", | |
"Fran Lannister" | |
] |
This file contains hidden or 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 json,time | |
import boto3 | |
athena_output = 's3://aws-athena-query-results-ACCOUNTID-REGION' | |
athena = boto3.client('athena') | |
glue = boto3.client('glue') | |
s3 = boto3.client('s3') |
This file contains hidden or 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 EXTENAL SCHEMA | |
-- https://docs.aws.amazon.com/pt_br/redshift/latest/dg/r_CREATE_EXTERNAL_SCHEMA.html | |
CREATE EXTERNAL SCHEMA 'yourDatabase' | |
FROM DATA CATALOG DATABASE 'yourDatabase' | |
REGION 'us-east-1' | |
IAM_ROLE 'arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME'; |
This file contains hidden or 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
# List | |
hdfs dfs -ls / | |
# Delete Directory | |
hdfs dfs -rm -r /DIRECTORY |
This file contains hidden or 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
# S3 - Sync Local Directory (deleting cloud files if local files were deleted) | |
aws s3 sync ./ s3://bucket_name/ --delete |
This file contains hidden or 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 | |
print( | |
os.path.dirname(os.path.abspath(__file__))+os.sep | |
) |
NewerOlder