ENGS 20

You will be using a Thayer School computer to make computer programs for this course. There is at least one application that you will need to load onto your laptop before you make programs on this remote machine. Depending on whether you have a Mac or PC you will use different software.


Servers

Your assigned server is based on the first letter of your last name as shown below. You should stick to this server for your work as much as possible. However, if there are problems with your server, you can use one of the others temporarily.

The four servers are:

  • engs20-1.thayer.dartmouth.edu - Last name begins with A-E
  • engs20-2.thayer.dartmouth.edu - Last name begins with F-L
  • engs20-3.thayer.dartmouth.edu - Last name begins with M-R
  • engs20-4.thayer.dartmouth.edu - Last name begins with S-Z

Mac OS

You will use the terminal application to log in to the Thayer School computer to access files.
The application you need is a simple text editor called TextWrangler, which
will allow you to write computer programs for this classs. There are several
additional steps to configure this application correctly so follow the steps listed below.

Connect to the remote machine using terminal
  • search for 'terminal' in the spotlight and click it to run
  • type 'ssh username@hostname' where
    • username is your Dartmouth NetID and
    • hostname is the name of your assigned remote machine: e.g., engs20-1.thayer.dartmouth.edu
    • Note that username must be in lower-case, e.g., f00910a
  • enter your password
    • Note that nothing is displayed when you type your password so it seems like it is not accepting what you are typing; have faith and keep typing.
  • the first time you connect to a server say 'yes' to the host key question
Setup your directory and make your first program
  • type 'ls' to see contents of home directory (folder)
  • type 'mkdir engs20' to create a new directory for this course
  • type 'ls' to see that the new directory was indeed created
  • type 'cd engs20' to change into the new directory
  • type 'ls' to see contents of new directory (should be empty)
  • type 'mkdir workspace' to create a new directory for your programs
  • type 'cd workspace' to change into the new directory
  • type 'ls' to see that there are no files here
  • type 'getfile hello.c' to copy a C program to your directory
  • type 'ls' to see that the file hello.c was indeed copied to your directory
  • type 'cat hello.c' to display the file to the screen
  • type 'compile hello.c' to make your first C program
  • type 'ls' and you should see two new files: hello.o and hello
  • type 'hello' to run your first C program
Congratulations, you just made your first C program!

Install TextWrangler
Configure TextWrangler to save files to remote machine
  • search for 'TextWrangler' in spotlight and click it to run
  • select File->Open from FTP/SFTP Server ... from menu (Apple-ctrl-O)
  • enter engs20-1.thayer.dartmouth.edu for Server:
  • click SFTP box
  • enter NetID for User:
  • enter your password for Password:
  • click 'Connect'
  • the first time you connect to a server say 'yes' to the host key question
  • navigate to your workspace directory: engs20/workspace
  • double click 'hello.c'
  • you should see the contents of the file hello.c, in color
Make a new program
  • in hello.c, select all (Apple-A) and copy (Apple-C)

  • open a new file (Apple-N) and paste (Apple-V)

  • modify the program to print out your name

  • save file (Apple-ctrl-S) Be careful not to use Apple-S and save to your laptop
    • make sure to use a filename with a .c extension, such as new.c

  • use the terminal to 'compile' and run your new program; i.e., type
    • compile MyFileName.c
    • MyFileName
Congratulations, you just made your second C program!
Configure TextWrangler
  • in View->Text Display->Show Fonts (Apple-T)
  • select font size 10 (for printing)
  • set Tab Width: 2
Set up printing

PC (Windows OS)

There are two applications that you need to load onto your laptop in
order to allow you to access this remote machine. The first is PuTTY, which
will allow you to log in to the Thayer School computer to access files. The
second is NotePad++, an editor in which you will write computer programs for
this class. There are several additional steps to configure these applications
correctly so follow the steps listed below.

Install PuTTY
Configure and Run PuTTY
  • double click putty.exe icon on Desktop
  • click 'Run' when security warning appears (uncheck 'Always Ask')
  • make a shortcut
    • enter your assigned remote machine (e.g., engs20-1.thayer.dartmouth.edu) in Host Name
    • enter name (whateveryouwant) in Saved Sessions
    • click 'Save' button to right
  • double click name to start PuTTY session
  • First time click 'Yes' to host key question
  • type your username in the login prompt
    • username is your Dartmouth NetID must be in lower-case, e.g., f00910a
  • enter password
    • Note that nothing may be displayed when you type your password so it seems like it is not accepting what you are typing; have faith and keep typing.
Setup your directory and make your first program
  • type 'ls' to see contents of home directory (folder)
  • type 'mkdir engs20' to create a new directory for this course
  • type 'ls' to see that the new directory was indeed created
  • type 'cd engs20' to change into the new directory
  • type 'ls' to see contents of new directory (should be empty)
  • type 'mkdir workspace' to create a new directory for your programs
  • type 'cd workspace' to change into the new directory
  • type 'ls' to see that there are no files here
  • type 'getfile hello.c' to copy a C program to your directory
  • type 'ls' to see that the file hello.c was indeed copied to your directory
  • type 'cat hello.c' to display the file to the screen
  • type 'compile hello.c' to make your first C program
  • type 'ls' and you should see two new files: hello.o and hello
  • type 'hello' to run your first C program
Congratulations, you just made your first C program!
Install NotePad++
  • go to http://notepad-plus-plus.org/

  • click 'download' on left side of page

  • click on Download icon

  • click 'Save File' when prompted to save npp.x.x.x.Installer.exe

  • double click npp.x.x.x.Installer.exe in the Downloads window that appears

  • answer 'Yes' if asked about installing something downloaded from Internet

  • click 'OK' to install English language version

  • click 'Next'

  • click 'I Agree' to the license

  • click 'Next' to install to default folder (or change at own risk)

  • click 'Next' to install default components

  • check 'Create Shortcut on Desktop' and click 'Install'

  • click 'Finish'

Install NppFTP for Notepad++ to save files to remote machine
  • double click NotePad++ shortcut to start NotePad++
  • go to the Plugins menu and select Plugin Manager -> Show Plugin Manager
  • check the checkbox for the plugin called NppFTP
  • click Install and Yes to allow installation

*** If you don't see the Plugin Manager in Plugin menu: 

  • click the ? icon at the end of the menu bar and select Get More Plugins
  • In the web page that opens, search for the NppFTP plugin and follow the link to download from SourceForge
  • Choose "Open" to view the downloaded files in an Explorer Window
  • Go to the bin folder to find the NppFTP.dll file. Copy this file.
  • In Windows Explorer, navigate to Local Disk C: > Program Files (x86) > Notepad++
    • If you downloaded the 64 bit version of Notepad++ it will be in the Program Files folder
  • Open the plugins folder and copy the NppFTP.dll file into it

Connecting to ThayerFS with NppFTP

  • After you install the NppFTP plugin, restart Notepad++
  • go to the Plugins menu and select NppFTP > Show NppFTP Window
  • click on the gear icon (6th icon from the left)
    • If you don't see the gear icon, click on the >> symbol
  • choose "Profile Settings"
  • click the "Add new" button
  • enter a name for the new profile (e.g., ThayerFS or ENGS 20) and click 'OK'
  • For Hostname, enter engs20-1.thayer.dartmouth.edu 
  • choose SFTP for the Connection type
  • For Username and Password, enter your NetID and password
  • for Initial remote directory, enter: public_html
  • click "Close"
Open file on remote machine
  • click on the connection list icon (1st icon) and select the profile name

  • the first time you connect to a server say 'yes' to the Host Key question
  • navigate to your workspace directory: engs20/workspace
  • double click 'hello.c'
  • you should see the contents of the file hello.c, in color
Make a new program
  • in hello.c, select all (ctrl-a) and copy (ctrl-c)
  • open a new file (ctrl-n) and paste (ctrl-v)
  • modify the program to print out your name
  • save file (ctrl-s)
    • make sure to use a filename with a .c extension, such as new.c
  • In PuTTY, compile your program with the compile command, e.g., type
    compile MyFileName.c 
  • If you type ls now you should see two new files, one with a .o extension and one without any extension e.g. MyFileName.o and MyFileName. If not, your code did not compile correctly and you need to debug it and try again.
    Once you've successfully compiled your code, run your program by typing the file name (without extension) in your PuTTY window and hitting enter e.g.
    MyFileName
Congratulations, you just made your second C program!

Configure NotePad++
  • in Settings->Preferences, on the Language Menu/Tab Settings tab check box to replace tabs with spaces, change Tab size: to 2
  • language for a new file can be chosen from the Language menu or save file with a .c extension
Set up printing


Still need help? Contact Us Contact Us