User Tools

Site Tools


opus:fall2012:dsherbur:start

(CUSTOMIZE'd) DUSTIN SHERBURNE's fall 2012 Opus

(MODIFY'd) MANDATORY SUBTITLE

Introduction

Hello, my name is Dustin Sherburne, if the page heading didn't tell you already. I am currently studying German and Calculus 3 in addition to Unix. I took this class last semester, but I was a turd and didn't put any time into it, so I had to withdraw. Anyway, I hate my job and I want to be a computer engineer so I can hate my job while making obscene amounts of currency, thereby making me not hate my job. As far as a career plan goes, I don't have one. I'm not sure if I want to get an entry level position after my time at Corning, if that time ever comes, or if I want to transfer to a 4-year college and get a BS after my time in Corning; A) if that time ever comes and B) if any institution will have me and my horrid GPA. Hobbies include death metal.

Part 1

Entries

Entry 1: September 17th, 2012

cd's lost sibling

So, I was thinking last night if there was another way to navigate the file system besides using cd. Most unix utilities have specialized functions, but sometimes they overlap a little bit. For example, you can use cat to view a text file. You can also use more and/or less to view a file. Cat, more, and less each have their own niche that they fill; some features present in less are not present in cat. What features could this other navigation utility (lets call it go for now) have to make it different from cd? Could there be a need for another navigation utility? Cd does a pretty good job alredy, so I can't really fathom a need for another separate utility, but then again I'm not a wizard yet. I suppose there could possibly be some situation in which cd was not sufficient, though such a situation has not yet presented itself to me.

*Brief intermission*

After consulting with the Oracle, I can find no leads to another navigation utility. Indeed, cd leaves little to be desired and fulfills its duty with aplomb. I was wrong for ever doubting.

Entry 2: September 17th, 2012

Just a moment ago, I wished I was in vim. See, I was writing an entry and I forgot to capitalize the beginning of the sentence. As I noticed the leading letter was not with the stature leading letters typically have, I watched in slow motion horror as my right hand, my very own right hand, moved FROM the keyboard and TO the mouse. And the nightmare didn't stop there. Paralyzed by fear, I could to naught but look on as my possessed appendage wrought havoc upon my poor wretched soul. Then I saw movement on the screen; it was the cursor! It was moving to the beginning of the sentence! O, woe! O, ye gods, offer thy solace! I heard a click, and the offending letter was dispatched by a swift back-space. What had driven my hand to become such a devilish creature? Was it neglect? Had I done some great unforgivable wrong? I was so fixed on the affairs unfolding before me, that I had paid little attention to my left hand. Ever the opportunist, the hand, once stoic and obedient, began to stir; joining forces with the right hand, and, thereby, relinquishing myself of all control. I was at the mercy of two rogue hands, well-trained in the martial art of Type Kwon Do. There was a shift, and a character strike (a very effective two-hit combo) and on the grave of the former character, there the hands summoned a capitalized version (I believe it was an 'a', but I am very shaken from the experience and certain details may be lost on me). The right hand returned the cursor, via mouse, to the unfinished end of the line, and, as soon as it had begun, the calamity had ended. I wept for the moments lost. Moments that seemed like hours, hours lost forever.

Had I been in vim, I may have avoided much of this great catastrophe.

Entry 3: September 24th, 2012

I just learned the importance of saving. Part way through lab 0x0, I noticed my trackpad was on (theres a little light right above it). I use a mouse since this computer is largely immobile, and, not wanting to brush it with my palm and interrupt the flow of typing, I decided to turn it off (theres a little button, too). So I push the button, and, lo and behold, the computer no longer responds to any input from the keyboard or mouse. I was unable to save the text file I was working in, unable to copy/paste into a new document, unable to even click the shutdown button. An hour's worth of work unsaved and gone like my ex-wife. fml

Entry 4: September 26th, 2012

Today I learned that echo doesn't really like newline characters. Whilst doing project 0x01, there is a point where you have to print the output of an incantation into a file in order to run it correctly. On my first few attempts, I was using echo in a manner such that the output was not the way I wanted it to be. The script wouldn't run, even though it was the same code. After cat'ing the file, I noticed that the text was absent of newlines and tabs. Let's have a look-ey, shall we?

lab46:~/the answer.txt$ echo `rev sales | tr ^ ' '`
#!/bin/bash # # Puzzle Box Script - This is an actual script that you need to run # in order to finish this project. # echo -n "What is black and white and read all over? " read response if [ "${response}" = "newspaper" ]; then echo "You are correct! Finish this project by providing GIMMEH with that answer" exit 0 else echo "That is not correct. You'll have to try again." exit 1 fi exit 0 # # wonk ot sdnammoc lufesu era )1(rt dna )1(ver #

Siehst? Das ist nicht gut. Let's take out the echo bit and see what we get.

lab46:~/nix/0x01/the answer.txt$ rev sales | tr ^ ' '
#!/bin/bash
#
# Puzzle Box Script - This is an actual script that you need to run
#                     in order to finish this project.
#

echo -n "What is black and white and read all over? "
read response

if [ "${response}" = "newspaper" ]; then
	echo "You are correct! Finish this project by providing GIMMEH with that answer"
	exit 0
else
	echo "That is not correct. You'll have to try again."
	exit 1
fi

exit 0
#
# wonk ot sdnammoc lufesu era )1(rt dna )1(ver
#

Now THAT looks like a script. And, when outed to a .sh file and executed, runs. Also, when we went into /usr/bin and ran echo *, it returned text in a very hard-to-digest manner. When trying to use wc, the -l option might not have worked, but -w probably would have.

Keywords

Keyword 1 Phase 1

Identification of chosen keyword: Current working directory

Definition

Definition (in your own words) of the chosen keyword:

THE WORD(S) OF THE DAY IS(ARE): CURRENT WORKING DIRECTORY. *Note: If you haven't read Unix for the Beginning Mage yet, some of the terminology might seem odd.

COMMENCE

The current working directory refers to the absolute path of where you are “standing”. To find out where, exactly, you are standing, type “pwd” into the terminal. You should get an output; if you don't, I'm sorry. This output will change as you change your position in the file system. The prompt will also change as you move around. To illustrate a few concepts, I have made a directory in my home directory called “cwd” (current working directory) and a few directories therein.

lab46:~$ mkdir cwd
lab46:~$ cd cwd
lab46:~/cwd$ mkdir file
lab46:~/cwd$ cd file
lab46:~/cwd/file$ mkdir music
lab46:~/cwd/file$ cd music
lab46:~/cwd/file/music$ pwd
/home/dsherbur/cwd/file/music

In the prompt, lab46 refers to the system's name (as far as this entry is concerned). Then there is a colon (:), and, if you are standing in or past your home, there is a tilde (~). The prompt can help you identify your current working directory without having to type pwd. The tilde refers to the path of your home directory, which is usually /home/username. Everything after the tilde and between the dollar sign is your current directory. If you are not in the home directory, or you are in a directory contained within the home directory, the prompt will not have a tilde in it.

lab46:~$ cd /
lab46:/$ pwd
/

I changed directories from my home directory to the root directory. The prompt no longer uses a tilde because root is not part of home, but rather home is a part of root.

References

List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).

  • Reference 1: Play

Keyword 1 Phase 2

Remote Host

Definition

A remote host is a computer typically refereed to as a server in a private or a public network. The computer or server will be located in a distant location. This server or computer can retrieve and store data and users can even access data off of them. A good example would be the servers located here at the business center when we log on and access files from home.

References

Demonstration

Demonstration of REMOTE HOST:

Our remote host is lab46. There is one centralized computer or server from which, via terminals, data is/are accessed. To demonstrate this, we will be examining the PS1 line. This line is a variable (notice the caps) that determines what the prompt looks like.

lab46:~$ echo $PS1
\h:\w\$

The “\h” (whack h) prints the hostname in the prompt. Furthermore, when I ssh into lab46 from my home computer, I use the following incantation:

dustin@balagog:~$ ssh dsherbur@lab46.corning-cc.edu

Lab46, or more specifically, lab46.corning-cc.edu is our remote host.

See: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html

Experiment 1

Question

We learned how to make a ghetto ls; can we make a ghetto find? Moreover, can we make an incantation that can find all instances of the search parameter in the entire filesystem? I'm sure there's an option for find that facilitates this function, but I want to brute force it.

Resources

man pages, growing incantations

Hypothesis

I believe, with the use of pipes and such, that this task can be accomplished.

Experiment

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

I shall forge an incantation to accomplish this task and compare my findings to the results of a function meant to do this.

Data

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

Through the man pages, I have discovered an option to ls that lists all directories recursively (-R). Since we are searching the entire filesystem, this incantation should be performed in root. Putting the output from ls -R into this wiki would be stupid. We can, however, pipe that output into grep, argument grep with our search parameter, and viola (hopefully).

dustin@balagog:/$ ls -RA | grep grep
ls: cannot open directory ./proc/96/task/96/fdinfo: Permission denied
ls: cannot open directory ./proc/961/fd: Permission denied
ls: cannot open directory ./proc/961/fdinfo: Permission denied
ls: cannot open directory ./proc/961/task/961/fd: Permission denied
ls: cannot open directory ./proc/961/task/961/fdinfo: Permission denied
ls: cannot open directory ./proc/961/task/968/fd: Permission denied
ls: cannot open directory ./proc/961/task/968/fdinfo: Permission denied
ls: cannot open directory ./proc/961/task/969/fd: Permission denied
ls: cannot open directory ./proc/961/task/969/fdinfo: Permission denied
ls: cannot open directory ./proc/97/fd: Permission denied
ls: cannot open directory ./proc/97/fdinfo: Permission denied
ls: cannot open directory ./proc/97/task/97/fd: Permission denied
ls: cannot open directory ./proc/97/task/97/fdinfo: Permission denied
ls: cannot open directory ./proc/972/fd: Permission denied
ls: cannot open directory ./proc/972/fdinfo: Permission denied
ls: cannot open directory ./proc/972/task/972/fd: Permission denied
ls: cannot open directory ./proc/972/task/972/fdinfo: Permission denied
ls: cannot open directory ./proc/987/fd: Permission denied
ls: cannot open directory ./proc/987/fdinfo: Permission denied
ls: cannot open directory ./proc/987/task/1103/fd: Permission denied
ls: cannot open directory ./proc/987/task/1103/fdinfo: Permission denied
ls: cannot open directory ./proc/987/task/987/fd: Permission denied
ls: cannot open directory ./proc/987/task/987/fdinfo: Permission denied
ls: cannot open directory ./proc/tty/driver: Permission denied
ls: cannot open directory ./root: Permission denied
ls: cannot open directory ./tmp/.esd-114: Permission denied
ls: cannot open directory ./tmp/orbit-gdm: Permission denied
ls: cannot open directory ./tmp/pulse-PKdhtXMmr18n: Permission denied
oil-bugreport
pgrep
rgrep
zipgrep
greprev_.gif
greprev.gif
greplus.gif
totem-bugreport.py
greprefs
./usr/lib/xulrunner-1.9.2.28/greprefs:
system-greprefs.js
grep
bogogrep.c
egrep.awk
./usr/share/doc/grep:
grep-maintainer
grep_native_packages.py
gedit-bugreport
gnome-power-bugreport
grep.info.gz
grep.mo
grep.mo
bzegrep.1.gz
bzfgrep.1.gz
bzgrep.1.gz
egrep.1.gz
fgrep.1.gz
grep.1.gz
pgrep.1.gz
rgrep.1.gz
zegrep.1.gz
zfgrep.1.gz
zgrep.1.gz
zipgrep.1.gz
bugreport.vim
ls: cannot open directory ./var/cache/ldconfig: Permission denied
grep.list
grep.md5sums
ls: cannot open directory ./var/lib/gdm: Permission denied
ls: cannot open directory ./var/lib/polkit-1: Permission denied
ls: cannot open directory ./var/log/gdm: Permission denied
ls: cannot open directory ./var/run/cups/certs: Permission denied
ls: cannot open directory ./var/run/gdm: Permission denied
ls: cannot open directory ./var/spool/cron/atjobs: Permission denied
ls: cannot open directory ./var/spool/cron/atspool: Permission denied
ls: cannot open directory ./var/spool/cron/crontabs: Permission denied
ls: cannot open directory ./var/spool/cups: Permission denied

While the incantation worked, it did report a lot of permission denied error messages (from ls). With more polish, these error messages could be trimmed out, but excluding terms is a more difficult task than I had initially planned for. Furthermore, I can not use find as a control, as it only searches the current working directory, and not the entire filesystem.

Analysis

Based on the data collected:

  • Was your hypothesis correct?
    • yep
  • Was your hypothesis not applicable?
    • I'm not sure
  • Is there more going on than you originally thought? (shortcomings in hypothesis)
    • Yes, there are directories that cannot be read by ls because of permissions. Each one spits out an error, and at the end, there are too many errors.
  • What shortcomings might there be in your experiment?
    • The experiment was flawless and a golden model of the scientific method. Although I totally shafted myself on the control, as my control method was not applicable.
  • What shortcomings might there be in your data?
    • There was too much data and no control.

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.

It is my thought that many utilities that exist in linux today began as simple incantations. These incantations were imperfect and left much to be desired, and so, ambitious folk went to work modifying, tweaking, polishing, and adding functionality to these once one-line incantations.

Part 2

Entries

Entry 1: October Day, 2012

LETS PLAY WITH PS1!!

There are several PS lines to work with, and right now, we are going to play with the PS1 line. PS1 is an environment variable and is determines what your prompt looks like. Maybe you'd like your prompt to show the absolute path that you are standing in. Maybe you'd like to play your ego and have your prompt beg for a command (kinky). There are many ways to customize your prompt, especially when you start working with the other PS lines. You can even change your color scheme!

lab46:~$ echo $PS1
\h:\w\$
lab46:~$ PS1="victory@\h:\w\$"
victory@lab46:~$PS1="\u@\h:\w\$"
dsherbur@lab46:~$PS1="\u@\h:\W\$"
dsherbur@lab46:~$PS1="\s\\\T\j\#\\\$""
> ^C
dsherbur@lab46:~$PS1="\s\\\T\j\#\\\$"
-bash\T06$whoami
dsherbur
-bash\T07$PS1="\s;\T;\j\#"job"\\\$"
-bash;12:21:10;08job$PS1="\s;\T;\j\#"job"\\\$  "
-bash;12:21:26;09job$

Dates, hosts, jobs, command numbers, and thats just PS1! Working outside of lab46, like, say, on Ubuntu, you can get programs like Bashish and really change the look of your terminal. However, changing the PS1 line in lab46 is only temporary and will revert to a default state when you log out and log back in.

Entry 2: October Day, 2012

LETS GET A JOB!!

So. we've learned a lot about using a unix/linux system, but where does that get us? Well, one route to go with this new-found knowledge is becoming a UNIX/Linux administrator. Junior admins can expect to make about 55k/year while senior admins can expect closer to 90k and up. Not too shabby. These positions can require a bachelor's degree and several years of experience in a related field such as IT. Job growth and compensation is set to increase over the next several years, thereby growing demand for technically inclined folks with a solid linux background. Careers in technology in general are set to grow in the future anyway, so this isn't much of a surprise.

Entry 3: October Day, 2012

FONT CHANGE (MAYBE)! I MISS ARIAL!!

After playing with the PS1 line for a bit, I realized how much I enjoy working with linux on my home computer. I looks a lot better, what with the color and screen resolution and all. So I wonder if I can change the font on lab46. This would be a good experiment.

Entry 4: October Day, 2012

UNIX IN GERMAN? LOLWTF!

In addition to UNIX Fundamentals and Calculus 3, I am also taking German 1. I think I'd like to live in Germany one day, hopefully before another republican gets elected president. To successfully expatriate myself, I need to be proficient in the native tongue of the country I am seeking to live in. I also need a set of skills that would get myself a job so I'm not homeless and stuck in a foreign country. So, my question is, is there a German language version of unix, more specifically bash? I know that German and English are pretty similar, and there have to be computer-related jobs in Germany as well as the rest of the developed world. Do they have a different set of commands that make sense to a German-speaking programmer? Regular expressions would stay mostly the same, but what about commands like cd and ls and cat? On article I read said that even though Linus Torvalds was from Sweden and learned English as a second language, he preferred using it when talking about computer stuff to his comrades, even if they spoke English as a second language. There is some talk about English having a more extensive technical vocabulary, and that if programming languages like C and bash each had a different version to agree with a certain natural language, it would be a massive project and it most likely would never be finished. So, I guess being a natural English speaker is going to make me a wizard in Germany someday.

Keywords

Keyword 2 Phase 1

alias

Definition

Definition (in your own words) of the chosen keyword.

Alias: semantics applied to the command shell. An alias is a string substituted for another string. If, for example, you always need to use the -l option to ls, you would be typing ls -l and potentially wasting 3 keystrokes. With the help of alias, we can make a more terse command that accomplishes what you want without typing more than is absolutely necessary.

lab46:~$ alias lsl='ls -l'
lab46:~$ lsl
total 72

Alias can also take pipes, which means you can write very lengthy incantations, and instead of typing the whole thing out or trolling through your history to use it again, you can make an alias and make your life a touch easier.

lab46:~$ alias lsl='ls -l | wc -l'
lab46:~$ lsl
30

Aliasing can be used to customize your commands, as well as to play some cruel pranks. If someone walks away from an open terminal, you could alias one command to something completely different, like alias vim='cd /; cat *', or alias cd='cat /dev/random'.

References

List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).

Keyword 2 Phase 2: I/O Redirection

Definition

There is no clear definition for I/O redirection but both of these in the UNIX universe in particular are actually two components of our interface that we use at every given moment while actively using the terminal or even this browser. The Input is coming from your computer's keyboard or terminal keyboard while the Output is what you see on the monitor typically, such as in the Lab46 Terminal, the text you see is the output. In the middle of both input and output is actually where all the processing happens, this is key to the redirection as it has an effect to where the output will be directed. There are two kinds of I/O redirection, them being represented by the less than and greater than symbols ><. The less than < symbol is what does input redirection, commonly useful for when a program doesn't read files but reads from standard input, for example, you can have file1 send its contents to a mail of some sort like jackrabbit@rabies.org and the command would look something like this: mail jackrabbit@rabies.org < file1

The greater than > symbol does the “opposite” and is used in a different scenario. Say you wanted all the output you receive from issueing an ls -l command to be put into file2. Just do ls > file2 and all that output will be within the file.

Some other important concepts about I/O redirection is usage of the pipe | and the semicolon ;. The pipe and semi are used when you want to use more than one command at one time, but the difference between the two is crucial to a successful incantation. The pipe will redirect output from the initial command into the next command while the semicolon will not redirect any output into the next command, it will just perform it as if you were doing it singularly. A situation where the semicolon is crucial is if you have a cat command following your initial casting.

Now when you use the output redirect, one thing to keep in mind is that if you send another piece of output into file2 with a single >, it will overwrite the file with that new output and the old output from ls -l will no longer be there.

References

  • O'Reilly Learning The UNIX Operating System

Demonstration

Demonstration of the indicated keyword.

If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:

/*
 * Sample code block
 */
#include <stdio.h>
 
int main()
{
    return(0);
}

Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:

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

In my first experiment, I tried to make an incantation that combs the entire filesystem for a search parameter. Its kind of primitive, and most of the output is error text. We can redirect that error text to clean that up a bit (wedge).

Experiment 2

Question

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

Resources

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

Hypothesis

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

State your rationale.

Experiment

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

Data

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

Analysis

Based on the data collected:

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

Conclusions

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

Part 3

Entries

Entry 1: November 28th, 2012

Today, I found something to get bash, or something like it, onto a windows environment. I like bash, and I don't have much experience with the windows command line interface. I have heard terrible, terrible things, though. This is important because the computer I am currently working on (I have named it “REDTOP” /cruise) has a locked uefi bios that will not allow me to install linux. I tried my damndest to no avail, but there are people, wizards I think they are called, working on a fix for this problem. If I had spent 1000 years in the astral planes consuming the souls of angles and dead stars, I might be able to aid them in their glorious battle. But alas, my experience renders me a mere child when palely compared to they, and I am not fit to lend my axe, let alone feast beside them in Valhalla. This could be significant because I almost always have this computer within arms reach, and when I want to do linux work at home, I have to get up and walk all the way across the room to one of my other computers, restart it, and boot up linux (so many steps!) just to get my bash on. Hopefully, this program called Cygwin will be an adequate solution. If, by some strange grace, someone is reading my barren opus, they may find the link to this Philosopher's Stone here:http://cygwin.com/ . I must say, though, it smells of fool's gold.

Entry 2: November 28th, 2012

After installing Cygwin and using it for about 5 minutes, I can say that I just might be happy with it. It is lacking a few things like ssh so I will have to find a new way to connect to lab46. There is a root directory and I was able to run my favorite incantation cat /dev/random, although this caused my terminal session to end… After a little research, I found that most packages are not included with a default install. I must re-run the installer and select those packages I want it to include, like python, games, openssh, etc. When I installed it before (for the first time), the process took about 5 minutes from start to finish with a prompt in my face. This install could take a while longer, since I went a bit inclusion-crazy.

Entry 3: November Day 30th, 2012

So I was thinking about why my favorite command (cat /dev/random) casues cygwin to crash. When I run it in lab46, it can run for as long as I care to let it run until i decide to kill it. I think there might be some sort of resource manager on lab46 that prevents overflows, and, I think, my computer has no such manager, allowing the command to make full use of my 3rd generation i5 processor. This could be a good experiment, but I dont think it is within the scope of my abilities.

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:

  • What action or concept of significance, as related to the course, did you experience on this date?
  • Why was this significant?
  • What concepts are you dealing with that may not make perfect sense?
  • What challenges are you facing with respect to the course?

Remember that 4 is just the minimum number of entries. Feel free to have more.

Entry 4: November Day, 2012

THE BEAUTY OF UNIX ON THE HOMEFRONT! GAMES, MOFO!!

Let's talk about something important. There is an incredible disparity among high school educated suburbanite white males aged 18-30, and that disparity lies in each of those males' choice of video gaming platform. The two most notable nations in this discussion are PC and console gamers. PC gamers are treated to incredible graphics capabilities along with the pure utility provided by a PC. Console gamers are locked in a 10-year cycle where the hardware is unchanged and unchangeable with very little additional utility. One exception to this rule was the PlayStation 3, which could be made to run linux. However, after a recent patch to the core of the system, this functionality has been axed. The USN was using a cluster of linux PS3's for super-computing and now they are stuck with a few hundred bricked playstations. Furthermore, PC gamers, through the help of services like Steam, can get great deals on great games. Almost any game that comes out for both PC and console will be cheaper to purchase on PC sooner than consoles. For example, it takes about 6 months for the price to drop on the Steam store, where it could take a year or more for a game to be added to Xbox's Platinum Hits collection. This is all well and good for a PC gamer operating on a Windows platform, but graphically intensive block-buster games are virtually nonexistent on a linux platform. But that could be changing soon. Steam is working diligently to get their entire library of titles to run on a linux platform, provided that the end-user has to hardware required to run those titles. Why is this important? Because linux needs gamers. Also, I am planning on building a gaming computer within the next year and it would be just super if I could limit my dependence on Windows. This could help linux become more mainstream. Many linux-using gamers are forced to dual boot with windows just to play their games. What a travesty! If Steam can get this project on the fast track, these users would use windows even less.

Keywords

unix Keyword 3

Identification of chosen keyword: umask

Definition of umask

The command umask is used to determine file modes at creation. Using umask on a file will determine the permissions of that file and all child processes resulting from that file. umask was used on Super Puzzle Box 2 Turbo (vim setup.exe). Where chmod changes permissions on a file, umask sets the initial permissions. In Super Puzzle Box 2 Turbo (the best Puzzle Box this side of the Danube), when the datafile is created, umask is used to set permissions to (octal) 777, ensuring that permissions will not be an issue when working with the file.

lab46:~$ umask u=rwx,g=,o=
lab46:~$ mkdir goop; cd goop
lab46:~/goop$ touch trees
lab46:~/goop$ mkdir pain
lab46:~/goop$ ls -l
total 0
drwx------ 2 dsherbur lab46 6 Nov 14 15:19 pain
-rw------- 1 dsherbur lab46 0 Nov 14 15:18 trees

Setting the umask values to what would be octal 700, which gives all permissions to the user and owner and no permissions to group or other, I have made private files. Changing umask again changes the permissions of newly created files.

lab46:~$ umask u=rwx,g=rwx,o=rwx
lab46:~$ cd goop
lab46:~/goop$ ls -l
total 0
drwx------ 2 dsherbur lab46 6 Nov 14 15:19 pain
-rw------- 1 dsherbur lab46 0 Nov 14 15:18 trees
lab46:~/goop$ touch park
lab46:~/goop$ ls -l
total 0
drwx------ 2 dsherbur lab46 6 Nov 14 15:19 pain
-rw-rw-rw- 1 dsherbur lab46 0 Nov 14 15:22 park
-rw------- 1 dsherbur lab46 0 Nov 14 15:18 trees

Note the difference in the umask line from the first block to the second block. We can use this to prank people who leave their terminals open by setting the umask vales to 0 across the board, making files that they create themselves unaccessible. However, umask can be changed and the files created under the permissionless umask and be changed via chmod to be accessible.

lab46:~/goop$ umask u=,g=,o=
lab46:~/goop$ touch jello
touch: setting times of `jello': Permission denied
lab46:~/goop$ ls -l
total 0
---------- 1 dsherbur lab46 0 Nov 14 15:26 jello
drwx------ 2 dsherbur lab46 6 Nov 14 15:19 pain
-rw-rw-rw- 1 dsherbur lab46 0 Nov 14 15:22 park
-rw------- 1 dsherbur lab46 0 Nov 14 15:18 trees
lab46:~/goop$ vim jello
lab46:~/goop$ chmod 777 jello; ls -l
total 0
-rwxrwxrwx 1 dsherbur lab46 0 Nov 14 15:26 jello
drwx------ 2 dsherbur lab46 6 Nov 14 15:19 pain
-rw-rw-rw- 1 dsherbur lab46 0 Nov 14 15:22 park
-rw------- 1 dsherbur lab46 0 Nov 14 15:18 trees

When I vim'd jello, i was greeted with a permission denied screen and I was unable to modify or write to the file, verifying the initial permissions of the file.

References

List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).

  • Reference 1
  • Reference 2
  • Reference 3

unix Keyword 3 Phase 2

whiptail/dialog

Definition

Whiptail and dialog are used to make interactive dialog boxes from shell scripts. A good example of these programs at work is GIMMEH. It is important to note that a command line interface is not always the best solution. Sometimes, information is better presented in a more graphical manner, even though the mouse is still mostly vestigial.

References

List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).

  • Reference 1
  • Reference 2
  • Reference 3

Demonstration

Demonstration of the indicated keyword.

If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:

/*
 * Sample code block
 */
#include <stdio.h>
 
int main()
{
    return(0);
}

Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:

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

Experiment 3

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.

opus/fall2012/dsherbur/start.txt · Last modified: 2012/12/31 09:33 by 127.0.0.1