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.
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
~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
~~~~
"
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.
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.