Every workstation in Henn 205 has all the same accounts as
the server hyper.phas.ubc.ca, to which you can log in remotely
using ssh (which see).
In the following, "hyper" denotes any of these computers;
"~
" (tilde) refers to your hyper
home directory
(same as the environment variable $HOME),
and all file and directory references are relative to that home directory.
You will also be copying files owned by user ~phys210
(the course's home directory on hyper).
Be sure to read and follow all instructions carefully,
as your grade will depend on certain files being in the right places
with the right names. Remember, case matters!
For the tasks below you will need a plain text editor. A few choices are vi, pico, nano, gedit, kedit, nedit, xedit, emacs or xemacs; pick one you like. There are others, but they all have the common feature that they display the raw ASCII characters in a file as you type in or delete or move or modify same. DO NOT try to use a wysiwyg ("what you see is what you get") application like M$-Word or any of the other "word processors" and "Web page editors". I want you to understand HTML (for example) as a simple typesetting language with a straightforward (if primitive) syntax. The wysiwyg applications insert lots of proprietary, encrypted or nonessential garbage; we will know if you use one, so don't!
As always, ask or e-mail me and/or the TAs right away if you encounter problems or don't understand something.
Almost everyone completed the survey; thank you! I'd be interested in hearing why a few declined to complete it. This will be requested two more times, once at mid-term and finally at the end of the course. Remind me if I forget. You can of course update your entries any time; we just take "snapshots" now and at mid-term.
When bash starts up in your Terminal window,
the first thing it does is read the
instructions and commands stored in its own special
resource (rc) file,
.bashrc,
that lives in your $HOME directory.
If you have no ~/.bashrc
file, bash will use the
system's default /etc/bashrc file,
but, as Billy Holiday said,
"God bless the child who's got his own!"
So let's.
I have provided an example .bashrc file
in the
Another goof on my part: I should have asked you to copy
your ~/.bashrc file to your a02 directory
on /home2/phys210/ so that only the markers and I could read it;
your original ~/.bashrc file should not be readable,
even by us, lest everyone else be able to read it too.
Same problem for .aliases.
Of those who left ~/.bashrc readable so we could check them,
very few made any customizations of the original
.bashrc from ~phys210/. I suppose this reflects
justifiable paranoia, since a seriously corrupted .bashrc
might prevent soccessful login.
~phys210/
directory.
First rename ("mv")
any existing .bashrc file
to .bashrc-old (or whatever makes it easy to remember,
in case you decide not to use mine) and then
copy ("cp")
the example to your own $HOME directory.
Edit .bashrc to suit your taste,
using "source ~/.bashrc
"
to reload the file and
check the effects of your editing.
if [ -f ~/.aliases ]; then
source ~/.aliases
fi
There are a few simple examples in the sample .aliases file
provided in the ~phys210/
directory.
These are either self-explanatory or easily decrypted,
but they lead the way to greater convenience and power.
The examples shown are typical in that their purpose
is either to safeguard against careless boo-boos
(like "rm *") or to provide a more mnemonic
alternative to weird shell command names (like "ls")
or to "bundle" a lot of frequently used "switches"
(the letters following minus signs in a shell command)
into one easily remembered personalized command.
Basically, if you find you are always doing something the same way
and you get tired of typing in the same details over and over,
alias can be a big time-saver.
The last example in ~phys210/.aliases
combines several commands into one,
using a semicolon (";") to string them together.
You can also combine commands using "&&" or "||
",
with slightly different effects. Try "man bash"
to learn more about the syntax of such combinations.
Or, better yet, go to one of the friendlier bash manuals on the Web.
Several are listed on our Website (see Manuals and References).
Finally, in your new .aliases file, add a few aliases of your own to "customize your shell" and make it more comfortable.3
When you have your .bashrc and .aliases files the way you want them, carefully enter the following commands:
mkdir /phys210/<you>/a02
ln -s ~/.bashrc /phys210/<you>/a02/
ln -s ~/.aliases /phys210/<you>/a02/
chmod -R o-r /phys210/<you>
chmod -R g+r /phys210/<you>
where "<you>
" is your account name on hyper.
What does each of these commands do?
Write your explanations in the file
/phys210/<you>/a02/readme.txt
(Hint: the chmod commands4
render the directory tree starting with
/phys210/<you>
inaccessible to others.5
NOTE: Unless we get it fixed by Thursday, the above commands will only work if you are logged in to hyper; for some reason they do not work from the workstations in Henn 205 yet. This is not difficult: just use the command
ssh -Y hyper.phas.ubc.ca
This was a mess, but it was our fault, not yours.
It is now taken care of by "brute force":
a script runs periodically that restores the proper ownership
and permissions to the entire /home2/phys210/ directory tree,
which I believe is also now successfully symlinked to the shorter
"/phys210/" on all the workstations, but just to be sure,
you should habitually refer to it by its full name (with the
leading /home2).
Eventually almost everyone got this part done.
~~~~
"
to ensure that you get credit for it!)
and then go see if you have anything to add to the "PHYS
210 CORE COMPETENCIES" page.
You are not required (or even encouraged) to change
the latter page unless you feel an urge to do so,
but you should read it and think about it.
This went pretty smoothly. Now that you know how to use a wiki, please feel free to use this one! But (1) please stay within the P210 section (make sure any new page you open includes "PHYS 210" in its title somewhere); and (2) tag any new entries with "~~~~". Editing doesn't require a tag, but every change is recorded, so don't think you can modify stuff anonymously.
public_html
in your $HOME directory on hyper
where you can "publish" Web pages.
It must be world-readable and -executable.6
The Department's web server will serve up a file in that directory
(e.g. ~jess/public_html/filename.html
) as a Web address7
http://www.physics.ubc.ca/~jess/filename.html
to any Web browser. I'll refer to ~/public_html
as your Web directory. By default, a visitor to the directory
http://www.physics.ubc.ca/~jess
(with no filename.html)
will be shown the contents of a file index.html (if it exists).
To prevent others from browsing all the files in your
Web directory, you'll want to create index.html there,
even if it's empty.
(To create an empty file, use "touch index.html".)
Feel free to use your Web directory for any purpose that does not
violate UBC's guidelines for computer use (or waste the Department's
resources and bandwidth frivolously). However, we need to reserve
a subdirectory for material related to this course. For that purpose
you need to "mkdir ~/public_html/p210
" to create a subdirectory
p210 where we'll know to look for your work.
In that subdirectory, create a non-empty file index.html
that displays your name, address, phone number etc.
If you are unfamiliar with
HTML syntax,
don't worry; plain text with a few formatting commands like
<br>
("break") for a new line and
<p>
for a paragraph will get you by.
There are several simple manuals
on our course Website if you get stuck.
You won't be marked on the elegance or complexity
of your new Web page, just on getting it set up and filled with
the information specified in the template file at
http://musr.physics.ubc.ca/p210/templates/index.html
which you can copy into your own directory
using the "wget"
command (a very handy command indeed).8
Use the plain text editor of your choice to make the specified (in the template) changes to the template index.html file. Add a few suitably labelled links to other Web pages that relate to your favourite topic in Physics or Astronomy. Feel free to add other information if you wish.
Next, log in to our course Website and Update your Profile so that your Work Web Page points to your own new Homepage. Check your work by verifying that you can get to your Homepage by going to our Course Homepage, selecting "Student Pages" and then your name.
Most people had no trouble with this part, and there were some cute homepages.
The most common errors were
Almost no one edited their index.html file into a form that
couldn't be displayed on a browser, though some were pretty drab and terse.
You can jazz it up later now that it is "up".
Thank you all for not resorting to any "Web design" editors!