Turkey day coming!

Leave a comment

Chit chat


Made some cables and also plan to do a bit of soldering this weekend.

Screenshot - 11052014 - 08:16:36 PM


Take your standard menu and with a little help it can become gui friendly.

Original code:

#! /bin/bash

echo “************************”
echo “* Music programs       *”
echo “************************”
echo “* [1] Autoharp         *”
echo “* [2] Radio            *”
echo “*                      *”
echo “* [0] Exit/Stop        *”
echo “************************”
echo “Enter your menu choice [1-2, or 0]: ”
read -n 1 yourch
case $yourch in
1) autoharp.sh  ;;
2) radio.sh ;;
0) exit 0 ;;
*) echo “Oopps!!! Please select choice 1,2 or 0”
echo “Press Enter to continue. . .” ; read ;;

Which generates:

Or you could go to a mouse friendly gui:

#! /bin/bash
while selection=$(zenity –list \
“1 Autoharp” \
“2 Radio” \
“0 Exit/stop” \
–column=”” –text=”Music programs” –title=”Menu”)
case “$selection” in
“1 Autoharp”) autoharp.sh;;
“2 Radio”) radio.sh;;
“0 Exit”) exit;;
*)  zenity –error –text=”Invalid option. Try another one.”;;

Which generates:

As simple as that.


Html image gallery from bash

Before we took a file listing and made a list in an html file (http://computoman.blogspot.com/2014/11/file-listing-into-html-file.html) . Must admit I do not know css, so I use what I know with simple html. This time we are going to use bash to create a picture gallery page. The main thing we want to do is to automate creation of web pages even if they are static so to speak. If things so as planned we will make an automated version of out bookmarks page http://computoman.blogspot.com/2014/09/bookmarks-plus.html.

There is a lot more that could be done, but thought this was a good start.  The second picture is a more realistic size. Used filename without the extension for the alt tag. Probably do that later. After I thought about it. this could also be used for several things including a comics section for our newspages (http://computoman.blogspot.com/2013/12/create-your-own-newspages.html) with a little coding changes. Comics come usually in sets of three frames

Anyway here is the skeleton of a program. may not work exactly right with html5.


# daffinitions
ls *.png > picdatafile
m=”not done”
d=” ”

#read the file
while read line
do fdata[$a]=$line
let a=a+1
done < $datafile
# top
echo “<html>” > $htmlfile
echo “<body>” >> $htmlfile
echo “<h2><center>Picture list</center></h2>” >> $htmlfile
echo “<hr>” >> $htmlfile

echo “<center>” >> $htmlfile
echo “<table border=”10″>” >> $htmlfile

# middle
for (( COUNTER=1; COUNTER<=$a; COUNTER+=3 )); do
echo “<tr>” >> $htmlfile
for i in `seq 0 2`;
echo “<td>” >> $htmlfile
d=`echo ${fdata[$i+$COUNTER]} | sed ‘s/\([^\.]*\)\..*/\1/’`
theline='<img src=”‘${fdata[$i+$COUNTER]}'” alt=”‘${d}'” width=”300″ height=”300″ hspace=”20″ vspace=”20″>’
echo “$theline” >> $htmlfile
echo “</td>” >> $htmlfile
echo “</tr>” >> $htmlfile
echo “<br />” >> $htmlfile

echo “</table>” >> $htmlfile
echo “</center>” >> $htmlfile

#  bottom
echo “</body>” >> $htmlfile
echo “</html>” >> $htmlfile

code generated:


Shame that computer makers have pretty much eliminated the parallel port. You can use the usb parallel cables or if you can find them pci cards are available on a declining basis. The usb parallel cables are not completely compatible with the traditional parallel port.  This a shame because so many options are available for the parallel port. Everything from the old Covox fake sound card interface, digital interfacing including I2C, and even doing CNC machining.  So many options taken away from users.

Using the parallel port is as easy as making a cable. The centronics parallel interface has the available thirty-six pins. Coming off the computer the computer has only twenty-five pins. If you really look at the parallel port only eighteen pins are only what is used. With two ten pin terminal bars, you can access the eighteen usefull pins from the parallel port. You can control stepper motors, led lights, and a host of other pieces of equipment. One of the reasons like to keep an old machine. Frys did have a sale of pci parallel port cards for five dollars. After an article was published how useful the cards are, the price went back up.

Finished adapter cable for use with the parallel port or a micro-controller such as the Arduino.

One of the most popular thing to do now is to take old floppy drives and turn them into musical instruments. Now though most of the applications are done with the Arduino and other micro-controllers. Earlier we hooked the parallel port to a three and one half inch drive. Now we are going to use the the same idea for the 5 and one forth inch drive. Made this image to easily pick out the lines needed for the interface.

Fortunately, both drives have the same connections that we need. The difference is that The larger drive has has a thirty-four pin wide cable instead of a seventeen pin two layer cable. Had fun looking though a junk bin to find an old floppy cable.  In finding a cable, we cut off the farthest end so we could use the part of the cable that has a twist in the cable. Allegedly IBM’s idea so you did not have to use the jumpers on the drives to decide which was the first and the second drive (i,e, known as A: and B:).  I untwisted the cable to use it.

Like the smaller drive connections you will short together lines eleven and twelve. Then you will take lines seventeen and nineteen and short those two line together and connect them to pin eighteen of the parallel port connector.  Lines eighteen and twenty go to separate pins using two of the two through nine pins on the parallel port.  Pins two though nine are used for data control. Which pins you use will determine the programming of the parallel port.

Port 888 can be used to send data to the parallel port. Examples of code can be found in an earlier articlel.

  • Direction pin: use on for forward and off for backward.
  • Stepping pin: An on followed by an off will step the drive.

Floppy drives (as well as older hard drives) used to use these big clunky stepper motors to move the head from one track to the next. Stepper motors move in steps, going ka-chunk ka-chunk at each step, which sounds more like a brrrzzzzzzttttttt if it goes fast enough. By controlling the track to track seeks you can generate specific tones.

Per George Whiteside:

Under the hood of a floppy drive, a magnetizable disk rotates at a fixed speed while a read/write head travels back and forth along its radius. The read/write head is actuated by a stepper motor, which is a special type of electric motor that rotates in discrete steps. It’s the rhythmically pulsed movements of the transmission system between the read/write head and stepper motor that cause the delicious buzz and grind you know and love.
Beyond that, floppy drives aren’t terribly sophisticated devices. They need to be instructed when to spin the disk, how far to move the data head, when to read or write, and you have to keep track of all this. There is no data formatting done for you, and you literally have to lay it down bit-by-bit. Obviously this is annoying and potentially error-prone for its intended purpose, but great for screwing around decades later after the format is long obsolete. So I like to pretend that the original architects of the technology and the pushers who kept it around so long sort of had me in mind.

Since we’re lacking a hardware floating point unit, the 128 MIDI note frequency reference values were precomputed and stored as (100,000 ÷ frequency). In other words, the period (T) expressed as tens of microseconds, rounded to the nearest whole integer.
I generated the values with a quick Perl script:


foreach (@values = 0..127) {
    $_ = 440 * (2 ** (($_ - 69) / 12));     # en.wikipedia.org/wiki/MIDI_Tuning_Standard
    $_ = 100000 / $_;                       # multiply period by 10^5
    $_ = int($_ + 0.5);                     # round to nearest integer

print join(", ", @values), "\n";

Have fun.




Good day.


Simple oatmeal.

Leave a comment

Simple oatmeal.


Sugarless pancake syrup
1/4 – cup Condensed milk
1 – cup whole oats
1 3/4 – or so cups Water

Bring water to a boil.
Add the oats and stir into the water.
Once the oats are immersed turn down the heat to about medium.
Stir every 2 minutes or so.
After 5 to 6 minutes, the oats should have soaked up all the liquid and be soft.
Turn off the heat.
Add the milk and the syrup.

No knead bread.

Leave a comment


3 – cups flour
1/8 – teaspoon yeast
1 teaspoon salt
1/2  – cups 100 to 110 degree Fahrenheit water.


Mix all the ingredients together and cover for a few hours.

Let the dough rise overnight.

Punch the down and let it rise again

Bake the bread at 450 degrees for about thirty minutes. Check on it at 15- twenty minutes.  Fahrenheit in a heat proof container (i.e. not plastic handles).

And then you get:

Caught the mouse.

Leave a comment