This file contains 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
<style> | |
.loc { | |
color:gray; | |
font-style:italic; | |
font-size:11px; | |
} | |
</style> | |
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script> | |
<script type='text/javascript'> | |
$(document).ready(function() { |
This file contains 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 | |
# Checks Hadoop and alerts if there is a change in data nodes | |
require 'yaml' | |
DFS_USED_PERCENT_THRESHOLD = 75 | |
error_flag = 0 | |
report = `hdfs dfsadmin -report` | |
# Datanodes available: 17 (28 total, 11 dead) |
This file contains 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
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
This file contains 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 | |
# encoding: UTF-8 | |
# Simple password generation in Ruby. | |
# | |
# Generate reasonably secure random passwords of any chosen length, | |
# designed to be somewhat easy for humans to read and remember. | |
# Each password has a capitalized letter and a digit. | |
# | |
# Example: |
This file contains 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
# This utilityi extracts schema of a JSON object | |
# It returns the keys of the JSON object separated by commas | |
# It also returns a create table statement in Hive | |
require '/var/lib/jenkins/scripts/lib/hive_utils.rb' | |
require 'json' | |
# This function should probably be in hive_utils.rb | |
def create_table_string(params) | |
header = "CREATE TABLE #{params[:hive_schema]}.#{params[:hive_table]}(" |
This file contains 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 'mixpanel_client' | |
require 'csv' | |
require 'multi_json' | |
require 'net/http' | |
class MixpanelExtract | |
attr_reader :filename, :request_uri | |
def initialize(config, for_date) | |
@client = Mixpanel::Client.new(config[:mixpanel_auth]) |
This file contains 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
# Download Mixpanel Data | |
require '../lib/hive_utils.rb' | |
require 'yaml' | |
require 'fileutils' | |
require File.expand_path(File.dirname(__FILE__) + '/mixpanel_extract.rb') | |
# TODO use thor here to take the date from the commandline | |
def print_usage_and_exit | |
puts %q[Usage: |
This file contains 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
$:.push('/home/yranadive/gen-rb') | |
# This file monitors a set of storm topologies and generates | |
# 1. Zenoss friendly status message. e.g. topo1:1 topo2:0 (1=active, 0=inactive) | |
# 2. Mails the inactive topologies | |
# Usage: ruby storm_monitor.rb [mail] | |
# Optional argument "mail" on the command line will mail the report | |
require 'rubygems' | |
require 'thrift' | |
require 'nimbus' |
This file contains 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
irb> require 'webhdfs' | |
irb> client = WebHDFS::Client.new('hadoop-nn', 50070) | |
irb> fl = client.list('/user/hive/warehouse/database.db/tablename/') | |
irb> DateTime.strptime(fl.collect {|x| x['modificationTime']}.max.to_s, '%M') |
This file contains 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
execute pathogen#infect() | |
call pathogen#helptags() | |
filetype off | |
syntax on | |
filetype plugin indent on | |
map <C-n> :NERDTreeToggle<CR> | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif |
OlderNewer