CS 203 - Getting Started
The lab sessions for this course will be held in
a Bishop's computer lab administered by ITS, and
you log in to computers there with your general Bishop's username and
password. They have a choice of operating systems: Mac-OS or
Windows. Select your preference before logging in. (You may need to
reboot.)
However, during the pandemic, you may use any Bishop's computer that is available. N-113 is desirable as having only Mac-OS, The the other Nichols labs
have only Winddows, and J-118 offers a choice. You may want or need to use your own computer, and you have chosen your operating system.
3 reasons to use Mac-OS - these only apply to Bishop's computers that have a choice
- On starting up, the Mac-OS is booted (takes a minute.) Then it
gives a choice of Mac-OS or Windows. Choose Mac-OS, and you get a login
prompt promptly. If you choose windows, Windows will have to be
"booted", which takes another minute or more.
- ITS has a "deep freeze"
policy for Windows, necessary because of the mass ow Windows-specific
viruses.Therefore after you log in, it takes a minute to freshly set up
your own personal files.
- When you log out of Windows, there is another minute of delay
while all your local files (on the hard disk (C:) are destroyed. This means you must never save anything in
the default Documents, or you lose it. Then comes another
Windows login prompt. The next person can't get back to Mac-OS,
and must actually turn the power off and then back on to get it.
In Mac-OS, your Documents are not lost, but are only available on that same machine, so you should store
anything you want to access later on the ITS network, your folder
youracct$ a.k.a. M: in windows.
Osiris Accounts
For this course, you will be getting a separate account on the
server osiris.ubishops.ca. Your username will generally be
the first letter of your given name, then your family name, all
lower-case. (without any numbers) Your initial password will be given
in class, and also at the first lab session.
You got an email about it, or ask me
Troubleshooting
What if you can't "get to" osiris? (or linux) - you try to log in, you can't.
first of all, be aware that if you fail 3 times, your IP address
will be banned for 2 hours. This is because there are
robots that try to guess passwords, and may make oodles of tries.
This has resulted in "Timed out" responses,
when someone fails to connect.
So, ask yourself these questions:
- Do I know my (osiris) username? lower case, no numbers. Try:
https://osiris.ubishops.ca/youracct if response is
- Not Found -- then that's not your account, so ask me
- perhaps I didn't set it up
- Forbidden -- YES, that's an account all right, you just haven't
put the file index.html there yet
- Am I sure about my password? Have I forgoten it? - Ask me to set a new password - by email
- I tried and tried, but got a timed out message -
Probably your IP address has been banned.
This happens whenever at least three failed login attempts are detected
from one IP address in any 10-minute window. Do this:
- Wait two (2) hours
or go to https://www.whatismyip.com/ and copy " My Public IPv4"
and send an email to ljensen@cs.ubishops.ca (me), describing the problem, and giving your username, whether osiris or linux, and the IP address you just got.
- Try again ONCE
- Send an email to ljensen@cs.ubishops.ca (me), asking me to reset your password on osiris (or linux).
- Wait for my reply
- Try again, very carefully
- Is it time to call it a day?
A virtual linux style desktop
If you want to use Linux, you may also request an account on linux.ubishops.ca.
Username
and password as for Osiris. You can then get a remote
(virtual) desktop by using the application x2go, with an xfce session.
x2go should be on Bishop's computers, in a folder "Computer Science",
or upload to your own computer, from
https://wiki.x2go.org/doku.php
However, x2go has been found slow depending on network speed and load.
Instructions for Linux: (or skip)
- Log in to a computer with Mac-OS (or windows):
- Start the application x2go. Choose session type XFCE
- type your username (you will probably need to erase the name of
the previous user),
- type your initial password, which will be same as for osiris,
or ask me. (you will see just spots)
- Choose your own password.
- Once logged in, Open a Terminal from the "Applications" menu,
or search for "terminal". It gives you a window with a 'command line',
allowing you to do direct Linux commands. In this window, type
- passwd
(and press Enter) then when prompted, type your existing
password, and then your chosen password, two times. (You won't see anything
on the screen as you type -- not even spots) -- end each
password with the Enter key. (You will use the same method for
changing your Osiris password.)
- Open a browser, either Firefox,
Chrome, or Konqueror. Look at the course web
page, where you can find these instructions!
- Open a text editor, I recommend mousepad or gedit ("Text editor").
Find in Applications | Accessories. You might want to put your
favourite on the desktop.
Server - osiris
For this class, we are also using a computer named osiris for our
web server. Typically, you will edit your files on some client, such as
one of the J-118 workstations or your personal computer, and then
transfer them to whatever server is being used by your organization.
Osiris is running the Apache web server, which is used by a majority of
the world's websites. It is open-source, free software.
I will create an account for you on osiris, as mentioned above. Once
you have a file to transfer, follow these instructions:
Step by step for using the server
In these instructions, things you click on with the mouse
are shown bold, things you type in are shown in "tty"
font.
Some alternate instructions are provided for use away from
the lab, were you may not have the same desktop or utilities as in
Bishop's labs. We are assuming you have the same account name on both
systems. Otherwise, you'll have to connect to myothername@osiris
- Transfer your file(s) to osiris scp or sftp.
Don't
forget any images. :
- Use a terminal command (Linux or Mac-OS):
Be in the directory where your files are located, and type:
scp index.html osiris.ubishops.ca:www - to the remote directory www
scp index.HTM osiris.ubishops.ca:www/index.html
- can be used to "rename" the file as well
... and give your password when asked
(When usernames differ, instead of osiris..,
type myname@osiris.. instead)
You can get a file back by reversing the order
- Or, To use command - line sftp (This is sometimes more convenient when
you have several files to transfer}
- cd to the directory in which your
file is located, if necessary.
- type: sftp osiris.ubishops.ca
this
opens
a connection to osiris.
- you must now give your password for osiris
- type cd www to change to your public
subdirectory for web pages.
- type: put index.html
this sends the file index.html to osiris
- type: dir
to see that it is there. Notice the case of file
name. Unix file names are case sensitive, so you will have to refer to
it exactly as it appears.
- type: bye to get out of sftp
- In Windows, open WinSCP
- In Mac-OS, you can use
CyberDuck similarly.
- Check that your file is there, using your Browser (Firefox,
etc.). Your
address depends on your login name. For the login name "astudent", the
address is: https://osiris.ubishops.ca/astudent You won't be able to
see anything but a Forbidden message until you have a file
named index.html, unless you add a specific file name
(after another / ) you will see that file instead. index.html
should contain links to any other files you have. You will only
be graded upon files that are linked from index.html.
- Start a terminal, and start a ssh session on osiris: (see Putty instructions
if using Windows.)
ssh osiris
- You should be asked for your password. If you do not in
fact have an account, see me. If you didn't already change your
password:
- passwd
-- Enter your temporary password, then your chosen new password, twice.
It should be hard to guess (your name won't do).
- cd www Change to your public directory
for html pages. (your "home" directory is only visible to you, and not
reachable by apache.)
- ls
List your directory. (Unix
commands
are very short)
ls
-l
Check the permissions. Should be -rw-r--r--
- Test your html file from the location: https://osiris.ubishops.ca/youracct (naturally, your
account is different from "youracct")
How to do it from a "Windows" machine:
You will need to use 2 applications that are on the main Bishop's
system, and can be downloaded from the internet for your own computer.
- PUTTY gives the same functionality as using a Terminal window and
typing
ssh
- WinSCP gives "drag-and-drop" functionality between local and
remote machines. You may also use it to open a remote file for editing.
Using PUTTY
Start putty in ssh mode (not telnet). putty.exe is a
client for the telnet and ssh protocols. Putty is open source, GPL
licensed software. This means you may copy and use it, but may never
sell it. A copy that runs under windows is on Bishop's Windows systems,
in the desktop folder "Computer Science." You can also find a current
copy to download on the internet.
- Click on the desktop icon to start putty.
- In the connect menu, choose ssh. The system you
want is osiris.ubishops.ca You don't want to change anything
else.
- You will see a "login:" prompt. Type your login name (case
sensitive), and press enter.
- Continue with the regular lab instructions
Using WinSCP
- Double click on the WinSCP icon, if present, or find it
in the desktop folder "Computer Science"
- Type osiris.ubishops.ca in the host field,
also
your user name and password. make sure it says SSH or SFTP, not
FTP
- [At home, you can "Save" this session info.]
- Click on "Connect"
- You will eventually see two directory listings. On the left is
your local machine (the one you are sitting at). Change directory to
the one where your file is located. [Some versions have just the remote
listing, or you can choose this view option. In this case, you can
drag, copy, or paste between this and other windows.]
- Change to your subdirectory on osiris named: www. This
is your "public" directory, where you will put all your web pages, and
php scripts.
- Select your file(s) and drag into the right-hand window, or Click
on the arrow pointing right. Your file should now appear in the
remote (osiris) directory window, on the right. It may be several bytes
shorter than the original, this is because Unix stores new lines
differently.
- Verify that the name is what you want, beware that Unix is case
sensitive. You may rename it using SCP, or in your Putty session.
- Exit WinSCP, or keep it open as you like.
Please bear in mind that a file in
your home directories at Bishop's (M: or acct$), on Linux, on Osiris,
and on your own computer are 4 distinct entities, any changes you make
must be copied to the other places!
Tools
Editors
Since all the file types we will edit (except images) are plain-text
files, you will want to use a plain text editor. Also, since computers
are very picky about syntax, it is an enormous advantage to use one
with syntax highlighting (All those
listed here). This will make it easier to read your code, and
spot errors. Most also match up parentheses. They will do this for many
different file types, as soon as you save the file with proper
extension (e.g.. .html, .php, .css) Note that they don't all use the
same colour scheme, but one gets used to whatever is in use.
- atom - (Mac)
- notepad++ - for Windows. Good syntax highlighting
- jedit - Good highlighting, found on the Bishop's computers. (Any OS, since it is a Java application)
- kate - (linux) Can have
several files open. Great syntax highlighting, and convenient file
system browser and built in Terminal.
- kwrite - simpler, same great highlighting, opens new files in
separate windows.
- avoid notepad -
The bare minimum (can't handle files created in Linux.) No syntax hilighting
Terminal Editors
Designed to operate in a plain text (not GUI) environment, these are
fast, and can be used through a terminal ssh or putty session to edit
files directly on the server. Great for quick repairs!
- nano - intuitive, with command summary (for using control keys)
at the bottom. Decent syntax highlighting, providing a file named
.nanorc is installed, or in your home directory.
- vi - excellent syntax highlighting, guaranteed availability on
all UNIX (including Mac and Linux) systems, takes getting used to, I
have a nice 1 page summary sheet if you are interested. When it loads,
most keys are commands, to get into INSERT mode, type 'i', to get out
type the ESC key. To exit, you need to type :wq (You need to know that should
you ever end up in vi for some reason)
Browsers
There are many. Because html and css are based upon standards, your
pages should be rendered approximately the same in any browser, and are
subject to the default settings of each, configurable by individual
users. In particular many people set their browsers for particular
fonts and sizes. (Older people often prefer larger type! Blind people
use Aural or Braille browsers.)
- Firefox - full featured, plug-ins available for most content.
Good security alerts and pop-up blocking. Available for most platforms.
Free open-source software from Mozilla Foundation.
- SeaMonkey - Also from Mozilla, includes also composer, mail,
newsgroups, and IRC chat.
- Internet Explorer - Least likely to follow standards, widely used
simply because Microsoft "gives" it away with their operating system.
Should you use any "cutting-edge" JavaScript techniques, you should
test them also on this browser.
- Safari - Mac-OS native browser
- Chrome - from Google, probably well kept up to date for new
features.
Back to Contents
Home page of Lin Jensen