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
| sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
| sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo | |
| sudo yum install -y apache-maven | |
| mvn --version |
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
| %pyspark | |
| import matplotlib | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| import StringIO | |
| matplotlib.use('Agg') | |
| plt.rcdefaults() |
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 EXTERNAL TABLE rankings_external ( | |
| pageURL VARCHAR(300), | |
| pageRank INT, | |
| avgDuration INT | |
| ) | |
| ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' | |
| STORED AS SEQUENCEFILE | |
| LOCATION 's3a://big-data-benchmark/pavlo/sequence/1node/rankings/'; | |
| CREATE TABLE rankings ( |
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
| #!/bin/bash | |
| aws ec2 describe-instances | jq --arg hostname `hostname` '.Reservations[].Instances[]| select(.PrivateDnsName | contains($hostname)) | .PublicDnsName' |
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
| #!/bin/bash | |
| AMBARI="hostname:port" | |
| CLUSTER="clustername" | |
| EC2=".ec2-list" | |
| COMPONENTS=".hdp-components" | |
| aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | [.Tags[].Value, .PublicDnsName,.PrivateDnsName] | @tsv' > ${EC2} | |
| curl -u admin:admin ${AMBARI}/api/v1/${CLUSTER}/factory/host_components | jq -r '.items[].HostRoles | [.host_name, .component_name] | @tsv' | perl -e 'my %hosts; for(<>){ chomp $_; my($host, $component) > |
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
| require 'aws-sdk-core' | |
| ddb = Aws::DynamoDB::Client.new(region: "ap-northeast-1") | |
| table_name = 'rangetest' | |
| hash_key_str = 'test' | |
| (1...100).each do |i| | |
| ddb.put_item({ | |
| table_name: table_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
| var fs = require('fs'); | |
| var files = process.argv; | |
| files.shift(); | |
| files.shift(); | |
| var operations = []; | |
| files.forEach(function(filePath){ | |
| fs.readFile(filePath,'utf8',function(err,body){ |
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
| var AWS = require("../aws-sdk-js"); | |
| var counter = 0; | |
| setInterval(function(){ | |
| counter++; | |
| var dynamodb = new AWS.DynamoDB({region:"ap-northeast-1"}); | |
| dynamodb.getItem({ | |
| Key: {key:{S:"test"}}, | |
| TableName: "ec2-metadata-test", | |
| ProjectionExpression:"body" |
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
| require 'aws-sdk' | |
| require 'json' | |
| stream_name = "stream_handson" | |
| kinesis = Aws::Kinesis::Client.new(region: "ap-northeast-1") | |
| stream = kinesis.describe_stream(stream_name: stream_name) | |
| shard_id_array = stream[:stream_description][:shards].map{|shard| |
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
| #!/usr/bin/env python | |
| # [coinlocker] | |
| # | |
| # Copyright (c) 2014 Yuta Imai | |
| # | |
| # This software is released under the MIT License. | |
| # | |
| # http://opensource.org/licenses/mit-license.php | |