You are not logged in.
Pages: 1
boxinfo is a cool perl script to grab extensive system info. Just another of those many tools, right? But its differential feature is gathering the output into a nice html file. Perl is onboard by default in Debian since apt needs it, so the script will work right out of the box.
Run it like this:
perl /path/to/boxinfo.pl
It will output the html (plus another debugging intended file) into the current pwd. Then you can open the file with your favorite web browser.
You may want to run it like sudo to get some info only available to privileged users, like your drives mount options. Try both and choose your poison.
Now, one may ask: Cool, but why the heck do I need an html anyway? Well, you can use a bash script to use it in a quite dirty/perverted way. I mean, just like another CLI tool.
Here's my own approach:
#!/bin/bash
DIR="mkdir boxinfo"
GO="cd boxinfo"
SHOW="w3m boxinfo.html"
if [ pwd != ~/Downloads ]; then
cd ~/Downloads && $DIR && $GO && sudo perl ~/bin/boxinfo.pl && $SHOW
else
$DIR && $GO && sudo perl ~/bin/boxinfo.pl && $SHOW
fi
rm -rf ~/Downloads/boxinfo
Name it boxinfo.sh or whatever you like, and as always place it in ~/bin or somewhere else in your path and make it executable.
A short explanation: I use ~/Downloads as a sort of tmp directory for almost anything aside of pure Downloads, just to gather all the new stuff in a single place. Adjust the path or pwd to your taste/needs.
I chose to open the html with w3m for some reasons; it remains in the CLI, it's darn fast to launch (at least way faster than most GUI browsers) and it displays the html cleaner and nicer than the other browsers (just try). If you don't like w3m and/or python, the ultra lightweight and efficient links will do it good too. Only a tad uglier for my taste.
The reason why I use the (dangerous) -rf switch for rm is that I have this safety alias in bash:
alias rm='rm -Iv --preserve-root'
It always asks for confirmation, so by using the switch it skips the confirmation and the entire thing works fast and clean like another typical CLI tool (the way I want it). That's also the reason to make and delete an specific "temporary" directory. Just to try to keep it clean and harmless (constructive criticism will be welcome).
If you still want to keep the html for some reason save it from w3m some place else before closing it.
Of course you can make way more complex, smart and featured scripts, but I'm crap at scripting and it does just what I want.
Cheers.
Offline
Pages: 1