Skip to content

Instantly share code, notes, and snippets.

@chipchilders
Created April 20, 2011 12:56
Show Gist options
  • Save chipchilders/931258 to your computer and use it in GitHub Desktop.
Save chipchilders/931258 to your computer and use it in GitHub Desktop.
Really simple Sinatra app to explore a CloudFoundry runtime environment
require 'sinatra'
require 'pp'
get '/' do
processor = `head /proc/cpuinfo`
memory = `head /proc/meminfo`
swap = `head /proc/swap`
linuxversion = `head /proc/version`
disks = `head /proc/partitions`
appuser = `whoami`
net = `cat /etc/network/interfaces`
output = 'local OS user: <br>' + appuser + '<br><br>processor: <br><pre>' + processor + '</pre><br><br>memory: <br><pre>' + memory + '</pre><br><br>swap:<br>' + swap + '<br><br>ver: <br>' + linuxversion + '<br><br>disks:<br><pre>' + disks + '</pre><br><br>networking:<br><pre>' + net + '</pre>'
output = output + '<pre>' + ENV.pretty_inspect + '</pre>'
output
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment