computer science mentor scheme
TRANSCRIPT
![Page 1: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/1.jpg)
COMPUTER SCIENCE MENTORSCHEME
Session 1: Linux and Git
![Page 2: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/2.jpg)
PREFACEAll materials available online at
Link is available in Discord/Teams.
https://thytom.github.io/session1
![Page 3: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/3.jpg)
ME• Archie• Senior mentor• Discord co-admin• Wrote the Registration Bot (sorry)
![Page 4: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/4.jpg)
TOPICS• Configuring VirtualBox• Working with Linux• Using Git for projects
Several demos using Linux, feel free to follow along.
![Page 5: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/5.jpg)
SHOW OF HANDSWho has:
• Installed VirtualBox• Installed an Ubuntu VM• Installed the Guest Utilities
![Page 6: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/6.jpg)
INSTALLING UBUNTU ONVIRTUALBOX
https://linuxhint.com/install_ubuntu_virtualbox_2004
![Page 7: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/7.jpg)
VIRTUALBOX CONFIGURATIONYou can change settings about your VM.
It is recommended to set:
• Memory 4GB or more if you can• Video memory 128MB• More than one CPU core
![Page 8: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/8.jpg)
DEMO: FRESH UBUNTU VM
![Page 9: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/9.jpg)
SOME PROBLEMS• Mac users - setting up guest/host copy/paste• 32-bit only
We have mentors on hand who can help you.
![Page 10: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/10.jpg)
THE PACKAGE MANAGER• Linux programs are bundled into packages• Install and update via the package manager• Updates all your programs*• Ubuntu uses two package managers, apt and snap
![Page 11: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/11.jpg)
APT COMMANDS# Update package database
$ sudo apt update
# Perform system update
$ sudo apt upgrade
# Install packages
$ sudo apt install [packages...]
![Page 12: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/12.jpg)
SNAP COMMANDSSnap packages are automatically updated.
# Install a package
$ snap install spotify
![Page 13: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/13.jpg)
VIRTUALBOX GUEST ADDITIONS• VirtualBox drivers to talk to the host• This allows for:▪ better performance▪ higher resolutions/fullscreen▪ shared copy/paste
There are several packages needed to make this work(listed later):
$ sudo apt install virtualbox-guest-utils virtualbox-guest-
dkms virtualbox-guest-x11
![Page 14: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/14.jpg)
TEXT EDITOR• Ubuntu comes with GEdit• There are many others• We recommend Visual Studio Code (vscode)
$ snap install --classic vscode
![Page 15: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/15.jpg)
BUILD-ESSENTIAL, VALGRIND, GITBuild-essential: Meta-package, pulls in a bunch of
useful build tools like gcc and make.
Git: more on this later, you’ve likely already used it.
Valgrind: Used later on in PGA for debugging.
![Page 16: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/16.jpg)
PACKAGE LIST# Build tools (used in PGA)
build-essential git valgrind
# Virtualbox Guest Utils
virtualbox-guest-dkms
virtualbox-guest-x11
virtualbox-guest-utils
# Visual Studio Code (via snap)
vscode
![Page 17: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/17.jpg)
DEMO: INSTALLING PACKAGES
![Page 18: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/18.jpg)
WHAT IS GIT?
![Page 19: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/19.jpg)
WHAT IS GIT?
• Version Control System (VCS)• Every change is recorded• “Timeline” for your code
![Page 20: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/20.jpg)
BASICS OF GIT• Projects are stored in repositories• Repositories contain all your code• They also contain the history of your code
![Page 21: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/21.jpg)
BASICS OF GIT• Changes are committed to the history• History is permanent*• Time-travel - roll back to previous commits
![Page 22: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/22.jpg)
DEMO: COMMITSMaking changes, committing them
![Page 23: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/23.jpg)
BRANCHES• Create a branch in history• Develop features in isolation▪ Changes don’t affect main branch
• Merge branch when done
![Page 24: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/24.jpg)
BRANCHES
https://rlogiacco.wordpress.com/2017/04/05/git-tricks/
![Page 25: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/25.jpg)
DEMO: BRANCHING
![Page 26: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/26.jpg)
GITLAB/GITHUB• Online git hosting platforms• A copy called the remote repository• Everyone pulls updates from the remote• Then pushes changes back
![Page 27: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/27.jpg)
UNIVERSITY GITLAB
• Private university GitLab instance• You can host projects here• Make use of it!
(Some courseworks will be released on here)
https://projects.cs.nott.ac.uk
![Page 28: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/28.jpg)
EXTRA FEATURES• Issue tracker• Merge/Pull requests• CI/CD• Forking
![Page 29: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/29.jpg)
DEMO: GITLAB• Creating a remote GitLab repository• Pushing to it
![Page 30: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/30.jpg)
BENEFITS OF GITSafety
Complete history of changes, remote back-upsCollaboration
Work on the same project from multiple placesFeature separation
Implement a feature, merge when it’s readyMaintainability
Branches, issues and good commits keeps codeorganised and clean.
![Page 31: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/31.jpg)
QUESTIONS?
![Page 32: COMPUTER SCIENCE MENTOR SCHEME](https://reader033.vdocument.in/reader033/viewer/2022053104/6291be4c5ca7ae78612618ae/html5/thumbnails/32.jpg)
TASK20 minutes
If you haven’t: Welcome To The Machine
Otherwise, follow the worksheet handed out to you.
Ask a mentor for help if you need it.