If you plan to do the exercises on lifa (or molveno), you only need an internet connection and a terminal emulator with ssh capabilities. There is a terminal emulator for Windows—PuTTY—which should do just fine. MacOS and other *BSDs and Linux-based systems all have built-in terminal emulators.
Lifa runs Linux (as most servers do) so it is best, although not strictly necessary, to use a Linux system for this course, especially if you plan to do exercises on your own box. You can get a running Linux system in a multitude of ways, for example:
Install Ubuntu on you laptop. It takes about half an hour (somewhat longer if your have to shrink the existing partition).
Simply run Ubuntu from a 2G+ USB stick on any computer bootable from USB – the computers in the excercise room are bootable from USB (though all disk operations will be much slower than with a hard disk).
Run Ubuntu in a VirtualBox.
All your excersises and the project should be uploaded and built on lifa (or on molveno). You can either work directly on lifa through the internet—the default way—or you can work on your personal computer and then upload the exercises to lifa, but you still have to build them there.
Get yourself a username on "lifa.phys.au.dk", the IFA server.
You probably have one if you have an email account at IFA (an NFIT account). If your email is "pks05@phys.au.dk" you username on lifa is "pks05".
If not go to NFIT help-desk (1525-415) and get yourself an NFIT account and NFIT password.
From inside the IFA firewall you login on lifa with your NFIT username and your NFIT password.
To login from the outside of the firewall you need a pair of RSA keys – a public key and a private key. The private key should be kept on your private computer you login from; the public key has to be added to the "authorized_keys" file on lifa (as described below).
Login on you lifa account.
You need to run a program called "terminal emulator" or simply "terminal". On older Ubuntu click Applications→Accessories→Terminal. On newer Ubuntu click on launcher (in the upper-left corner) and type "terminal", then click on the appeared terminal icon. On Mac run the utility "Terminal" in the Utilities folder in the Applications folder. On Windows you can use PuTTY, which is installed on the computers in the excercise room.If you are inside the firewall—for example on one of the computers in the exercise room—login on lifa with your NFIT username and NFIT password using secure shell:
ssh your_username@lifa.phys.au.dk
where instead of "your_username" you have to type your actual NFIT
username. It might ask you whether you trust lifa – answer "yes"
without quotes. Then it will ask you for your password – type in
your NFIT password. If everything goes right, you are logged in on lifa.
On windows run PuTTY and specify "lifa.phys.au.dk" without quotes as the destination. Then login with your NFIT username and password. It might ask you whether you trust lifa – answer yes.
If you plan to login from outside of the IFA firewall, you have to set up a pair of RSA keys – a private key and a public key. The public key has to be added to the authorized keys on lifa and the private key has to be kept privately on your private computer you will be loggin in from.
If you have already set up the keys, go to the next item.
Otherwise, the official instructions (also for PuTTY) are here in English and here in Danish. If you can't read them, here are the unofficial instructions for a Linux system:
If you don't have a suitable pair of personal RSA keys, create them with ssh-keygen command on a linux system (you can also do it on lifa itself by loggin in from inside the firewall with NFIT username and password as described above) by issuing the following commands at the terminal
cd
cd .ssh
ssh-keygen -t rsa
It will ask you for a passphrase which you have to make up and
remember – there is no way to restore the passphrase if you forget
it. The passphrase belongs to the key and has nothing to do with your
NFIT password. Do not use a blank passphrase!
If everything goes right, a private key, called "id_rsa", and a public key, called "id_rsa.pub" are generated in your .ssh directory.
If you have generated the keys on lifa itself and assuming you
are connected to lifa from your private Linux box to be used to login
from outside, do right after the ssh_keygen command
cat id_rsa.pub >> authorized_keys
this will add the public key to the authorized keys on lifa. Now logout
from lifa with the exit command and copy the private key to
your private computer using the secure copy command
scp your_username@lifa:/usr/users/your_username/.ssh/id_rsa ~/.ssh/
You can now login from outside of the firewall using this system.
Using a computer with a terminal emulator from inside the firewall:
cd
cd .ssh
nano authorized_keys
Using a computer with X-windows system inside the firewall. You can get one by booting an Ubuntu live USB or live CD on a computer in the excercise room:
-X option: you will need it to run Firefox on lifa):
ssh -X your_username@lifa
firefox --no-remote &
in this firefox, go to your email, get your attachment, and save it in
the .ssh directory.
cd
cd .ssh
cat id_rsa.pub >> authorized_keys
ssh your_username@lifa.phys.au.dk
It will ask you for the pasphrase of the public key.
Once you have logged in on lifa try
ssh your_username@molveno
Molveno is the dedicated server for numerical methods. Your home
directory is the same as on lifa.
Molveno should have more recent software as compared to lifa and I can install extra software on molveno should you need some.
Prepare the directory for the exercises:
Create the directory for the exercises using the mkdir command:
mkdir -p ~/public_html/numeric
where ~/ is the abbreviation for you home
directory.
Now the URL http://www.phys.au.dk/~your_username
points to your ~/public_html/ directory, while
http://www.phys.au.dk/~your_username/numeric points to your
~/public_html/numeric directory which should then be the
place for your exercises.
Change the permissions to allow the others see
your ~/public_html directory,
chmod -R go+xr ~/public_html
You might need to issue this command again after you have created some
new files.
If you do not wish the others to see a certain file, for example
my_secret_file, do
chmod go-r my_secret_file
Try it out
Create a "test" sub-directory in your numeric directory
mkdir -p ~/public_html/numeric/test
and go there
cd ~/public_html/numeric/test
Hint: the tabulator-key on the left of the keyboard does "completion":
it tries to complete—in a smart way—the words you type.
You only need to type the (qualified) beginning of the name and then
pressing tabulator-key will complete the name for you.
Pick your favourite text editor. If you don't have one, try nano –
it is very simple. You only need to remember that, for example,
^X in the menu list at the bottom of the window means
pressing the Ctrl-key (usually bottom left) and the x-key (often between
z and c) together, with Ctrl-key first.
A very popular GUI text editor is gedit but you need a computer with an X-window system installed to run it (linux-based systems, like Ubuntu, usually have it installed by default). For example, you can boot the computers in the computer room off an Ubuntu Live CD or USB and work from that.
test.c with the content
#include <stdio.h>
int main(void)
{
printf("hello\n");
return 0;
}
cc test.c
./a.out
the word "hello" must appear on the screen if everything goes right.
htp://www.phys.au.dk/~your_username/numeric/test