Difference between revisions of "CS Accounts and CS Lab Computers"

From Computer Science
Jump to: navigation, search
(Created page with "This section contains information for CS majors to help get you started with logging into the CS server and do the sorts of programming that goes on in most of the CS courses...")
 
 
(28 intermediate revisions by the same user not shown)
Line 1: Line 1:
This section contains information for CS majors to help get you started with logging into the CS server and do the sorts of programming that goes on in most of the CS courses
+
This section contains information for CS majors to help get you started with logging into the CS server and do the sorts of programming that goes on in most of the CS courses. For getting your home computer setup to connect to the CS server, see [[Linux and CS Systems - Getting Started]].
  
 
== Operating System and Class Accounts ==
 
== Operating System and Class Accounts ==
 
Many of the CS courses make use of the CS server, which runs Linux. For courses that use the CS server, your programming assignments will be compiled and run on the CS server.
 
Many of the CS courses make use of the CS server, which runs Linux. For courses that use the CS server, your programming assignments will be compiled and run on the CS server.
  
If your class makes use of the CS server, you will be given a "class account". These class accounts allow you to login to the CS server remotely and login to the computers in the CS lab and classroom (Root Hall, A-015 and A-017). The class accounts will be given to you by your instructor. The class account login names all start with cs and then the number of course. For example, CS 151 students get class accounts that begin with cs151 (e.g., cs151000, cs151001, ...). Note that the class accounts are deleted at the end of each semester. If you are a CS major and would like a permanent account on the CS server you can ask your instructor.
+
If your class makes use of the CS server, you will be given a "class account". These class accounts allow you to login to the CS server remotely and login to the computers in the CS lab and classroom (Root Hall, A-015, A-017, A-019). The class accounts will be given to you by your instructor. The class account login names all start with cs and then the number of course. For example, CS 151 students get class accounts that begin with cs151 (e.g., cs151000, cs151001, ...).  
  
For courses using the CS server, you are encouraged to do your programming while logged into the server (using Putty from Windows, or another terminal client if using another OS). You should use the same program to compile your code that the instructor uses, so you are sure it will compile when your instructor grades your code.
+
Note that the class accounts are deleted at the end of each semester, so you need to backup your files at the end of the semester (transfer the files to your home computer). If you are a CS major and would like a permanent account on the CS server you can ask the [http://cs.indstate.edu/info/contact.html CS lab/server coordinator].  For how to backup your files see [[CS Account Backup]].
  
== Using Linux ==
+
== CS Account Policies ==
Most of your work on the machines in the CS labs will likely be done using the shell/terminal. This is a text-based program that allows you to navigate your files on the system, compile programs, and run commands. You can view some videos demonstrating some of the basics on the [https://www.youtube.com/playlist?list=PLXFP6J47Bp0fe6g5rQV0ka-AKDLdVvZ56 CS at ISU youtube] playlist.
+
=== Prohibitions ===
 +
For any accounts that you have on the CS server (whether class accounts or permanent accounts), you should follow all ISU policies.  In particular the following are prohibited -
 +
* using your account to store or distribute anything that is against its terms/copyright/etc. (e.g., no movies, textbooks, answers to HW problems)
 +
* using your account to do anything that is illegal
 +
* using a password that is too easy to guess (i.e., a password cracker that we run finds your password)
 +
* overloading the CPU or GPU of the system, or filling up any of the system drives
 +
* anything that is along these lines that we have not thought to state explicitly
 +
A violation of any of these will result in your account being locked and no longer being allowed to have an account on the systems.
  
* [http://cs.indstate.edu/~sbaker/faq/QuickRefCard.pdf Unix/Linux Quick Reference Card]
+
=== Inactivity ===
* [http://www.linuxcommand.org/ Linux Console Tutorial]
+
Permanent accounts that are not used for a period of 6 months will likely be locked as a security precaution. You can write to root@cs.indstate.edu to ask to have your account unlocked again.
* [http://www.reallylinux.com/ Information for Beginning Linux Users]
 
* [http://www.ee.surrey.ac.uk/Teaching/Unix/ Linux Tutorial]
 
  
== Text Editors ==
+
==Assignment==
Note - you can view some videos demonstrating some of these text editor options on the CS at ISU youtube playlist.
+
For courses that want to give credit for successfully logging into the system with your class account, you should do the following.
 +
* Get your account information from your instructor.  Some put this as a comment to a grade item for the class in canvas.  Some have it emailed to your ISU email.  If you are not sure then check with your instructor
 +
* When you login the first time, it will ask for your full name, office, etc.  For the full name put in your name.  For Office put your ISU email address (the @sycamores.indstate.edu one).  For Office Phone and Home Phone, leave them blank.
 +
** If you need to update this information later on, you can do so by being logged in and running: <code>chfn</code>
  
While you are logged into the CS lab machines or CS server, you need to use a text editor to edit files. In getting started, you can use pico, nano, or jove to edit files. These text editors are relatively easy to use and show on the screen what control keys need to be pressed to do different things (e.g., ctrl-x to exit).
+
You should also update your password to be something you will be able to remember. The first time you login it will ask you to do this. If you need to do this later on, you can do so by running this command in the terminal: <code>passwd</code>
  
Once you are comfortable using the shell/terminal and one of the basic text editors, you should learn either vim or emacs. vim and emacs have many useful features for programming that the basic text editors do not. But they do not show on screen what commands are needed to do different things, so you'll have to have a reference to check against until you remember them.
+
'''Pass rating check''' To check if you should get a ''pass'' rating for this task, your instructor can do the following.
 
+
* Run <code>finger YOUR_LOGIN</code> to verify that your name and email show up. If not, you need to run <code>chfn</code> to update them.
'''How to get started?'''  When getting started with a new text editor, you should search online for a tutorial to follow along (e.g., search for jove tutorial). Once you are familiar with the basics of using the editor, search online for a reference (e.g., search for jove reference) that will give a short summary of the most important commands.
+
* Run <code>passwd -S YOUR_LOGIN</code> to check when your password was last changed. It should show that it was changed some time after initial account creation. You can run <code>passwd -S</code> to see when your password was last changed.
 
 
'''Graphical Editors'''  The editors mentioned above are all plain-text editors, meaning they can be used from Putty as well as when you are logged into the lab machines. For editing files when you are not using Putty, you can use a graphical editor as well. Some that people have liked include Notepad++, Kate (KDE Advanced Text Editor), and Atom. You can also use MS Visual Studio, Eclipse, or other IDEs to edit text files. Some of these have the ability to let you edit files that are located on the CS server by entering your login credentials; note that this is unsupported, and we won't help you to get it working.
 
 
 
== Logging into CS Server Remotely ==
 
You can view videos of the installation and use of the software mentioned here on the CS at ISU youtube playlist.
 
 
 
=== Working Remotely on the CS Server ===
 
From Windows - To login to the CS server from a Windows computer, you should install the Putty software. Putty is a shell/terminal that runs on your computer and sends the commands to the CS server. This allows you to edit files on the CS server, compile using programs installed on the CS server, etc. To install, follow the [http://cs.indstate.edu/FAQ/PuTTY/ Installing Putty on Windows] instructions.
 
 
 
From Mac or Linux - To login to the CS server from a Mac or Linux, you do not need to install putty. Instead, you can open your terminal or shell program, and then type "ssh username@cs.indstate.edu". On a mac, you find the shell by going to Finder, then Applications, then Utilities, then Shell or Terminal.
 
 
 
=== Transferring Files To/From the CS Server ===
 
To transfer files between your computer and the CS server, use an sftp program. This can be a text-based sftp program (one comes pre-installed on Mac and Linux, and one comes with Putty for Windows). Or, you can use a GUI sftp program. [https://filezilla-project.org/download.php FileZilla] is a GUI sftp program that works on Windows, Mac, and Linux. [https://winscp.net/eng/download.php WinSCP] is another popular GUI sftp program that only works on Windows. If given an option of what port to connect to, use port 22 (this is the "secure" port, so data is encrypted while transferring over the public internet).
 
 
 
== Other Software ==
 
If you want to develop on your own computer without logging into the CS server you have a few options...
 
 
 
* MS Visual Studio - the best option to develop GUI programs for Windows, not a good option for developing for Linux.
 
* Eclipse - a cross-platform IDE that can be used for Java, C/C++, and some other languages.
 
* Cygwin - software that installs a shell/terminal and associated programs on your Windows computer so that it works pretty much like the CS Linux machines. If you select the option to install gcc/g++ and emacs/vim, then you can work on your programs on your local Windows computer with basically the same environment as the CS Linux computers.
 
 
 
== Programming Languages ==
 
Many of the CS courses use C and C++. If you are a new graduate student or a transfer student, you should get started by making sure you can connect to the CS server with Putty or another terminal program. Once you can connect, you should familiarize yourself with linux shell commands (see the Unix/Linux Quick Reference Card linked above). You should also learn to use one of the text editors mentioned above.
 
 
 
For CS courses that use C and C++, the gcc and g++ compilers are normally used. These are already installed on the CS server. If you have a C or C++ program, you compile it by first logging into the CS server using Putty or another terminal program and typing
 
 
 
<blockquote><code>gcc code.c -o outputName</code></blockquote>
 
 
 
for C, or g++ for c++. You run the resulting program by typing ./outputName (and then enter/return) at the shell prompt (aka command line). You should make sure your C/C++ programs compile and run using gcc/g++. Note that programs made using MS Visual Studio or some other compiler will normally not work straight away with gcc/g++ because there are some differences in which functions are included in the header files.
 
 
 
=== Tutorials and Reference ===
 
For a review of C and C++, you can look at various tutorials and references online and courses from other universities that teach these languages. The following is a list of resources we have used in the past; there are many others online as well.
 
 
 
* [http://publications.gbdirect.co.uk/c_book The C Book]
 
* [http://markburgess.org/CTutorial/C-Tut-4.02.pdf C Programming Tutorial]
 
* [http://fresh2refresh.com/c-tutorial-for-beginners/ Fresh2fresh C Tutorial]
 
* [http://en.wikibooks.org/wiki/C_Programming C Programming Wikibook]
 
* [http://www.greenteapress.com/thinkcppHow to Think Like a Computer Scientist C++ Version]
 
* [https://en.wikipedia.org/wiki/The_C_Programming_Language The C Programming Language by Kernighan and Ritchie]
 
* [http://www.cplusplus.com/ cplusplus.com]
 
* [http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-087-practical-programming-in-c-january-iap-2010/ MIT course - Practical Programming in C]
 
* [http://www.cs.cornell.edu/courses/cs2022/2011sp/ Introduction to C - course at Cornell]
 
 
 
=== Practice Programming Problems ===
 
To practice C/C++ programming, first start by following a tutorial and writing the programs the tutorial shows you. Once you are reasonably familiar with all the syntax rules, start trying "programming contest problems". These are problems with precisely defined correct output, so that you can submit your program to make sure it is 100% correct.
 
 
 
* [http://www.hackerrank.com/ Hacker Rank] - very user-friendly, different programming languages available, different categories of questions
 
* [https://open.kattis.com/problems Practice problems] at open.kattis.com (sort by difficulty or solved % to try the easiest ones first)
 
* [http://cs.indstate.edu/acm/contests.html ISU ACM Club's Contest Problem page]
 
* [http://cs.indstate.edu/~jkinne/Cpractice/ A few simple practice problems], with solutions to some on the CS server. See the .txt files.
 

Latest revision as of 13:37, 24 August 2023

This section contains information for CS majors to help get you started with logging into the CS server and do the sorts of programming that goes on in most of the CS courses. For getting your home computer setup to connect to the CS server, see Linux and CS Systems - Getting Started.

Operating System and Class Accounts

Many of the CS courses make use of the CS server, which runs Linux. For courses that use the CS server, your programming assignments will be compiled and run on the CS server.

If your class makes use of the CS server, you will be given a "class account". These class accounts allow you to login to the CS server remotely and login to the computers in the CS lab and classroom (Root Hall, A-015, A-017, A-019). The class accounts will be given to you by your instructor. The class account login names all start with cs and then the number of course. For example, CS 151 students get class accounts that begin with cs151 (e.g., cs151000, cs151001, ...).

Note that the class accounts are deleted at the end of each semester, so you need to backup your files at the end of the semester (transfer the files to your home computer). If you are a CS major and would like a permanent account on the CS server you can ask the CS lab/server coordinator. For how to backup your files see CS Account Backup.

CS Account Policies

Prohibitions

For any accounts that you have on the CS server (whether class accounts or permanent accounts), you should follow all ISU policies. In particular the following are prohibited -

  • using your account to store or distribute anything that is against its terms/copyright/etc. (e.g., no movies, textbooks, answers to HW problems)
  • using your account to do anything that is illegal
  • using a password that is too easy to guess (i.e., a password cracker that we run finds your password)
  • overloading the CPU or GPU of the system, or filling up any of the system drives
  • anything that is along these lines that we have not thought to state explicitly

A violation of any of these will result in your account being locked and no longer being allowed to have an account on the systems.

Inactivity

Permanent accounts that are not used for a period of 6 months will likely be locked as a security precaution. You can write to root@cs.indstate.edu to ask to have your account unlocked again.

Assignment

For courses that want to give credit for successfully logging into the system with your class account, you should do the following.

  • Get your account information from your instructor. Some put this as a comment to a grade item for the class in canvas. Some have it emailed to your ISU email. If you are not sure then check with your instructor
  • When you login the first time, it will ask for your full name, office, etc. For the full name put in your name. For Office put your ISU email address (the @sycamores.indstate.edu one). For Office Phone and Home Phone, leave them blank.
    • If you need to update this information later on, you can do so by being logged in and running: chfn

You should also update your password to be something you will be able to remember. The first time you login it will ask you to do this. If you need to do this later on, you can do so by running this command in the terminal: passwd

Pass rating check To check if you should get a pass rating for this task, your instructor can do the following.

  • Run finger YOUR_LOGIN to verify that your name and email show up. If not, you need to run chfn to update them.
  • Run passwd -S YOUR_LOGIN to check when your password was last changed. It should show that it was changed some time after initial account creation. You can run passwd -S to see when your password was last changed.