Computer Access and Use InformationEveryone who is registered in a computer science class automatically gets two computer accounts: one on the ACRC's Windows network, and one on "hills", which is a Linux server. By registering in this class, you also get a third account, on the Linux desktop machines in our classroom.
hills account infoYour hills account is on a Linux server, and gives you access to text file editing through the "pico" program, and C++ compiling through the "g++" program, plus other standard software. Hills may be accessed from any computer that has dial-up or Internet access, including the computers in the ACRC. To access hills, use any SSH or terminal emulation program, such as SSH Client or PuTTY.Your hills login name is the same as your CCSFmail account user name. To find this user name, Login to Web4, go to the "Student Services & Financial Aid" tab, and scroll down to the "Student CCSFmail" link near the bottom of the page. Then click on "CCSFmail info". If you need help determining your login name, ask an ACRC staff member. If you've never logged onto hills before, your initial password for hills is your birthday, written like: jan0380 if you were born on January 3, 1980. You will be forced to change this password the first time you login, using this password as your "old password", and a new one of your choice for future use. If you've logged onto hills before, your password is the same as it was last time you logged in. Ask the ACRC staff for help if you don't remember your password.
To connect to hills, use a
terminal emulation program such as SSH Client or PuTTY.
From a Mac or Linux computer, you can open a terminal window and type:
Linux Classroom Account InfoYour Linux desktop machine account is used when you sit down at a computer in our classroom (Batmale 413) or at one of the Linux desktop computers in the ACRC (on the right-side wall past the counter). Your initial login and password on this Linux account are the same as on hills, but remember they are different accounts. So if you change the password on one account, it doesn't change the other. Pretty much everything else you read below regarding Hills also applies to Linux. One big difference between our Linux desktop machines and the hills Linux server is that the desktop machines have a full graphical user interface (GUI), and can run programs such as Firefox, OpenOffice, etc. The hills system has only a text, command-line interface, as described below.To use a Linux desktop computer to write, compile, and run a C++ program, here is what you do:
ACRC account infoYour ACRC account is used only to log into PC's in the Academic Computing Resource Center (ACRC) computer lab in Batmale 301, PC-Lab 2, plus some of the PC's toward the back-left of the main concourse. These computers are specifically for CS and CNIT students, and they have special software for our classes. Other computers don't require special logins. You can access Firefox, SSH Client, and compilers such as Eclipse from these computers, as well as other standard software.There are also tutors available in the ACRC. They can help you with your homework. For extra help getting started with hills and the computers in the ACRC, go to a lab orientation in the first couple weeks of the semester. The login to your ACRC Windows account is the same as the initial login to your Hills account described above. Your initial password is your birthdate in the same format as it was for hills, and this password is reset at the beginning of each semester, so your old password is no longer valid if you've logged in to the ACRC network in previous semesters. If this is your first login to your Windows account, or if your password has expired (approximately every 45 days), there is a reminder to change your password, and you should do so. Make sure to log off when you are finished with the computer. To log out of Windows, go to the Start menu at the bottom-left-side of the screen and select "Log Off" Homework submission guidelines:When turning in a programming assignment, the entire source code listing of your program must be included, along with sample test results that show the full range of your program's behavior. You can use any C++ compiler to do this. It can be done using copy and paste, or other tools. Instead of using Linux and g++, you can install your own C++ compiler, such as those listed on my links page.If you do use hills (Linux) as described in this document, the best way to capture your output is to save it as a script. To do so, simply type "script myscript.txt" at the Linux prompt. You should see the following message in response: "Script started, file is myscript.txt". This means that everything displayed on the terminal window from now on will be saved in a text file called myscript.txt. When you are finished testing your program and you want to stop adding to the script file, type "exit", and you should see the following: "Script done, file is myscript.txt" The file "myscript.txt" can then be printed, or submitted for your homework, etc. Warning: Make sure you always exit your script when you are done testing your file. If you don't exit the script, your script file will keep growing and growing. Also, never run pico when a script is running. The screen displayed by pico will fill your script file with junk. To get help or ask questions, use the class's Insight discussion board to ask your classmates for help. (I will read and respond to discussion board postings too.) Please don't post more than a couple lines of C++ code to the Insight discussion forums, as other students may copy your work. If you need to show a large part of your code to ask your question, please e-mail your question to me directly. If you are e-mailing me your question, please include as much information as possible: send me your full program and the exact results it produces (error messages or other output).
Linux BasicsThe ACRC has put some good Linux-related tips onlineOne common mistake with hills Linux is when people use the mouse. On hills, we are using Linux with a text-only interface, so your mouse does nothing to interact with hills. When you're using hills, forget about the mouse. Another common mistake is that people don't know Linux is case- sensitive. So file and program names must always be in the correct (upper or lower) case. When you log in to hills using your own username, you will automatically be placed in your own directory on hills. So you can save any files you wish in that directory or any subdirectories you create. All the files you create will be there for you next time you login. Here is a list of basic commands you should know, all of which you type at the main Linux (bash) prompt:
There are two main programs you'll use on hills: pico for text file editing (including writing programs) and g++ to compile your C++ programs. Following are some basic directions on how to use these programs: pico (text editor)To run pico to create a new file, simply type "pico" at the Linux prompt. To use pico to edit an existing file (or create a new one) type "pico filename" where filename is replaced by whatever file you want to edit. To save your file in pico, type Ctrl-o (for write Out), and to exit, type Ctrl-x (it will prompt you to save if you've made changes). The is a limited menu of commands at the bottom of the pico screen, with the control key represented by ^. To insert a file that you've saved on hills into the document you're currently editing, type Ctrl-R.g++ (C++ compiler)Once you've used pico to write your C++ program, use g++ to compile it. The filename for your program must end in ".cpp" so that g++ knows it is a C++ program. So for instance to compile a program called prog1.cpp you would type the following command: "g++ prog1.cpp". If your program didn't compile correctly, you'll get errors or warnings telling you what's wrong. Otherwise, g++ should have created an executable file for you called "a.out". So to test your program, simply type "a.out" at the command line.Logging OutWhen you are done using any computer system, you should always log out. To log out of hills, type "exit" at the command prompt. To log out of the Windows network, go to the Start menu and select "Log Off".Summary: Step-by-Step Instructions for Doing HomeworkYou may use any text editor and any C++ compiler to write and run your program; just make sure you turn in a text file containing your source code and sample output. Here are some step-by-step instructions for doing all this using CCSF resources that are available from anywhere:
More InformationFor more information on many of these topics, see my Links page at http://fog.ccsf.edu/~cpersiko/links.html |