Ying Li at myITforum.com

PowerShell & System Center

March 2007 - Posts

Not All Carbohydrates Are Created Equal

What are carbohydrates? They are a bunch of sugar molecules daisy-chained together. For our bodies to use these carbohydrate string as energy, we need to break them down into their component simple sugars.

The speed at which this breakdown takes place determines how much sugar enters our bloodstream, and how quickly, after a carbohydrate-rich meal. That speed is important, because it has an impact on how much insulin we produce.

When sugar in our blood rises quickly, we make a lot of insulin. When sugar rises slowly, we make much less insulin.

As long as we’re not diabetic, our bodies make exactly as much insulin as is needed to control our blood sugar within a certain range. If the blood sugar begins to rise rapidly, our bodies’s response is to release more insulin in an effore to control our blood sugar level. But releasing a lot of insulin is not a good thing.

As we release more insulin, our livers become sluggish, our cholesterol and triglyceride levels rise; we put on weight and feel tired as well as hungry.

Over the long run, if execssive amounts of insulin are released regularly, our body develops a degree of tolerance, or resistance, to the effects of insulin, and we lose our nomal response to it.

We then fall into a vicious cycle. As we become less sensitive to insulin, our blood sugar tends to run higher thatn normal, which triggers the release of more insulin, which leads to more tolerance, or resistance, which leads to higher insulin levels, and so on.

The process reveals the reasons why all carbohydraes are not created equal. Some carbohydrates can be converted to sugar very quickly, while other sources of carbohydrate are converted to sugar very slowly. How quicly any particular carbohydrate can be converted to sugar is indicated by something called the glycemic index of the food.

To be continued…

Posted: Mar 30 2007, 10:45 PM by yli628 | with no comments
Filed under:
Fiber explained

Fiber is an indigestible carbohydrate. Human lack the enzymes needed to convert fiber to sugar(although other organisms do this quite well, such as some bacteria.)

Even though we can’t use fiber as a source of energy, fiber is an important nutrient, because it has a significant impact on the absorption of other, digestible carbohydrates. Fiber also has an effect on our digestion and elimination, and a major impact on the types of bacteria living and growing in our intestines, which can and do utilize fiber as a food source.

There are two main categories of fiber: soluble and insoluble.

The terms soluble and insoluble simply indicate whether a fiber can be digested or not.

For example, bran is an insoluble fiber, It cannot be broken down by the body. This increases the bulk of stool and the speed with which you eliminate waste, and may also cause absorption of toxins.

Soluble fiber comes most often from non wheat types of fiber, such as from fruits or vegetables, and is broken down by the beneficial bacteria in your gut; these bacteria rely on soluble fiber as their own food source. Generally, the more soluble fiber in your diet, the more you promote the growth of healthy bacteria in the colon.  These bacteria are considered beneficial because in the process of breaking down soluble fiber, they produce by-products (vitamins) that are important for out health.

That’s one of the reason we should be careful to use antibiotics because it not only induce tolerance for the “bad bacteria” and it also kills “good” bacteria.

Posted: Mar 29 2007, 09:52 PM by yli628 | with no comments
Filed under:
Powershell command categories

As you may already know, there are four categories of commands in PowerShell: cmdlets, functions, scripts, and native Win32 executables.

Cmdlets is a term that’s specific to PowerShell environment. A comlet is implemented by a .NET class and building cmdlets is a developer task and requires the PowerShell SDK.

get-wmiobject

Cmdlets always follows Verb-Noun pattern, where the verb specifies the action and the noun specifies the object to operate on.

The next type of command is function. This is a named piece of PowerShell script code that lives in memory while the interpreter is running, and is discarded on exit.

Functions are made up of user-defined code that is passed once when defined. This parsed representation is preserved so it doesn’t have to be re-parsed every time it is used.

A script command is a piece of PowerShell code that lives in a file with a .ps1 extension. In version 1.0 of PowerShell, these script files are loaded and parsed every time they are run, making them somewhat slower than functions to start (although once started, they run at the same speed).

The last type of command is called a native command. These are external programs (typically executables) that can be executed by the operating system. Native commands are the slowest of the command types.

Posted: Mar 29 2007, 09:15 AM by yli628 | with no comments
Filed under:
Answer to Quiz 4

a. Going to a spa is a great way to jump-start your overall health program. But a spa week along won’t solve your problem.

b. Sounds right, it’s not. Walking is relatively good for you, but unless you walk up hills very briskly, the number of calories burned isn’t very high

c. Strength training is correct; especially focusing on large muscle groups such as the thighs, hips, and buttocks builds the large muscles that are the engine of your metabolism. Building muscle is like adding two cylinders to your car’s engine — it will burn more gas even when idling. Strength training has the greatest effect on improving metabolism and will actually help you burn calories while you sleep.

d. Chewing gum is not as silly as you might think. Chewing gum all day can burn significant calories and can produce weight loss of up to eight to ten pounds per year. But it is not as good as (c).

Posted: Mar 28 2007, 09:15 PM by yli628 | with no comments
Filed under:
The Modern Myths Quiz 4

You have always struggle with your weight. No matter how virtuous you seem to be, diet wise you’re never able to maintain any long-term weight loss. Your weight just keeps creeping up, may be three to five pounds per year. The most helpful exercise regime to reach your goal would be:

a. Go to a spa for a week

b. Begin walking thirty minutes three times per week

c. Perform strength-training exercises with weight machines three times per week

d. Chew gum all day long

Posted: Mar 28 2007, 08:44 AM by yli628 | with no comments
Filed under:
Live long and healthy, die without ill

Heterophiles, the father of anatomy (and physician to Alexander the Great), wrote in 300 B.C. : “ When health is absent, wisdom cannot reveal itself; art cannot become manifest; strength cannot be exerted; wealth is useless; and reason is powerless; Jack Coca doesn’t taste like J&C.”

OK, I make up the last one.

The doctor of the future will give no medicine but will interest his patients in the care of human frame, in diet, and in the cause and prevention of disease.

— Thomas Edison

Posted: Mar 24 2007, 08:25 PM by yli628 | with no comments
Filed under:
Love handles equal no fat

When you want to lose weight, you may think that getting rid of fat is the key. You see all that adipose tissue, or fat cells, accumulate on your body, and you think you have to get rid of it. This type of fat is very different from the fats humans need to perform essential body and brain functions – cut out all fat from your diet is not healthy!

On the other hand, don’t rejoice because you have extra fat on your body — it doesn’t mean your head is doing fine. Your love handles are merely a storage form of fat. They’re not going to make you happy, in any sense of the word.

Balance and moderation

 

Posted: Mar 23 2007, 07:26 PM by yli628 | with no comments
Filed under:
Omega-3, Another myth in the making?

As studies proving the benefits of omega-3 fatty acids continue to crop up, food manufacturers have begun a campaign to include the healthy additive in a variety of everyday grocery products. Among others, Tropicana has announced that they will unveil their omega-3 rich orange juice.

What exactly is an omega fat? The “omega” classification refers to the chemical structure of unsaturated fats. The omega numbers 3, 6, and 9 refer to the location on the fat molecule where the hydrogen atom joins onto it. It is just basic chemical nomenclature, but these simple differences have profound biological effects in the body.

Of all of the fats, our bodies actually require only two: alpha-linolenic acid (an omega-3) and linoleic acid (an omega-6). As with some vitamins, our bodies need these two fats but cannot manufacture them. By using these as raw materials, however, we can manufacture all the other fats our bodies use.

Omega-6 fats are much more prevalent than omega-3 fats.  Sources of the omega-6 linoleic acid include safflower and sunflower oils, and corn, soy, and canola oils. Sources of the omega-3 alpha-linolenic acid include flaxseed oil and blackcurrant seed oil. they can also be found in smaller amounts in certain nuts and seeds.

The optimal ration of omega-6 to omega-3 fats in our diet is between 2;1 and 4;1, whereas the standard American diet has a ration of more than 20:1. this means most of us need to increase our intake of omega-3 fats and reduce our intake of omega–6 fats.

Important omega-3 fatty acids in nutrition are: a-linolenic acid (ALA), eicosapentaenoic acid (EPA), and docosahexaenoic acid (DHA). Studies have shown omega-3 fats can cut the risk of heart disease, assist in brain development. and even reduce the risk of Alzheimer’s disease.

Recent research at Harvard has shown that supplemental essential fatty acids can improve the symptoms of bipolar (manic-depressive) disorder. This is based on the fundamental understanding that the cells of the brain normally contain high levels of DHA, which is also commonly found in fish fat, and that adequate levels of this type of fat are critical for healthy communication between brain cells.

The positive effects of omega-3 fatty acids are not really disputed, and both the American Heart Association and the FDA are in support of omega-3s, but some nutritionists note that foods with naturally occurring omega-3s are still healthier than foods with the fatty acid added.

Posted: Mar 22 2007, 09:21 PM by yli628 | with no comments
Filed under:
Fat is beautiful!

As you can see: Intake of unsaturated fats is essential and critical to the functioning of every cell in our bodies.

The cell membrane, which is the outside surface of every cell, is composed primarily of fat and the mineral phosphorus. This membrane, which forms the interface through which each of our cells interacts with its neighboring cells, has important functions.

The member is semi permeable, meaning that it allows some substances across and into the cell (including nutrients from food, hormones, messenger molecules, and so on) while keeping others out (such as large molecules, sodium, calcium, et cetera).

The cell membrane also acts something like a battery. Our bodies spend a significant amount of energy just maintaining the “charge” of our cell membranes; this battery like action is crucial for the functioning of our cells and for protecting them from break down and deterioration.

The point here is that the types of fats that make up our cell membranes are very important. For optimal cell health, the cell membrane must be fluid and flexible, rather than stiff and rigid. To allow for this flexibility and fluidity, the fats composing the cell membranes also need to be fluid and flexible. If the fats within our cell membranes are stiff and rigid, as happens when we fill ourselves with saturated and /or hydrogenated fats, the cell membrane becomes stiffer, less fluid, less able to perform optimally.

The monounsaturated fats and polyunsaturated vegetable fats are some of the fluid, flexible fats. But no single fat or oil should be the only fat in your diet. Eating a balance and blend of the mono– and polyunsaturated fats is important for optimal cellular and general health.

Studies show that the proportions, or ratios, of certain fats in the diet have an impact on the level of inflammation in our bodies. Diets that are too high in the polyunsaturated fat known as arachidonic acid may lead to an increase in inflammation. Foods are high in arachidonic acid include red meat, shellfish and egg yolks

Posted: Mar 21 2007, 09:39 PM by yli628 | with no comments
Filed under:
Powershell script to change the Last Modified Timestamp for all the files in a folder

Here is a very cool script and you can change the last modified timestamp for all the files in a folder:

$Now= Get-Date
$TargetFolder = Get-ChildItem "C:\MyWorkPlace"
foreach($file in $Targetfolder)
{
$file.LastWriteTime = $Now
$Now = $now.Addminutes(5)
}
$TargetFolder

I can choose whatever the time I want and just change to $now = Get-Date "3/21/2007 2:00 PM ". This will make me looks busy in front of my boss if he cares. Or I could help some VIP users (of course, they need to buy me lunch first )

Posted: Mar 21 2007, 04:52 PM by yli628 | with no comments
Filed under:
Chinese restaurant food unhealthy

Rod brought to my attention this article:

Chinese restaurant food unhealthy

I found it is very interesting and I basically agree with their findings. As a Chinese myself, I know they add more sodium for taste (even at home) and they like fried stuff which is the source of transfat which we should avoid at all cost especially in the current eating environments.

But the take away message of this article is this:

“Across the board, American restaurants need to cut back on calories and salt, and in the meantime, people should think of each meal as not one, but two, and bring home half for tomorrow,”

I believe we should start a campaign to lobby the restaurant industry to cut the size of their dishes in half (reduce the price in half at meantime isn’t all that bad )!

Posted: Mar 21 2007, 11:51 AM by yli628 | with no comments
Filed under:
Powershell script to check if opsware agent is installed and running

Here is a powershell script to check if opsware agent installed and running. It uses the .NET class I mentioned in my previous post[System.ServiceProcess.ServiceController]:: to get the service status from remote computer.

#$erroractionpreference = "SilentlyContinue"

$a = New-Object -comobject Excel.Application
$a.visible = $True

$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)

$c.Cells.Item(1,1) = "Machine Name"
$c.Cells.Item(1,2) = "Opsware Agent"
$c.Cells.Item(1,3) = "Report Time Stamp"

$d = $c.UsedRange
$d.Interior.ColorIndex = 19
$d.Font.ColorIndex = 11
$d.Font.Bold = $True

$intRow = 2

foreach ($strComputer in get-content C:\MachineList.Txt)
{
 $c.Cells.Item($intRow,1)  = $strComputer

Function CheckOpsware
{
 $OpswareSVC = [System.ServiceProcess.ServiceController]::GetServices($strComputer) | where{$_.name -eq 'OpswareAgent'}
 If($OpswareSVC.status -eq "Running")
  {
  $c.Cells.Item($intRow,2) = "Running"
 }
 ElseIf($OpswareSVC.status -eq "Stopped")
 {
  $c.Cells.Item($intRow,2) = "Stopped" 
 }
 Else
 {
  $c.Cells.Item($intRow,2) = "Opsware Agent may not be installed"
 }
}

CheckOpsware

$c.Cells.Item($intRow,3) = Get-Date

$intRow = $intRow + 1
}
$d.EntireColumn.AutoFit()

Posted: Mar 20 2007, 10:26 AM by yli628 | with no comments
Filed under:
Not all fats are created equal

There are many different types of fats. The three main categories are: saturated fats (primarily animal fats); unsaturated fats (primarily from plant source and from fish), which include both polyunsaturated and monounsaturated fat; and synthetic fats, which include the trans fats, or hydrogenated fats.

Harmful fats:

Saturated fat is fat that consists of triglycerides containing only saturated fatty acids. Saturated fatty acids have no double bonds between the carbon atom of the fatty acid chain; hence, they are fully saturated with hydrogen atoms. It is usually solid or waxy at room temperature, saturated fat is most found in animal products — such as red meat, poultry, butter and whole milk. Other foods high in saturated fat include coconut, palm and other tropical oils.

Meat from land animals tends to contain saturated fats because these creatures are typically warm-blooded. Think of it this way: Fats are more fluid when warmer, so at body temperature, saturated fats are still flexible. Thus beef and pork have higher amounts of saturated fats than other foods.

On the other hand, the flesh of cold-blooded animals like fish contains predominantly polyunsaturated fats, which are more fluid at colder temperatures. If fish had predominantly saturated fats, the fat would solidify in cold water and the fish would die.

Range-fed beef cattle, although their meat has saturated fat, have lower concentrations than commercially raised, grain-fed beef cattle, which have 500% more saturated fat in their tissues.

Saturated fats can increase your risk of heart disease by increasing your total and LDL(“bad”) cholesterol.

Trans fat are unsaturated, it result from adding hydrogen to vegetable oil through a process called hydrogenation. The reason the food industry created trans fats is that these fats are very resistant to oxidation (or going rancid), giving foods with high trans fat content a very long and stable shelf life. Trans fats include partially hydrogenated fats, margarine, and shortening; today they can be found in every aisle of the supermarket — such as crackers, cookies and cakes — and in fried food.s, such as doughnuts and French fries. Your can keep that jar of Crisco in your cabinet for thirty years and still make a fine pie crust with it.

But just as bacteria (which make food go bad) have difficulty in digesting the fats, so do humans. The body doesn’t have natural enzymes that can easily break them down. Intake of trans fats has been associated with increased rates of cardiovascular disease and cholesterol levels, as well as increased incidence of cancer and diabetes.

Dietary Cholesterol — Your body naturally manufactures all of the cholesterol it needs, but you also get cholesterol from animal products, such as meat, poultry, seafood, eggs, dairy products, lard and butter.

Dietary cholesterol isn’t technically a fat, but it’s found in food derived from animal sources. Intake of dietary cholesterol increases blood cholesterol levels, but not as much as saturated and trans fats do, and not to the same degree in all people.

Healthy fats

Unsaturated fats is a fat or fatty acid in which there are one or more double bonds in the fatty acid chain.

  • Monounsaturated fat contains one double bond and it remains liquid at room temperature but may start to solidify in the refrigerator. Foods high in monounsaturated fat include olive, peanut and canola oils. Avocados and most nuts also have high amounts of monounsaturated fat.
  • polyunsaturated fat contains more than one double bond and is usually liquid at room temperature and in the refrigerator. Foods high in polyunsaturated fats include vegetable oils, such as safflower, corn, sunflower, soy and cottonseed oils.
  • Omega-3 fatty acids are polyunsaturated fats found mostly in seafood. Good sources of omega-3s include fatty, cold-water fish, such as salmon, mackerel and herring. Flaxseeds, flax oil and walnuts also contain omega-3 fatty acids and small amounts are found in soybean and canola oils

When choosing fats, your best options are unsaturated fats: monounsaturated and polyunsaturated fats. These fats, if used in place of others, can lower your risk of heart disease by reducing the total and LDL cholesterol levels in your blood.

Omega-3 fatty acids, may be especially beneficial to your heart. Omega-3s appear to decrease the risk of coronary artery disease. They may also protect against irregular heartbeats and help lower blood pressure levels.

Posted: Mar 18 2007, 10:56 PM by yli628 | with no comments
Filed under:
Fat is an ugly three-letter word

The myth that fat is an ugly three-letter word probably started for a simple reason: People figured that if they were trying to lose weight, they had to shed fat. And it seemed logical that if you were trying to lose fat, you shouldn’t eat fat.

In 1988 the U.S. surgeon general set out to gather the data to prove that dietary fat is harmful. But after eleven years and four project officers, the project was disbanded, because there wasn’t enough scientific data to support the expect forgone conclusion.

Says writer Gary Taubes in the March 30, 2001, issue of Science, “Mainstream nutritional science has demonized dietary fat, yet fifty years and hundreds of millions of dollars of research have failed to prove that eating a low-fat diet will help you live longer”

Still, over the last thirty years, Americans have tried and tried to cut fat out of their diet, decreasing fat consumption from over 40% to 34% of our calorie intake. But the consequences of eating some of the 15,000 new low-fat foods on the market have been disastrous. The proportion of the population suffering from obesity has surged from 14% to more than 30%, and more that 65% of Americans are overweight.

Fat itself is not intrinsically ‘bad for us’ and, in fact, is an important nutrient with a host of important functions within the body.

Your body needs fat to function properly. Besides being an energy source, fat is a nutrient used in the production of cell membranes, as well as in several hormone-like compounds called eicosanoids. These compounds help regulate blood pressure, heart rate, blood vessel constriction, blood clotting and the nervous system. In addition. dietary fat carries fat-soluble vitamins —  vitamins A, D, E and K from your food into your body. Fat also helps maintain healthy hair and skin, protects vital organs, keeps your body insulated, and provide a sense of fullness after meals.

So the problem is not the fat but rather the types of fat you eat!

Posted: Mar 17 2007, 11:02 PM by yli628 | with no comments
Filed under:
HDL and LDL explained

Cholesterol is not soluble in water and therefore need some assistance to travel throughout the blood stream.

HDL (High Density Lipoprotein) help to remove cholesterol from the walls of blood vessels – and brings it back to liver and excreted from there. HDL helps Protect, or to say it better, clean your arteries from cholesterol build up. Hence it is good cholesterol.

On the other hand, LDL (Low Density Lipoprotein) does not aid in the transportation of cholesterol out of the body, instead it deposits cholesterol onto the vessel wall. Therefore it is bad cholesterol.

It is bad because it causes cholesterol to build up inside blood vessels. As the cholesterol passes through the arteries, some of it gets left behind in the form of plaque. The build up gets thicker and thicker, and your arteries get more and more clogged.

Think calcium in your shower pipes, that’s atherosclerosis (cholesterol build up in your arteries).

LDL molecules contain much more cholesterol than HDL molecules.

The (total cholesterol)TC/HDL ratio is more indicative of cardiovascular disease than TC.

The amount of HDL and LDL in the blood are added together, this number for all practical purposes, indicates the amount of total cholesterol. Therefore, if your HDL count is low the LDL count will account for the reminder of the total.

For men an acceptable ratio of TC/HDL is 4.5 or below, and women is 4.0 or below.

The HDL level have an inverse relationship with coronary heart disease. The ability of HDL to predict the development of coronary atherosclerosis has been estimated to be four times greater than LDL and eight times greater than TC. Treatment is recommended for those with a HDL < 40mg/dL.

How to increase HDL and decrease LDL:

Don’t smoke. Smoking lowers HDL cholesterol and increases your blood’s tendency to clot.

Maintain a healthy weight. Excess pounds take a toll on HDL cholesterol. But there’s a good news. If you’re overweight, losing even a few ponds can improve your HDL level. For every 2 pounds you lose, your HDL may increase by .35 mg/dL.

Get more physical activity. Some study shows regular aerobic exercise increased HDL cholesterol by 3% to 9% in otherwise healthy sedentary adults. Try to get at least 30 to 60 minutes of aerobic activity on most days of the week. Better yet, exercise everyday.

Choose healthier fats. A healthy diet includes some fat – up to 25% to 35% percent of your total daily calories can come from fat. But saturated fat should account for less than 7%. Avoid foods contain trans fat, which raise LDL and lowers HDL. This includes many margarine, most commercial baked products and anything that contains partially hydrogenated vegetable oil. Mono unsaturated fat – found in olive peanut and canola oils, is a healthier option. Nuts, fish and other foods containing omega-3 fatty acids are even better.

Drink alcohol only in moderation. In some studies, moderate use of alcohol (particularly red wine) has been linked with higher levels of HDL — but the benefits aren’t strong enough to recommend alcohol for anyone who doesn’t drink already. If you choose to drink alcohol , do so in moderation.

Try to avoid and postpone the cholesterol lowering drugs. The cholesterol drug lowers cholesterol, making you think you are fine because your cholesterol is lower. But the medication hasn’t addressed the underlying reason why your cholesterol might be high in first place, – for example, your cholesterol is high might because insulin resistance. The drug you taken sometimes even aggravate the situation.

More Posts Next page »