Tuesday, December 31, 2013

Recipe for new years good luck.

From  http://www.whfoods.com/genpage.php?tname=foodspice&dbid=52

Compared to other types of dried beans, lentils are relatively quick and easy to prepare. They readily absorb a variety of wonderful flavors from other foods and seasonings, are high in nutritional value and are available throughout the year.
Lentils are legumes along with other types of beans. They grow in pods that contain either one or two lentil seeds that are round, oval or heart-shaped disks and are oftentimes smaller than the tip of a pencil eraser. They may be sold whole or split into halves with the brown and green varieties being the best at retaining their shape after cooking.

Nutrients in
Lentils
1.00 cup cooked (198.00 grams)
Nutrient%Daily Value

 molybdenum198%

 folate89.5%

 fiber62.5%

 tryptophan50%

 manganese49%

 iron36.6%

 protein35.7%

 phosphorus35.6%

 copper25%

 vitamin B122%

 potassium20.8%

Calories (229)12%


This chart graphically details the %DV that a serving of Lentils provides for each of the nutrients of which it is a good, very good, or excellent source according to our Food Rating System. Additional information about the amount of these nutrients provided by Lentils can be found in the Food Rating System Chart. A link that takes you to the In-Depth Nutritional Profile for Lentils, featuring information over 80 nutrients, can be found under the Food Rating System Chart.

Health Benefits

Lentils, a small but nutritionally mighty member of the legume family, are a very good source of cholesterol-lowering fiber. Not only do lentils help lower cholesterol, they are of special benefit in managing blood-sugar disorders since their high fiber content prevents blood sugar levels from rising rapidly after a meal. But this is far from all lentils have to offer. Lentils also provide good to excellent amounts of six important minerals, two B-vitamins, and protein—all with virtually no fat. The calorie cost of all this nutrition? Just 230 calories for a whole cup of cooked lentils. This tiny nutritional giant fills you up—not out.

Lentils—A Fiber All Star

Check a chart of the fiber content in foods; you'll see legumes leading the pack. Lentils, like other beans, are rich in dietary fiber, both the soluble and insoluble type. Soluble fiber forms a gel-like substance in the digestive tract that snares bile (which contains cholesterol)and ferries it out of the body. Research studies have shown that insoluble fiber not only helps to increase stool bulk and prevent constipation, but also helps prevent digestive disorders like irritable bowel syndrome and diverticulosis.

Love Your Heart—Eat Lentils

In a study that examined food intake patterns and risk of death from coronary heart disease, researchers followed more than 16,000 middle-aged men in the U.S., Finland, The Netherlands, Italy, former Yugoslavia, Greece and Japan for 25 years. Typical food patterns were: higher consumption of dairy products in Northern Europe; higher consumption of meat in the U.S.; higher consumption of vegetables, legumes, fish, and wine in Southern Europe; and higher consumption of cereals, soy products, and fish in Japan. When researchers analyzed this data in relation to the risk of death from heart disease, they found that legumes were associated with a whopping 82% reduction in risk!!
A study published in the Archives of Internal Medicine confirms that eating high fiber foods, such as lentils, helps prevent heart disease. Almost 10,000 American adults participated in this study and were followed for 19 years. People eating the most fiber, 21 grams per day, had 12% less coronary heart disease (CHD) and 11% less cardiovascular disease (CVD) compared to those eating the least, 5 grams daily. Those eating the most water-soluble dietary fiber fared even better with a 15% reduction in risk of CHD and a 10% risk reduction in CVD.
Lentils' contribution to heart health lies not just in their fiber, but in the significant amounts of folate and magnesium these little wonders supply. Folate helps lower levels of homocysteine, an amino acid that is an intermediate product in an important metabolic process called the methylation cycle. When folate (as well as vitamin B6) are around, homocysteine is immediately converted into cysteine or methionine, both of which are benign. When these B vitamins are not available, levels of homocysteine increase in the bloodstream—a bad idea since homocysteine damages artery walls and is considered a serious risk factor for heart disease.
Lentils' magnesium puts yet another plus in the column of its beneficial cardiovascular effects. Magnesium is Nature's own calcium channel blocker. When enough magnesium is around, veins and arteries breathe a sigh of relief and relax, which lessens resistance and improves the flow of blood, oxygen and nutrients throughout the body. Studies show that a deficiency of magnesium is not only associated with heart attack but that immediately following a heart attack, lack of sufficient magnesium promotes free radical injury to the heart. Want to literally keep your heart happy? Eat lentils.

Lentils Give You Energy to Burn While Stabilizing Blood Sugar

In addition to its beneficial effects on the digestive system and the heart, soluble fiber helps stabilize blood sugar levels. If you have insulin resistance, hypoglycemia or diabetes, legumes like lentils can really help you balance blood sugar levels while providing steady, slow-burning energy. Studies of high fiber diets and blood sugar levels have shown the dramatic benefits provided by these high fiber foods. Researchers compared two groups of people with type 2 diabetes who were fed different amounts of high fiber foods. One group ate the standard American Diabetic diet, which contains with 24 grams of fiber/day, while the other group ate a diet containing 50 grams of fiber/day. Those who ate the diet higher in fiber had lower levels of both plasma glucose (blood sugar) and insulin (the hormone that helps blood sugar get into cells). The high fiber group also reduced their total cholesterol by nearly 7%, their triglyceride levels by 10.2% and their VLDL (Very Low Density Lipoprotein—the most dangerous form of cholesterol)levels by 12.5%.

Iron for Energy

In addition to providing slow burning complex carbohydrates, lentils can increase your energy by replenishing your iron stores. Particularly for menstruating women, who are more at risk for iron deficiency, boosting iron stores with lentils is a good idea—especially because, unlike red meat, another source of iron, lentils are not rich in fat and calories. Iron is an integral component of hemoglobin, which transports oxygen from the lungs to all body cells, and is also part of key enzyme systems for energy production and metabolism. And remember: If you're pregnant or lactating, your needs for iron increase. Growing children and adolescents also have increased needs for iron.

Description

Lentils are legumes, seeds of a plant whose botanical name is Lens ensculenta. They grow in pods that contain either one or two lentil seeds.
Lentils are classified according to whether they are large or small in size with dozens of varieties of each being cultivated. While the most common types in the United States are either green or brown, lentils are also available in black, yellow, red and orange colors. These round, oval or heart-shaped disks are small in size, oftentimes smaller than the tip of a pencil eraser. They are sold whole or split into halves.
The different types offer varying consistencies with the brown and green ones better retaining their shape after cooking, while the others generally become soft and mushy. While the flavor differs slightly among the varieties, they generally feature a hearty dense somewhat nutty flavor.

History

Lentils are believed to have originated in central Asia, having been consumed since prehistoric times. They are one of the first foods to have ever been cultivated. Lentil seeds dating back 8000 years have been found at archeological sites in the Middle East. Lentils were mentioned in the Bible both as the item that Jacob traded to Esau for his birthright and as a part of a bread that was made during the Babylonian captivity of the Jewish people.
For millennia, lentils have been traditionally been eaten with barley and wheat, three foodstuffs that originated in the same regions and spread throughout Africa and Europe during similar migrations and explorations of cultural tribes. Before the 1st century AD, they were introduced into India, a country whose traditional cuisine still bestows high regard for the spiced lentil dish known as dal. In many Catholic countries, lentils have long been used as a staple food during Lent. Currently, the leading commercial producers of lentils include India, Turkey, Canada, China and Syria.

How to Select and Store

Lentils are generally available in prepackaged containers as well as bulk bins. Just as with any other food that you may purchase in the bulk section, make sure that the bins containing the lentils are covered and that the store has a good product turnover so as to ensure its maximal freshness. Whether purchasing lentils in bulk or in a packaged container, make sure there is no evidence of moisture or insect damage and that the lentils are whole and not cracked.
Canned lentils can be found in some grocery stores and most natural foods markets. Unlike canned vegetables, which have lost much of their nutritional value, there is little difference in the nutritional value of canned lentils and those you cook yourself. Canning lowers vegetables' nutritional value since they are best lightly cooked for a short period of time, while their canning process requires a long cooking time at high temperatures. On the other hand, beans require a long time to cook whether they are canned or you cook them yourself. Therefore, if enjoying lentils is more convenient for you, by all means go ahead and enjoy them. We would suggest looking for those that do not contain extra salt or additives. (One concern about canned foods is the potential for the can to include a liner made from bisphenol A/BPA. To learn more about reducing your exposure to this compound, please read our write-up on the subject).
Store lentils in an airtight container in a cool, dry and dark place. Stored this way, they will keep for up to 12 months. If you purchase lentils at different times, store them separately since they may feature varying stages of dryness and therefore will require different cooking times. Cooked lentils will keep fresh in the refrigerator for about three days if placed in a covered container.

Tips for Preparing and Cooking

Tips for Preparing Lentils
Lentils can be prepared the day of serving since they do not need to be presoaked. Before washing lentils you should spread them out on a light colored plate or cooking surface to check for, and remove, small stones or debris. After this process, place the lentils in a strainer, and rinse them thoroughly under cool running water.

The Healthiest Way of Cooking Lentils

To boil lentils, use three cups of liquid for each cup of lentils. Lentils placed in already boiling water will be easier to digest than those that were brought to a boil with the water. When the water returns to a boil, turn down the heat to simmer and cover. Green lentils usually take 30 minutes, while red ones require 20 minutes.
These cooking times can be slightly adjusted depending upon the final use. If you are going to be serving lentils in a salad or soup and desire a firmer texture, remove them from the stove top when they have achieved this consistency—typically 5-10 minutes earlier than their usual cooking time. If you are making dal or some preparation that requires a mushier consistency, achieving this texture may take an additional 10-15 minutes.

How to Enjoy

A Few Quick Serving Ideas
  • Combine cooked lentils, and chopped sweet peppers to make a delicious cold salad. Season with your favorite herbs and spices.
  • Toss buckwheat soba noodles with cooked lentils, small broccoli florets and leeks. Dress with olive oil mixed with garlic and ginger.
  • Moroccan lentil soup is easy to make. After cooking lentils, add diced vegetables of your choice and season with soy sauce, coriander, cumin, turmeric and cayenne.
For some of our favorite recipes, click Recipes.

Individual Concerns

Lentils and Purines
Lentils contain naturally-occurring substances called purines. Purines are commonly found in plants, animals, and humans. In some individuals who are susceptible to purine-related problems, excessive intake of these substances can cause health problems. Since purines can be broken down to form uric acid, excess accumulation of purines in the body can lead to excess accumulation of uric acid. The health condition called "gout" and the formation of kidney stones from uric acid are two examples of uric acid-related problems that can be related to excessive intake of purine-containing foods. Yet, recent research has suggested that purines from meat and fish increase risk of gout, while purines from plant foods fail to change the risk. For more on this subject, please see 'What are purines and in which foods are they found?"

Nutritional Profile

Lentils are an excellent source of molybdenum and folate. They are a very good source of dietary fiber and manganese and a good source of iron, protein, phosphorus, copper, thiamin and potassium.
For an in-depth nutritional profile click here: Lentils.

In-Depth Nutritional Profile

In addition to the nutrients highlighted in our ratings chart, an in-depth nutritional profile for Lentils is also available. This profile includes information on a full array of nutrients, including carbohydrates, sugar, soluble and insoluble fiber, sodium, vitamins, minerals, fatty acids, amino acids and more.

Introduction to Food Rating System Chart

In order to better help you identify foods that feature a high concentration of nutrients for the calories they contain, we created a Food Rating System. This system allows us to highlight the foods that are especially rich in particular nutrients. The following chart shows the nutrients for which this food is either an excellent, very good, or good source (below the chart you will find a table that explains these qualifications). If a nutrient is not listed in the chart, it does not necessarily mean that the food doesn't contain it. It simply means that the nutrient is not provided in a sufficient amount or concentration to meet our rating criteria. (To view this food's in-depth nutritional profile that includes values for dozens of nutrients - not just the ones rated as excellent, very good, or good - please use the link below the chart.) To read this chart accurately, you'll need to glance up in the top left corner where you will find the name of the food and the serving size we used to calculate the food's nutrient composition. This serving size will tell you how much of the food you need to eat to obtain the amount of nutrients found in the chart. Now, returning to the chart itself, you can look next to the nutrient name in order to find the nutrient amount it offers, the percent Daily Value (DV%) that this amount represents, the nutrient density that we calculated for this food and nutrient, and the rating we established in our rating system. For most of our nutrient ratings, we adopted the government standards for food labeling that are found in the U.S. Food and Drug Administration's "Reference Values for Nutrition Labeling." Read more background information and details of our rating system.
Lentils
1.00 cup cooked
198.00 grams
229.68 calories
NutrientAmountDV
(%)
Nutrient
Density
World's Healthiest
Foods Rating
molybdenum148.50 mcg198.015.5excellent
folate358.38 mcg89.67.0excellent
fiber15.64 g62.64.9very good
tryptophan0.16 g50.03.9very good
manganese0.98 mg49.03.8very good
iron6.59 mg36.62.9good
protein17.86 g35.72.8good
phosphorus356.40 mg35.62.8good
copper0.50 mg25.02.0good
vitamin B10.33 mg22.01.7good
potassium730.62 mg20.91.6good
World's Healthiest
Foods Rating
Rule
excellentDV>=75% OR
Density>=7.6 AND DV>=10%
very goodDV>=50% OR
Density>=3.4 AND DV>=5%
goodDV>=25% OR
Density>=1.5 AND DV>=2.5%
In-Depth Nutritional Profile for Lentils

References

  • Bazzano LA, He J, Odgen LG et al. Dietary intake of folate and risk of stroke in US men and women:NHANES I Epidemiologic Follow-up Study. Stroke 2002 May;33(5):1183-9. 2002.
  • Davies M, Ghosh A. Towards evidence based emergency medicine: best BETs from the Manchester Royal Infirmary. Prophylactic magnesium in myocardial infarction. Emerg Med J. 2001 Mar;18(2):119-20. 2001.
  • Ensminger AH, Esminger M. K. J. e. al. Food for Health: A Nutrition Encyclopedia. Clovis, California: Pegus Press; 1986. 1986. PMID:15210.
  • Kharb S, Singh V. Magnesium deficiency potentiates free radical production associated with myocardial infarction. J Assoc Physicians India. 2000 May;48(5):484-5. 2000.
  • McIntosh M, Miller C. A diet containing food rich in soluble and insoluble fiber improves glycemic control and reduces hyperlipidemia among patients with type 2 diabetes mellitus. Nutr Rev 2001 Feb;59(2):52-5. 2001.
  • Menotti A, Kromhout D, Blackburn H, et al. Food intake patterns and 25-year mortality from coronary heart disease: cross-cultural correlations in the Seven Countries Study. The Seven Countries Study Research Group. Eur J Epidemiol 1999 Jul;15(6):507-15. 1999.
  • Sueda S, Fukuda H, Watanabe K, et al. Magnesium deficiency in patients with recent myocardial infarction and provoked coronary artery spasm. Jpn Circ J. 2001 Jul;65(7):643-8. 2001.
  • Touyz RM. Role of magnesium in the pathogenesis of hypertension. Mol Aspects Med 2003 Feb 6;24(1-3):107-36. 2003.
  • Wood, Rebecca. The Whole Foods Encyclopedia. New York, NY: Prentice-Hall Press; 1988. 1988. PMID:15220.

Count down script for new years.

Happy new year!





'Nix style new years count down:

$ while [[ $(date +%Y) -ne 2015 ]];do figlet $(($(date -d 2017-01-01 +%s)-$(date +%s)));sleep 1;clear;done;figlet 'Happy New Year!'


-----------------------------------------------------------------------
Auld Lang Syne

Should auld acquaintance be forgot, 
And never brought to mind? 
Should auld acquaintance be forgot, 
And days o’ lang syne!

Chorus:
For auld lang syne, my dear 
For auld lang syne, 
We’ll tak a cup o’ kindness yet 
For auld lang syne!               
We twa hae run about the braes, 
And pu’d the gowans fine, 
But we’ve wander’d mony a weary foot 
Sin’ auld lang syne.
             
We twa hae paidl’t in the burn 
Frae morning sun till dine, 
But seas between us braid hae roar’d 
Sin’ auld lang syne.
             
And there’s a hand, my trusty fiere, 
And gie’s a hand o’ thine, 
And we’ll tak a right guid willie-waught 
For auld lang syne!
             
And surely ye’ll be your pint’ stoup, 
And surely I’ll be mine! 
And we’ll tak a cup o’ kindness yet 
For auld lang syne!

Count down script for new years.

Happy new year!





'Nix style new years count down:

$ while [[ $(date +%Y) -ne 2017 ]];do figlet $(($(date -d 2017-01-01 +%s)-$(date +%s)));sleep 1;clear;done;figlet 'Happy New Year!'


-----------------------------------------------------------------------
Auld Lang Syne

Should auld acquaintance be forgot, 
And never brought to mind? 
Should auld acquaintance be forgot, 
And days o’ lang syne!

Chorus:
For auld lang syne, my dear 
For auld lang syne, 
We’ll tak a cup o’ kindness yet 
For auld lang syne!               
We twa hae run about the braes, 
And pu’d the gowans fine, 
But we’ve wander’d mony a weary foot 
Sin’ auld lang syne.
             
We twa hae paidl’t in the burn 
Frae morning sun till dine, 
But seas between us braid hae roar’d 
Sin’ auld lang syne.
             
And there’s a hand, my trusty fiere, 
And gie’s a hand o’ thine, 
And we’ll tak a right guid willie-waught 
For auld lang syne!
             
And surely ye’ll be your pint’ stoup, 
And surely I’ll be mine! 
And we’ll tak a cup o’ kindness yet 
For auld lang syne!

Monday, December 30, 2013

The new vcr.


Got out the old Mythtv box and updated it. Made a few tweaks and all was well. Now you can get standalone digital recorders aka pvr's that are not tied to a provider, Not tested any of them yet. Mythtv has one advantage that you can use it with thin clients and or touchpads as frontends to watch/listen media. Just like the new pvrs, with MythTV you can use OTA (over the air) antenna TV very easily. No wonder that cable subscriptions have allegedly gone down dramatically.

SUNP0047


Titantv.com is a good place for TV listings.
http://www.instructables.com/id/Setting-up-a-computer-based-DVR-with-Mythtv-for-l/

The new vcr.


Got out the old Mythtv box and updated it. Made a few tweaks and all was well. Now you can get standalone digital recorders aka pvr's that are not tied to a provider, Not tested any of them yet. Mythtv has one advantage that you can use it with thin clients and or touchpads as frontends to watch/listen media. Just like the new pvrs, with MythTV you can use OTA (over the air) antenna TV very easily. No wonder that cable subscriptions have allegedly gone down dramatically.

SUNP0047


Titantv.com is a good place for TV listings.
http://www.instructables.com/id/Setting-up-a-computer-based-DVR-with-Mythtv-for-l/

They are reusable.

Old hardware can be used for doing electronics just like the Arduino, Raspberry Pi, and etc. Parallel port can be used for digital interfacing.

pcduino

You can use the joystick port for analog input just like the Arduino. (less accurate though). The serial port allows you to do communication.

SUNP0003 


Some vga cards even have i2c interfaces















http://www.instructables.com/id/Electronic-Guides/

Teleprompter update

While back I have made a cheap teleprompter, but you had to use the internet to take advantage of it. This software would probably work great with a touchpad as it is basically a web page that does not take up nuch room. you can find more information at: http://www.instructables.com/id/Linux-ghetto-Tele-prompter/


Screenshot from 2013-12-28 21:03:41



-----------------------------------------------------------------------------------
Example code:

Teleprompter.html

<html>
<head>
<style>
body {
     font-family: Helvetica,Arial,sans-serif;
     font-size: 2.4em;
     line-height: 1.4;
     background: #000;
     color: #fff;
     overflow: hidden;
}

#speech {
     position: absolute;
}

p {
     margin: .5em;
}

.slide {
     text-align: center;
     margin: 0;
}
</style>
<script type="text/javascript" src="teleprompter.js"></script>
</head>
<body>
<div id="speech">
<p>

<strong>From Basic Forms to Shopping Carts</strong><br><br>
An electronic shopping cart is a critical aspect of an e-commerce business. The shopping cart is the software (or series of scripts) that allows users to select products from your Web site, save them and check out when they are done shopping. In the early stages of electronic shopping, the shopping cart was usually a basic HTML form from which a customer selected the products he  wanted to purchase. Long before using a credit card over the Internet was widely accepted, it was common to find that you would need to print the form and mail it along with a money order or credit card information to the company. Over time, as e-commerce grew and online stores began to offer hundreds, if not hundreds of thousands of products, obviously a better method for storing a customer's purchases and placing an order was needed.</p>
<p>
        The shopping cart acts as the user-interface for the customer to shop. It allows users to place items in a "shopping basket". The cart remembers these items for a predetermined length of time, usually 15 to 30 days unless the shopper removes the items from the cart. Today's shopping carts are really designed for the ease-of-use of the shopper. Extra features such as different color or size options, quantity of order, and matching item links can be integrated into the shopping cart. Once a shopper enters her shipping address, taxes and shipping costs can also be tallied from within the shopping cart. For the merchant, the shopping cart also provides important information, which is often transparent to the shopper, including a cart number to track the order, and even a cookie to provide you with some limited tracking details about your customer.</p>

</body>
</html>

teleprompter.js

/*global document, window, event */

var scroll = function(element) {
     var scrolling = null;
     var inc = 1;
     var wait = 50;
     var getYpos = function() {
          var ypos = element.offsetTop;
          var thisNode = element;
          while (thisNode.offsetParent &&  (thisNode.offsetParent != document.body)) {
               thisNode = thisNode.offsetParent;
              ypos += thisNode.offsetTop;
         }
         return ypos;
     };

     var doScroll = function() {
          var y = parseInt(getYpos(),10);
          y=y-inc;
          y=y+"px";
          element.style.top = y;
          scrolling = window.setTimeout(doScroll,wait);
     };

     var toggleScrolling = function() {
          if (scrolling) {
               window.clearTimeout(scrolling);
               scrolling = null;
          } else {
               doScroll();
          }
     };

     element.onclick = toggleScrolling;

// 'keys' code adapted S5 (http://www.meyerweb.com/eric/tools/s5/)
//    which was in turn adapted from MozPoint (http://mozpoint.mozdev.org/)

     var keys = function(key) {
          if (!key) {
               key = event;
               key.which = key.keyCode;
          }
        switch (key.which) {
             case 221:    // ]
                  if (scrolling) {
                       inc++;
                  }
             break;
             case 219:    // [
               if (scrolling && inc>1) {
                       inc--;
                  }
             break;
             case 10:    // return
             case 13:    // enter
                  toggleScrolling();
             break;
        }
          return false;
     };
     document.onkeyup = keys;
};

var init = function() {
     if (document.getElementById && document.getElementById("speech")) {
          scroll(document.getElementById("speech"));
     }
};

window.onload = init;


Friday, December 27, 2013

Create your own newspages

Using bash over simplified to create a web page so that you do not have to go to a bunch of web pages and therefore you miss the ads. Update: You can find the similar code for the sub-programs in earlier articles.

Update new section to add to script

#--------------------------------------------------------
# cnn
echo "<h3>CNN Headines</h3>" >> report.html
echo "<pre>" >> report.html
# creates cnn.txt
./cnn.sh > cnn.txt
echo "<pre>" >> report.html
cat cnn.txt >> report.html
echo "</pre>" >> report.html

Original script

#----------------------------------------------
# daily journal
echo "<html>" > report.html
echo "<body>" >> report.html
echo "<script>" >> report.html
echo "var d=new Date();" >> report.html
echo "document.write('<h2> Journal for ');" >> report.html
echo "document.write(d);" >> report.html
echo "document.writeln('</h2>');" >> report.html
echo "</script>" >> report.html
#  echo Journal for: $(date) >> report.html
 echo "<hr>" >> report.html
#------------------------------------------------
# weather
echo "<h3>The weather</h3>" >> report.html
echo "<pre>" >> report.html
# creates tw
gwhtml.sh  20201 >> tw
echo "<pre>" >> report.html
cat tw >> report.html
echo "</pre>" >> report.html
# display weather map
echo "<img src="http://radar.weather.gov/ridge/Thumbs/LWX.png" alt="" width=300 height=450 />" >> report.html
#-------------------------------------------------
# horoscope
echo "<h3>The horoscope</h3>" >> report.html
# creates h
ghphtml.sh virgo > h
echo "<pre>" >> report.html
cat h >> report.html
echo "</pre>" >> report.html
echo "</body>"  >> report.html
echo "</html>" >> report.html




---------
extra:
 ghphtml.sh

#===================================
# Get today's horoscope
# get sign
hsign="virgo"
#-------------------------------------------
# output data
# character width required for information box
cw=38
#create data file (datadir and file name can be changed to your needs.
datadir="/home/eddie/signs"
filename="$datadir/th"
# make sure hsign is uppercase
hsign="`echo $hsign|tr '[a-z]' '[A-Z]'`"
cat $datadir/$hsign > $filename
echo -n "Today's date: " >> $filename
date +%D >> $filename
echo "Today's horoscope for:" >> $filename
lynx -width 1000 -dump "http://www.creators.com/lifestylefeatures/horoscopes/horoscopes-by-holiday.html" | grep $hsign | fold -sw $cw >> $filename
#output
# zenity --text-info --filename=$filename
cat $filename
#remove  unneeded file
rm $filename

gwhtml.sh
zip=$1
tmon=$(date +"%b")
tday=$(date +"%d")
echo "The weather for $zip on $tmon $tday:" >> tw
lynx -width 1000 -dump "http://m.wund.com/cgi-bin/findweather/getForecast?brand=mobile&query=$zip" > weather
cat weather | grep "Updated" > tw
cat weather | grep "Observed" >> tw
cat weather | grep "Temperature" >> tw
cat weather | grep "Humidity" >> tw
cat weather | grep " Dew Point" >> tw
cat weather | grep "Wind" | head -1 >> tw
cat weather | grep "Wind Gust" | head -1 >> tw
cat weather | grep "Pressure"  >> tw
cat weather | grep "Conditions" | head -1 >> tw
cat weather | grep "Visibility" >> tw
cat weather | grep "UV"  >> tw
cat weather | grep "Clouds" >> tw
cat weather | grep "Yesterday's Maximum" >> tw
cat weather | grep " Yesterday's Minimum" >> tw
cat weather | grep "Sunrise" >> tw
cat weather | grep "Sunset" >> tw
cat weather | grep "Moon Rise" >> tw
cat weather | grep "Moon Set" >> tw >> tw
cat weather | grep -A1 "Moon Phase" >> tw
cat weather | grep "Raw METAR" >> tw


Repair hd

Under construction
----------------------------

"Bad block messages" usually happens when drives will not mount or boot completely.
Checkout error for sure

dmesg | tail
[ 4324.292510] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[ 4324.292521] sd 3:0:0:0: [sdb] Attached SCSI disk
[ 4327.713599] EXT4-fs (sdb1): ext4_check_descriptors: Checksum for group 1536 failed (18982!=0)
[ 4327.713612] EXT4-fs (sdb1): group descriptors corrupted!
[ 4331.946594] EXT4-fs (sdb1): ext4_check_descriptors: Checksum for group 1536 failed (18982!=0)
[ 4331.946607] EXT4-fs (sdb1): group descriptors corrupted!
[ 4342.836612] EXT4-fs (sdb1): ext4_check_descriptors: Checksum for group 1536 failed (18982!=0)
[ 4342.836625] EXT4-fs (sdb1): group descriptors corrupted!
[ 4600.601626] EXT4-fs (sdb1): ext4_check_descriptors: Checksum for group 1536 failed (18982!=0)
[ 4600.601637] EXT4-fs (sdb1): group descriptors corrupted!

Get back up blocks (if any) so problem can be resolved.  sudo mke2fs -n /dev/xxx

$ sudo mke2fs -n /dev/sdb1

mke2fs 1.42 (29-Nov-2011)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
15007744 inodes, 60001024 blocks
3000051 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
1832 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Run the fix. Takes an eon. Battery backup required. sudo e2fsck -b block_number /dev/xxx

$ sudo e2fsck -b 23887872 /dev/sdb1

---
---
Group descriptor 1825 checksum is invalid.  FIXED.
Group descriptor 1826 checksum is invalid.  FIXED.
Group descriptor 1827 checksum is invalid.  FIXED.
Group descriptor 1828 checksum is invalid.  FIXED.
Group descriptor 1829 checksum is invalid.  FIXED.
Group descriptor 1830 checksum is invalid.  FIXED.
Group descriptor 1831 checksum is invalid.  FIXED.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 10882413 has zero dtime.  Fix<y>? yes

Monday, December 16, 2013

Twas the night before xmas...


'Twas the night before Christmas,
and while not a creature was stirring (not even an optical mouse),
/.'ers were posting & moderating with squeals of delight.
When out on the Internet there arose such a clatter,
I sprang from my keyboard to see what was the matter.
I knew in a moment it must be Alek's Controllable Christmas Lights Webcam.
But remembered in previous years it was a hoax - /. said darn.
And then, in a twinkling, I realize Alek has done it for real — W'OH!
With 20,000 lights plus giant inflatable Elmo, Frosty, Santa, SpongeBob, and Homer Simpson — D'OH!
The X10 controls and 3 live webcams provide such clarity,
that it has raised over $70,000 for Celiac charity.
'Merry Christmas to all, and to all a good night!'"

Happy Hollidays!

The xmas tree!






Friday, December 13, 2013

Mediatomb.


There are several media servers on the market that work well with TVs and PlayStation 3’s. I prefer MediaTomb, a uPnP-compliant server, because it is simple to install and configure. MediaTomb works flawlessly with my WD TV Live, and allows me to stream video (mostly AVI files), audio (mostly AAC files with .m4a extensions), and photos from my server to my TV.

Install MediaTomb

MediaTomb is simple to install on Ubuntu Server because a Debian package for it is in the repositories. To install MediaTomb, simply install the mediatomb package.
$ sudo apt-get install mediatomb

The MediaTomb daemon will start automatically after installation.

Configure Port Number

By default, MediaTomb will pick the first available port starting with 49152. When restarting the server, it may pick a different port, such as 49153. I prefer to lock MediaTomb down to a certain point, so my bookmarks for the web interface are always correct, and so I can set firewall and networking rules consistently.
To lock MediaTomb to a single port, simply edit the XML configuration file.
$ sudo nano /etc/mediatomb/config.xml
Find the  <name> element in the configuration file. (You can rename its contents if you wish to. Personally, I don’t like the word “tomb” displayed on my TV, so I rename the service “MediaServer”.) Underneath the element, insert an element, as follows:
<port>49152</port>
Save the configuration file, and restart the service.

$ sudo service mediatomb restart

Now MediaTomb will be locked down to port 49152. You can now set up your firewall to allow traffic on that port.

Add Media Files to MediaTomb’s Library

MediaTomb needs to be told where your media files reside in order to serve them. For simplicity, I prefer to keep all my media files in one folder tree, with high-level subfolders corresponding to media type. My media folder tree is within my home directory; your media may be spread out over your hard drive. MediaTomb doesn’t really care; you simply need to add each folder your media is in to the media library.
  • media
    • movies
    • music
    • photos
    • tv

Add Media to MediaTomb

To add my media folder to MediaTomb, I use MediaTomb’s web interface. I point my browser to my server’s IP address, plus the port it is running on, as follows: http://serverip:49152.
MediaTomb’s sparse web user interface will appear. You will want to click on the Filesystem link, then browse the file system tree to find your media folder. Click on the media folder you wish to add, then click the icon that looks like a plus sign with two sync arrows, as in (+). This button calls up a form that allows you to add that folder to the media library, and set up automatic updating.
Set the scan mode to Inotify, the initial scan to Full, and check the Recursive checkbox. Then click Set, and you have added the folder. MediaTomb will scan the folder for media files to serve. Because we selected the Inotify scan mode, MediaTomb will monitor this folder tree for file changes, and update the media library accordingly. This allows you to add and remove media using Samba or the command line.
Repeat this process for each media folder on your server. Note that Inotify will not work with media served from remote file shares; you will need to set scanning to a timed interval.
Note: It is possible to add media via the command line, but it does not work well for the packaged Ubuntu install.

Enabling Web Interface

MediaTomb provides a web interface to help with configuration. To enable:
<ui enabled="yes" show-tooltips="yes">
With any changes to the configuration file, the MediaTomb service will need to be restarted for them to take effect.

Allowing Accounts

As of version 0.12.1 to be able to 'Login', it appears like having accounts enabled now is mandatory. To do this change:
<accounts enabled="no" session-timeout="30">
to yes. Here you can change the password too. However since MediaTomb only runs on a local network you may want to consider whether privacy is an issue. Default login/password is: mediatomb/mediatomb.

Connect to your Server

You will need to port foward 49152  on your router. After setting up the server and adding media to it, you are essentially done. Your front-end device should automatically discover MediaTomb on the network. XMBC and VLC work well with Mediatomb.

Had no problem connect with VLC on the desktopn and an adfoid application form a touchpad.

Mediatomb.


There are several media servers on the market that work well with TVs and PlayStation 3’s. I prefer MediaTomb, a uPnP-compliant server, because it is simple to install and configure. MediaTomb works flawlessly with my WD TV Live, and allows me to stream video (mostly AVI files), audio (mostly AAC files with .m4a extensions), and photos from my server to my TV.

Install MediaTomb

MediaTomb is simple to install on Ubuntu Server because a Debian package for it is in the repositories. To install MediaTomb, simply install the mediatomb package.
$ sudo apt-get install mediatomb

The MediaTomb daemon will start automatically after installation.

Configure Port Number

By default, MediaTomb will pick the first available port starting with 49152. When restarting the server, it may pick a different port, such as 49153. I prefer to lock MediaTomb down to a certain point, so my bookmarks for the web interface are always correct, and so I can set firewall and networking rules consistently.
To lock MediaTomb to a single port, simply edit the XML configuration file.
$ sudo nano /etc/mediatomb/config.xml
Find the  <name> element in the configuration file. (You can rename its contents if you wish to. Personally, I don’t like the word “tomb” displayed on my TV, so I rename the service “MediaServer”.) Underneath the element, insert an element, as follows:
<port>49152</port>
Save the configuration file, and restart the service.

$ sudo service mediatomb restart

Now MediaTomb will be locked down to port 49152. You can now set up your firewall to allow traffic on that port.

Add Media Files to MediaTomb’s Library

MediaTomb needs to be told where your media files reside in order to serve them. For simplicity, I prefer to keep all my media files in one folder tree, with high-level subfolders corresponding to media type. My media folder tree is within my home directory; your media may be spread out over your hard drive. MediaTomb doesn’t really care; you simply need to add each folder your media is in to the media library.
  • media
    • movies
    • music
    • photos
    • tv

Add Media to MediaTomb

To add my media folder to MediaTomb, I use MediaTomb’s web interface. I point my browser to my server’s IP address, plus the port it is running on, as follows: http://serverip:49152.
MediaTomb’s sparse web user interface will appear. You will want to click on the Filesystem link, then browse the file system tree to find your media folder. Click on the media folder you wish to add, then click the icon that looks like a plus sign with two sync arrows, as in (+). This button calls up a form that allows you to add that folder to the media library, and set up automatic updating.
Set the scan mode to Inotify, the initial scan to Full, and check the Recursive checkbox. Then click Set, and you have added the folder. MediaTomb will scan the folder for media files to serve. Because we selected the Inotify scan mode, MediaTomb will monitor this folder tree for file changes, and update the media library accordingly. This allows you to add and remove media using Samba or the command line.
Repeat this process for each media folder on your server. Note that Inotify will not work with media served from remote file shares; you will need to set scanning to a timed interval.
Note: It is possible to add media via the command line, but it does not work well for the packaged Ubuntu install.

Enabling Web Interface

MediaTomb provides a web interface to help with configuration. To enable:
<ui enabled="yes" show-tooltips="yes">
With any changes to the configuration file, the MediaTomb service will need to be restarted for them to take effect.

Allowing Accounts

As of version 0.12.1 to be able to 'Login', it appears like having accounts enabled now is mandatory. To do this change:
<accounts enabled="no" session-timeout="30">
to yes. Here you can change the password too. However since MediaTomb only runs on a local network you may want to consider whether privacy is an issue. Default login/password is: mediatomb/mediatomb.

Connect to your Server

You will need to port foward 49152  on your router. After setting up the server and adding media to it, you are essentially done. Your front-end device should automatically discover MediaTomb on the network. XMBC and VLC work well with Mediatomb.

Had no problem connect with VLC on the desktopn and an adfoid application form a touchpad.

Wednesday, December 11, 2013

Couple of bash scripts

-----------------------------------------------------------------
Simple bash scripts for NFL football.
------------------------------------------------
nfl data for phase = 2 week = 14 season = 2013
------------------------------------------------
Home           Score              Away
Thursday, December 5
Houston 20 - 27 Jacksonville Final
Sunday, December 8
Minnesota 26 - 29 Baltimore Final
Kansas City 45 - 10 Washington Final
Buffalo 6 - 27 Tampa Bay Final
Miami 34 - 28 Pittsburgh Final
Detroit 20 - 34 Philadelphia Final
Oakland 27 - 37 NY Jets Final
Cleveland 26 - 27 New England Final
Atlanta 21 - 22 Green Bay Final
Indianapolis 28 - 42 Cincinnati Final
Tennessee 28 - 51 Denver Final
Seattle 17 - 19 San Francisco Final
NY Giants 14 - 37 San Diego Final
St. Louis 10 - 30 Arizona Final
Carolina 13 - 31 New Orleans Final
Monday, December 9
Dallas 28 - 45 Chicago Final
---------------------------------------------
Script 1:
####################################
# Score  Grabber
#
#===============================
# Assignments
# --------------------------------
datafile="nflscorefile"
a=1
flag=0
week=14
# phase 1 is preseason phase 2 is regular season phase 3 is
phase=2
season=2013
#finished week = 1 unfinished week = 0
weekfinished=1
league="nfl"
# end assignments
#=================================
#
# Get data file
#---------------------------------
case $weekfinished in
1)
elinks "http://sports.yahoo.com/$league/scoreboard/?week=$week&phase=$phase&season=$season"  > $datafile
;;
0)
elinks "http://sports.yahoo.com/$league/scoreboard/"  > $datafile
;;
*)
#
;;
esac
#=================================
#
# Extract and display data
#---------------------------------
while read line
do fdata[$a]=$line
echo $line | grep -q "Home Score Away"
if  [ $? -eq 0 ]; then
# header
clear
echo
echo ------------------------------------------------
echo  $league  data for phase = $phase  week = $week  season = $season
echo ------------------------------------------------
echo
echo "       Home           Score              Away"
echo ""
let "flag = 1"
fi
if [ $flag -eq 1 ]; then
echo $line | grep -q "Latest NFL Videos"
if [ $? -eq 0 ]; then
let "flag = 0"
else
echo $line | grep -q "Home Score Away"
if  [ $? -ne 0 ]; then
case $weekfinished in
1)
echo $line | sed 's/\[.*\]//'
;;
0)
echo $line
;;
*)
#
;;
esac
fi
fi
fi
let "a += 1"
done < $datafile
# footer
echo ---------------------------------------------
echo
#===============================
# End.
####################################
------------------------------------------------
NFL schedule for week: 15 of season = 2013
------------------------------------------------
Week 15
Thursday, Dec. 12
San Diego Chargers at Denver Broncos, 8:25
Sunday, Dec. 15
Washington Redskins at Atlanta Falcons, 1
Chicago Bears at Cleveland Browns, 1
Houston Texans at Indianapolis Colts, 1
Buffalo Bills at Jacksonville Jaguars, 1
New England Patriots at Miami Dolphins, 1
Philadelphia Eagles at Minnesota Vikings, 1
Seattle Seahawks at New York Giants, 1
New Orleans Saints at St. Louis Rams, 1
San Francisco 49ers at Tampa Bay Buccaneers, 1
Arizona Cardinals at Tennessee Titans, 1
New York Jets at Carolina Panthers, 4:05
Kansas City Chiefs at Oakland Raiders, 4:05
Green Bay Packers at Dallas Cowboys, 4:25
Cincinnati Bengals at Pittsburgh Steelers , 8:30*
Monday, Dec. 16
Baltimore Ravens at Detroit Lions, 8:40
---------------------------------------------
Script 2
####################################
# Nfl schedule  Grabber
#
#===============================
# Assignments
# --------------------------------
datafile="nflscorefile"
a=1
flag=0
week=15
# phase 1 is preseason phase 2 is regular season phase 3 is
phase=2
season=2013
# end assignments
#=================================
#
# Get data file
#---------------------------------
elinks www.usatoday.com/story/sports/nfl/2013/04/18/week-by-week-2013-nfl-schedule/2093613/ > $datafile
#=================================
#
# Extract and display data
#---------------------------------
while read line
do fdata[$a]=$line
echo $line | grep -q "Week $week"
if  [ $? -eq 0 ]; then
# header
clear
echo
echo ------------------------------------------------
echo  NFL schedule for week: $week of season = $season
echo ------------------------------------------------
echo
let "flag = 1"
fi
let nextweek=$week+1
echo $line | grep -q "Week $nextweek"
if [ $? -eq 0 ]; then
let "flag = 0"
else
if [ $flag -eq  1 ] ;  then
echo $line
fi
fi
let "a += 1"
done < $datafile
# footer
echo ---------------------------------------------
echo
#===================================
# End.
####################################
------------------------------------------------------------------------------
Couple of dumb scripts  using Hak5.
Script 1
################################################################
#   New hak5 episode?
#
file1=hak5episodes
file2=hak5episodesold
cp $file1 $file2
elinks "revision3.com/hak5/episodes"  > $file1
# diff_file=diffed
# diff  $file1 $file2 | grep "<" | sed 's/^<//g' > $diff_file
# cat diff_file
I=`wc -c $file1 | cut -d' ' -f1`
J=`wc -c $file2 | cut -d' ' -f1`
if [ $I -ne $J ]
then
echo new episode
echo new episode at $(date) > hak5lastupdate
else
echo no new episode
fi
------------------------------------------------
Hak5 episodes
------------------------------------------------
All Episodes
* Point to Point Pineapple mesh continued. Decibels to Watts,
antenna polarization, "cable loss" and why HAMS get all the good...
Point to Point Pineapple Mesh Continued and Syncing with
GoodSync
* Learn the ins and outs of EIRP, 2.4 GHz and the legal way to
balance radio output with antenna gain. This episode is...
Legally build a 60 Watt WiFi Link - 2.4 GHz and EIRP
* This week we go behind the scenes at the  Studio during our
recent studio upgrades. Also Shannon explores some of the...
Upgrading the Studio and Chromecast Tricks
* This week Darren interviews Craig Heffner on his research in to
backdoors on routers. Also find Shannon dices into Seafile...
Discovering Hidden Backdoors In Home Routers And Storing Data With
Seafile
* Darren meets Paul McMillan to see the whole internets VNC servers
in 16 minutes. Also find new was to connect to your phone...
Hidden Device Inputs Revealed!
* Wireless Packet Sniffing!!! Tracking vehicle Tire Pressure Sensor
data with Jared Boone and open source software defined...
Tracking Cars Wirelessly And Intercepting Femtocell Traffic
* Exploring the software development for the castAR with Rick
Johnson. Also seeing the hardware side of castAR with Jeri...
Creating Virtual Worlds With castAR
* The new WiFi Pineapple Mark V is unveiled at this special
launch event featuring Darren, Sebastian, Eighty of Dual...
The New WiFi Pineapple Mark V
* Session Hijacking with Raphael Mudge of Armitage, Disk Forensic
from Raspberry Pi and Custom Hacker Linux Distros from...
Derbycon 2013 Continues and Enterprise Cloud Syncing
* This time on , Darren speaks with RenderMan at Derbycon 2013
on vulnerabilities in the nextgen Air Traffic Control...
Secure Messaging and Air Traffic Control Hacking
* Syncing files with BitTorrent Sync and alternative ways to Sneaker
Net files using optics and audio! All that and more, this...
Alternative Sneaker Nets and BitTorrent Syncing
* Cheap Kali Linux Laptop with a Raspberry Pi, a Lapdock and Custom
Cables - Shannon Morse reports. Then, Persistently...
Kali Linux Raspberry Pi Laptop and Hijack Windows Password
* The latest NSA leaks outline a massive program against internet
encryption. What is safe anymore? Can you trust PGP? How do...
Setup Your Own Private Cloud and Air Gaps
* Cracking Windows passwords in 15 seconds or less with a special
USB Rubber Ducky firmware and mimikatz. Build your own...
Install OwnCloud and Cracking Passwords with a Rubber Ducky
* Windows exfiltration with a USB thumb drive and a USB Rubber
Ducky and Benchmarking Your Linux Systems. All that and more...
How to Benchmark Your Linux System And Exfiltration Ducky
Attacks
* Running the occasional Windows program with out cramping your
Linux lifestyle, Windows exfiltration with the USB Rubber...
What's Up with the Duck?
-------------------------------------
Script 2:
####################################
# Latest Hak5 episodes
#
#===============================
# Assignments
# --------------------------------
datafile="hak5episodes"
a=1
flag=0
# end assignments
#=================================
#
# Get data file
#---------------------------------
elinks "revision3.com/hak5/episodes"  > $datafile
#=================================
#
# Extract and display data
#---------------------------------
while read line
do fdata[$a]=$line
echo $line | grep -q "All Episodes"
if  [ $? -eq 0 ]; then
# header
clear
echo
echo ------------------------------------------------
echo  Hak5 episodes
echo ------------------------------------------------
echo ""
let "flag = 1"
fi
echo $line | grep -q "Load More"
if [ $? -eq 0 ]; then
let "flag = 0"
else
if [ $flag -eq  1 ] ;  then
echo $line | sed 's/\[.*\]//' | sed 's/\Hak5//'
fi
fi
let "a += 1"
done < $datafile
# footer
echo ---------------------------------------------
echo
#===================================
# End.
####################################
-----------------------------------------------------------------

Yet another music server.



Screenshot from 2013-12-08 15:50:30.png




Love MPD. It is both a music player and an internet radio player. You can install this on a really old machine or a new arm based linux device. Just add an amp and  speakers and you have a new age stereo that can be controlled remotely.. 
Make your directories where you want your music to be and then copy them there if they are not already there. Now to inbstall the basic software. You have the program itself (mpd)and a command line player to test it.(mpc)

$sudo apt-get install mpd mpc.

Sure sure your stero and or speakers are attached to the sound card and they work. Now to test it. We will do it with a radio station if you do not have any music to t4est with.

$ mpc add http://relay3.slayradio.org:8000/
adding: http://relay3.slayradio.org:8000/

$ mpc play
You should hear the radio station out of your speakers now.

Now let's edit the config file for file location and to allow the server to be accesed from other systems. Warning this is not secure, as your better off sshing into the machine to control it.

$ sudo vim /etc/mpd.con
Change the directory where you files are (uncomment  the line also
# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
# music_directory               "/var/lib/mpd/music"

If you want to access the machine remotely you will need to change the hostname to the nmae of the michine, Warning: people will be albe to telnet into the machine unless you password protect the system.
#
# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon. Choose any if you want
# to have mpd listen on every address
#
# For network
# bind_to_address               "localhost"

Permissions:

# Permissions #################################################################
#
# If this setting is set, MPD will require password authorization. The password
# can setting can be specified multiple times for different password profiles.
#
#password                        "password@read,add,control,admin"
#
# This setting specifies the permissions a user has who has not yet logged in.
#
#default_permissions             "read,add,control,admin"
#
###############################################################################

There are other settings, but I will let you check that out your selves..

Now to access the system form other machines. There is a client for about every system known to man. You can check them out yourself at:


 Screenshot from 2013-12-08 16:25:45.png










http://mpd.wikia.com/wiki/Clients

To add a radio station, you most likely have to have a url.

Have fun