Skip to content

Instantly share code, notes, and snippets.

View charleskirk's full-sized avatar

Charles Kirk charleskirk

  • Chime
  • Chicago
View GitHub Profile
@charleskirk
charleskirk / error.r
Created October 19, 2012 20:45
Errror
NoMethodError: undefined method `load_balancers' for #<Instance:0x007f8ea48e75a8>
from /Users/charleskirk/.rvm/gems/ruby-1.9.3-p286/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:in `method_missing'
from /Users/charleskirk/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in `method_missing'
from (irb):24
from /Users/charleskirk/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
from /Users/charleskirk/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
from /Users/charleskirk/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
@charleskirk
charleskirk / Rubez.rb
Created October 22, 2012 18:24
Rubez
def save_aws_data
@elb = AWS::ELB.new(
:access_key_id => AWS_CONFIG['access_key_id'],
:secret_access_key => AWS_CONFIG['secret_access_key'])
instances_downloaded = Array.new
@elb.load_balancers.inject({}) do |a, b|
@lb = LoadBalancer.create(:name => b.name, :canonical_hosted_zone_name_id => b.canonical_hosted_zone_name_id, :dns_name => b.dns_name)
@elb.load_balancers[b.name].instances.inject({}) do |m, i|
@charleskirk
charleskirk / Help
Created October 23, 2012 18:24
Help
@list[:hosted_zones].each do |zone|
records = @r53.client.list_resource_record_sets({:hosted_zone_id => zone[:id].gsub('/hostedzone/','')})
records.resource_record_sets.each do |record|
if required_records.include? record[:type]
new_record = {:name => record[:name], :type => record[:type], :set_identifier => record[:set_indentifier],
:region => record[:region]}
if record.has_key?("alias_target")
new_record[:alias_target_zone] = record[:alias_target][:hosted_zone_id]
new_record[:alias_target_dns_name] = record[:alias_target][:dns_name]
end
@full_list = Array.new
@list = @r53.client.list_hosted_zones
loop do
@list[:hosted_zones].each do |zone|
@full_list << zone
end
@next_marker = @list[:next_marker]
@list = @r53.client.list_hosted_zones({ :marker => @next_marker })
Net::SSH::Multi.start(:on_error => :ignore) do |ssh|
Instance.all.each do |instance|
if instance.status == 'running'
ssh.use 'portal_user@' + instance.ip_address, :keys => ['~/.ssh/portal_user.pem']
end
end
stdout = ""
# run this on all boxes
ssh.open_channel do |channel|
channel.request_pty do |c, success|
awk: {print ,,}
awk: ^ syntax error
awk: {print ,,}
awk: ^ syntax error
awk: cmd. line:1: {print ,,}
awk: cmd. line:1: ^ unexpected newline or end of string
i am here
i-de1111beAmazon Linux AMI release 2012.09
cpe:/o:amazon:linux:2012.09:ga
@charleskirk
charleskirk / Gemfile
Created May 10, 2013 16:38
Rails precompile error on production
group :assets do
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem 'ejs', '>= 1.0.0'
gem "compass-rails"
gem 'sass-rails', '~> 3.2.3'
gem 'bootstrap-sass', '~> 2.3.1.0'
end
gem 'twitter-bootstrap-rails'
{
"caret_style": "solid",
"color_scheme": "Packages/Theme - Brogrammer/brogrammer.tmTheme",
"detect_indentation": false,
"detect_slow_plugins": false,
"drag_text": false,
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
button.class_name {
-webkit-box-shadow: 0px 0px 15px 2px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 15px 2px rgba(0,0,0,0.75);
box-shadow: 0px 0px 15px 2px rgba(0,0,0,0.75);
}