Thomas Hakes's Opus
Where the magic happens…
Hello everyone, my name is Tom and I enjoy unix. I chose to take this class because I have always wanted to learn more about Unix, and so far I have learned that I must learn alot more.
Today I learned that the terminal screen can be split into multiple instances within one terminal. How crazy is that?! This will probably change how I will work within terminal for the rest of the class. I am currently using three instances at once for terminal, various manual pages, and the largest for my working terminal.
Today I researched “beep” and found that the internal speaker of your computer can be manipulated by using some of the suffixes of beep. I will now spend time trying to write “funky town” in a script just to play for the nice people down at the Lair.
Today I learned that there is a wait in bash. By issuing a sleep, I am able to wait before issuing several commands. This is helpful for creating multiple command scripts that will not overlap each other and will allow it to run exactly how I see it running. It also helps for issuing a command several times throughout the day, such as beep >;]
The beep command is strange indeed. The man page gives a detailed list of different frequencies that should match up with different tones similar to a piano. Unfortunately, They do not sound the same as the notes.
Identification of chosen keyword (unless you update the section heading above).
One of the more basic text editors in terminal. Primarily used with writing code.
By using a basic command, you are sent into the text editor. From there you can write whatever you want. You can either choose to save it or not upon exit by hitting escape then “:q”
What it looks like:
lab46:~$ vi newfile.txt ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "newfile.txt" [New File] 0,0-1 All
An alias for the network address “127.0.0.1” that always points to the local computer.
The local host is the name given to this network address “127.0.0.1” It is how the computer refers to itself.
When testing a web service on a server (such as apache) you use the local host address 127.0.0.1.
A directory in the system that contains the users files.
In lab46, the generic path to the home directory is /home/(enter your user name here)
There are several shortcuts to the home directory. The command “cd ~” has always been my favorite.
Here is an example of a home directory
lab46:~$ ls Desktop Folder Templates public_html Documents Maildir Pictures Videos bin src Downloads Music Public Workspace src.bak lab46:~$
The part of the hierarchy you currently reside in.
In the Directory system of linux, there are several files and folders. These folders are actually directories. The current directory is the directory that the terminal is in.
By casting the command “pwd” , it prints your current working directory and displays it in front of you.
lab46:~$ pwd /home/thakes3 lab46:~$
A web server or database that you have access to via the internet.
A good demonstration of remote hosting would be Window's remote desktop. Remote Desktop is an application run on Windows that allows you to connect to another computer's screen remotely.
Script written for the shell of an operating system.
Shell scripts are mostly ascii text, with several commands in them , and are executable.
Shell scripts can be executed by using the “./”
The process of changing, moving, adding, deleting, or allowing access to a file.
There are several ways files can be manipulated. I will show you some of the ways to manipulate a file.
By moving the file
lab46:~$ mv file.txt /folderhere lab46:~$ cd /folderhere lab46:/folderhere$ ls file.txt lab46:/folderhere$
By deleting the file
lab46:~$ rm file.txt lab46:~$ ls lab46:~$
By copying the file
lab46:~$ cp file.txt file2.txt lab46:~$ ls file.txt file2.txt lab46:~$
The ability to work jobs in the background while you continue to work at the shell.
By using the bg command, you are able to send the job you are currently working on to the background while you continue to work.
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ bg lab46:~/src$
State the course objective
In your own words, define what that objective entails.
State the method you will use for measuring successful academic/intellectual achievement of this objective.
Follow your method and obtain a measurement. Document the results here.
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
Are you able to connect to Lab46 through ssh, from Lab46?
I believe that you are able to connect to your ssh terminal (or another users) from an already existing terminal such as lab46.
My experiment will be logging onto lab46 and attempting to connect to lab46 via ssh.
I begin by connecting to lab46.
__ _ _ _ __ . . . . . . . . . . . . . . . . . . . . . . . . . | | __ _| |__ / | |_/ / . Basic System Usage: Type 'usage' at prompt . | |__/ _` | '_ \\_ _/ _ \ . Events and News: Type 'news' at prompt . |_____\__,_|_.__/ |_|\___/ . Broken E-mail? Type 'fixmail' at prompt . --------------------------- . Check Lab46 Mail: Type 'alpine' at prompt . c o r n i n g - c c . e d u . . . . . . . . . . . . . . . . . . . . . . . . . Lab46 is the Computer & Information Science Department's Student Development Server for Computer-related coursework, projects, and exploration. For more information, please check out: .. . . . . . . . . . .. . Lab46 Web Page: http://lab46.corning-cc.edu/ . . Lab46 Help Form: http://lab46.corning-cc.edu/help_request . . Help E-mail: haas@corning-cc.edu or wedge@lab46.corning-cc.edu . .. . . . . . . . . . .. You have old mail.
From here I attempt to connect to lab46 (ssh lab46.corning-cc.edu -l thakes3)
thakes3@lab46.corning-cc.edu's password:
And viola! A beautiful inception-like lab46 terminal!
thakes3@lab46.corning-cc.edu's password: __ _ _ _ __ . . . . . . . . . . . . . . . . . . . . . . . . . | | __ _| |__ / | |_/ / . Basic System Usage: Type 'usage' at prompt . | |__/ _` | '_ \\_ _/ _ \ . Events and News: Type 'news' at prompt . |_____\__,_|_.__/ |_|\___/ . Broken E-mail? Type 'fixmail' at prompt . --------------------------- . Check Lab46 Mail: Type 'alpine' at prompt . c o r n i n g - c c . e d u . . . . . . . . . . . . . . . . . . . . . . . . . Lab46 is the Computer & Information Science Department's Student Development Server for Computer-related coursework, projects, and exploration. For more information, please check out: .. . . . . . . . . . .. . Lab46 Web Page: http://lab46.corning-cc.edu/ . . Lab46 Help Form: http://lab46.corning-cc.edu/help_request . . Help E-mail: haas@corning-cc.edu or wedge@lab46.corning-cc.edu . .. . . . . . . . . . .. You have old mail.
Based on the data collected:
My conclusion is that the experiment worked exactly as I thought, and this brings up many topics to be learned regarding ssh.
Can you remotely use a pc speaker via an ssh connection?
I believe that by connecting to my pc (foxtrot) from lab46, I will be able to use the beep command and make the internal pc speaker on foxtrot beep.
I will attempt to connect to foxtrot from lab46, and then use the beep command to see if the pc speaker beeps.
I start by connecting to lab46.
lab46:~$
From here I will connect to foxtrot. I have a script written so that I would not have to type the ip in repetively.
lab46:~$ ./foxtrot thakes3@foxtrot:~$
And then from here, I will now use beep to see if the pc speaker beeps.
thakes3@foxtrot:~$ beep thakes3@foxtrot:~$
The pc speaker beeped, thus success.
I was able to connect successfully and remotely beep the machine.
By manipulating the beep command, are you able to play melodies?
I believe that by using the varias manipulations of beep, you are able to play songs from the pc speaker
I will attempt to use a script I found on ubuntu forums on foxtrot to try and play a melody.
I start by connecting to lab46 and then connecting to foxtrot.
thakes3@foxtrot:~$
From here I copy and paste the several lines of code into a new file i named louder.sh by using the text editor nano. Now I must use the chmod command to make it able to run
thakes3@foxtrot:~$ chmod 744 louder.sh thakes3@foxtrot:~$
And now lastly, I must execute the program.
thakes3@foxtrot:~$ ./louder.sh thakes3@foxtrot:~$
The pc speaker was able to play a fine tuned melody perfectly.
I was correct that the pc speaker can play a melody.
A short coming I came across: I had to modprobe pcspkr. This allows me to use the beep command. Without it I could not. Also, you must install the beep command. It does not come automatically as a command.
Today using the lab46 net boot, I installed debian on 5 different machines. I am beginning my journey to create an orchistra of pc speakers using the beep command. All the names of the computers are of similar style as foxtrot.
Today I researched the different modifications to vim, from line numbers to syntax coloring. As I researched, I had found that there are several themes to choose instead of the default syntax coloring. Right now I'm using the desert theme.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
There are several types of files in the unix environment.
Regular Files: These are a common file within unix. It is a plain collection of bytes of data. Directory: These are a special type of file as they only contain other files. You do not work on a directory directly. Special Files: These are commonly known as the device files on unix. They are usually only owned by root and cannot be modified by the user.
There are several ways to manipulate files in an Unix system. Manipulation ranges from removing, creating, sharing, storing, copying, and editing.
Removing a file:
lab46:~$ rm file.txt lab46:~$
Creating a file:
lab46:~$ touch file.txt lab46:~$
Changing sharing settings on a file:
lab46:~$ chmod 777 file.txt lab46:~$
Copying a file:
lab46:~$ cp file.txt file2.txt lab46:~$
Editing a file (using vim):
lab46:~$ vim file.txt ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Default 0,0-1 All
Saving a file (with vim):
Random Text Here ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ :save file.txt
There are many commands for processing text within unix. Text Processing is the manipulation of text within the unix system.
grep, sort, tail, less, more, and echo.
Echo is a text manipulation tool that reads text back to the user. It is very useful for editing files without opening them in a text editor.
lab46:~$ echo hello hello lab46:~$
Sort is a nifty little tool that allows you to sort a file of random values and sort them by different means. Using -d will sort them by the dictionary, -n numerically, ect.
thakes3@lab46:~$ ls | sort -d Backups Cprog Desktop Documents Downloads Foxtrot Maildir Source_Code Universe Unix bin file.pie pop public_html src thakes3@lab46:~$
Tail is a neat little tool that allows you to read the last 10 lines of a file (by default). Several invocations allow you to manipulate and change what the tool does.
thakes3@lab46:~/Source_Code/ed_editor_vineeth$ tail GNU\ Public\ License.txt 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS thakes3@lab46:~/Source_Code/ed_editor_vineeth$
less is a filter for paging through text, based on the more command. It is different to more because it does not need to read in the entire file before editing
The GNU General Public License (GPL) Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. GNU\ Public\ License.txt :q thakes3@lab46~$:
More is a more primitive version of less that reads in the entire file before opening it for editing.
The GNU General Public License (GPL) Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to sh are and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free progr ams; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain respo nsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, r eceive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someo ne else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' re putations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, i n effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public Licen se. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limita tion in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the o utput from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. --More--(26%) :q thakes3@lab46:~$
grep is an amazing tool that allows you to search for patterns in both files and folders. You can also search for a string or certain cases.
thakes3@lab46:~$ who | grep thakes3 thakes3 + pts/23 2012-04-27 22:47 00:39 2264 (172.16.198.142:S.0) thakes3 + pts/32 2012-04-27 22:48 . 2569 (172.16.198.142:S.1) thakes3@lab46:~$
The Unix Shell refers to the command programming language that speaks directly to the operating system in order to complete several tasks.
There are many different types of Unix Shells. A few important ones include:
Bourne shell (sh) - Was written by Steve Bourne of Bell labs and is available on every unix operating system C shell (csh) - Was written in the University of California, and is a shell written in C code that uses C code to execute scripts and such. TC shell (tcsh) - Is a public domain shell, and it has all of the functionality of the C shell with the emac's style editing of command line Korn shell (ksh) - This shell is also a public domain shell that uses both the c and the tc shell's features but with a shell programming language similar to the bourne shell. Bourne Again SHell (bash) - Is a public domain shell under the GNU project and has features from both the c shell and the ksh shell, yet directly programmable like the bourne shell.
The ability to multitask on a Unix command line interface is very important. Having such abilities allows us to work on several things at once and allows us to be more versatile and efficient with whatever we are working on. For this we have such tools that allow us to switch easily between jobs.
Backgrounding and Foregrounding are a very nice way to run things in the background while working on the console at hand. Let's say I want to download a large file, like the iso file for Ubuntu (12.04 just came out). By adding a '&' to the end of the command, it is able to start in the background while I continue on other things.
lab46:~$ wget ubuntu* & lab46:~$
Now I have my prompt back I am able to continue working. To resume that task all I need to do is type 'fg'.
lab46:~$ fg [ =========> ] 26%
Screen is another amazing multitasking tool that allows us to have multiple cli's open at once. It allows us to switch between screens and work on multiple files at once by splitting the terminal down. To open a screen just type in 'screen', as an alias in lab46 is already in place. This will open a new cli with a completely different .bash_history.
The Unix interface is a special one in that it was designed by programmers for programmers. It holds several tools in it's system to both create and maintain code and provide an environment for others to do the same. From text editors to compilers, the Unix environment is designed for programming.
The Unix programming environment has tools created by those beautiful folks over at GNU, that allow compiling upon the installation of the os. This is very useful as in some instances people cannot access the internet or do not have the means to get another compiler.
The GNU Compiler Collection (GCC) contains front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as many other languages.
The native text editors such as pico or vi, are very powerful tools. They allow easy editing, quick saving, and several helpful tools such as syntax highlighting, finding, over riding, and other great tools that systems such as a windows platform may not come with.
In most platforms of unix, there are easy to use tools to download and install applications written by other peoples in repositories. Such tools include apt-get, aptitude, yum, ect.
These are some of the stages of compilation in the C programming language. They all provide a specific roll in creating programs that run on the computer.
Compiler - Does the lexical analysis by breaking the code into pieces and then checks them for correctness. It then generates a lower level code from the code written. It then looks for possible flaws in the programs logic, and then generates assembly code.
Assembler - Translate the assembly code given from the compiler into the system specific object code.
Linker - Links the object code with some other libraries to make it run-able
Loader - Executes the program on a system specific platform
Pattern matching is a neat little process that allows us to decipher text from either files or other processes outputting text. We can choose to display what we want to display.
Pattern matching in unix is quite fun really. We can look for common identifiers between files, such as the tailing file type or the use of vowels.
For this example I have created a file named file.txt that holds several words.
This is the inside of the document
Puppy Kitty Cow sheep elephant alligator
Now I will make use of the command “grep” and it's ability to match certain patterns within words. I will grep for the vowel 'o' and what words contain them
lab46:~$ grep [o] file.txt Cow alligator lab46:~$
State the course objective
In your own words, define what that objective entails.
State the method you will use for measuring successful academic/intellectual achievement of this objective.
Follow your method and obtain a measurement. Document the results here.
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
Can I remove the beep from the terminal so that it can stop annoying me?
http://www.thinkwiki.org/wiki/How_to_disable_the_pc_speaker_(beep!) the man page for modprobe the man page for beep
I believe that if the pcspkr is disabled, then it cannot beep any longer and it would prevent angering me beyond belief. By backspacing in terminal
I will attempt to remove the probe in pcspkr disabling it from beeping anymore when I backspace in terminal
I begin by logging into Foxtrot. From here I use the -r appendage to the modprobe command.
thakes3@foxtrot:~$ sudo modprobe -r pcspkr password: thakes3@foxtrot:~$
from here I will try to backspace to see if the terminal will beep
lab46:~$
Based on the data collected:
Now the beep will not bother me, as it is long gone.
Is it possible to create multiple monitors without the need of an external graphics card in linux?
By attempting to configure X to my needs, I should be able to make my computer be able to handle three heads at once.
By editing my X11 configuration file
I started off by running X -configure in root user mode with no GUI present.
bravo:~$ cd /etc/X11/ bravo:~$ X -configure
I then began looking for the xorg.conf file.
lab46:~$ find / -name 'xorg.conf' 2> /dev/null /etc/X11/xorg.conf lab46:~$
I added a third entry for the monitor I am trying to use and assigned it to the second graphics card.
Based on the data collected:
Multiscreening is hard!
Perform the following steps:
Whose existing experiment are you going to retest? Provide the URL, note the author, and restate their question.
Evaluate their resources and commentary. Answer the following questions:
State their experiment's hypothesis. Answer the following questions:
Follow the steps given to recreate the original experiment. Answer the following questions:
Publish the data you have gained from your performing of the experiment here.
Answer the following:
Answer the following:
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
Like pattern matching, regular expressions involve text manipulation and other commands like grep.
By definition, a regular expression is a formula for matching strings that follow some pattern.
There are several important commands in unix for networking. Whether it's checking your IP address or seeing if a website is up, these simple networking tools are very important.
ping - it sends packets to the address you give it, and tells you whether or not it received them.
lab46:~$ ping cnn.com PING cnn.com (157.166.255.19) 56(84) bytes of data.
ifconfig - device interface config. These are your networking devices and what they are currently up too. It will list a bit of information reguarding the network it is connected too.
[sudo] password for thakes3: eth0 Link encap:Ethernet HWaddr 00:30:84:0e:88:c1 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:16 Base address:0x1400 eth1 Link encap:Ethernet HWaddr 00:11:0a:36:64:4d inet addr:10.80.2.180 Bcast:10.80.2.255 Mask:255.255.255.0 inet6 addr: fe80::211:aff:fe36:644d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4832 errors:0 dropped:0 overruns:0 frame:0 TX packets:2954 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4155503 (3.9 MiB) TX bytes:526011 (513.6 KiB) Interrupt:20 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:10 errors:0 dropped:0 overruns:0 frame:0 TX packets:10 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:660 (660.0 B) TX bytes:660 (660.0 B)
Telnet - a protocol that allows you to remote to computers and both receive and send ascii text.
one of my favorite Telnets would be the star wars movie in ascii.
telnet towel.blinkenlights.nl
Shell scripting in unix is very important as it accomplishes repetitive tasks simply and provides an easy method of executing a command that takes rather long to type over and over again.
Shell scripting is very useful for writing a long command that sometimes is forgotten.
For this demonstration I will reveal my ssh shell script within my home folder
lab46:~$ cat Universe ssh thakes3@69.207.208.154 lab46:~$
by changing the permissions to allow it to be executed (chmod a+x Universe) all I would need to do is execute that file and it would ssh me to that address.
lab46:~$ ./Universe thakes3@69.207.208.154's password:
The security environment in unix is rather unique as it relies on permissions and users to block out the information that should not be accessed by others.
Permissions are important in unix as they are needed for the current user to access the file. If your permissions are low for other users, such as read only, then they are not able to edit the file or make amends to it.
to view your permissions, use the -l appendage to the command 'ls'
lab46:~$ ls -l total 3 drwxr-xr-x 4 thakes3 lab46 46 Feb 29 11:41 Backups drwxr-xr-x 2 thakes3 lab46 28 Feb 25 15:06 Desktop -rwxr--r-- 1 thakes3 lab46 27 Mar 2 14:43 Foxtrot lab46:~$
to edit your permissions, see the chmod command.
Users in Unix often are put within a group of other users often referred to as a User Group. They are often given certain permissions to the entire group so that the group can accomplish a task together. every user must be a member of at least one group, which is identified in /etc/passwd. This group is referred to as the primary group ID. A user may be listed as member of additional groups in the relevant entries in the /etc/group; the IDs of these groups are referred to as supplementary group IDs.
results given by cat'ing /etc/group :
lab46:~$ cat /etc/group root:x:0: daemon:x:1: bin:x:2: sys:x:3: adm:x:4: tty:x:5:wedge disk:x:6: lp:x:7: mail:x:8: news:x:9: uucp:x:10: man:x:12: proxy:x:13: kmem:x:15: dialout:x:20: fax:x:21: voice:x:22: cdrom:x:24: floppy:x:25: tape:x:26: sudo:x:27: audio:x:29: dip:x:30: www-data:x:33: backup:x:34: operator:x:37: list:x:38: irc:x:39: src:x:40: gnats:x:41: shadow:x:42: utmp:x:43: video:x:44: sasl:x:45: plugdev:x:46: staff:x:50:wedge games:x:60: users:x:100: nogroup:x:65534: libuuid:x:101: crontab:x:102: ssh:x:103: ntp:x:104: tss:x:105: scanner:x:106: nvram:x:107: fuse:x:108: kvm:x:109: rdma:x:110: messagebus:x:111: utempter:x:112: avahi:x:113: netdev:x:114: cl-builder:x:115:
The path variable in unix is used for finding files that are executable instead of having to go to those locations specified inorder to execute a program.
By echo'ing the $PATH variable, you are given each directory that the cli searches for on the system.
lab46:~$ echo $PATH /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin lab46:~$
without these listed, when you attempt to use a program it will return a “command not found”
lab46:~$ PATH = null lab46:~$ man dd man: command not found lab46:~$
Tab completion in unix refers to the utility that allows you to automatically fill out the rest of the command you are attempting to type out, as well as directories that exist.
By using Tab completion your computer will guess as to what you are attempting to type. Let's say I want it to auto complete for file.
lab46:~$ fli file filebyproc.d filecoordinationd filtercalltree lab46:~$ fli
Now I would like to edit a file with a very long file name. lets say treehuggersarefriendly.txt . Since there are no other commands or files that have any characters beyond tree, it will auto complete the name for you.
lab46:~$ vi treehuggersarefriendly.txt lab46:~$
Environment Variables are sets of dynamically named values that affect how programs run.
By using the command 'set', you are able to see all of the environment variables that are currently in place on the system.
lab46:~$ set Apple_PubSub_Socket_Render=/tmp/launch-zxcVFC/Render Apple_Ubiquity_Message=/tmp/launch-h4tdQI/Apple_Ubiquity_Message BASH=/bin/bash BASH_ARGC=() BASH_ARGV=() BASH_LINENO=() BASH_SOURCE=() BASH_VERSINFO=([0]="3" [1]="2" [2]="48" [3]="1" [4]="release" [5]="x86_64-apple-darwin11") BASH_VERSION='3.2.48(1)-release' COLUMNS=80 COMMAND_MODE=unix2003 DIRSTACK=() DISPLAY=/tmp/launch-nlv4HI/org.x:0 EUID=501 GROUPS=() HISTFILE=/Users/Thomas/.bash_history HISTFILESIZE=500 HISTSIZE=500 HOME=/Users/Thomas HOSTNAME=Thomass-MacBook-Pro.local HOSTTYPE=x86_64 IFS=$' \t\n' LANG=en_US.UTF-8 LINES=24 LOGNAME=Thomas MACHTYPE=x86_64-apple-darwin11 MAILCHECK=60 OPTERR=1 OPTIND=1 OSTYPE=darwin11 PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin PIPESTATUS=([0]="0") PPID=649 PROMPT_COMMAND='update_terminal_cwd; ' PS1='\h:\W \u\$ ' PS2='> ' PS4='+ ' PWD=/Users/Thomas SECURITYSESSIONID=186a5 SHELL=/bin/bash SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor SHLVL=1 SSH_AUTH_SOCK=/tmp/launch-3MwPil/Listeners TERM=xterm-color TERM_PROGRAM=Apple_Terminal TERM_PROGRAM_VERSION=303 TERM_SESSION_ID=C4D3E870-C900-43E5-8C99-DD82C82ED39A TMPDIR=/var/folders/s_/4x3d698174b8cn1l1c0m1mkm0000gn/T/ UID=501 USER=Thomas _=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin __CF_USER_TEXT_ENCODING=0x1F5:0:0 update_terminal_cwd () { local SEARCH=' '; local REPLACE='%20'; local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"; printf '\e]7;%s\a' "$PWD_URL" }
You are able to change an environment variable by setting it equal to some value
lab46:~$ echo $TERM xterm-color lab46:~$ TERM=xterm lab46:~$ echo $TERM xterm lab46:~$
Wildcards are a magical operator that allows the unix system to search for the beginning characters + 0 or more characters. They are very useful for searching for a very long file or searching for one that you do not know the rest of the name.
In this example I will be searching for a file named 'diablo3looksprettygood.jpg' within my home directory of /home/thakes3.
lab46:~$ find /home/thakes3 --name 'diablo*' 2> /dev/null diablo3looksprettygood.jpg lab46:~$
Note that it found the exact file even though we did not specify the rest of it.
I can also use vi on a different file 'lulzjkidkroflhahanoob.txt'
lab46:~$ vi lulz*
State the course objective
In your own words, define what that objective entails.
State the method you will use for measuring successful academic/intellectual achievement of this objective.
Follow your method and obtain a measurement. Document the results here.
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
What is the question you'd like to pose for experimentation? State it here.
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.
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.
How are you going to test your hypothesis? What is the structure of your experiment?
Perform your experiment, and collect/document the results here.
Based on the data collected:
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.
What is the question you'd like to pose for experimentation? State it here.
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.
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.
How are you going to test your hypothesis? What is the structure of your experiment?
Perform your experiment, and collect/document the results here.
Based on the data collected:
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.
Perform the following steps:
Whose existing experiment are you going to retest? Provide the URL, note the author, and restate their question.
Evaluate their resources and commentary. Answer the following questions:
State their experiment's hypothesis. Answer the following questions:
Follow the steps given to recreate the original experiment. Answer the following questions:
Publish the data you have gained from your performing of the experiment here.
Answer the following:
Answer the following: