Showing posts with label information. Show all posts
Showing posts with label information. Show all posts

Saturday, January 29, 2011

Updated Post: Arbsorption Of Knowledge In The Computer Age

Hello again, --> GENERAL WARNING: If you don't like to read a lot of text online, blow off this post! Also, ZOOM OUT when you're done reading for a nice surprise! It's a tech opinion piece and won't solve any problems that can't be cured by slowing your life down a bit and paying more attention to the moment. That being said, even though this text is meant to be right above the "F" I'm going to put this disclaimer here anyway, just to see how many complaints I get. This post is full of misleading, and often completely incorrect, information and a few typos. For instance, I'm well aware that the square of 25 is not 3. Sometimes, I use the wrong case (we instead of I) on purpose. I don't address some points at all. Depending upon how some folks read
online (based on my own stockpile of comments and responses to posts) you may very
well have either missed what I just wrote or will have forgotten it by the time you
get to the point where I make that false assertion. Hopefully we're below the Adsense block now, so we can begin with the top of the "F."

Today I'm going to follow up on post we did a good long while ago regarding absorption of knowledge in the computer age. And I'm going to get a few things out of the way right off the bat, just in case you're the type of "F" reader they refer to in that previous post (more on that farther down the page ;) I was originally going to post some ridiculously bad code, explain that I was doing it on purpose, and why, with text in the "F pattern" and see how many people still complained about the shoddy quality of the code. Instead, I looked back at some older posts where the code was intentionally bad (in order to illustrate concepts related to the porting of shell to Perl or other programming languages more easily - since if two different languages are more structurally and visually similar, it's generally easier for anyone to process their own translation - my opinion, of course ;) and decided that, since I've already done that, it would be cheap to do it again. Easy for me. Lame for you. Believe it or not, that original series of posts on porting continued to generate complaint mails, even though the follow-up (linked to above) and rationale was spelled out within the top section of the post and is just a small part of a pretty sparse read; especially when compared to the endless lunatic yammering I slap down on the virtual page nowadays ;) If that link generates more complaints about improper or inefficient code we'll be numb with indifference... There's only so much caring one man can do ;) This has been the (possibly slightly goofed up by Adsense) top of the "F."

instead, i'm going to attempt to explain (and have fun with)
one basic concept in the aRticle from our prEvious post on computer reADing habiTs.
tHE writeR begIns the article (quite cleverly, actually, since he's assuming
you'll be the type of reader he describes and packs that information in the
relevant places) exploring the theory that most children (and a lot of teenaGers
and adults) are "f" readers when it comes to reading text on tHe inTernet. the
"f" is Somewhat of a double entendre (I'm going with the strict french translation
of "DoublE understanding" since the term is mOstly used to describe a "phrase"
rather than a single letter ;) in this case, since it's used as both a mnemonic
(the less to remember you by, my dear ;) for "F"ast and as a visual descripTion
of the patH most onlIne reader'S eyes follow when reading books or text on the
comPuter screen. if you've reAd this faR, the remAinder of the post should be
completely uninteresting. we tried to do a few thinGs on purpose to make this
post enteRtAining on more than just a Plain level. wHatever doesn't make sense,
probably will when you see the forest :)

Just for the record, I prefer to read books on paper. Not because reading online
makes me lose control like Patty Duke in the presence of a hot dog (see The Patty Duke Show Theme Song
for the full lyrics to that bizarre reference ;), but I find that reading a computer
screen is generally either uncomfortable (sitting in a chair or trying to balance a
laptop on my knees) or outright painful (bad refresh rates and certain color schemes
make my eyes dry up like juicy oranges and twitch uncontrollably). Bless all of you
who enjoy reading lots of text online. If I can, I go the library and get the book
instead. Unprovoked question: If I can't stand reading lots of text on a computer,
why do I write such long blog posts? Am I sadist, a masochist, both or just oblivious? ;)

Generally, I will read every word on an Internet page if, and only if, I have a
particular reason to. This is parallel to my reading habits offline. If I like
an author's work or I find a book on a subject I find interesting, you can bet I'll
read every single word in that book. Speed reading is fine for some (I guess), but
it seems to contradict any sense of enjoyment. Soaking up lyrical prose at 50 pages
a minute would be, probably, a really wonderful way to have an anxiety attack that
would make Evelynn Wood proud ;)

In much the same way (both online and offline), if I'm just looking for a particular
nugget of information, I'm not sure what letter my eye-scan pattern creates, but I
definitely skim. This is one point where I felt the article fell a bit short of
exploring both sides of the issue. The assumption being that people read "everything"
on the Internet the same way they read their Facebook pages doesn't necessarily hold water.
It's certainly true in some situations.

As a for instance: If, for some strange reason, I was surfing the web (nobody seems to do that any more. They stopped driving down the information superhighway, too. Another example of Howard Johnson's Syndrome, except sometimes under water ;), we didn't know the square root of 25 (that's actually supposed to be the strange part ;) and discovered that the only place it was listed was on an online encyclopedia entry on square roots in general, I'd go there and check it out. One humongous old-school web page that covered everything from origin of the square, the root, why
the square and/or the root may have nothing to do with numbers, the history of the square root, detailed biographies of people involved in the development, application
and sustained nutrition of the Lego-like plant, etc. Now, keeping in mind that I only want to know that the square of 25 is 3, I would, of course, skim that page like crazy; probably looking for a table or list of some sort that listed out common
numbers and their square roots. This activity would be considered "F" type reading. More like "spots on a Dalmatian" reading, but who's counting? ;) I would be reading fast, not because I have the attention span of some dumb animal with a very short attention span (that's another situation of an entirely different colour ;), but because there was only one piece of information on that page that I was actually interested in reading. Taken out of context, this might reflect poorly on me and my reading habits, but, taken within the proper context, it would make me seem reasonably intelligent and somewhat efficient.

Another reason kids (there was a big deal made about how having computers in schools
didn't' help improve a child's education, in and of itself) might read more quickly online (And I am doing my very best to defend all of you complete idiots out there -
I'm just kidding, of course, but I'm ready for the hate mail ;) is that a statistical majority of content available for consumption online is worthless crap.
Phenomena like "Ad blindness" and "F" reading are not convenient fictions designed to make us bookish-folk feel superior. Think about how often you go to the library and just browse a few pages from a couple hundred books. Have you ever done that? Really? And, supposing you did, how many of those books would be plastered with advertising (like the advertisements on this page that, if you read regularly enough, basically cease to exist after a certain amount of time)? Or how many would
spontaneously open other books (in the "Adult" section ;)? Or how many would have titles like "The History and Culture of Ancient Sumeria" and actually be about 500 different ways you can eat Haggis and manage not to vomit?

Also, the 10 to 40 dollars that the average person might pay for
unlimited Internet access per month makes the ability to consume
volumes and volumes of useless information incredibly easy. If you
had to pay 40 dollars for a real book, would you buy the same trash
you spend hours mooning over online? My guess is probably not. In
the offline world, that 40 dollar expenditure on an 800 page book
that promised you (no matter how little marketing experience you had)
that it could teach you a revolutionary new method of selling antique
dildoes to geriatric women (or something else less offensive to geriatric
women ;) would seem like "COST." For your 40 dollar
monthly Internet access fee, that 800 page PDF would seem like
"BENEFIT." No matter how I feel about geriatric women
(for some reason, I just can't stop writing that now - I feel like Norm
McDonald talking about "hookers"
;), the way in which you read that
book in the offline world would, most likely, be much different than you way
you would read it online. Offline you'd probably pay more attention. After
all you just spent your 40 dollars and this is all you have to show for it
(those geriatric women won't be on life-support forever ;). Online, you could
skim the book to find all the relevant information you needed about dildoes and
move along, having, theoretically, spent only a few cents of your 40 dollar
investment. You, and whatever other kinks you're carrying around, would still
have 39 dollars and 98 cents worth of perusing to do ;)

DOG'S IS GOOD FOOD! if you've even scanned down THis far, you
probably rEad that line. why? because it was pRintEd In bold in an article that iS
mostly devoid of bolditude (it's NOt a real word, Look it up in the phonE book ;) did you read that and consider that it didn't make a whole lot of sense. are you wondering, right now, if I having just been jerking you around in a solipsistic pseudo-intellectual diatribe with the sole intention of wasting your time? you're probably right. as a matter of FacT, you are almost definitely parked on the left SIDE-street ;) thIs has beeN an experimenT, after all. tHe thIng that'S really most questionable about this Piece is the question of "why would I go to such lengths just to see whAt happens?" think about it. admitting you've just wRitten An opinion piece that doesn't necessarily Gel on puRpose, provides no reAl value and
may not have even been worth scanning is a risky Proposition for a blog autHor. okay, more directly, it's a risky proposition for a blog author who wants you to continue to read his blog and has a reputation to uphold as a semi-competent working
professional in the field. i'm one of those kind of blog writers. but, now that you've read this post and its half-hearted apology are you more or less likely to trust that the next post you read will contain useful and/or relevant information?

Believe it or not, I'm actually interested in your opinion. Let me know what you think. Was this post as fun for you as it was for me? Did you enjoy finding all the incorrect and goofed-up stuff inside it? Do you think you found it all? And, most importantly, does this little math trick at the end redeem this post in any way
whatsoever? I put it on the bottom of the "F" so it would be easy to find, so here it is:

If you want to multiply any number by 5, divide it by 2 and then move the decimal place one over to the right. If you want to multiply any number by 25, divide it by
4 and move the decimal place to the right two spaces. And, yep, it even works for multiplying any number by 125. To do that divide it by 8 and move the decimal place
over 3 spaces. If you have trouble dividing by any number greater than, but a multiple of 2, just divide by 2 twice (to divide by 4) and divide by 2 three times (to divide by 8). If you can't divide by two, I know a great Elementary school. I can probably get you in on my kid's recommendation ;)

Ex:

133 x 5 = (133/2) = 66.5 = 665
133 x 25 = (133/4) = 33.25 = 3325
133 x 125 = (133/8) = 16.625 = 16625

Cool, yeah? "F" me - It's an "E" ;)

Cheers,

, Mike




Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Tuesday, November 18, 2008

Bash One-Liner Script To Produce Somewhat-Fancy Output Of Who's On Your Linux Or Unix Box

Hey there,

Today we're going to shoot out a quick one liner script that can come in handy from time to time. It doesn't fall under the "necessary" category (or, maybe not even the "useful" one ;), but it's nice to have for those times when you just don't feel like doing any extra typing or expending the effort required to separate the wheat from the chaff on a screen full of garbage output. That is, as I've always understood, one of the main reasons to script things out in the first place. The other reasons, like automation, efficiency, etc, are pretty much ignored here, even though we will be automating a repetitive action and that, by definition, will make our waste of company time more efficient. No matter how you look at them, automation and efficiency always seem to be a good thing ;)

This "script" is really just a simple pipe-slam so that we can figure out who's on the machine with us (my preference is for a script, but - as you'll soon see - this could just as easily be an alias, etc). Sure, we could just type "w" or "who," (and "w" does form the base of this bash one-liner script), but we'd like to have this whole thing look more personal. And by personal, I mean, we'd like to know who else is on other than us by UID or login name. The functionality (or relative merit) of this script depends heavily on the way in which users were created on your machine in the first place. If no "comment" (or "gecos") field is populated for users on your system, this command-chain is completely worthless.

For instance, assuming we had a user, with a login name of user1, logged in at the same time as us, with an entry that looked like this in /etc/passwd:

user2:x:32678:99::/home/user2:/bin/bash

and our /etc/passwd entry looked like this:

user1:x:32677:99:Mike The SysAdmin:/home/user1:/bin/bash

the command would pull no useful information for user2. So, if the output from w looked like this:

host # w
13:49:12 up 8 days, 3:41, 2 users, load average: 0.00, 0.14, 0.43
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
user2 pts/0 08:44 5:03m 0.01s 0.01s -bash
user1 pts/1 09:05 0.00s 0.04s 0.00s w


our command would only produce output like this:

host # ./wdo.sh
Mike The SysAdmin


Whereas, if we added a comment field (perhaps via usermod -c "Bob The Guy Who Used To Be Anonymous" user2 or the chfn command), we would get nice output like the following:

host # ./wdo.sh
Mike The SysAdmin
Bob The Guy Who Used To Be Anonymous


and so forth, with users who had multiple sessions open being reported more than once. This script was written to give us a warm, fuzzy feeling, so seeing Bob's name five times is no big deal. If you want to use it for profiling purposes on a more heavily trafficed machine, there's always "sort."

Note, of course, that your version of Unix or Linux may produce slightly different output for the "w" command and xargs' -i flag may be "-I" (also, if, for some bizarre reason, your login names have spaces in them, just be sure to double quote the variable you define via xargs with the -i or -I flag. This should never happen). Basically, what I'm saying is, this script probably won't run correctly, exactly as it comes, on every single distribution of Linux and Unix out there :)

Enjoy the neighborhood watch :)

Cheers,

#!/bin/bash

#
# wdo.sh - More comments than code :)
#

w|awk '{print $1}' |xargs -ibing grep bing /etc/passwd|awk -F":" '{print $5}'



, Mike




Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Thursday, August 21, 2008

Displaying System Information On Linux Or Unix With Cfg2html

Hey There,

Today's post is about a program I got turned on to at work, and which makes our script on linux server information reporting seem a bit lackluster. Then again, there's something to be said for not having "too much" information ;) What we're going to look at today is something you (and your technical colleagues) might love (or hate -- check out a message board or two to keep an accurate reading on the heated and irregular pulse of the user community at large ;) This is definitely not something the higher-ups are going to want to deal with. I'm sure they'd love to know it's available, but (and once you check it out, you'll agree) it doesn't contain the requisite number of pie-charts and 3-dimensional lines to impress a board of directors ;)

The script (which is available for free) is called cfg2html and, from my experience so far, I must say it does a fantastic job of reporting what's reportable and making for a very easy-to-read html server analysis (even if I do have to page-down 50 times to look at absolutely everything it reports on). You can pick up the latest (but not necessarily most stable) version at the cfg2html main site. This is an excellent place to go and grab it, but, since it does always have the latest version, you run the risk of picking up a newer (meaning not quite as thoroughly tested) release that you may not want.

If you're looking for stability, and/or a major release, check out the cfg2html Yahoo group. I'm not sure why this is their main site for stable releases, but it's an option that I've never seen used by a free software distributor, so far, and that makes it (at the very least) interesting. There's probably a very good reason. And I'll make myself nuts trying to figure out what it is unless I just drop it... immediately ;)

The cfg2html latest release page and the cfg2html stable release page (which is redirected to from both come.to and freshmeat.net) both have links to downloads tested to run on HP-UX 10 and 11, Solaris, AIX, SCO Unix, SUSE, Debian, Ubuntu and Red Hat) Linux, NT4.0, Windows 2000, certain Brocade switches and OpenWRT/Freifunk routers. You can also find plugins for AP R/3, Oracle, Informix, Samba (with or without SWAT), ITO and NNM, XP-Surestore Storage, EVA, SureStore E, SuperDome, OLA/R, SCM, AutoRAID, FC60, Tip/X, MC/SG, and Dataprotector/OmniBack. Your download size will vary depending on what you need, but the basic setup doesn't get much larger than 900Kb (Which is actually pretty large when you consider that it's a "script"! ...Actually there are probably some extra binary components to a few of the more eccentric entries in the series. The script I used was only about 40 or 50 Kb.)

If that list of options isn't extensive enough for you, you'll be glad to know that sourceforge.net hosts a separate project exclusively for cfg2html for IBM AIX and another, more specific, revision of the original product, called ora2thml which is more heavily geared toward Oracle configuration reporting. And, just to prove it's a small world, ora2html is in the midst of getting together support for AIX.

Random Interesting Fact: The term "acronym" is almost always used incorrectly. An acronym is any combination of letters, which can be pronounced like a word (actually, it should, technically, be a "real" word, but we've let that slip long ago), consisting of the initials of other words. Self Contained Underwater Breathing Apparatus (SCUBA) or White Anglo-Saxon Protestant (WASP) are acronyms. NT, XP, SCM, NNM, CFG, etc are just groups of initials. People who prefer to avoid conflict sometimes refer to them as abbreviations, although that is generally a bit of a stretch, as well ;)

Snapping right back to (One of my favorite acronyms ;) cfg2html, I've posted some screen shots below of the run-time output (taken from the internet public domain -- Shoot me an email if you deserve credit, since I couldn't find who it actually belonged to) and sections of the actual output from a box I got to test it out on. I think you'll agree that the results are impressive, if not overwhelming and possibly suffocating ;)

Click the picture below to see the run-time output from some guy's server in its original size:

cfg2html runtime

And, just after and below this sentence, click the following pictures for larger versions of a portion of the cfg2html TOC output and two out of 50-odd pages of copious details:

cfg2html report header


cfg2html kernel parameter report


cfg2html hardware report

Like I mentioned, if you're looking for something less severe, check out our old post on reporting Linux system information (and maybe even check out our famously lame collections of sar graph scripts for Unix (follow the links near the top of the article to get all the other scripts) and their all-in-one counterpart Linux sar graphing script.

If you want it all and you've gotta have it now (or as soon as you figure out how to make the html format itself the way you want it to ;), I'd highly recommend checking cfg2html out for yourself.

In a future post, we'll look at ways to configure it other than the "everything under the sun" method we've employed today.

Cheers,

, Mike




Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Thursday, April 10, 2008

Perl Script To List Out Linux or Unix Crontabs In HTML

Output from crontab HTML Perl script

Hello again,

Today's script is a simple, but useful, one. A while back, we ran a series of posts on graphing out disk, paging, memory and cpu statistics for Unix, with a big roundup for paging, memory and cpu on Linux.

This time, we're going to go in a bit of a different direction and put together an example script that creates an HTML page, also (hopefully) providing some useful information for you, the sysem admin or user.

As with the other scripts, there are a few words of caution that go with putting any sort of script like this "out there." While this doesn't have the destructive potential of the Linux graphing scripts (or the Unix ones), as they were interfacing directly with system commands, you should still be careful whenever you publish information in this way. Since our script goes to the filesystem to read its information from a system output file, it affords access that may not necessarily be granted to a user logged on to that system.

In any event, all "gloom and doom" aside, we're starting out simple with today's "system information" script by just reporting on crontab contents. The script below does need to be run from the command line (unless you expressly allow execution of .pl files in your web server's configuration and modify it somewhat), which creates an interesting cyclical loop if you run it from cron ;) It's also kind enough to remove all comment lines from the crontabs so they're, hopefully, more readable!

You can execute it simply by running it from the command line with no arguments, like so:

host # ./cron.pl

You'll probably need to modify a few variables (like the "chdir" line, to indicate the correct path to your crontabs directory, the output file's destination and the section where I purposefully ignore the basic "system accounts" (including root) and then print to the HTML page that they're "currently unused"), but it should run right out-of-the-box, otherwise.

Cheers,


Creative Commons License


This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License

#!/usr/bin/perl

#
# cron.pl --- Easily scan through a server's cron jobs
#
# 2008 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

chomp($cur_dir=`pwd`);
chdir("/var/spool/cron/crontabs");
@crons = `ls`;
$filename = "${cur_dir}/cron.html";
$hostname = `hostname`;

foreach $job (@crons) {
chomp $job;
if ( $job =~ /(^adm$|^lp$|^sys$|^uucp$|^root$)/ ) {
next;
} elsif ( $job =~ /\.pl|html|passwd/ ) {
next;
} else {
push(@parcel, $job);
}
}

open(OUTPUT, ">$filename");
print OUTPUT "<html><head><title>$hostname Cron Services</title></head>\n";
print OUTPUT "<body BGCOLOR=\"#000000\" TEXT=\"#00FF00\" LINK=\"#FFFF00\" VLINK=\"#FF0000\" ALINK=\"#BECD8C\">\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">$hostname -- CRON SERVICES:</FONT>\n";
print OUTPUT "<br><hr><br>\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">root:</FONT><br>Currently unused. - System Supplied.<br>\n";
print OUTPUT "<br><hr><br>\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">adm:</FONT><br>Currently unused. - System Supplied.<br>\n";
print OUTPUT "<br><hr><br>\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">lp:</FONT><br>Currently unused. System Supplied.<br>\n";
print OUTPUT "<br><hr><br>\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">sys:</FONT><br>Currently unused. - System Supplied.<br>\n";
print OUTPUT "<br><hr><br>\n";
print OUTPUT "<FONT COLOR=\"FFFF00\">uucp:</FONT><br>Currently unused - System Supplied.<br>\n";
print OUTPUT "<br><hr><br>\n";

foreach $part (@parcel) {
open(PACKAGE, "<$part");
@package = <PACKAGE>;
close(PACKAGE);
print OUTPUT "<FONT COLOR=\"FFFF00\">$part</FONT>\n";
print OUTPUT "<br>\n";

foreach $pretty (@package) {
if ( $pretty =~ /^#/ ) {
next;
} else {
@picture = split(/ /, $pretty);
$frame = join(" ", @picture);
chomp $frame;
print OUTPUT "$frame<br>\n";
}
}
print OUTPUT "<br><hr><br>\n";
}
close(OUTPUT);


, Mike




Friday, February 1, 2008

Solaris Shell Script To Gather Basic System Info

Wrapping up this work week, it occured to me that I'd spent all my time on Linux and none on Unix (A bad thing? Judgement call ;)

In any event, I thought it would be somewhat equalizing if I put together one of my basic shell scripts, specifically for Solaris, that you can be run on any Unix system (although you'll need root privilege to ensure that all of these commands give you the information you want) and print up a nicely formatted listing of system information.

When run in an SSH shell loop, it can be a quick and tidy way to put together a system inventory to keep the big dogs happy ;) You can run it simply by calling it on the system you're running it on, like so:

./solinfo.sh

Cheers; enjoy your weekend :)


Creative Commons License


This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License

#!/bin/sh

#
# solinfo.sh
#
#
# 2008 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

echo "hostname: \c"
/usr/bin/hostname
echo

echo "model: \c"
/usr/bin/uname -mi
echo

echo "cpu count: \c"
/usr/bin/dmesg|grep cpu|sed 's/.*\(cpu.*\)/\1/'|awk -F: '{print $1}'|sort -u|wc -l
echo

echo "disks online: \c"
echo "^D"|format 2>/dev/null|grep ".\. "|wc -l
echo

echo "disk types:"
echo
echo "^D"|format 2>/dev/null|grep ".\. "
echo

echo "dns name and aliases:"
echo
nslookup `hostname`|grep Name;nslookup `hostname`|sed -n '/Alias/,$p'
echo

echo "Interfaces:"
echo
netstat -in|grep -v Name|grep -v lo0|awk '{print "Name: " $1 " : IP: " $4}'
echo

echo "Access Restrictions:"
echo
if [ -f /etc/hosts.allow ]
then
cat /etc/hosts.allow
else
echo "No host based access restrictions in place"
fi
echo
echo "OS Release: \c"
uname -r


, Mike




Thursday, January 31, 2008

Linux Shell Script To Gather Basic System Info

Today, I thought we'd go for some lighter fare, so I put together another one of my simple shell scripts, specifically for Linux, that you can run on any system (although you do need some elevated privilege to get the correct information for a few of the commands) and print up a nicely formatted listing of system information (I tried to pick the stuff superiors tend to want to know).

If you run this in an SSH shell loop, it might just be a handy way to slap together a little system inventory to pacify the big guys ;) You can run it simply by calling it on the system you're running it on, like so:

./sysinfo.sh

Anyway, enjoy and best wishes. The work week is almost over :)


Creative Commons License


This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License

#!/bin/bash

#
# sysinfo.sh
#
# 2008 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

echo -n "hostname: "
/bin/hostname
echo

echo -n "model: "
/bin/uname -pm
echo

echo -n "cpu count: "
/bin/dmesg|grep CPU|awk -F: '{print $1}'|sort -u|wc -l
echo

echo -n "disks online: "
fdisk -l|awk '{print $1}'|grep \/dev\/|sed 's/[1234567890]//'|sort -u|wc -l
echo

echo "disk types:"
echo
fdisk -l|awk '{print $1}'|grep \/dev\/|sed 's/[1234567890]//'|sed 's/\/dev\///'|sort -u|xargs -iboink grep "^boink" /var/log/dmesg
echo

echo "dns name and aliases:"
echo
nslookup `hostname`|grep Name;nslookup `hostname`|sed -n '/Alias/,$p'
echo

echo "Interfaces:"
echo
netstat -in|grep -v Kernel|grep -v Iface|grep -v lo|awk '{print $1}'|xargs -iboink cat /etc/sysconfig/network-scripts/ifcfg-boink|sed -n 1,2p
echo

echo "Access Restrictions:"
echo
if [ -f /etc/hosts.allow ]
then
cat /etc/hosts.allow
else
echo "No host based access restrictions in place"
fi
echo
echo -n "OS Release: "
uname -r


, Mike