Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created August 26, 2016 20:16
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 anonymous/30323d9e01dd94c3c2ad9e4cbd9c787c to your computer and use it in GitHub Desktop.
Save anonymous/30323d9e01dd94c3c2ad9e4cbd9c787c to your computer and use it in GitHub Desktop.
Facter.add(:ulimit) do
setcode do
proc_file = '/proc/self/limits'
limits = File.readlines(proc_file)
if limits.include?("Max open files")
val = line.split[3]
break
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment