welcome: Login

Lab 0

Today you'll be setting up your CSE account, doing a few basic things in Linux, writing some code, and submitting your first assessment. We're hoping that you'll learn enough today to get you through the semester.

Your CSE account is very important, as most CSE lecturers will use this as a primary way to communicate with you. It is also what you will use to submit your CSE assignments throughout your degree, and it gives you access to the 17 CSE labs on campus. We recommend that you safeguard your password closely.

If at any time you need assistance, raise your hand, or walk over to one of the Lab 0 supervisors.

If there are any problems with this Lab0, i.e. typos, broken commands, send an email <csesoc DOT tech DOT head AT cse DOT unsw DOT edu DOT au> with the problem details, i.e. the command you did or the part of the document with the mistake.

Activate Your CSE Account

  1. Know your student ID number and unipass
  2. Login (as a new user) to one of the computers in the lab
    • Username: <your ZID> <press enter or return don't press the session button>

    • Password: <your Z Pass>

  3. In the next few days you will be emailed the yellow form.
    • /!\ Read the Yellow Form carefully. Don't just acknowledge without reading, because you are legally bound by the terms. At the end of the page, press the button ACCEPT YELLOW FORM AND ACTIVATE ACCOUNT

      • Basically, don't use your CSE account for anything questionable. This includes, but is not limited to:
        • Hacking
        • Phishing
        • Software piracy
        • Harassment
        • Identity theft
        • Plagiarism (this is a big one! CSE takes plagiarism VERY seriously, be sure to read this section carefully)

Getting Online

When you log in, you'll get a blank screen, perhaps with a couple of terminals open, and a bar at the bottom. This is the fluxbox window manager.

loggedin.png

Fluxbox has a simple menu you can access by right-clicking anywhere on the desktop. Have a look around the menu, and open up a web browser. It's under Applications -> Network -> Web Browsing -> Iceweasel

right-click.png

Course homepage

The first place you want to visit is the homepage for your CSE course. This is where you go to get lecture slides, assignment specifications and updates, and important announcements. You may also want to take note on who your tutor is and note down contact details in case you have questions about course content.

Undergraduates

If you're enrolled in a CSE degree, you should be in COMP1917, it's homepage is at:

http://www.cse.unsw.edu.au/~cs1917

If you're in another degree, like electrical or mechanical engineering, a non-computing science major, or anything else, you're probably enrolled in COMP1911, it's homepage is at:

http://www.cse.unsw.edu.au/~cs1911

Note: If you are a computing degree student (Computer Science, Computer Engineering, Software Engineering or Bioinformatics) and you're enrolled in COMP1911, not COMP1917, tell one of your Lab 0 supervisors NOW.

More info on which course to take can be found by clicking here.

Postgraduates

Even if you are not enrolled in COMP9021, go to http://www.cse.unsw.edu.au/~cs9021/ where you will find an introduction to Unix.

More generally, go to the homepage of any of the courses you are enrolled in (by replacing 9021 with the right four-digit number) in order to familiarise yourself with the course outlines, that should be accessible from the corresponding homepage.

All

Browse around your course homepage, and see if you can find out who your tutor is, and what their email address is.

CSE Email

By default, your CSE mail will redirect to your zMail. This means you only have to check one email, but you have to check it, as your lecturers will contact you at your CSE mail often and expect you to read it.

If you forward to your zMail [default]

If you use zMail, be sure to login to Identity Manager and zMail to check your settings.

If you want to keep your CSE email separate

You can disable the default forward at https://status.cse.unsw.edu.au/Control_Panel/Mail/Forwarding You may forward your zMail to your CSE mail, which can be configured at http://idm.unsw.edu.au, and your CSE mail can be accessed using any of the methods described at http://taggi.cse.unsw.edu.au/FAQ/Reading_mail

All

Anyone enrolled in a CSE course should check their email account at least once a day. Important information from your lecturers, course administrators and student societies are sent here. If you have un-redirected your CSE email, you can get to your email online by going to:

http://webmail.cse.unsw.edu.au/

Undergraduates only: Log in with your CSE account, click 'Compose', and send your tutor an email, introducing yourself.

If you're interested in forwarding your CSE email to another account, go to https://status.cse.unsw.edu.au/Control_Panel/Mail/Forwarding

Working with the terminal

Now for the fun part! If you get stuck with any of this, don't hesitate to ask one of the Lab 0 supervisors for help, that's why we're here!

If there isn't a terminal open, right click on the desktop to bring up the Fluxbox menu, and click 'Applications -> Terminal Emulators -> XTerm'. This will bring up a window where you can type commands.

xterm.png

There are a few commands you can use to check your account details:

ipq tells you how much of your internet quota you've used up (from browsing the web) rquota tells you how much of your disk quota you've used up (from creating files) pp tells you your name, what classes you're in, where your home directory is, how much print quota you have and how much ip quota you have.

Each of these is a command, and when entering into your terminal, you need to press enter (or return) after each command. Try the three we just mentioned above.

ipq.png

Now we're going to learn about 4 commands for working with files: pwd, ls, mkdir and cd, and one text editor gedit.

pwd stands for Present Working Directory, and it tells you where you are. If your username is 'dgcl807', and you enter the 'pwd' command into the XTerm, it might tell you:

/import/cage/1/dgcl807

This means I'm in dgcl807's home directory (sort of like My Documents, where you keep all your files), and my home directory is stored on the fileserver called 'cage'. What does pwd say for you?

ls prints a list of the files in the present directory. You have a fresh account, so your home directory contains only your website, in a directory called public_html.

mkdir makes a new directory (directories are like folders in windows).

type:

mkdir cs1917

(or cs1911 if you're a 1911 student, or cs9021 if you're a 9021 student), to make a directory to keep your work for that subject.

now type:

ls

again, and you should be able to see the directory you just created

cd stands for 'change directory', to move into the new directory you just created, enter each of these three commands:

cd cs1917
pwd
ls

The 'pwd' should confirm you've now moved into your new directory, and 'ls' will confirm that it's empty. Now it's time to make a file.

Your First Program

Type:

gedit lab0.c

This will open up a graphical editor where you can manipulate text. When you save, it will place the contents of the editor into the file 'lab0.c'. C is the programming language you'll be learning this semester, here's a simple example of C, copy it into the gedit window, and save. Don't worry, you're not supposed to understand it, yet (unless you're an experienced postgrad). :-)

#include <stdio.h>

int main(int argc, char *argv[]) {

   printf("Hello World!\n");
   return(0);
}

gedit.png

Once you have saved, open another XTerm, cd to your cs1911/cs1917/cs9021 directory, and type these two commands on the command line:

gcc -Wall -Werror -o hello lab0.c
./hello

The first command should have no output. Generally, no output means no problems. Hopefully the second command will say "Hello World!". If you have trouble, ask a Lab 0 supervisor.

(!) Congratulations, you've just compiled your first computer program on a CSE machine!

Now usually when you do assignments or labs, you'll need to submit your program using 'give'. To submit this work, run the command in an XTerm (use cs1911 for 1911 students):

/!\ if you are enrolled in COMP9021 do NOT run this command, it won't work

give cs1917 lab0 lab0.c

Read the prompts and type yes a couple of times. The give system will perform a dryrun, which will test that your program works correctly.

Submission: lab0
------------------------------
Files found: lab0.c
------------------------------

Running submission through simple test...

Checking your submission...

Compiling your submission...

Compiles OK

Testing your submission...

Well done! Your program passed the simple test.

If you see the message above, you have completed lab0 and will get your marks. If it didn't work, try following the suggestions in the output, or ask a supervisor for help.

When you wish to leave, make sure you log off! To do this, right click anywhere on the desktop, and select 'Exit' from the menu.


Uniwide

There is free WiFi with no download quota covering most of UNSW called uniwide. You can find setup instuctions for uniwide here(http://www.it.unsw.edu.au/students/uniwide/index.html).


Accessing your CSE Account From Home

If you are interested in installing Linux on your laptop or desktop computer, CSESoc is holding a Linux Installfest on Saturday, March 10th, where we can help you get it up and running. More details will be sent via email and the Beta newsletter in the coming weeks.

Linux

Open up a terminal and type:

ssh -X username@login.cse.unsw.edu.au

The '-X' allows to run graphical applications such as gedit. If you are only going to use the terminal, you can leave it out.

Enter your CSE password, tada! You're now sitting in front of a terminal on one of CSE's login servers. You can access your files, print things, etc. as if you were in one of the CSE labs.

Mac OS X

CSESoc recommends that you go to a CSESoc Linux Installfest as soon as possible!

In the mean time, go to Applications -> Utilities -> Terminal and follow the same instructions as for Linux.

If you are using a version of Mac OS X Older than 10.5 (Leopard), you will not be able to use the -X option unless you install 'X11' from your Mac OS X CD (in the 'Additional Software' category). There are also several non-graphical editors available on the CSE systems, try out one of these: nano, vim, emacs. You can ask your tutor if you want to learn more about these editors.

Windows

CSESoc recommends that you go to a CSESoc Linux Installfest as soon as possible!

In the mean time, you can download 'putty' from http://www.chiark.greenend.org.uk/~sgtatham/putty/

When you run it, enter 'login.cse.unsw.edu.au' in the hostname field, click open, follow the prompts for your username and password, then you are in front of a CSE terminal as per Linux.


To Infinity and Beyond

The basic lab is over now, however if you want to learn about other useful (and cool) stuff you can do with the lab machines and your CSE account, click here.

Things that will be covered in it include:

  • Trivia
  • Printing
  • Aliases (command line shortcuts)
  • Colours
  • Making your own webpage
  • Finding your friends
  • Sending CSE emails through Gmail
  • Background mode

You know you want to click this

/!\ Hint: Click me.

Tech/Lab0/Worksheet/Worksheet (last edited 2012-02-28 14:44:20 by pchu161)