Linux (dmidecode) & Windows (wmic)

Posted in Hardware, Linux, Windows on August 20th, 2010 by Sean – Be the first to comment

Least administrative effort…

Back when I was in school, this was a common theme. Having held a position as an IT Department of one through two different companies in the past 7 years, this is a phrase to live by. The Linux command dmidecode displays information about your hardware as reported to the system BIOS. This can be very handy for finding serial numbers and identifying hardware in the machine. One thing I find it particularly useful for is reading service tags off my Dell Servers running Linux.

Instead of walking to the server room, I can simply grep the serial number from the output of dmidecode. Here is an example output of dmidecode on one of my servers:

root@someserver:~# dmidecode | grep Serial
Serial services are supported (int 14h)
Serial Number: 5ZNT6D1
Serial Number: ..CZ7170375A0373.
Serial Number: 5ZNT6D1
Serial Number: Not Specified
Port Type: Serial Port 16550A Compatible
Serial Number: 7Z146BF4
Serial Number: 7Z146C8B
Serial Number:
Serial Number:

This saves me from getting around behind machines in the server room or digging around for wherever they may have stuck the service tag sticker. If you take a look at the output of dmidecode sans grep, you’ll be able to find much, much more information as well.

If you only have Windows servers, don’t fret, there’s a way to do exactly the same thing in Windows. You can use the command-line Windows Management Instrumentation tool wmic.

wmic bios
wmic bios get serialnumber

Try the above two commands separately. The first will output a jumbled mess of all the bios information available to WMI and the second will output only the Serial Number. The wmic command can also be entered by itself. This will place you in the WMI shell. Any information and configurations tasks that can be completed via WMI can be completed within this shell. Have a look at the help. It’s some interesting stuff that’s not used by most admin-type folks.

Enjoy!

Share this on Facebook | Tweet this

Weight Loss; What Worked (For Me)

Posted in Life on August 18th, 2010 by Sean – Be the first to comment

Hello Again!

I’m going to take a recess from tech posts to write about something completely different. I will start this post by saying that I am not a nutritionist, dietitian or personal trainer but I did do a whole lot of reading before arriving at my conclusions.

Since high school I struggled with weight gain. Like everyone else, I was looking for the miracle pill or food that would make it all go away. I wanted to lose weight, but I didn’t want to change my overall exercise or eating habits. I wanted a supplement that would let me continue to go about my day as I always had, but, lose weight. I never found that miracle solution, nor do I believe one actually exists (despite the claims of some pharmaceutical companies).

The closest that I came to finding a diet that worked and I could handle was Atkins. I had some success with Atkins but eventually gave up and binged on carbohydrates to end up back where I started, possibly heavier. Afterwards, I tried adding a little exercise while keeping my horrible eating habits in place. While I felt a little better, the weight didn’t come off.  Feeling like I was exercising for nothing, I gave that up…

Finally, in December of 2009, I had a wake up call. What I really mean is, I awoke in the middle of the night sweating profusely with my heart pounding. While I wasn’t in pain, I thought I might have been having a heart attack. I know what panic feels like and during this “episode” I could feel it setting in. Eventually, everything passed. The next day I sat down in the blood-pressure machine at Shoppers Drug Mart. I took four readings and they all said the same thing. My blood pressure at 31 years old was ~135 over ~92. I decided that I was going to usher in the new year with a goal of real effort towards weight loss.

Being the sort of person that loves to know how stuff works, I realized that I knew very little about how the human body really works when it comes to nutrition, metabolism and energy storage. I started digesting article after article on Wikipedia about metabolism, amino acids, fatty acids, carbohydrates, glycogenesis, lipogenesis and the citric acid cycle (to name a few). I also decided that I wanted to know why whole grains are better for you. Obviously, I had heard the term before — but what exactly makes a whole grain different from refined grains? What’s left over from grains when they refine them? Almost nothing; they mechanically separate everything from the endosperm and use only that part. Essentially, they remove the nutrients, fiber and antioxidants and leave the protein and (lots of) carbs (See for yourself).

With the things I learned, I set about making a change in lifestyle. This is what I believe needs to happen in anyone’s life when they want to lose weight. A diet is seen as a temporary thing. To truly lose weight and keep it off, you need to change your lifestyle. I quit butter and salt; cold turkey. I stopped eating refined grain and I added more fruit and vegetables to my daily meals. Thanks to some work by the US Military I was able to find a great formula to mathematically estimate body fat percentage. While body mass index is a nice starting point, its not an accurate measure for anyone who may have lifted weights to build muscle at some point in their life. If you know your body fat percentage (or a good estimate) you can figure out your lean mass. If you know you’re lean mass, you can calculate BMR (basal metabolic rate) with a higher degree of accuracy.

BMR is important because you then know the absolute minimum you can eat without putting your body into starvation-mode. If you’re eating less than your BMR, you body is going to start storing more fat. This is a survival mechanism. The Katch-McArdle formula for calculating BMR uses your actual lean mass as a measure.

With all of this information at hand, I created a spreadsheet to do all the work for me. I took a few measurements, punched in a few numbers and found out how much I needed to eat. Now that I had some numbers and food choices figured out, the next step was devising an exercise plan with which I would be consistent.

Looking at the articles once more, it became apparent to me that oxygen (and lots of it) is required for fatty-acid metabolism (converting stored fatty acids into ATP). When you are oxygen deprived (anaerobic), your body will use mostly glycogen (stored glucose) and amino acids. I knew I needed to be able to exercise for extended periods at a medium intensity so I could continue breathing deeply to ensure there was ample oxygen available fatty acid metabolism. For this, I decided that heart rate was the best factor to determine intensity level. I took resting heart rate measurements for a few days in the morning and used the average to find my maximum heart rate and target heart rate using the Karvonen method. My aim would be for 65% of my maximum heart rate as my target for maintaining oxygen levels during exercise.

For duration, instead of picking a timed goal, I picked a caloric goal. I used Metabolic Equivalents (MET) to calculate how long I would have to exercise to burn 400-500 calories per session. Since heart rate was my measure of intensity and I planned to stay at 65% — I chose 6.5 as my measure of MET (obviously, this was an educated guess as to MET measure).

Again, I added all of this information to my spreadsheet. I made my lifestyle change and stuck with it. As a result, I’ve dropped 44lbs and 7% body fat (from 30% to about 23%). My waist is down 6″ and my blood pressure is routinely around ~115 over ~70.  I feel terrific.

So… that’s that.  Again, my statements come from no medical background.  Take what I’ve said as you will.  If you’re interested, there is a link to my spreadsheed below.

Google Docs link; click ‘File’>’Download As’ in order to save it to your computer and edit it.

Enjoy the rest of your day!  Back to the tech posts soon, I’m sure.

Share this on Facebook | Tweet this

Remote Administration – RDP

Posted in Information Technology, Networks, Remote Administration, Windows on August 11th, 2010 by Sean – Be the first to comment

As an IT department of one, I frequently find myself without sufficient time to complete maintenance tasks as other ‘right now’ jobs often take priority. When I do get a moment to take a look at warnings or errors that appear that show up in Nagios, I want to be able to do it as quickly and easily as possible.

I’ve always found the RDP client interface in Windows a little clunky. I really prefer to simply double-click a shortcut and be presented with the remote server/workstation desktop–this is where .rdp files come in. These files are associated with the Microsoft Terminal Services Client and they store information about a remote desktop connection. They can be crafted ahead of time and placed conveniently on your desktop for quick access. The .rdp file is a simple plain-text file that, like a Linux .conf file, stores one setting per line. The syntax is varname:datatype:data.

Here is my template for an .rdp file:

full address:s:<serverNameOrIP>:3389
desktopwidth:i:1280
desktopheight:i:720
username:s:<username>
password 51:b:<encryptedPassword>
winposstr:s:0,1,50,50,1380,810
audiomode:i:2
auto connect:i:1
bitmapcachepersistenable:i:1
compression:i:1
disable cursor setting:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:1
disable wallpaper:i:1
displayconnectionbar:i:1
keyboardhook:i:1
maximizeshell:i:0
port:i:3389
redirectcomports:i:0
redirectdrives:i:0
redirectprinters:i:0
redirectsmartcards:i:0
screen mode id:i:1
server port:i:3389
session bpp:i:16
smart sizing:i:0

If you choose to save your passwords in an .rdp file, they are encrypted. You’ll need a way to encrypt your password for storage in the .rdp file. The small application at this blog will help. For help with each of the settings in the .rdp file, check out this Microsoft article.

Share this on Facebook | Tweet this