Skip to content

Instantly share code, notes, and snippets.

View jeremyd's full-sized avatar

Jeremy D jeremyd

View GitHub Profile
@jeremyd
jeremyd / gist:9461410
Created March 10, 2014 08:28
clustersense_bootstrap_basic.sh
#!/bin/bash
NODE_NAME=$(hostname -s)
FQDN=$(hostname -f)
NODE_IP=$(dig $FQDN +short)
# Fill this in with the host running Zookeeper.
ZOOKEEPER_HOST=$ZK_IP
echo NODE_NAME: $NODE_NAME
echo FQDN: $FQDN
@jeremyd
jeremyd / rs_api_config.yaml
Created January 28, 2009 21:25
rightscript example get and put, to and from a local file
---
:pass: yourSecurePassword
:user: youremail@test.com
:rs_api_url: https://my.rightscale.com/api/acct/999999999999
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> Gem.available?('sinatra')
=> false
irb(main):003:0> `gem install sinatra`
WARNING: Installing to ~/.gem since /opt/local/lib/ruby/gems/1.8 and
/opt/local/bin aren't both writable.
WARNING: You don't have /Users/jeremy/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
=> "Successfully installed sinatra-0.9.2\n1 gem installed\nInstalling ri documentation for sinatra-0.9.2...\nInstalling RDoc documentation for sinatra-0.9.2...\n"
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> Gem.available(^C
(reverse-i-search)`availab': Gem.^Cailable?('sinatra')
irb(main):002:0> Gem.available?('mixlib-cli')
=> false
irb(main):003:0> `gem install mixlib-cli`
WARNING: Installing to ~/.gem since /opt/local/lib/ruby/gems/1.8 and
/opt/local/bin aren't both writable.
WARNING: You don't have /Users/jeremy/.gem/ruby/1.8/bin in your PATH,
HISTFILE = "~/.irb_history"
MAXHISTSIZE = 100
begin
if defined? Readline::HISTORY
histfile = File::expand_path( HISTFILE )
if File::exists?( histfile )
lines = IO::readlines( histfile ).collect {|line| line.chomp}
puts "Read %d saved history commands from %s." %
[ lines.nitems, histfile ] if $DEBUG || $VERBOSE
@jeremyd
jeremyd / gist:167435
Created August 13, 2009 20:30
rackspace api to launch servers with personalities
#!/usr/bin/env ruby
#
# this will eventually be a cmd line script:
# inputs -
# 1) authentication, 2) packages list, 3) chef recipe url, 4) node attributes as .. yaml?
#
require 'rubygems'
require 'right_rackspace'
$activity.start_ruboto_activity("$source_picker") do
setup_content do
x = self.load_deployments
@list_view = list_view(:id => 55555, :list => x)
#registerForContextMenu(@list_view)
@list_view
end
def self.reload_deploys(parent_context)
x = get_deployments
Distributed logging for physical deployment (for UEC and more)
User story:
As a UEC admin I can view all logs from every physical system include in my UEC deployment in one central place so that I can easily find out and debug why some components of my UEC deployment are failing.
* flume:
- java component
- centrally configured (redundant via zookeeper)
- agents / forwarders / sinks / management server
@jeremyd
jeremyd / gist:661823
Created November 3, 2010 22:24
Moving inputs from one server to another (Rightscale, rest_connection gem)
# Moving from one "currently running server" to another
server1 = Server.find 1
server2 = Server.find 2
server1.reload_current
server2.reload_current
server1.parameters = server2.parameters
server1.save
@jeremyd
jeremyd / image_jockey.rb
Created November 5, 2010 06:15
image jockey
require 'rubygems'
require 'rest_connection'
require 'rspec'
require 'ruby-debug'
CONFIGDIR = File.dirname(__FILE__)
def set_params_from_json(server, file)
inputs = JSON::load(IO.read(File.join(CONFIGDIR, file)))
server.parameters = inputs