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 ruby | |
| require 'cgi' | |
| require 'base64' | |
| require 'net/https' | |
| require 'openssl' | |
| require 'rexml/document' | |
| ACCESS_KEY_ID = SOMETHING | |
| SECRET_ACCESS_KEY = SOMETHING |
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
| wget http://rubyenterpriseedition.googlecode.com/files/ruby-enterprise_1.8.7-2011.03_amd64_ubuntu10.04.deb | |
| sudo dpkg -i ruby-enterprise_1.8.7-2011.03_amd64_ubuntu10.04.deb | |
| sudo gem install --no-ri --no-rdoc puppet |
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
| tail = (channel, callback) -> | |
| socket = require('zeromq').createSocket('sub') | |
| socket.connect("tcp://IP_ADDRESS:5555") | |
| socket.subscribe(channel) | |
| socket.on 'message', (ch, data) -> callback(JSON.parse(data.toString('utf8'))) | |
| tail 'channame', (row) -> console.log(row) |
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
| find /tmp -mtime +7 -type f -exec rm -rf {} \; | |
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 'rubygems' | |
| require 'date' | |
| countrys = %w[at au br de dk es fr in int it jp kr mx nl no pl pt ru se uk us za] | |
| dates = (Date.parse('2010-12-02')..Date.parse('2011-05-01')) | |
| dates.each do |date| | |
| query = "" | |
| query += "SET hive.exec.compress.output=true;" |
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 'rubygems' | |
| require 'date' | |
| require 'rbhive' | |
| countrys = %w[at au br de dk es fr in it jp mx nl no pl pt ru se uk us za] | |
| dates = (Date.parse('2011-01-01')..Date.parse('2011-04-30')) | |
| RBHive.connect('hiveserver') do |con| | |
| dates.each do |date| | |
| countrys.each do |country| |
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 ruby | |
| require "date" | |
| five_days_ago = Date.parse(Time.now.to_s) - 5 | |
| IO.popen("hadoop fs -lsr /tmp").each_line do |line| | |
| permissions,replication,user,group,size,mod_date,mod_time,path = *line.split(/\s+/) | |
| if (mod_date) | |
| if Date.parse(mod_date.to_s) < five_days_ago | |
| puts line | |
| if permissions.split('')[0] == 'd' |
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
| current = '' | |
| file_count = 0 | |
| total_size = 0 | |
| output = File.open('output.csv','w') | |
| IO.popen('hadoop fs -lsr /user/hive/warehouse').each_line do |line| | |
| split = line.split(/\s+/) | |
| #permissions,replication,user,group,size,mod_date,mod_time,path | |
| next unless split.size == 8 |
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
| limit nofile 20000 20000 | |
| kill timeout 300 | |
| env MONGO_DATA=/var/lib/mongodb/ | |
| env MONGO_LOGS=/var/log/mongodb/ | |
| env MONGO_EXE=/usr/bin/mongod | |
| env MONGO_CONF=/etc/mongodb.conf | |
| pre-start script |
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
| description "nginx http daemon" | |
| start on runlevel [2345] | |
| stop on runlevel [!2345] | |
| exec /opt/nginx/sbin/nginx -g "daemon off;" | |
| respawn |