Table of Contents
Quinton “The Awesome” Clark's Opus
\m/
Introduction
My name is Quinton Clark and I love videogames, Warhammer 40k, and food. I'm a huge metal head but I listen to other things as well. Like dubstep for example. I love it. I am also a big art student. I'm always looking for cool things on deviantart. Concerning videogames i love RPG's and FPS's, as well as RTS's and racing games. I extremely dislike sports games unless its twisted up like Warhammer's Bloodbowl. I'm a 90's kid so I love alot of the older shows and movies. The 90's kicked ass man. Anywho i need to extend this introduction so here we go. Once upon a time there was a magical land called Altruem. In this land there was an evil knight by the name of Quintonius. His heart was blacker than the devil's and he had more power than the gods themselves. He had his own kingdom with his loyal evil subjects and wenches. Many tried to conquer his land but his armies smote them down. His armies, they say, were cursed to ferever fight for their lord. People say they were armies of the dead that would not die. Beside his armies were his great beasts of death. All treacherous kinds that you could imagine: from behemoths of the land to the leviathans of the sea, to the dragons of the sky. He was an unstoppable force. And no one could stand against him.
Part 1
Entries
September 13, 2011
On this day i had experienced more of what one might call a simple text editor. But this text editor was not your ordinary text editor you see. This text editor was greater then your common text editors such as Microsoft Word. I can see but what i have said that you are in pure disbelief. But what i say is true. Behold, VI! The vi text editor is one of the greatest tools in the known and Linux/Unix universe. There are many commands to this text editor, but if you practice these commands you will be able to harness the skills of VI. I look forward to learning this. VI will be just so much more helpful and quicker than Microsoft Word. I WON'T HAVE TO USE THE MOUSE!!! But like i said before i have to practice the commands before i can become a master like the Great Haas.
September 15, 2011
Today in Unix/Linux we learned about process id's (PID). They are basically a small id for any process that happens to be running. So anything you are doing at that moment has a PID. With that you can go in and maniupulate it in some way. Thats when we learned the kill commands. We take the PID of the process we want to kill and we just kill it with a any kill command that we want. There are numerous kill command options but 'kill -9' is the deadliest of them all. It's basically the equivalent of dropping a NUCLEAR WARHEAD on the command you do not want existing anymore. We also learned that there is such thing as zombies in the UNIX/Linux universe (not to say that there aren't zombies in the human plane of existence.) Expected zombies we can take care of but an unexpected zombie is something we do not want period. So we learned how to make expected zombies, find processes with any specifics and a little more on the VI editor.
September 22, 2011
In linux today we learned shell scripting. You basically run the system from the outside instead of the inside. We wrote some simple scripts, for example one will ask for our name and say a message. Then another one asks for a password. Either the password was in the script or it called another file with the password we wanted. We learned what we needed to do, what means what like # stands for a comment. #! this is a shhh bang! And we made them executable with a new way of changing permissions. He gave us one more program which took any files in a directory and got rid of any extensions and made them all just regular files, no extensions.
September 20, 2011
Today we worked on our first project called FILESYSTEM SAFARI. Haas pretty much put this in our projects so that we could get started on them because everybody is lazy in the class (guilty). Any-who, the project is still underway, it isn't too hard but it is cumbersome. It's taking a bit of time to finish it.
Unix Topics
Localhost
Localhost is the standard hostname given to the address of the loopback network interface. The name is also a reserved top-level domain name set aside to avoid confusion with the narrower definition as a hostname.
Home directory
A Home directory is a file system directory on a multi-user operating system containing files for a given user of the system.
Regular File
A Regular File is the simplest of files being a read only file.
Directory
The Directory is the most common special file. The layout of a directory file is defined by the filesystem used. As several filesystems, both native and non-native, are available under Unix, there is not one directory file layout. Within a directory you can store many files or other directories.
Special File
A Special File cannot be regularly accessed through basic means. It has to be opened with a certain command. Some special files include Socket Files and Device Files.
File Listing
File Listing can be carried out by the ls command. If there you want to find out more about the ls command you can look up its arguments in its manual pages.
lab46:~$ ls Desktop age.sh burninator.c hello.c public_html Documents archive1.tar closet hello.s shell Downloads archive2.zip data lab1.text src Maildir archives extravagentpiranha list-basedloop.sh tmp Music ascii file.txt motd trog3 Pictures badname filecreat.sh numericloop.sh trog3.c Public badname.tar guess1.sh password unix.text Templates bin hellisharmadillo prog2 Videos burninator hello prog2.c
Copying Files
Copying Files is carried out by the cp command. However, in order to fully copy a file to a new area you have to type the file you want and then type the area you want it to reside in.
lab46:~$ cp burninator bin lab46:~$
Creating
Creating a file requires the touch command. When you touch a file that you have just named it creates it in the current directory you are in.
lab46:~$ touch file1 lab46:~$
Removing
Removing a file requires the rm command. When you type rm make sure you type the file you want removed and that you are in the directory in which it is located. After that you will be prompted with a question for removing the file because Unix cares.
lab46:~$ rm file1 rm: remove regular empty file `file1'? y lab46:~$
Permissions
There are 3 different Permissions for files:
- Read - which allows the user to “read” the file
- Write - which allows the user to type on the file whatever pleases them
- Execute - which allows the user to run the file
Of course these permissions can be turned on/off for each class by the user who created the file in the first place. These permissions are indicated by 'r' for Read, 'w' for Write, and 'x' for Execute.
-rwxr--r-- 1 qclark lab46 202 Sep 27 14:33 extravagentpiranha -rw-r--r-- 1 qclark lab46 52 Mar 25 2011 file.txt -rwx------ 1 qclark lab46 201 Apr 29 16:50 filecreat.sh -rwx------ 1 qclark lab46 1019 Apr 25 17:53 guess1.sh -rwxr--r-- 1 qclark lab46 365 Sep 27 16:41 hellisharmadillo -rwxr-xr-x 1 qclark lab46 6625 Oct 12 2010 hello
Tab Completion
Tab Completion is a handy little trick if you feel lazy and don't feel like writing out you entire file. Just type the first few letters of the file and hit TAB, your file should appear automatically.
Moving
Moving a file requires the mv command. Type this command, then the file that you want moved, and then the location of where you want it move to.
lab46:~$ mv extravagentpiranha bin lab46:~$ lab46:~$ cd bin lab46:~/bin$ ls bin burninator corpseshark extravagentpiranha lethalbadger whitetiger
Objectives
Familiarity with the structure of UNIX systems
Familiarity with the structure of UNIX systems; what this objective entails is to have an understanding of things that correlate with the UNIX/Linux system.
Method
One can demonstrate a basic knowledge and understanding of the UNIX system.
Measurement
A measurement can consist of the topics and experiments that i have performed above.
Analysis
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
- How did you do? - I believe it did this to the best of my ability.
- Room for improvement? - There is definitely a whole lot of room for improvement.
- Could the measurement process be enhanced to be more effective? - Yes. I believe i may have the basis of the measurement secured but other things could be added in as well.
- Do you think this enhancement would be efficient to employ? - Yes. In fact i think it would be more efficient.
- Could the course objective be altered to be more applicable? - No I don't believe so.
Experiments
Experiment 1
Question
#!/bin/bash cd ~/tmp for file in `/bin/ls -1A ~/tmp`;do fname="`echo $file | cut -d'.' -f1`" mv -v $file $fname done exit 0
Is it possible to replace the -f1 with a -f2 and get that field instead?
Resources
My brain, curiosity, Matt Haas
Hypothesis
I believe that if i change the f1 to an f2 then it will show me the field that occurs after the '.'
Experiment
To test my hypothesis I shall replace f1 with f2.
Data
#!/bin/bash cd ~/tmp for file in `/bin/ls -1A ~/tmp`;do fname="`echo $file | cut -d'.' -f2`" mv -v $file $fname done exit 0
lab46:~/bin$ ./corpseshark mv: `chimera' and `chimera' are the same file `derp.ent' -> `ent' mv: `dragon' and `dragon' are the same file mv: `filealpha' and `filealpha' are the same file mv: `filebeta' and `filebeta' are the same file mv: `griffin' and `griffin' are the same file `herp.txt' -> `txt' mv: `kraken' and `kraken' are the same file mv: `scorpion' and `scorpion' are the same file mv: `spider' and `spider' are the same file
Analysis
Based on the data collected:
My hypothesis was correct!
Conclusions
In conclusion, with how many delimiters you have in the file you can choose and whatever comes before it or after are the fields. You can change the field you want by choosing the number that corresponds to where the field is.
Experiment 2
Question
Is it possible to do the same experiment above but instead taking more then one field out?
Resources
My brain, curiosity and Matt Haas
Hypothesis
I believe that replacing the single number with a number-number, for instance 5-7, will take out those fields.
Experiment
I am going to replace the current field with 5-7 and perform this action in the lab46 terminal.
Data
#!/bin/bash cd ~/tmp for file in `/bin/ls -1A ~/tmp`;do fname="`echo $file | cut -d'.' -f5-7`" mv -v $file $fname done exit 0
lab46:~/bin$ ./corpseshark `file.herp.derp.nyan.cat.fyi.uti.txt.blops.fable.gears' -> `cat.fyi.uti'
Analysis
Based on the data collected:
It works!
Conclusions
This conclusion is basically the same premise as the previous experiment. The only difference here is that you can take out multiple sections of fields.
Experiment 3
Question
Is it possible to only take out the exact fields you want out, even if they may be a few fields apart?
Resources
My brain and curiosity
Hypothesis
I believe that i can take out only the fields i want by using 'commas'.
Experiment
I'm going to type in the necessary actions in order to carry out my hypothesis.
Data
#!/bin/bash cd ~/tmp for file in `/bin/ls -1A ~/tmp`;do fname="`echo $file | cut -d'.' -f1,3,6,8,9`" mv -v $file $fname done exit 0
lab46:~/bin$ ./corpseshark `file.herp.derp.nyan.cat.fyi.uti.txt.blops.fable.gears' -> `file.derp.fyi.txt.blops'
Analysis
Based on the data collected:
It worked!
Conclusions
In conclusion we can take out any field we want as long as we know the actions to take them out. Otherwise it will yell at you
Part 2
Entries
October 4, 2011
Today we went over regular expressions in class. We reviewed and played with basic regular expressions that one may encounter. I am starting to get a good feel for the regular expressions and with a little more practice, I should be fairly comfortable with using them. The biggest difficulty i can foresee with this is knowing precisely what I want to do with them but this is common for all new tools.
October 6, 2011
This week we learned some new things with regular expressions. Normally we would use a command like cut or grep to pick apart data and choose what we want to show. But with the regular expressions we were able to be even more precise in a more concise manner as well. They are a little hard to grasp because the concepts are kind of obscure, but for the most part i understand how they work. I just need to work with them more in my shell scripting or just in general like in my programs as well. We also did a script that will extract the data from our opus. It takes the total score you can get, the score you got and what percentage you recieve. We wrote that and added more on like cutting off the many decimal points after or similar stuff. We used some regular expressions in it as well which is really confusing but if i pick it apart piece by piece i can understand it.
October 18, 2011
Today we talke a little about wildcards and how to use them. I had read about them in in one of the books but had not played with them on my own. Today's class allowed me to see them in action. I see that they are very similar to regular expressions but with minor differences. The same basic principles applied to regular expressions can be applied to wildcards keeping in mind what symbols are used for what and when they can be used appropriatetly.
October 20, 2011
Today I brought in my laptop because there was an issue with java on it and i wanted to be able to run Minecraft. In case you didn't know Minecraft is a fantastical game where you can DO WHATEVER THE HELL YOU WANT!!!!! Sounds to good to be true right? Wrong. I myself am building an awesome Castle of Darkness. Anywho today we just worked on some more C programming which was not too difficult to understand.
Unix Topics
Remote Host
A computer that resides in some distant location from which data are retrieved. It typically refers to a server in a private network or the public Internet.
Current Working Directory
The current directory is the directory in which a user is working at a given time.
lab46:~$
Archiving
An archive is a collection of computer files that have been packaged together for backup, to transport to some other location, for saving away from the computer so that more hard disk storage can be made available, or for some other purpose.
lab46:~$ archive1
Compressing
Compressing files give you more storage space when using your OS, because it condenses the file down. Compressing a file can involve certain file extensions such as: .tar .zip .gzip etc.
lab46:~$ badname.tar
Viewing Files
In order to view files it depends on what type of file you want to view. You might have to use cd, cat, ./, etc.
lab46:~$ cat ascii
lab46:~$ cd closet
lab46:~$ ./burninator
The VI Editor
This is the greatest text editor EVAR!
The VI Editor: Insert Mode
There are certain commands to enter Insert Mode, but once you are in this mode it will tell you at the bottom. And once here you can type out anything that needs to be typed as well as creating programs that can be run once you change the permissions.
~ ~ ~ ~ ~ ~ ~ ~ -- INSERT -- 0,1 All
The VI Editor: Command Mode
This is the starting area when you create a VI text. In here there are keys that do specific actions that can help you in creating/editing what you want in your VI text.
~ ~ ~ ~ ~ ~ ~ "alpha" [New File] 0,0-1 All
The VI Editor: Extended Command Mode
The extended command mode begins with the colon : and from there you can add things like a number line or color. You can also save your work or discard when in this mode.
~ ~ ~ ~ ~ :q
$PATH
The PATH environment variable is a colon-delimited list of directories that your shell searches through when you enter a command.
lab46:~$ echo $PATH /home/qclark/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
Wildcards
A wildcard is a symbol that takes the place of an unknown character or set of characters. These characters are: ?, *, [], [^ ]
lab46:~$ grep '^r.*$' *d
Job Control
Job control facilities allow you to have the system work on a job in the background while you do something else at the keyboard.
unix Objective
Objective
The ability to accomplish/automate tasks.
Method
State the method you will use for measuring successful academic/intellectual achievement of this objective.
Measurement
Follow your method and obtain a measurement. Document the results here.
Analysis
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
- How did you do?
- Room for improvement?
- Could the measurement process be enhanced to be more effective?
- Do you think this enhancement would be efficient to employ?
- Could the course objective be altered to be more applicable? How would you alter it?
Experiments
Experiment 1
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.
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.
Retest
If you're doing an experiment instead of a retest, delete this section.
If you've opted to test the experiment of someone else, delete the experiment section and steps above; perform the following steps:
State Experiment
Whose existing experiment are you going to retest? Prove the URL, note the author, and restate their question.
Resources
Evaluate their resources and commentary. Answer the following questions:
- Do you feel the given resources are adequate in providing sufficient background information?
- Are there additional resources you've found that you can add to the resources list?
- Does the original experimenter appear to have obtained a necessary fundamental understanding of the concepts leading up to their stated experiment?
- If you find a deviation in opinion, state why you think this might exist.
Hypothesis
State their experiment's hypothesis. Answer the following questions:
- Do you feel their hypothesis is adequate in capturing the essence of what they're trying to discover?
- What improvements could you make to their hypothesis, if any?
Experiment
Follow the steps given to recreate the original experiment. Answer the following questions:
- Are the instructions correct in successfully achieving the results?
- Is there room for improvement in the experiment instructions/description? What suggestions would you make?
- Would you make any alterations to the structure of the experiment to yield better results? What, and why?
Data
Publish the data you have gained from your performing of the experiment here.
Analysis
Answer the following:
- Does the data seem in-line with the published data from the original author?
- Can you explain any deviations?
- How about any sources of error?
- Is the stated hypothesis adequate?
Conclusions
Answer the following:
- What conclusions can you make based on performing the experiment?
- Do you feel the experiment was adequate in obtaining a further understanding of a concept?
- Does the original author appear to have gotten some value out of performing the experiment?
- Any suggestions or observations that could improve this particular process (in general, or specifically you, or specifically for the original author).
Part 3
Entries
November 1, 2011
Today in UNIX/Linux class we pretty much played with the video wall and being able to display objects and commands on other peoples monitors. First we had to find which server they were on and then we had to find out which computer they were at. This was generrally accomplished with the ssh command. After we found they're computer it was fun just to display random things on their monitor. What i thought was cool was that we display the object on the other persons computer but the whole process is still being performed by the person who is performing the action.
November 3, 2011
Today we worked on a lot on sed command implications. We took an html code and we were able to find certain lines and things within the code by using the sed command. The entire code was the course catalog for CCC. What we did was we typed in certain arrangment of characters and within those characters we could decide which ones we wanted to see first. It was easy because we just typed in a whole mix of things that were generalized to what we wanted to see and the computer just filled in the blanks for us and found out what we wanted to see.
November 8, 2011
Today in UNIX/Linux class we worked on the class finder from last class and worked on some more shell scripting shtuff.
Nov3mber 17, 2011
Today i helped out a classmate for one of his projects that wasn't part of the UNIX/Linux course. It was pretty tricky because i had to use the file organizer. I had to add a lot of things to the file organizer to get rid of junk he didnt need and order the rest of the words into a way that he wanted.
unix Topics
Killing A Process
Is what happens when you wipe a process from existence or you just stop the action. A favorite one is kill -9, which is basically the equivalent of an atomic bomb dropping.
lab46:~$ kill -9
Job Control
Every command you give is a job that is executed. A job can be suspended, placed in the background, moved back to the foreground or terminated.
Backgrounding A Process
A background process executes independently of the shell, leaving the terminal free for other work. To run a process in the background, include an & (an ampersand) at the end of the command you use to run the job.
lab46:~$ bg
Foregrounding A Process
The foreground process is the program that the user is interacting with at the present time In order to foreground a process do this:
lab46:~$ fg
Signals
Signals represent a very limited form of interprocess communication. They are easy to use (hard to use well) but they communicate very little information. In addition the sender (if it is a process) and the receiver must belong to the same user id, or the sender must be the superuser. Signals are sent explicitly to a process from another process using the kill function.
Multitasking
The ability to execute more than one task at the same time, a task being a program.
Compiler
A compiler is a computer program (or set of programs) that transforms source code written in a programming language into another computer language.
Object Code
Code produced by a compiler or assembler.
C
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. Although C was designed for implementing system software, it is also widely used for developing portable application software.
Assembly Language
An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices. It implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture.
Filtering
A filter is a program that gets most of its data from its standard input (the main input stream) and writes its main results to its standard output (the main output stream). Unix filters are often used as elements of pipelines.
Linker
A computer program that takes one or more objects generated by a compiler and combines them into a single executable program
unix Objective
Objective
State the course objective; define what that objective entails.
Method
State the method you will use for measuring successful academic/intellectual achievement of this objective.
Measurement
Follow your method and obtain a measurement. Document the results here.
Analysis
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
- How did you do?
- Room for improvement?
- Could the measurement process be enhanced to be more effective?
- Do you think this enhancement would be efficient to employ?
- Could the course objective be altered to be more applicable? How would you alter it?
Experiments
Experiment 1
Question
Can you gunzip a regular zip file
Resources
None.
Hypothesis
I hypothesize that gunzipping a zip file will not bode well.
Experiment
I am just going to wing it and see if it works.
Data
lab46:~$ gunzip omegafile.zip gzip: omegafile.zip: unknown suffix -- ignored
Analysis
Based on the data collected:
- was your hypothesis correct? Nope
- was your hypothesis not applicable? Yes, it was not applicable
- is there more going on than you originally thought? (shortcomings in hypothesis) I don't think so.
- what shortcomings might there be in your experiment?I am not sure
- what shortcomings might there be in your data? I am not sure
Conclusions
I discovered that you can't really mix and match. You have to unzip zip files and gunzip gzip files.
Experiment 2
Question
Is it possible to block other users from displaying things on my screen?
Resources
My resources include but are not limited to: Matt Haas
Hypothesis
I hypothesize that the command xhost will effectively carry out this action
Experiment
I am going to type the command and have a friend try to penetrate my wall of solitude.
Data
My screen:
lab46:~$ xhost - access control enabled, only authorized clients can connect
Other person's screen:
gnu:~$ export DISPLAY=flake03:4 gnu:~$ xeyes No protocol specified Error: Can't open display: flake03:4
Analysis
Based on the data collected:
- was your hypothesis correct? Yes
- was your hypothesis not applicable? No
- is there more going on than you originally thought? It said that only 'authorized' clients could connect which means I could be able to pick and choose who I want to connect to my client
- what shortcomings might there be in your experiment? none that i have noticed
- what shortcomings might there be in your data? none that i have noticed
Conclusions
In conclusion you can block people from displaying images or files onto your monitor. You can also block specific or entire groups of people as well.
Retest
If you're doing an experiment instead of a retest, delete this section.
If you've opted to test the experiment of someone else, delete the experiment section and steps above; perform the following steps:
State Experiment
Whose existing experiment are you going to retest? Prove the URL, note the author, and restate their question.
Resources
Evaluate their resources and commentary. Answer the following questions:
- Do you feel the given resources are adequate in providing sufficient background information?
- Are there additional resources you've found that you can add to the resources list?
- Does the original experimenter appear to have obtained a necessary fundamental understanding of the concepts leading up to their stated experiment?
- If you find a deviation in opinion, state why you think this might exist.
Hypothesis
State their experiment's hypothesis. Answer the following questions:
- Do you feel their hypothesis is adequate in capturing the essence of what they're trying to discover?
- What improvements could you make to their hypothesis, if any?
Experiment
Follow the steps given to recreate the original experiment. Answer the following questions:
- Are the instructions correct in successfully achieving the results?
- Is there room for improvement in the experiment instructions/description? What suggestions would you make?
- Would you make any alterations to the structure of the experiment to yield better results? What, and why?
Data
Publish the data you have gained from your performing of the experiment here.
Analysis
Answer the following:
- Does the data seem in-line with the published data from the original author?
- Can you explain any deviations?
- How about any sources of error?
- Is the stated hypothesis adequate?
Conclusions
Answer the following:
- What conclusions can you make based on performing the experiment?
- Do you feel the experiment was adequate in obtaining a further understanding of a concept?
- Does the original author appear to have gotten some value out of performing the experiment?
- Any suggestions or observations that could improve this particular process (in general, or specifically you, or specifically for the original author).