User Tools

Site Tools


opus:spring2012:thakes3:part1

Part 1

Entries

Entry 1: February 17, 2012

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.

Entry 2: February 29th, 2012

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.

Entry 3: March 1st, 2012

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 >;]

Entry 4: Almost March 2nd 2012

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.

Keywords

unix Keywords

The Vi Editor

Identification of chosen keyword (unless you update the section heading above).

Definition

One of the more basic text editors in terminal. Primarily used with writing code.

Demonstration

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

Local Host

Definition

An alias for the network address “127.0.0.1” that always points to the local computer.

Demonstration

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.

Home Directory

Definition

A directory in the system that contains the users files.

Demonstration

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:~$ 

Current Working Directory

Definition

The part of the hierarchy you currently reside in.

Demonstration

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:~$ 

Remote Host

Definition

A web server or database that you have access to via the internet.

Demonstration

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.

Shell Scripting

Definition

Script written for the shell of an operating system.

Demonstration

Shell scripts are mostly ascii text, with several commands in them , and are executable.

Shell scripts can be executed by using the “./”

File Manipulation

Definition

The process of changing, moving, adding, deleting, or allowing access to a file.

Demonstration

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:~$

Job Control

Definition

The ability to work jobs in the background while you continue to work at the shell.

Demonstration

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$ 

unix Objective

unix Objective

State the course objective

Definition

In your own words, 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?
  • Is there 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

Connect to Lab46 from Lab46

Question

Are you able to connect to Lab46 through ssh, from Lab46?

Hypothesis

I believe that you are able to connect to your ssh terminal (or another users) from an already existing terminal such as lab46.

Experiment

My experiment will be logging onto lab46 and attempting to connect to lab46 via ssh.

Data

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.

Analysis

Based on the data collected:

  • My hypothesis was correct.
  • There are many other ways that this can be applied, as in connecting to a machine on the network.
  • This also shows that you can have multiple people on the same account running at the same time

Conclusions

My conclusion is that the experiment worked exactly as I thought, and this brings up many topics to be learned regarding ssh.

Remote Beeping

Question

Can you remotely use a pc speaker via an ssh connection?

Hypothesis

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.

Experiment

I will attempt to connect to foxtrot from lab46, and then use the beep command to see if the pc speaker beeps.

Data

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.

Analysis

I was able to connect successfully and remotely beep the machine.

  • This shows me that several functions of the computer can be accessed remotely and used.
  • This also shows that by connecting to foxtrot via ssh, you are completely engulfed in the computer, and thus all functions are of that computer and do not relate to the computer you are currently on.

Melodies with Beep

Question

By manipulating the beep command, are you able to play melodies?

Resources

Hypothesis

I believe that by using the varias manipulations of beep, you are able to play songs from the pc speaker

Experiment

I will attempt to use a script I found on ubuntu forums on foxtrot to try and play a melody.

Data

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.

Analysis

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.

opus/spring2012/thakes3/part1.txt · Last modified: 2012/03/02 04:58 by thakes3