shairontoledo / hdinfo-linux
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
README.textile | Mon Dec 29 16:07:46 -0800 2008 | |
| |
hdinfo-0.3.gem | Mon Dec 29 15:47:52 -0800 2008 | |
| |
hdinfo.c | Mon Dec 29 15:47:52 -0800 2008 | |
| |
hdinfo.gemspec | Mon Dec 29 15:47:52 -0800 2008 |
README.textile
This code gets information manufacturer’s about hard disks. This code runs only on Linux.
Add more information if you need, I used the lib ‘linux/hdreg’ take a look it for more details
Installation
First all, you need the packages to compile it.
- ruby-dev
- kernel-headers
- libc6-dev
- linux-libc-dev
- gcc (of course)
Make the manual installation downloading the last gem version hdinfo-0.3.gem.
Install the gem with root privileges
Simple use
The class HdInfo extends Hash so you can do this
require ‘HdInfo’ HdInfo.new(‘/dev/sda’).each { |k,v| puts “#{k} = ‘#{v}’” }Generates this output
serial_no = ’0881J1FX406355" fw_rev = ‘TW100-11"’ device_name = ‘/dev/sda’ model = ‘SAMSUNG SP0411N’