0% found this document useful (0 votes)
83 views

2020 Spring CSCI251 Lab Preliminary

This document provides instructions for connecting to a Linux server called capa.its.uow.edu.au from Windows, Mac, or Linux in order to complete assignments that require a Linux environment. It describes how to use SSH and SFTP to connect and transfer files, interact with directories and files using commands like pwd, ls, cd, and cat. It also provides a basic C++ program example to compile and run as a demonstration of using the Linux compiler g++.

Uploaded by

Masud Zaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

2020 Spring CSCI251 Lab Preliminary

This document provides instructions for connecting to a Linux server called capa.its.uow.edu.au from Windows, Mac, or Linux in order to complete assignments that require a Linux environment. It describes how to use SSH and SFTP to connect and transfer files, interact with directories and files using commands like pwd, ls, cd, and cat. It also provides a basic C++ program example to compile and run as a demonstration of using the Linux compiler g++.

Uploaded by

Masud Zaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SCIT-EIS-UOW

CSCI251/CSCI851/HCSC851 Spring 2020

Laboratory Preliminaries
I’ll go through some of this at the first lecture/tutorial.
This is preliminary material that should ideally be completed before the end of Week One of Spring
2020. It isn’t just of relevance to the labs, since it primarily relates to the environment that assignments
need to run in.
The environment you need to be able to connect to is a Linux server, capa.its.uow.edu.au, which
is running Ubuntu 18.04. You will need to become familiar with some Linux functionality as part of this
subject.
Note that you can get a IDE for whatever local environment you work in, so something like CodeBlocks
for example, but you need to make sure you understand how to access and use capa since assignments
need to be capa compliant and you should attempt to make lab work capa compliant too.

1 Part One: Connecting to capa


1.1 From Windows
You can get Bitvise from https://www.bitvise.com/, specifically from https://www.bitvise.com/download-
You need the SSH Client. I’ve got version 8.43.
Note that while I could post a copy of that client software on Moodle, there were a few Bitvise updates
during Autumn 2020 so it’s helpful to know where the base software is from.
Install Bitvise on your Windows machine, and run it. It should come up with the Login tab. See
Bitvise for Windows document on Moodle to check what this should look like and what you do from
here to open a terminal on capa.
Bitvise has a file transfer system that should open when the terminal opens.

1.2 From MAC


Use a terminal. Connect using

$ ssh [email protected]

Use your own username in place of username in the above, that’s some sequence of letters then digits. The
password will be your SOLS password.
Dr. Sifer suggested the following source of information for MAC users:

https://www.servermania.com/kb/articles/ssh-mac/

There should be some sort of fingerprint test for this too.


File transfer can be done using sftp from the terminal or something like FileZilla.

1
1.3 From Linux
Similar to the MAC. Use a terminal. Connect using

$ ssh [email protected]

Use your own username in place of username in the above, that’s some sequence of letters then digits. The
password will be your SOLS password.
There should be some sort of fingerprint test for this too.
File transfer can be done using sftp.

2 Interacting with capa


After completing whichever part of the previous section is relevant, you should have a terminal connected
to capa. There is a file LinuxHelp.pdf on Moodle with some of the useful Unix functions.

1. The terminal will open in your home directory. You can use pwd, present working directory, to
determine where you are at any particular time.

$ pwd
/home/staff/l/lukemc

Note that $ is the default command prompt. When you see that, you can enter a command.

2. It’s a good idea to organise the material for each week into a directory. It is helpful know a little bit
about moving around directories, the following should help.

$ cd ~ This will take you to your home directory from anywhere.


$ mkdir W2 This is a directory for the first lab, in week 2.
$ cd W2 Change into the directory just made.

3. The material for each week will be on Moodle.

4. The pdf will need to be opened on your local machine.

5. The source files, likely in a zip file, may need to be put it into the lab directory you have just made
for the week.

6. Within the terminal, look in a directory using ls, or ls -la for more detail.

$ ls
$ ls -la

7. With text files you can read them using something like cat or less or more.

8. Long term, learn to use an Ubuntu editor. Likely pico. You can write source files on your local
machine and transfer them across to capa.

2
3 Part Two: Compilation
1. Open an editor to make a source file Hello.cpp. For example, if you are using pico, type

$ pico Hello.cpp

2. Type the following code into the editor. Please don’t copy and paste. I expect you will make some
mistakes in typing and it’s helpful to learn how to move around in the editor.

#include <iostream>
using namespace std;

int main()
{
cout << "Hello World!" << endl;
return 0;
}

3. To save in pico you use Ctrl-o. To exit the editor use Ctrl-x.

4. You compile Hello.cpp using the following instruction, remembering that this is in the terminal
window with your location being wherever the file Hello.cpp is.

$ g++ Hello.cpp

5. The default name for the executable is a.out. Use the argument -o name to specify a new name.

$ g++ -o Hello Hello.cpp

6. You can run the executables using

$ ./a.out
$ ./Hello


c Luke McAven, SCIT-EIS-UOW, 2020.

You might also like