Chit chat

=======

Fixed my issues with the Pogo plug without having to redo the unit. The http upgrade was causing the issues, but the fix was surprising simple. Glad I did the web research to resolve the issues.

When I upgraded Debian box to wheezy, it sured seemed strange. Look at it later. Also still learning how to do a tftp pxe boot install.

Is your command line screen all gobbletygook? try:

$ reset

This will probably the last last blog for this year for sure.

—————————————

What operating system do you put on a legacy Pentium one computer. Let’s see Mac os/x will not work. None of the latest Microsoft offerings of 8, 9, or 10 will work. Most linux major linux versions need at least a Pentium II. Enter Slackware 14. You can install it on a Pentium I thereby keeping lots of older computers viable a while longer. They would be good starter computers as a stop gap to keep a IT budget in line.  One thing that should mentioned is Slackware can go on a variety of systems including the Raspberry Pi and is definitely not limited to older systems.

Traditionally to install an operating system, you need a cd/dvdrom or a boatload of floppy disks and a hard disk for the operating system to be installed on for each system. We used a compact flash with an ide to compact flash adaptor for the hard drive. We also wanted to avoid all the making of media, though we did need to make a minimal floppy disk to get the  install started. On floppy could be used for multiple machines in a layered install process. What floppy disk do we need? We need first to make a pre-execution environment boot disk . Pxeboot disk for short. The we just need a simple web server to make a couple of files available on the network. To make the floppy disk, you will need to go to romomatic.net

 

 

You will want to customize the image by putting in the details for the server that will hold the special files. That means you need to download initrd.img and bzImage from ftp://ftp.slackware.com/pub/slackware.slackware-14.1 and copy them to the slack directory on the server. The ip address should be the actual ipaddress of your web server that is going to host the files.

#!ipxe
dhcp any
initrd http://192.168.3.88/slack/initrd.img
chain  http://192.168.3.88/slack/bzImage load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 nomodeset SLACK_KERNEL=huge.s

Then you need to start the install.  (More information at:  http://docs.slackware.com/slackware:install)

For the source you will want to use install from ftp/http server usually option 4. That saves having to make a lot of install cd’s.

Server:

ftp://ftp.slackware.com

Directory
/pub/slackware.slackware-14.1

If you have you have used linux before the rest should be pretty straight forward. For our installation, when the software started downloading, I hit the sack and planned to finish the install when I woke up.  The system was waiting there for me to add the last finishing touches to the install and fairly quickly we were up and running linux on a Pentium 1 without any per se Microsoft products!. Also see http://docs.slackware.com/slackware:install for some post install suggestions.  Have fun!

—————————————

Need to know the users on a system, then try this:lsuser.sh

#=================================
# lsuser - list users
#=================================
# Assignments
# --------------------------------
datafile="/etc/passwd"
# end assignments
#=================================
#
# Data input
#---------------------------------
while read line
do echo $line | cut -d: -f1
done < $datafile

$ chmod +x lsuser.sh

$ ./lsuser.sh


john
michael

—————————————

Random numbers can be extremely important in games. One of the oldest games is sort of a black ball game that tries to emulate a fortune teller. Here will will use bash to create such a game. The code was originally created on the TRS_80 MODEL I using Basic.

Screenshot - 12162014 - 01:55:17 AM

oracle.sh

 ####################################
# tcode
#
#===============================
# Functions
#--------------------------------
# pc = position cursor
function pc () {
               tput cup $1 $2
        }

function header () {
        clear
        pc 2 10 ; echo "The Oracle"
        }

function footer() {
        pc 24 0
    }

# end functions
#=================================
# Assignments
# --------------------------------
datafile="odata"
pay=5
a=1
m="not done"
d=" "
# end assignments

#=================================
#
# Metadata input
#---------------------------------
while read line
do fdata[$a]=$line
    let a=a+1
done < $datafile

#===================================
# local variables
#--------------------------------
let nodf=$a
declare -i X=$nodf
# NUM=$[ ( $RANDOM % $X )  + 1 ]
#====================================
# Header
#-----------------------------------
header
#=====================================
# Begin logic
#--------------------------------------
while true; do
  let turns=turns+1
  clear
  pc 4 1
  echo "                T H E  O R A C L E !"
  pc 25 2
  echo "Computoman: Copyright 1980 - 2014 All rights reserved";
  pc 7 1
  echo "Please enter your question "
  pc 8 1
  echo "["
  pc 8 2
  read q
  pc 10 1
  echo "The Oracle will show you it's thoughts, then summon your answer."
  pc 12 1
  echo "So please be patient!"
  pc 15 1
  echo "***********************************************************************"
  pc 16 1
  echo "*                                                                     *"
  pc 17 1
  echo "***********************************************************************"
  for y in {1..100};
  do
    pc 16 1
    echo "*                                                                     *"
    pc 16 3
    NUM=$[ ( $RANDOM % $X )  + 1 ]
    echo ${fdata[$NUM]}
  done

  pc 18 1
  echo "Play again (Y/n)"
  read -s -n1 d
  echo
  case $d in
    [nN] ) break ;;
  esac

done
let owe=$pay*$turns
echo "Please pay the cashier $owe dollars!"
read
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# end of job:
  echo
  clear
  pc 4 1
  echo "                T H E  O R A C L E !"
  pc 23 1
  echo "Computoman: Copyright 1980 - 2014 All rights reserved"
  pc 6 1
  echo
  echo "If you use this program more than several times and would like"
  echo "to see more programs like the Oracle and the Cartomancer, please"
  echo "let the author know!"
  echo
# END
# end logic
#-----------------------------------
# footer
footer
#===================================
# End.
####################################

odata:
Yes, if you are creative.
Yes, if you are receptive.
Anything is possible, but you will have a difficult start.
What a youthful folly to ask!
You must wait and ask again.
Only conflict will come of the result, please pray.
It will take many who are organized to accomplish your request.
Yes, if you keep it together.
Be meek and you will get your answer.
You are lucky to get this far!
You must have the fellowship of men.
In great measure will the possession result.
One must be modest to attain their goal.
You will do good to have enthusiasm for your quest.
Let someone else take the lead to your quest.
Atone for what has been spoiled, then reask your question.
You are too far away to get the answer.
Meditation will lead you to your answer.
Bite through to your goal.
If you handle life with grace!
There is to be a coming apart for fate to be realized.
All must return to what is.
Not knowing the true answer will be better.
You must tame the power of the great.
Watch the corners of the mouth.
The greatest preponderance will be fate.
It will be the abysmals, sorry!
You will be lucky to hold on to what you have.
Influence will be the steeping stone to your quest.
Just be patient for a while.
It is a time for getting away.
The power of the great is upon you.
Yes, there is a progression to be attained.
The crytal ball is losing light and no answer may be attained now.
Everyone close will be part of your answer.
No, there is too much opposition.
Not likely, there are obstructions in the way.
Yes, deliverance will come.
Not as much as you might as supposed.
Yes and more than was planned.
Yes, if there is a breakthrough.
Maybe if you come to meet.
Now is the time to gather together for the answer.
Yes, only if there is a push upward.
No, oppression will stop your quest.
Yes, no, and maybe…….
What the oracle says is opposite to your true answer.
The answer will take longer and you will pay for the wait.
Only through an arousing!
It is not time for a move, you must keep still.
Let fate develop as it will.
You must see the marrying maiden first.
More than you ever imagined.
You may wonder and wander, but it is time to move.
Only if you act gently.
Yes, with great joy!
No, so you must let go of it to spread out.
Only with limitations.
Look within yourself and you can find the answer.
Only with preponderance of the small.
It will come to be after completion.
Only before completion.
I love Elizabeth!
Only God knows…

—————————————

More cartoons from itcartoons.blogspot.com

—————————————

Google chart example:

 

Screenshot from 2014-12-16 02:23:12

#! /bin/bash

TEMP=$(mktemp -t chart.XXXXX)
QUERY1=36
QUERY2=64
cat > $TEMP <<EOF
<html>
  <head>
    <!--Load the AJAX API-->
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">

      // Load the Visualization API and the piechart package.
      google.load('visualization', '1.0', {'packages':['corechart']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.setOnLoadCallback(drawChart);

      // Callback that creates and populates a data table,
      // instantiates the pie chart, passes in the data and
      // draws it.
      function drawChart() {

        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Title');
        data.addColumn('number', 'Value');
        data.addRows([
          ['Error Percentage', $QUERY1],
          ['No Error Percentage', $QUERY2]
        ]);

        // Set chart options
        var options = {'title':'Errors',
                       'width':400,
                       'height':300};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>

  <body>
    <!--Div that will hold the pie chart-->
    <div id="chart_div"></div>
  </body>
</html>
EOF

# open browser
case $(uname) in
   Darwin)
      open -a /Applications/Google\ Chrome.app $TEMP
      ;;

   Linux|SunOS)
      firefox $TEMP
      ;;
 esac

—————————————
Sign wave in bash.

Screenshot from 2014-12-16 08:14:48

#!/bin/bash
# plotsine.sh
# A DEMO to display a sinewave inside a standard bash terminal.
# Issued as Public Domain, 2014, B.Walker, G0LCU.
# Device: Macbook Pro 13″, OSX 10.7.5, default bash terminal.
# Use variables so that you can see how it works.
angle=0
step_angle=5
vert_plot=0
horiz_plot=5
centreline=12
amplitude=11
PI=3.14159
clear
# Do a single cycle, quantised graph.
while [ $angle -le 359 ]
do
# Create each floating point value…
# CygWin now catered for… ;o)
vert_plot=$(awk “BEGIN{ printf \”%.12f\”, ((sin($angle*($PI/180))*$amplitude)+$centreline)}”)
#vert_plot=$(bc -l <<< “{print ((s($angle*($PI/180))*$amplitude)+$centreline)}”)
# Truncate the floating point value to an integer then invert the plot to suit the x y co-ordinates inside a terminal…
vert_plot=$((24-${vert_plot/.*}))
# Plot the point(s) and print the angle at that point…
printf “\x1B[“$vert_plot”;”$horiz_plot”f*”
printf “\x1B[22;1fAngle is $angle degrees…”
sleep 0.1
# Increment values…
angle=$((angle+step_angle))
horiz_plot=$((horiz_plot+1))
done
printf “\x1B[23;1fSinewave plotted as a quantised text mode graph.\n”
exit 0

—————————————

If you understand how this works you can easily make a microphone or a speaker.

Screenshot - 12162014 - 09:12:20 AM

—————————————

Another version of Mafalde pasta. Be sure and check out Notarealchef.blogspot.com

SUNP0029

Good day.

 

Advertisements