https://github.com/garno/fivesystem
Unix toolbox for retrieving system information.
https://github.com/garno/fivesystem
Last synced: about 1 month ago
JSON representation
Unix toolbox for retrieving system information.
- Host: GitHub
- URL: https://github.com/garno/fivesystem
- Owner: garno
- License: mit
- Created: 2013-03-19T00:55:32.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-03-19T00:56:21.000Z (about 13 years ago)
- Last Synced: 2025-03-20T11:57:58.478Z (about 1 year ago)
- Language: Ruby
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FiveSystem
Unix toolbox for system information written in Ruby.
* Load Average
* Hostname
* Uptime (Mac only)
* Disk Usage (Mac only)
* Process: Launch date, CPU & memory usage
### What's up with that name?
Yup, its lame but this library is an expirement so.. no fancy name needed.
*Again, this is an expirement, it should not be used in production.*
## Usage
#### Load Average
FiveSystem::LoadAverage.get # => [0.32, 0.40, 0.28]
#### Hostname
FiveSystem::Hostname.get # => "fivecandles-lb-1"
#### Uptime
FiveSystem::Uptime.days # => 34
FiveSystem::Uptime.hours # => 831
FiveSystem::Uptime.minutes # => 49879
FiveSystem::Uptime.seconds # => 2992727
FiveSystem::Uptime.last_reboot # => Sun, 26 Feb 2012 12:19:50 +0000
#### Disk usage
FCSystem::Disk.at('/').size # => 423903064
FCSystem::Disk.at('/').used # => 373156760
FCSystem::Disk.at('/').free # => 50234304
Convert to human readable number using the `number_to_human_size` method available in [ActionView](http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_human_size).