There are many ways you can work on the assignments if you already have
some experience with computers and programming. We do not wish to enforce
any given method for you to work on them, and if you feel confident you
can do it your own way, please use the tools you're familiar with. On the
other hand you can also try one of our methods in order to broaden your
knowledge of tools. For those who wish to try something different, and for
those who are not familiar with computers, we are going to present the two
different methods that we recommend for working on the assignments. But
first we will get everyone acquainted with the available resources from
School of Computing.
I. UNIX account
You should have registered for an SoC UNIX account by the time you
are reading this. This account is distinct from your NUSNET one, even if
you used the same identifier. The passwords can (and should be, security-wise)
different. Your UNIX account resides on a machine called sunfire, hosted
by SoC. This machine has two services that are of interest to us. The first
service is SSH (Secure SHell) which gives you access to a command line
interface, and is available at the sunfire.comp.nus.edu.sg
address. The second service is the Apache web server, reachable at the
II. First login
SSH Secure Shell program available under
Programs → SSH Secure Shell → Secure Shell Client
in the lab, click on the Quick Connect button and provide the following
and connect on it. The first time you connect from a given machine, you will be
asked to confirm that the server to which you are connected is the right one, by
verifying its fingerprints. Please refer to the SoC document repository's
feel the need to verify them.
If you feel confident enough, or once you have verified the authenticity of the
server, click on Yes, then enter your SoC UNIX account's password in the next
dialog box and validate.
If everything goes well, you should now have access to
a shell looking this way:
SSH Secure Shell 3.2.9 (Build 283)
Copyright (c) 2000-2003 SSH Communications Security Corp - http://www.ssh.com/
This copy of SSH Secure Shell is a non-commercial version.
This version does not include PKI and PKCS #11 functionality.
Last login: Mon Jan 14 12:51:58 2013 from kister-d980.d2.
DR3 & DR4, book at https://aces01.nus.edu.sg/fbs/jsp/index.jsp
Win8 and Printing: please see https://docs.comp.nus.edu.sg/node/2184#32
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
You have 0 New mail(s) in your Inbox.
Last login on sunfire0.comp.nus.edu.sg at Monday, January 14, 2013 12:51:58 PM SGT
Now enter the following commands (the $
symbol is the prompt, which tells
you that the machine is ready for you to type a command):
$ mkdir public_html
$ setfacl -s u::rwx,g::---,o:r-x,m:rwx,d:u::rwx,d:g::---,d:o:r-x,d:m:rw- public_html/
Important: Entering the second command manually is highly error-prone.
You can use copy/paste operations in the SSH client, though not with the typical shortcuts. Right-click in the window
to display a list of possible actions and their keyboard shortcuts.
The first command creates the directory in which the web server will look for files.
The second command ensures that everytime you create a file or a directory inside public_html,
it will get the necessary rights so that the web server can reach them.
The last step consists in downloading the Cascading Style Sheet (CSS) files used
by the assignment web pages. These files are used to describe to your web
browser what style (fonts, colours, margins, and much more) to apply to the
contents of a web page. For a striking example of what CSS allows, you can visit the
CSS Zen Garden
$ cd public_html
$ wget http://www.comp.nus.edu.sg/~gem1501/year1314sem2/assignments/assign.css
$ wget http://www.comp.nus.edu.sg/~gem1501/year1314sem2/assignments/highlight_js.css
III. Working on an assignment
A. Retrieving the file
If you want to work on the first assignment, numbered 00, you
must connect to your account by SSH and type the following commands (if you
already are working in the public_html directory, ignore the first command):
$ cd public_html
$ wget http://www.comp.nus.edu.sg/~gem1501/year1314sem2/assignments/assignment00.html
The first command changes the working directory to public_html, the
second command downloads the assignment file from the web server.
B. Visualizing your file
In order to see the result of your modifications to your file, you
have to use a web browser (Mozilla, Chrome, Opera, IE) and connect to
your account. If your Soc UNIX account is for instance u123456, it will
be available at (don't forget the ~ character):
C. Editing your file
1. jEdit, the easy way
JEdit is a very complete text editor written in Java. You can download and
install it by going to the following address:
One particularly useful feature of jEdit is the ability of one of its plugins
to transparently work over SSH, which means that you can edit directly the
files on the sunfire machine from any other machine on which you installed
In order to install the plugin, start jEdit and from the menu, open
Plugin → Plugin Manager, select the Install tab and write
ftp in the filter. You should be able to select the FTP plugin:
Install the plugin and Close the Plugin Manager. Now, in order to open a
connection to your account, click on
Plugin → FTP → Open from Secure FTP Server…
and fill the following form with the same values than in Section II of
Just like in Section II, the first time you use jEdit on a given machine
to connect to sunfire, you will be asked to verify the fingerprints:
Once you clicked Yes, you will be connected to your UNIX account and will be
ready to work on your assignments.
2. Command line interface, the less easy way
Alternatively, you can edit the file in the shell with editors such as
Retrieving all the files at once
You can retrieve all the assignments at once with the following command:
$ seq -w 0 19 | xargs -I% wget http://www.comp.nus.edu.sg/~gem1501/year1314sem2/assignments/assignment%.html
If you want to restart your assignment from scratch, you must first delete the
file then download it again (otherwise wget will add an extension to the file
in order to avoid overwriting it):
$ rm assignment00.html
$ wget http://www.comp.nus.edu.sg/~gem1501/year1213sem2/assignments/assignment00.html
If you want to try something new without losing your other changes, you can
create a backup copy of the file:
$ cp assignment00.html assignment00.html.backup
Later if you realize your new idea was no good, you can restart using the
previous version by doing a copy the other way around:
$ cp assignment00.html.backup assignment00.html
There are many more commands available that are beyond the scope of this
document, you can find a short listing
for instance. There are many resources available for learning UNIX commands.