This page provides answers to some commonly asked questions. Feel free to use the GitLab issues if you cannot find an answer here.
GitLab: where is it and how do I sign in?
When we refer to GitLab in this course, we always mean the faculty instance available at https://gitlab.mff.cuni.cz.
Use your CAS credentials to log in, i.e., the
same credentials you use to access SIS. Use the username derived from
your first and family name (such as doejohn
) instead of the numerical
identifier.
If it does not work, please, try changing your CAS password (even to a
temporary password that you will change back to the original one later)
to trigger password synchronization. If that does not help, contact us
as soon as possible at teachers-nswi004@d3s.mff.cuni.cz
.
Your first login will activate your GitLab account. Without that, it is impossible to provide you with access to various project repositories needed for participation in this course.
Note that for some accounts, projects were enabled only after you filled-in your e-mail address in your profile.
Also note that without an active account you will not be able to submit the graded assignments and quizzes and pass this course.
Logging to the lab
machine
Connect to port 22004 (standard SSH port + course code) of the machine
lab.d3s.mff.cuni.cz
using your SIS credentials.
Consider adding the following fragment to your ~/.ssh/config
to simplify
the login to bare ssh nswi004
.
Host nswi004
HostName lab.d3s.mff.cuni.cz
User YOUR_SIS_LOGIN
Port 22004
Note that this machine contains all that is needed to compile and run the assignments.
Logging to GNU/Linux machines in Rotunda lab
You will need a Secure Shell (SSH) client. On GNU/Linux machines, the
SSH client is typically part of a base installation, so you should be
able to simply run the ssh
command. On Windows machines, you need to
install an external client. We recommend using PuTTY,
but feel free to use any other client.
Connect to u-plN.ms.mff.cuni.cz
(where N
is a number between 1 and 23)
using your SIS credentials (i.e. the same username and password).
Note that machines in Rotunda use AFS and Kerberos and thus it is not possible to setup a login via a public SSH key.
Generally, you should prefer the lab
machine (see above) as it contains
the latest versions of the toolchain.
And it supports authentication via public key too.
Keeping your fork up-to-date
Most of the (later) assignments and the self-study material will be published in form of changes committed to the respective upstream repository. You are expected to merge these updates into your private repositories. When you view your private repository in GitLab, the corresponding upstream repository will be shown as the repository you Forked from.
For example, when we add a new quiz, we will commit the changes to the upstream repository and announce the update via e-mail.
To merge these changes into your student-LOGIN
repository for the first time,
you need to perform the following steps (for subsequent updates, you will only
need to perform the last 3 steps):
-
Clone your private repository and/or change to the directory with the clone.
git clone git@gitlab.mff.cuni.cz:teaching/nswi004/2021/student-LOGIN.git
cd student-LOGIN
You need to be inside the clone directory for the subsequent steps.
-
Add a remote pointing to the upstream repository.
git remote add upstream git@gitlab.mff.cuni.cz:teaching/nswi004/2021/upstream/student.git
This only needs to be done once per clone.
-
Fetch changes from the upstream repository.
git fetch upstream
-
Merge the changes.
git merge -m "Merge upstream changes" upstream/master
Git will respond with an
"Already up to date."
message and do nothing if there is nothing to merge. -
Push the merged changes from your (local) clone back to your private repository on faculty GitLab.
git push
A more detailed explanation is also available in the labs for Introduction to Linux course (NSWI177).
Merging partial changes from upstream
Sometimes it may happen that we will publish minor updates to the assignment (e.g. when we find a bug in the tests). And thus sometimes you may need to merge only certain upstream changes.
To merge only certain commits (note that it is possible to select any commit via cherry-picking, the following focuses on the simpler case when we want to merge up to some commit) following commands will do the trick.
Assuming we are inside team-whatever
directory:
-
Ensure we have upstream up-to-date.
git remote add upstream git@gitlab.mff.cuni.cz:teaching/nswi004/2021/upstream/team.git git fetch upstream
-
Merge changes up to a certain commit first (the commit mentioned relates to updates to A02).
git checkout master git merge ee551427e853808e04f6bf611500025bd390fb06 -m "Merge upstream changes"
-
Optionally, we may create a new branch where we would merge rest of upstream changes (here, because A03 breaks all tests as they are not even launched).
git branch a03-import git checkout a03-import git merge upstream/master -m "Merge A03"
Introductory materials
The following materials from the NSWI170 Computer Systems Course can be useful for refreshing your knowledge of the C language and basic principles of program execution.
- C language basics
- Instructions and compilation of basic programming language constructs (also contains an introduction to the MIPS instruction set)
Following materials from the Introduction to Linux course (NSWI177) can be also useful for refreshing your knowledge in the following areas.