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 org.apache.http.HttpResponse; | |
| import org.apache.http.client.methods.HttpGet; | |
| import org.apache.http.impl.client.DefaultHttpClient; | |
| import org.apache.http.util.EntityUtils; | |
| import org.json.simple.JSONObject; | |
| import org.json.simple.parser.JSONParser; | |
| String url = "http://..."; | |
| DefaultHttpClient httpclient = new DefaultHttpClient(); | |
| HttpGet httpget = new HttpGet(url); |
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
| from flask import Flask | |
| from flask import request | |
| app = Flask(__name__) | |
| #@app.route('/<int:test_id>', methods=['GET', 'POST']) | |
| @app.route('/', defaults={'path': ''}) | |
| @app.route('/<path:path>') | |
| def index(path): | |
| print str(request.url) |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| $master_script = <<SCRIPT | |
| #!/bin/bash | |
| cat > /etc/hosts <<EOF | |
| 127.0.0.1 localhost | |
| # The following lines are desirable for IPv6 capable hosts | |
| ::1 ip6-localhost ip6-loopback |
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/sh | |
| wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
| rpm -ivh epel-release-6-8.noarch.rpm | |
| wget -nv http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.6.0/hdp.repo -O /etc/yum.repos.d/hdp.repo | |
| cp /vagrant/files/jdk-7u45-linux-x64.rpm . | |
| rpm -Uvh jdk-7u45-linux-x64.rpm |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant::Config.run do |config| | |
| config.vm.box = "base-hadoop" | |
| config.vm.provision :puppet do |puppet| | |
| puppet.manifests_path = "manifests" | |
| puppet.manifest_file = "base-hadoop.pp" | |
| puppet.module_path = "modules" | |
| end |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = "precise64-for-kafka" | |
| config.vm.box_url = "http://files.vagrantup.com/precise64.box" |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = "centos-6.4" | |
| config.vm.box_url = "http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130731.box" |
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 urllib2 | |
| from time import gmtime, strftime | |
| for i in range(0, 1000): | |
| try: | |
| body = '{"message":%d,"@timestamp":"%s", data:"hello", "@version":"1","type":"myTest","host":"myHost"}' % (i, strftime('%Y/%m/%dT%H:%M:%S')) | |
| print body | |
| request = urllib2.Request('http://192.168.56.201/', body, {'Content-Type': 'application/json'}) | |
| response = urllib2.urlopen(request).read() | |
| #print response |
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 urllib2 | |
| for i in range(0, 100): | |
| try: | |
| response = urllib2.urlopen("http://sandbox:5000/%d/" % i) | |
| #print response.read() | |
| except: | |
| pass |
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
| ab -n 100 -p test.json -T "application/json; charset=utf-8" http://192.168.56.201/ |
NewerOlder