January 30, 2004
un-Script-ed
So here it is just about 12:30 am, and I'm still up. I know I should be forcing myself to go to bed but I just can't get relaxed, I even tried a very hot shower which usually does the trick but it didn't work as well as usual.
So what did I do? I went to through some old floppy disks of course. I have hundreds of the things, most of which are probably too corrupt to even be read at this point but the fresher ones from my college adventures should still hold some pretty crazy/entertaining/scary/geeky stuff.
The first disk I popped in held my cheesy web page I had to build to show off that I could indeed create a working web server, both in Linux with Apache, and in Windows with IIS (a few of us attempted Apache on Windows but decided it just was not worth it with the Linux version being so far superior and stable). Anyway, the page I created was actually pretty lame, it had black background and bright green text and of course lets not forget it sported FRAMES. Don't worry I'm not completely crazy, about 5 minutes into making the page I realized I wasn't getting graded on look/feel/content .. just ability to open it, the decision then was made to create an obnoxious page. Along with my main page that held a decent amount of fluff I also did up one page that I really liked. I made a page with the full text of Edgar Allen Poe's "The Raven". The rest of the stuff I did was on basic Linux commands and Vi commands. But most importantly I had "The Raven".
Well once I found that file on the disk I thought "hmm I wonder if I Could apply a style sheet to this page and make it just a little bit less obnoxious?" Guess what, I did it and it appears as if it worked (just don't look at the source code you will see how much of a short cut taker I really am). So without any further ado or gilding the lily I give you Edgar Allen Poe's "The Raven". I believe this text is in the public domain, so hopefully no one yells at me and throws rocks for posting it. But I am such a big fan of Poe that if I have to take a punch in the eye for just one more person to get to read his work then it's worth it.
Disk number 2 contained some of my very first (and consequently useless/boring) Linux shell scripts. Just playing with commands and whatnot. Here are a few prime examples.
This first one is a little word game where the user attempts to guess the secret word. In this case the secret word actually is "secret"
----------------------------------------------------------------------------------------------------------------
#! /bin/bash
word=secret
echo -n "What's my word? "
read guess
if test $word = $guess
then
echo "you are correct"
else
echo "nice try"
./wordgame
clear
fi
----------------------------------------------------------------------------------------------------------------
This next one is extremely simple, it simply asks for your name then goes into the floppy (which you are supposed to have in the drive) finds a program I had found that made echoing in color work.. and it simply repeats your name.... in green
----------------------------------------------------------------------------------------------------------------
#! /bin/bash
echo "Enter your name"
read name
/mnt/floppy/cecho "welcome to shell programming $name" green
#written by Joe Pierce
#inconceivable
----------------------------------------------------------------------------------------------------------------
This one is just as lame as the others, but it mixes up more work than anything so far. It's basically a small attempt at creating a form response from questions asked. In this case a baby announcement.
----------------------------------------------------------------------------------------------------------------
#! /bin/bash
echo -n "What is the fathers full name? "
read father
echo -n "What is the mothers full name? "
read mother
echo -n "What is the full name of the baby? "
read baby
echo -n "What is the date of birth? "
read date
echo -n "What is the birth weight? "
read weight
echo -n "What is the gender? "
read gender
clear
echo " We would like to congratulate Mr. $father, and Mrs. $mother, on the birth of their newborn baby $gender, $baby was born on $date the birth weight was $weight"
----------------------------------------------------------------------------------------------------------------
Lets see Disk 3 had my smb.conf and httpd.conf files I had backed up from various school projects. I could share the contents of them here, but I would have to do some editing on them first, it's not a big deal on them anyway. But I'm sure ITT would be slightly unhappy with me if I posted some of those IP's publicly
Disk 4 turned out to be some of my writing class work ups.
and Disk 5 was some homework and some study material.. I found another slightly more difficult script mixed in with my study work... Don't worry it's equally as unhelpful in real world application as the other scripts. I'll post it without explanation of what it really does, that was always a fun game to play in class.. decipher the code.
Fibbernache Script
----------------------------------------------------------------------------------------------------------------
#! /bin/bash
a=0
b=1
count=2
echo $a
echo $b
while [ count ?le 9 ]
do
((c=$a+$b))
echo $c
a=$b
b=$c
((count=count+1))
done
No comments:
Post a Comment