Operating Systems 2021F Lecture 2

From Soma-notes
Jump to navigation Jump to search

Video

Video from the lecture given on September 14, 2021 is now available:

Video is also available through Brightspace (Resources->Class zoom meetings->Cloud Recordings tab)

Notes

Lecture 2
---------
* TA assignments, tutorial logistics, & office hours
* Tutorial 1
 - the shell


Tutorial logistics
 - you should all be in a private channel with your TA on Teams.  If you aren't, PM me and I'll bug the TA :-)
 - you can also see who your TA is on Brightspace, there's a column in the gradebook (this may be broken now, but should be fixed soon)
 - IF YOU ARE NOT ON TEAMS, get on that!  If you have problems let me know.
 - you can get help from any TA or me, feel free to contact personally or, to also help others, post in channels

We have tutorial times assigned on Mondays, Fridays 8:30-10 and Fridays 2:30-4.  We're mostly ignoring this as we're doing tutorials asynchronously.  Instead
 - you have an assigned TA who grades your tutorials
 - that TA has a Teams channel for just talking with you
 - someone has office hours around the time of your assigned tutorial
 - and your TA is available to talk at the time of your tutorial,
   if their official office hours aren't then you may need to make an
   appointment

*Your TA is the one who gives you marks for each tutorial*
Either
 - submit written answers, or
 - talk to TA to convince them you've worked a good bit on it
   (and if you wish, ask questions)

Why aren't tutorials graded?
 - because finding the answers is much easier than actually understanding the material
 - the ultimate test is what you understand, not what you write down
 - they are a guide to learning, and the answer may be the least interesting part of that process
 - if you don't come up with your own questions over the course of a tutorial, you're doing them wrong

To build a mental model, you have to ask your own questions and then answer them.

The assignments test what you learned in tutorials
 - assignments should be straightforward if you spent time on tutorials
 - they should be hard if you blew off the tutorials

What do I mean by a "tutorial"?
 - really, here they are more lab exercises
 - self-directed learning with no penalties for failure and as much
   support as you want
    - we'll give you the answers if you ask nicely

Key insight: you can't do well in this class by memorizing things.  You have to understand.

Remember, you can use whatever resources you want for this class
 - only have to acknowledge sources and collaboration
Except, of course, for the midterm and final
 - and even those are open note/book/internet
 - but, you have to be able to demonstrate that you did write the answers yourself if you get interviewed

The textbook is a very good resource
 - the concepts I discuss in class are covered there
 - look them up to get a different perspective
 - if you can't find it in the textbook, ask

For openstack, I can't show the web interface while on zoom
 - because I have to be on the VPN
 - but I can post videos and screenshots
 - SCS has lots of openstack resources: https://carleton.ca/scs/tech-support/scs-open-stack/openstack-technical-support/

This step by step guide is very good:
https://carleton.ca/scs/tech-support/scs-open-stack/openstack-technical-support/openstack-step-by-step-guide/

When on openstack, make sure you are in the COMP 3000 project
 - if you aren't you probably won't be able to create VMs because you won't have a quota


Question - what are we doing with openstack?
 - these are just virtual machines, much like you'd run with virtualbox
 - however, they are running on the SCS openstack cluster, not on your box

Why openstack?
 - consistent environment: shouldn't have performance issues due to lack of resources on your personal box
 - visible: TAs or I can log in to your VM and see what's going on
    - hard to do that with virtualbox
 - safety: if you mess anything up, you can't destroy your local data
    - and some stuff we'll do will be dangerous
    - probably fine in virtualbox, but this is safer
 - also, this is how you'll do things when deploying to the cloud
 
You may use your own VMs, but you have to update and maintain them
 - for now, standard ubuntu or most other Linux should work
 - but starting next tutorial you'll have to install some more cutting edge stuff that can get a bit tricky
 - you really want to be running a newish distribution
    - we're using Ubuntu 21.04 (it is not at Long Term Support release)

If you are running Linux as your main OS, you can do everything in this class on it but...
 - if it isn't Ubuntu 21.04, you may have to do some more debugging than others,
 - and HAVE GOOD BACKUPS
    - we'll play with commands that can wipe your disk, that's part
      of their function

Let's talk about editors and writing things

rsync is a very cool command
 - but play with it using the -n option to simulate runs before syncing
   files
 - if you aren't careful, you can delete EVERYTHING
    - watch out when using --delete and --force
    - otherwise, will just overwrite existing files with the same name

If you want to make things fast, use how to learn command lines and ssh
 - x2go is very slow, as are any GUI in the cloud
 - run GUIs locally and access remote VMs via ssh, either directly
   or using tools (e.g., VSCode with remote development)

Feel free to show what you want to do to me or a TA in office hours, we can help you understand the options if this still isn't clear

scp is depricated, use sftp instead
 - rsync copies file changes, not entire files, so very efficient
   for large copies where a version is on the other side
 - I can sync hundreds of gigs of data in less than 30 seconds if little has changed

UNIX is a giant toolbox
 - if you use it for decades you'll still learn tricks every so often
 - learn as you go, it is like a language, you won't master it all at once

If you use an operating system or application controlled by a company
 - it will keep changing over time, probably in incompatible ways
 - it may get discontinued or the company can go away

Open source/free software lives as long as someone cares enough to maintain it

I've been using Emacs since 1989.  It is much more capable, but it is still emacs.  What commercial program is going to be like this?

This is why Linux is taking over everywhere
 - it has so much functionality
 - developers already know it
 - and free to use (no cost and can change the code)

MacOS, Windows, etc
 - enterprise software can have very long lifetimes
   - but they are zombie programs mostly, never really developing,
     just being maintained at a bare minimum effort

Windows dominates the enterprise software world, particularly desktops
 - but Linux dominates the cloud

I think the steam deck may change the dynamics in Windows gaming
 - yes, I've said it :-)

I keep saying UNIX and Linux, right?

UNIX is a family of operating systems
 - goes back to 1970's
 - I can post a video about the version of UNIX that came out of
   AT&T's Bell Labs
    - BTW today's AT&T isn't the old AT&T FWIW

Linux is a "UNIX-like" system
 - UNIX is trademarked by AT&T

many other UNIX-like systems
but Linux is the most popular now

and many, many variants of Linux
 - Linux only refers to the kernel
 - we'll explain what that is