User Tools

Site Tools


haas:spring2011:unix:eoce

Corning Community College

UNIX/Linux Fundamentals


End of Course Experience

~~TOC~~

Rules

Presented within will be various questions evaluating your knowledge and experience gained this semester. In places where you are able, the more you write and explain topics the better the chance you will have of receiving full credit (and alternatively, the more credit you will receive should something be incorrect).

The questions on this experience are open resource with the exception of other individuals. In that respect, it is CLOSED PERSON. This means you are not to communicate with other people (either in the class or otherwise), in real life or electronically. Use your own knowledge, use your skills, and use your ability to access the allowed resources to aid you in coming up with your well thought out answers to each question.

You are allowed, and expected, to ask me questions, so that a problem can be better clarified.

There are three parts to this experience:

  • Part I: 8 items, covering all the various concepts we've covered throughout the semester.
  • Part II: 4 scripts and/or system administration tasks.
  • Part III: 4 items, involving the course and various perspectives you got out of it.

You are to do all questions. Submission is to be in an organized and easy to read format in a plain text file, such as in an e-mail with attachments on Lab46, sent to wedge@lab46.corning-cc.edu and yourself.

You have until 11:59:59pm (that's 23:59:59 in 24-hour time) Wednesday, May 18th, 2011 to complete and submit this to me.

Although we do not have a scheduled finals week meeting time, you are welcome to come to the BDC, Room B003 for questions on:

  • Tuesday, May 17th from 8am-2:15pm
  • Wednesday, May 18th from 11:15am-2:15pm

Good luck!

Part I: Questions

0x0: RegEx

Write me regular expressions that, when used against a file like /usr/share/dict/words, will return only the following (give me the entire command-line or regex, AND number of results):

a. All the 6 letter words that begin with "pre" XOR end with "ing".
b. All the words that begin with "pre" or "post" and do NOT end with "ing".
c. All the words whose even placed characters are a vowel (only lowercase, 'y' excluded).
d. All the words whose even placed characters are a vowel (only lowercase, 'y' included).
e. All the words that do not contain any of the letters 'a' or 'A'.
f. Words that do not contain any of your initials (first, middle, last, upper, and lower).

0x1: Files

Tell me what type of file (regular, directory, special) for each of the following, and provide your reasoning for such:

a. /etc/group
b. /usr/lib/libsvn_diff-1.so.1.0.0
c. /dev/pts/*
d. /proc/cpuinfo

0x2: Mystery

In the /var/public/unix/eoce directory is an executable named mystery. Run this program and tell me the following:

a. Does the program output to STDOUT or STDERR?
b. How can you prove this?

Be sure to justify your answer and provide proof that backs up your claims.

0x3: Files

The /etc/shadow file contains account password information for certain users on the system.

a. How would you show me the encrypted password for one of the accounts?
b. If you try it, are you able to accomplish the task? Why or why not?
c. Why do you suppose that is?
d. What would be the benefit of doing something like this?

Be sure to answer ALL four parts.

0x4: Paths

Tell me whether each of the following is a relative or absolute path:

a. /usr/local/bin/usage
b. bin/bash
c. /usr/share/../../tmp
d. ./var/lib/dpkg

0x5: Permissions

For the following permissions:

a. drwxr-x--x
b. crw-r-----
c. -r---w--wx
d. p--xrw-rwx
  • Tell me the octal permissions for each.
  • Tell me what type of file for each.

0x6: Wildcards

Show me how you'd list the following:

a. All the files in the base of /proc that contain 4 characters and begin with a '1' or a '2'.
b. All the files in the base of /dev that end with '6' or 'v' or 'V'.
c. All the files in the base of /etc that begin and end with an 'r','s','t','l','n', or 'e'.
d. All the files in /bin that are symlinks AND 6 characters in length.

0x7: Matching

What tool(s) would I use to access/process the following in the most common sense fashion? Identify what the file is, and show me an example command-line of extracting/gaining access to the respective content

a. stuff.tar.gz
b. trees.bz2
c. text_file_with_100_lines_you_want_to_read
d. roms.zip

Part II: Scripting and System Administration

0x8: System Administration

A large part of our activities this semester involved learning how to use the system as a user and developer. Another important aspect of using systems is in their administration, known commonly as “System Administration”. As a System Administrator, one has higher privileges (ie access to the root superuser account) and is responsible for ensuring proper operation of the system and appropriately extending desired functionality.

Your task in this question is to play the role of the System Administrator and extend the functionality of a system.

I have set up a system for use, running another Open Source UNIX variant called NetBSD. The system is called eoce.student.lab and can be reached via SSH from Lab46.

Your task is to log into the system, become root using the su command, choose a yet-to-be-installed package from the list and figure out how to install it, investigate your package, perform any necessary configurations.

Some useful information:

  • System type: NetBSD 5.1/i386
  • hostname: eoce.student.lab
  • username: unix
  • password: unixclass

Please answer the following:

  • How do you log in to the system?
  • How did you become root?
  • What package did you choose to install?
  • How did you install it?
  • What does the package you install do?
  • What file shows the list of packages to be installed and who installed them on login?

Don't forget to edit the file that displays on login to mark off what package you've installed so others don't try to install a package that is already installed.

0x9: A 'last'ing impression

Utilizing the last utility, write a script that will output the following information:

  • how many unique IP addresses contacted Lab46 for successful login this month?
  • which user had the most bad logins for the month of April?
  • which IP address(es) contacted Lab46 the most (you choose- April or May)?
  • which IP address(es) contacted Lab46 the least (you choose- April or May)?
  • if an argument is given, assume it is a user
    • validate the user (id command), if not a valid user then print appropriate error and exit
    • tally total successful logins for April and May
    • tally total unsuccessful logins for April and May

NOTE: All successful logins to Lab46 will also generate a corresponding login failure. So you will see the number of bad logins being artificially high. This does not make the information useless- it still contains genuine information on bad logins.

0xA: emordnilaP as a Palindrome

Write two scripts, each one accepting as input two strings.

Each script must validate whether or not the two input strings are palindromes (or not), and output a message appropriately.

Each script must perform its palindrome processing in an entirely different way from the other.

The intent here is to come up with fundamentally different ways of solving a problem.

0xB: System Customization

On the eoce.student.lab NetBSD VM we explored in a previous question, I'd like for you to return and accomplish the following tasks:

  1. Create a new user, matching your Lab46 username and userID.
  2. Once bash is installed, switch your user's default shell to bash.
  3. Once vim is installed, customize your .vimrc
  4. Customize your .profile with settings similar to your settings on Lab46.

Be sure to answer for me:

  • How did you find the UserID of your user on Lab46? What is it?
  • How did you create the user on the NetBSD VM?
  • How did you make bash your default shell?
  • What settings did you put in your .vimrc, what does each setting do?
  • What settings did you utilize in your .profile, what does each setting do?

Part III: Things that aren't in the first two parts

0xC: * vs. *.*

The first UNIX filesystems allowed for filenames to be up to 14 characters in length. As time went by, this limit increased to 255 characters, and even larger (around 10,000 characters). In UNIX, there is no concept of an extension (ie in MS-DOS you have 8 characters followed by a 3 letter extention– known as 8.3 notation). However, the concept of the file extension is still in common use but used to help the user distinguish files (just as with the –color=auto option to ls(1), files are colorized). The underlying operating system doesn't care what extension or color the file is, but it can be useful to the user.

In DOS, a common wildcard to specify all files is: *.*

In UNIX, why is * better than: *.*

Explain your answer.

0xD: FAQ

A big part of our explorations this semester involved discovering knowledge, both the intrinsics that make UNIX make more sense in general, and knowledge that the greater internets seem to have scattered about the ether.

The class wiki has been a centralized place for the collection of this data, and now I'd like to fine tune it a bit, and perhaps create a resource that others on the internet can use when exploring UNIX.

Located at faq:unix is the FAQ list I've created for this class. I would like for EACH of you to contribute the following:

  • 8 questions
  • 8 answers (you don't have to answer your own questions)

These can include any aspect of exploring and utilizing UNIX this semester. But 8 distinct questions/answers from EACH person in the class is required.

The FAQ page contains some additional syntax for use with FAQ lists (even though it may not display in any unique way– yet).

Be sure to, as content develops, to organize/categorize as appropriate under subsections. I don't just want section headings containing each person's name.. I want categories, with multiple contributions beneath each category. The wiki keeps track of who did what, so don't worry about identifying what you specifically did on the FAQ content (aside from a signature trailing each Q and A submission).

The intent is to try and make this document something that would have been very useful to you when we started out at the beginning of the semester. For all those who have made use of Google this semester to look up information to help you on a lab or case study– I want this FAQ to be as valuable as that external data you found.

0xE: The UNIX Philosophy

What is the UNIX philosophy?

And how does that philosophy play a part in various places on a UNIX system, and even in various ideals behind coming up with solutions and computing in general?

0xF: Your Perspective

After an exciting and intellectually challenging run, we're arriving at the end of this semester's journey. The course as we all experienced it, unfolds in a manner pertaining in part to how you respond to concepts and topics (do we need more time, can I crank it up a couple notches, etc.) so each semester and each class is entirely different from any other- because of each of you, and all of us, working together and learning together.

So, searching deep down within your soul- balancing reason with emotion, and considering attendance and timeliness; answer me the following:

  • What grade do you feel you deserve for this course?
  • Why do you feel you deserve this mark? (Justify your answer based on your own perceived performance, not on need.)
  • How did you feel about the course?
  • Was it useful/interesting to you?
  • What was your least favorite aspect, and why?
  • What was something meaningful to you with respect to the course? Why does this stick out in your mind?
  • Any other comments or suggestions?

Submission

When done, compose an e-mail to me with your responses to the various questions. There is no electronic submission form for the EoCE.

Be sure your e-mail is organized and easy to read!

haas/spring2011/unix/eoce.txt · Last modified: 2011/05/10 09:49 by 127.0.0.1