Skip to content

Instantly share code, notes, and snippets.

View elmer's full-sized avatar
:octocat:
exploring

Elmer Rivera elmer

:octocat:
exploring
View GitHub Profile
@elmer
elmer / consolize.rb
Created September 19, 2010 05:22 — forked from twoism/consolize.rb
require 'rubygems'
require 'irb'
def consolize &block
yield
IRB.setup(nil)
irb = IRB::Irb.new
IRB.conf[:MAIN_CONTEXT] = irb.context
root@ph-lin01-srv:~# lvdisplay
--- Logical volume ---
LV Name /dev/ph-lin01-srv/root
VG Name ph-lin01-srv
LV UUID wgA7Jd-cve5-eK2K-OcUk-yZ43-vvbw-diT892
LV Write Access read/write
LV Status available
# open 1
LV Size 18.88 GiB
Current LE 4833

I found all of my ubuntu 10.04 rightscale hosts had the same ssh key. The base image they use has one ssh host key that is never regenerated on instance creation, so effectively 100% of hosts are likely to have the same key for each system image.

RightScale has been notified and they are working on notification and fixes for customers.

The script in this gist will regenerate your keys if you have the ones I know of (on the ubuntu 10.04 rightscale image)

AMI: ami-7c16e315

module HashExtensions
def symbolize_keys
inject({}) do |acc, (k,v)|
key = String === k ? k.to_sym : k
value = Hash === v ? v.symbolize_keys : v
acc[key] = value
acc
end
end
end
We couldn’t find that file to show.
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@elmer
elmer / RFC 1925
Created February 22, 2011 03:38
The Twelve Networking Truths
Network Working Group R. Callon, Editor
Request for Comments: 1925 IOOF
Category: Informational 1 April 1996
The Twelve Networking Truths
Status of this Memo
This memo provides information for the Internet community. This memo
does not specify an Internet standard of any kind. Distribution of
Rubinius Crash Report #rbxcrashreport
Error: signal SIGBUS
[[Backtrace]]
0 rbx 0x00011554 _ZN8rubinius11Environment19setup_cpp_terminateEv + 564
1 libSystem.B.dylib 0x909c39fc _sigtramp + 68
2 ??? 0x00000000 0x0 + 0
3 ??? 0x03c18e04 0x0 + 63016452
@elmer
elmer / ruby-1.9-tips.rb
Created May 20, 2011 14:04 — forked from igrigorik/ruby-1.9-tips.rb
Ruby 1.9 features, tips & tricks you may not know about...
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@elmer
elmer / bg-log-selinux
Created November 11, 2011 01:11
bg-log
D, [2011-11-10T09:19:13.044567 #25378] DEBUG -- : GFS: mount_options "" "/dev/sda2" "/boot"
D, [2011-11-10T09:19:14.328056 #25378] DEBUG -- : GFS: mount_options = 0
D, [2011-11-10T09:19:14.328372 #25378] DEBUG -- : GFS: set_e2label "/dev/sda2" "e21a3e10"
D, [2011-11-10T09:19:14.823726 #25378] DEBUG -- : GFS: set_e2label = 0
D, [2011-11-10T09:19:14.824347 #25378] DEBUG -- : GFS: exists "/etc/sysconfig/selinux"
D, [2011-11-10T09:19:15.003875 #25378] DEBUG -- : GFS: exists = 1
D, [2011-11-10T09:19:15.004529 #25378] DEBUG -- : GFS: aug_init "/" 32
D, [2011-11-10T09:19:28.505226 #25378] DEBUG -- : GFS: aug_init = 0
D, [2011-11-10T09:19:28.505545 #25378] DEBUG -- : GFS: aug_rm "/augeas/load//incl[. != '/etc/sysconfig/selinux']"
D, [2011-11-10T09:19:28.517468 #25378] DEBUG -- : GFS: aug_rm = 0