General linux tutorials
I'm always looking for good introductory linux tutorials, let me know if
you find these helpful (or find others that are better!)
Vim quick ref (pdf) (courtesy of Jonathan Funk)
Your instructors can look up your userid. If you forget your password, you will have to bring your Student ID card to the sysadmin (Merlin Hansen), who can change your password to a one-time-use password– you will have to reset it the next time you log in. If Merlin is unavailable, the department head (Gara Pruesse) can change your password. Both Merlin and Gara have offices on the second floor of the Physics building (315), in rooms 212 and 218 respectively.
Student server IP address
If you need to log in to the csci server and are having connection
problems you can also try by its IP address (22.214.171.124) instead
of the hostname csci.viu.ca.
Similarly, in your browser you can use the IP address instead of the hostname for the URL, e.g. 126.96.36.199/~wesselsd instead of csci.viu.ca/~wesselsd
Transferring files between your laptop/pc and the CSCI servers
Alternatively, check out WinSCP .
Auto-formatting C/C++ program layouts
OK, after a little playing with the linux 'indent' command,
I've got a set of options that will take poorly-formatted C++ programs
and produce formatting very close to the CSCI 160 standards.
It isn't perfect, but it's pretty good.
First, copy the following file to your home directory:
The changes will be usable the next time you login.
(You only need to do the copy/save this once.)
Subsequently, whenever you want to auto-reformat your C++ code, use the following command:
indent oldfilename.cpp -o newfilename.cpp
(e.g. indent lab5a.cpp -o lab5b.cpp
If you then wanted to rename the auto-formatted lab5b.cpp to lab5.cpp (for example),
you can then use the move command syntax: mv oldname newname, e.g.
mv lab5b.cpp lab5.cpp
Accessing CSCI machines from home
If you wish to connect to our servers from home
you can use virtually any secure shell (ssh) utility. ssh is
already installed on most linux and mac machines.
From a linux machine simply open a terminal window and use the same ssh command shown above.
For use from a phone or tablet, there are often apps that can be used similarly (e.g. ConnectBot for android) - Searching for 'ssh' apps is probably the best starting point.
For those on Windows machines, one commonly used program is PuTTY, which is freely available for download.
Once connected, you will have your command window to work in, very much like the terminal windows we open in the labs.
the gedit editor won't work
when connecting this way. There are a number of other editors
that can run inside your open terminal window - emacs, nano, and
vim to name a few. vim and emacs both have
a bit of a learning curve to them (but are ultimately worth
might be the easiest to get started with. Thus to edit a file
you would type nano filename instead of gedit filename
nano uses the control key to issue basic commands, e.g. control-X to exit, control-G for help, control-O to save (writeout), etc. A short menu of command options can be seen at the bottom of the window while you're working in nano.
Accessing CSCI machines from smartphones
Connecting from a smartphone is much like the access from home section above, it's just a matter of getting the correct app installed first. There are a variety of apps out there, including ConnectBot for android, ssh for iphone, and BBSSH for blackberry.
Cardkey access to CSCI labs
Lab 102 should be unlocked from 8am-6pm Monday to Friday. To get into lab 102 outside those hours, or to get into Lab 115, you will need a programmed card key.
Instructions to set up your card key are given here. Note that the email (in step 2) must be sent from your csci lab account.
Using email on the CSCI servers
You can access email from a terminal window on the machines in labs 102 or 115 as
Accessing Discovery U-drives from CSCI machines
Please find appended instructions on accessing your DISCOVERY U:
drive from the Computer Science Linux lab in 315-102.
This document describes how a Computer Science student can access their DISCOVERY U: drive from an Xterminal in 315-102. The same basic procedure probably works in 315-115, but this is untested.
1. Login to a Linux system in 315-102 or 315-115.
2. From the main menu select: Places->Connect to Server...
3. Select Service Type: Windows share
4. Set Server: dolphin.discovery.mala.bc.ca
5. Set Share: users$
6. The folder name consists of three components based on your student number - the second last digit, the last digit and the student number itself, separated by slashes. For example, if your student number is 123456789, set Folder: 8/9/123456789
7. Click Add bookmark
8. Set Bookmark name: UDrive
9. Click Connect - you should get a file browser window with the contents of your DISCOVERY U: drive.
1. To copy files or folders from one system to the other, the only method that appears to work consistenly is Copy/Paste: right click on the item you wish to copy and select Copy, then right click where you wish to move the file and select Paste. You can bring up a file browser with your home directory, from the main menu select Places->Home Folder.
2. Some files, such as (some) PDF files, can be opened directly from the U: drive, others probably need to be copied.
3. On subsequent logins, if you create a file browser (Places->Home Folder) you should be able to click on UDrive in the lower left pane to access your DISCOVERY U: Drive.
Disk quotas for student accounts
If you're having trouble saving files on your linux account (error messages
when you try to save) it is entirely possible your account is over its
disk quota (typically 1GB for a student account).
You can check your quota and current usage using quota -sp
If you're over the limit you'll need to hunt around for any large files causing the issue.
A useful pair of commands for finding large files or directories is
du -k | sort -n | tail -20
You can use the rm filename command to get rid of an offending file, or drag it to the Trash icon and empty the trash (the space isn't freed until you actually empty the trash).
Problems often come about due to web browsers storing a large amount of data in the cache - you can dig around the preferences for your chosen browser to find the right option to limit that (if desired) or find and remove their cached files (e.g. for chromimum look in ~/.cache/chromium, for firefox look in ~/.cache/mozilla)
If problems arise from having too many files (a less frequent problem, but students
can sometimes exceed their limit), you can find directories containing many files using
find . -printf '%h\n' | sort | uniq -c | sort -k 1 -n | tail -20
Simulating the lab's X-server on your home machine
Want to use the csci server's graphical elements but have the display
show up on your home machine?
Two free solutions are to install either
You can then open a terminal window and run this command to connect
to our server:
ssh -Y -l yourusername csci.viu.ca
At that point you can start up the tools you would usually use in the lab (gedit, wish, etc) and the display will show up properly (though perhaps slowly) on your home machine.