Table of Contents

Gaines' House

What would you like to know?

Introduction to my brain and thought process

Honestly, I do not think you really would like to know what goes on inside my head. Are you sure? Alright, My name is Charlotte. And this OPUS is mine. Mine I tell you. Honestly I am still trying to figure this out. m(

Part Numero Uno

Entries

Entry 1: September 7th, 2012

Professor Haas showed and explained VI/VIM to the class:

  • Learned that is was created by Bill Joy and that it was the first full screen.
  • I learned how to navigate, enter text, and other commands.
  • VI is a visual editor which has a insert mode and command mode
  • Still trying to remember the commands, and understand which one is to be used when. But once I understand it I will be a genius.

Entry 2: September 19th, 2012

This day gimmeh was introduced and a little information on scripts:

  • Gimmeh a neat program notifying when assignments are due, and has a count down
  • I also learned how to view how many times I have logged in
  • Learned how to create and run a script, script file is known as logincnt.sh
  • System is starting to pick up with me a little more.

Entry 3: September 21st, 2012

Today we learned about Wildcards, to me seems very tricky stuff:

  • wild cards are the following
    • * - match 0 or more of any characters
    • ? - match 1 of any characters
    • [ ] - character class; match 1 of any of the enclosed characters
    • [^] - inverted character class; do not match 1 of any of the enclosed characters
  • wild cards are basically a search to help us find the information we are looking for
  • Wild cards also show how many of the files have what characters
  • I will have troubles remembering commands and I may not use much of this because I am rather the bad lazy type of person

Entry 4: September 28th, 2012

Learning more on shell scripting:

  • Commands on shell scripting in VI
    • Echo; to output information to the user
    • read; to input information from the user into a variable
    • $RANDOM; environment variable which gives me a whole bunch of ranged random whole numbers
    • if; statements enabling us to make boolean choices
    • fi; closing the statements of if
    • else; statement to contain the countering action
    • -eg ; equal
    • -ne ; not equal
    • -gt ; greater
    • -ge ; greater than or equal to
    • -lt ; less than
    • -le ; less than or equal
    • exit; force termination of script
  • we created scripts that would give random numbers that we try to guess and it would tell us “correct” “wrong”
  • Learned how to use the bc inside of the script to minimize the numbers
  • I may have a little trouble remembering the commands, but I think I would like to create a script that actually talks with me

Keywords

unix Keyword 1

File Removal

Definition

File removal also known as file deletion is a way of removing a file from a computer's file system.

The reasons for deleting files are

  Freeing the disk space
  Removing duplicate or unnecessary data to avoid confusion
  Making sensitive information unavailable to others

All operating systems include commands for deleting files (rm on Unix, era in CP/M and DR-DOS, del/erase in MS-DOS/PC DOS, DR-DOS, Microsoft Windows etc.). File managers also provide a convenient way of deleting files. Files may be deleted one-by-one, or a whole directory tree may be deleted.

References

  • Wikipedia
  • Professor Matthew Haas
  • Mr. Joe Oppenheim

unix Keyword 1 Phase 2

Variable (environment / local)

Definition

Environment variable - within the shell, a variable that is stored in the environment. Because the environment is inherited by all child processes, environment variables can be thought of as global variables. However, they are not strictly global, because changes made by the child are not propagated back to the parent. Local Variable - A variable that exists only within the scope in which it was created. For example. within the shell, a variable that is not part of the environment is a local variable.

References

  • Harley Hahn's Guide to Unix and Linux
  • Programming Logic and Design
  • Wikipedia

Experiment 1

Question

Using wild cards, how would it change my search by adding or taking out a character out of the string?

Resources

Using the skills, and information learned in class.

Hypothesis

My hypothesis, by just changing one character or adding one from the string typed will make a difference in the results.

Experiment

Using the command ???? to search for directories, then I will change one thing and then add one thing to see what the results are.

Data

I will be working in files in sbin

using the command: ls -d ???? Result: dump fsck halt ifup init mkfs rarp Changing the command to ls -d ???* the result: I received way to much Changing the command to ls -d ????? the result: blkid fdisk getty lsmod rdump rmmod route rtmon udevd Changing the command to ls -d ?????? the result: agetty depmod e2undo ifdown mke2fs nameif rtacct swapon wipefs cfdisk e2fsck findfs insmod mkswap reboot sfdisk sysctl

this gave me every word that was at least four letters, then a result I did not intend for, then every word that was a least five letters, then the next with words that had six letters.

Analysis

Based on the data collected:

  • My hypothesis is correct
  • No short comings. You have to be accurate with what you type to get the items you require

Conclusion

That by just changing or adding one character in a command string it will change the results from the previous string

Part 2

Entries

Entry 1: October 10th, 2012

Today we learned a shortcut in Lab46, begin typing file or directory and press tab and it will appear. Learned AND, OR are binary functions and NOT is a unary function. Also learned a little on regular expressions.

Entry 2: October 12th, 2012

Learned a little about C programming, programming paradigms: Paradigm includes structured; Functional; Logical; object - oriented. Discussed Source code portable and Binary Portability

  Source code --- 
  syntax checking,syntax evaluation, pre-processor --- 
  compile/interpret --- 
  assembly --- 
  assembler --- 
  linker --- 
  binary

Entry 3: October 17, 2012

We talked about processes (programs in action)

  ps - process status
  top - show currently active processes
  pid - process id

We talked about signals, and killed many cats in various odd yet specific ways. We used:

kill-1 
kill-2 
kill-3
kill-4 
kill-7

Entry 4: October 19th, 2012

Played with grep, sed, and cut

  ps aux | grep irssi | wc -l
  -counts how many irrssi 
  ps aux | grep irssi | grep -v grep | wc -l
  -counts how many irssi with out grep in it
  ps aux | grep irrssi | grep -v grep | sed 's/  */ /g'
  - removes all spaces
  ps aux | grep irrssi | grep -v grep | sed 's/  */ /g' | cut -d' ' -f1,5
  -cuts out lines except 1 and 5

Keywords

unix Keyword 2

variables (environment/local)

Definition

Environment variable - within the shell, a variable that is stored in the environment. Because the environment is inherited by all child processes, environment variables can be thought of as global variables. However, they are not strictly global, because changes made by the child are not propagated back to the parent. Local Variable - A variable that exists only within the scope in which it was created. For example. within the shell, a variable that is not part of the environment is a local variable.

References

  • Harley Hahn's Guide to Unix and Linux
  • Programming Logic and Design
  • Wikipedia

unix Keyword 2 Phase 2

wildcards

Definition

wildcards are used in unix and other operating systems when searching for files or directory’s. some of the most common wildcards are the * and ?. The asterisk is used to represent any number of unknown characters. For example if you typed in file* you may receive a number of files beginning with file… file1.txt, file2.txt, fileboy.txt, fileoctopus.txt. Note that the .txt has nothing to do with it it is just a file name extension. The ? make on the other hand only represents one unknown character so if you typed in file? you will only receive file names such as file.txt, file1.txt, file2.txt but now files with more than one extra character after the name file.

References

Demonstration

Using wildcards to count how many files or directory with certain characters:

lab46:~$ ls ??? | wc -l
2
lab46:~$ ls ??* | wc -l
83
lab46:~$ ls -d *[aeiou] | wc -w
2 

Experiment 2

Question

What is the question you'd like to pose for experimentation? State it here.

Resources

Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.

Hypothesis

Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.

State your rationale.

Experiment

How are you going to test your hypothesis? What is the structure of your experiment?

Data

Perform your experiment, and collect/document the results here.

Analysis

Based on the data collected:

  • Was your hypothesis correct?
  • Was your hypothesis not applicable?
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
  • What shortcomings might there be in your experiment?
  • What shortcomings might there be in your data?

Conclusions

What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.

Part 3

Entries

Entry 1: November 2nd, 2012

client/server model designed to operate in a networked environment
- relationship of cooperating programs in an application
- server compnoent provides a function or service to one of many clients

Entry 2: November 7th, 2012

X X Window System X11 X11R6/X11R7

Learned about the LAIRwall

Wall 01.offbyone.lan:0
Wall 02.offbyone.lan:0
Wall 03.offbyone.lan:0
Wall 04.offbyone.lan:0
Wall 05.offbyone.lan:0
Wall 06.offbyone.lan:0

Learned to xeyes on another computer (redirected xeyes to other screens) Also learned about oneko

Entry 3: November 9th, 2012

Learned about more commands : head, tail, paste, join, diff, patch, comm… We learned to filter data with the commands.

Head - outputs the first part of the file

  1. last | grep cgaines | head -3

Tail - output the last part of the files

  1. last | grep cgaines | tail -3

Entry 2: November 16th, 2012

Networking - communication amoung devices between a common medium using common protocols.

  Standard - the way things should be done (English)
           - OSI module
  Protocol - set of rules (Northern Midland American English)
           - TCP/IP 
               - Application
               - Transport
               - Networking
                 - IP address (IPv4) 32-bit ~4.2 billion
                       - /sbin/ifconfig  10.80.2.38
                                 - 10 =
                                 - 80 = lair
                                 - 2  = subnet
                                 - 38 = unique node number
                       - show/manipulate routing, devices, policy routing and tunnels
                       - CCC ip 143.66.x.y (65,000 routable IPs)
               - Data Link

Keywords

unix Keyword 3

cron/crontab/at

Definition

      Is the time-based job scheduler in Unix-like computer operating systems. 
      Enables users to schedule jobs (commands or shell scripts) to run periodically
       at certain times or dates. 
      It is commonly used to automate system maintenance or administration.
      
      __Crontab_ (cron table) file, a configuration file that specifies shell 
      commands to run periodically on a given schedule. 
      

References

  • Wikipedia
  • Sean Edwards
  • Harley Hahn's Guide to Unix and Linux

talk/ytalk Phase 2

Let's talk.

Definition

talk is a program that provides visual communication between two parties via text through the terminal. ( talk person ) Using this command alone will prompt the second party with the following message:

  • Message from TalkDaemon@his_machine…
  • talk: connection requested by your_name@your_machine.
  • talk: respond with: talk your_name@your_machine

At this point, the terminal will be now a chat window between the two parties. Both parties can type at the same time since their text appears in different parts of the window. To exit the window, use CTRL + C

ytalk is a program that provides visual communication between multiple parties via text through the terminal. It's basically the same program as talk, only it allows for multiple connections. ( ytalk [-s] [-Y] [-E] [-i] [-q] [-v] [-h hostname_or_ip] username… )

The username portion can be formatted in the following ways:

  • name - some user on your machine
  • name@host - some user on a different machine
  • name#tty - some user on a particular terminal
  • name#tty@host - some user on a particular tty on a different machine
  • name@host#tty - same as “name#tty@host”
  • aliasname - an alias defined in your .ytalkrc

You can also specify multiple usernames on the command line with ytalk ( ytalk george fred@hissun.edu marc@grumpy.cc )

Say hello to the options:

  • -s option starts your YTalk window in a shell.
  • -Y option requires a capital Y or N as an answer to any yes/no question.
  • -E option requires you to press escape once before answering a yes/no question (for people who type looking at the keyboard).
  • -i option disables the auto-invite port (meaning you won't see “talk to blah@blah.com”, but your talk daemon will beep you instead).
  • -q option causes YTalk to prompt you before quitting.
  • -v option prints the program version and exits.
  • -h option specifies the name or address of the local machine; this is useful on multi-homed machines, or virtual hosts, to specify which network interface to use for communication.

More to be added with more awesome details to come.

References

Demonstration

Demonstration of the indicated keyword.

lab46:~$ cd src
lab46:~/src$ gcc -o hello hello.c
lab46:~/src$ ./hello
Hello, World!
lab46:~/src$ 

Experiment 3

Question

Will changing a relevant command in VI by a character completely change the outcome?

Resources

I just used techniques used in class to perform this experiment and then started manipulating the commands with no prior knowlegde of what the outcome would be.

Hypothesis

My Hypothesis is that by changing one character in the command will change the information

Experiment

I am going to type up some lines in VI and then I am going to input the command.

Using the command :%s/b/BB/g- this took all of the b's in the entire document and changed them to a BB.

Data

My name is BoBB and we had a BBaBBy its a BBoy, and charlie the unicorn and very funny. Billy BBoBB, is a hillBBilly, and a BBig one at that. Watching Hogan's Heroes and Hogan always seems to get the girls. BoBB we had a BBaB By its a very BBig BBoy.

Analysis

Based on the data collected:

Yes my hypothesis is correct, it shows that just changing one character out of the original command will change the result.

Conclusion

By doing this command I found out the many possibilities could happen when manupulating commands in VI.