Skip to content

Instantly share code, notes, and snippets.

@pwnall
Created May 26, 2010 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwnall/414985 to your computer and use it in GitHub Desktop.
Save pwnall/414985 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
# Prints the number of cores on your system.
# Requires the ohai rubygem.
require 'rubygems'
require 'ohai'
ohai = Ohai::System.new
ohai.all_plugins
puts ohai['cpu']['total']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment