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
param( | |
[string]$type=$(Throw "Parameter Missing: -type ?barebone/webserver/database?"), | |
[string]$machinename=$(Throw "Parameter missing: -machinename <MACHINENAME>"), | |
[string]$size=$(Throw "Parameter missing: -size ?small/medium/large?"), | |
[string]$vlan=$(Throw "Parameter missing: -vlan ?TRAF-TRU/TRAF-TEST/TRAF-DMZ?"), | |
[string]$creator=$(Throw "Parameter missing: -creator <CREATOR>") | |
) | |
#set numCPU and memory according to size | |
Switch ($size) |
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
param( | |
[string]$type=$(Throw "Parameter Missing: -type ?barebone/webserver/database?"), | |
[string]$machinename=$(Throw "Parameter missing: -machinename <MACHINENAME>"), | |
[string]$size=$(Throw "Parameter missing: -size ?small/medium/large?"), | |
[string]$vlan=$(Throw "Parameter missing: -vlan ?TRAF-TRU/TRAF-TEST/TRAF-DMZ?"), | |
[string]$creator=$(Throw "Parameter missing: -creator <CREATOR>"), | |
[string]$ipaddress=$(Throw "Parameter missing: -ip <IPADDRESS>") | |
) | |
$vms = Get-VM |
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
> map <- expression({ | |
+ lapply(seq_along(map.values),function(r){ | |
+ x <- runif(map.values[[r]]) | |
+ rhcollect(map.keys[[r]],c(n=map.values[[r]],mean=mean(x),sd=sd(x))) | |
+ }) | |
+ }) | |
> | |
> z <- rhmr(map, ofolder="/tmp/test", inout=c('lapply','sequence'), | |
+ N=10,mapred=list(mapred.reduce.tasks=0),jobname='test') | |
Error: could not find function "rhmr" |
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
#sort out GPG shiz (I did it for the cloudera stuff too) | |
gpg --keyserver pgp.mit.edu --recv-key E2A11821 | |
gpg -a --export E2A11821 | sudo apt-key add - | |
#add to /etc/sources.list.d/ | |
#R.list | |
deb http://rh-mirror.linux.iastate.edu/CRAN/bin/linux/ubuntu hardy/ | |
apt-get install r-base r-base-dev pkg-config littler |
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 | |
ARGF.each_with_index do |line, i| | |
puts line if line =~ /AirPort/ and i % 5 == 0 | |
end |
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
class John | |
def like_your_work | |
puts 'I like your work' | |
end | |
def x_your_face x | |
puts "I'll #{x} your face" | |
end | |
end |
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 'freeagent_api' | |
include Freeagent | |
Freeagent.authenticate({ | |
:domain => 'tthuk.freeagentcentral.com', | |
:username => 'tom@tthuk.com', | |
:password => 'NotMyRealPassword'}) | |
Contact.new({ :first_name => 'Tom', | |
:last_name => 'Hall', |
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
configure do | |
set :haml, { :attr_wrapper => '"', :format => :html5 } | |
end |
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
puts "I have PID #{Process.pid}" | |
Signal.trap("USR1") {puts "prodded me"} | |
loop do | |
begin | |
puts "doing stuff" | |
sleep 10 | |
rescue Exception => e | |
puts e.inspect |
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
start on runlevel [2345] | |
stop on runlevel [06] | |
respawn | |
expect fork | |
script | |
export HOME="/home/deploy" | |
export JAVA_HOME="/usr/lib/jvm/java-6-sun" | |
export HIVE_HOME="/usr/lib/hive" |