Archive for May, 2007

Create a Ruby Object from a Hash

May 7th, 2007 No comments

From the Rubyforge snippet library:

class Hash
  def to_struct(struct_name),*keys).new(*values)
if $0 == __FILE__
   h = {:name=>"Dan","age"=>33,"rank"=>"SrA","grade"=>"E4"}
   s = h.to_struct("Foo")
   puts "name: " +
   puts "age: " + s.age.to_s
   puts "rank: " + s.rank
   puts "grade: " + s.grade

Note: An empty string used as a key will cause 1.8 to choke
Categories: Uncategorized Tags:

Activate LVM During Rescue

May 1st, 2007 No comments

Using the SystemRescueCD, LVM partitions are visible but not active until you enter:

vgchange -ay

Categories: Uncategorized Tags: