Difference between revisions of "EGR 103 Startup"

From PrattWiki
Jump to navigation Jump to search
(25 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page will be a guide to how to get working on things for EGR 103.
+
This page will be a guide to how to get working on things for [[EGR 103]].  It has been updated for Spring 2018.
  
  
 
== Resources ==
 
== Resources ==
The main resources for [[EGR 103]] will be:
+
The main resources for [[EGR 103]] are listed on the bottom of that page.  There is also Pratt Pundit's [[:Category:EGR 103]], which collects page of special interest to EGR 103 students.
* Class web page: [http://classes.pratt.duke.edu/EGR103F12 http://classes.pratt.duke.edu/EGR103F12] - has the schedule, all the lab manual and appendix handouts, and contact information
 
* Duke Sakai page: [https://sakai.duke.edu/portal/site/egr103f12  https://sakai.duke.edu/portal/site/egr103f12] - this page will have the grades and a discussion board
 
* Pratt Pundit [http://pundit.pratt.duke.edu http://pundit.pratt.duke.edu] - you're here! This page will have various pages of special interest to EGR 103 and to Pratt in general.
 
** Pratt Pundit's [[:Category:EGR 103]], which collects page of special interest to EGR 103 students.
 
  
 
== Working from Home / Other Computers ==
 
== Working from Home / Other Computers ==
 
{{:Working from home}}
 
{{:Working from home}}
  
== Lab 1 ==
+
== One-time-only activities ==
 +
There are a couple things you will do during the in-lab time part of lab 1 that you (should) only have to do once.  They are:
 +
* Setting up your UNIX account - this will be done in lab.
 +
* Setting up permissions for your directories - this process is described at [[User:DukeEgr93/WindowsPermission]] and will also be completed during lab.
 +
<!--
 +
* Setting up the default paper sizes for [[LaTeX]].  This must be done since he default case for the dvips and dvipdf commands is to use A4 paper. To correct this, log into a Teer machine (login-teer.oit.duke.edu) and type
 +
texconfig
 +
: Press return to continue, then in the window that comes up, arrow down to the second row, PAPER. Hit return, then arrow down to LETTER and hit return. You may need to press return to continue after some configuration files have been changed. When you get back to the colorful window, hit return to EXIT.
 +
-->
 +
 
 +
== Other activities ==
 
To work on the lab from your own computer, follow these steps:
 
To work on the lab from your own computer, follow these steps:
* If on Windows, start X-Win 32.  Make sure the white X with the blue background shows up in the bottom right of your window.  Point to it with the mouse and hover - it should say "Display 0" or something similar.  If there is a number different from 0, right click and exit X-Win, then restart X-Win.  You need to be using Display 0.
+
* If on Windows, start [[MobaXterm]]
* Start a terminal program.  On Windows, this is [[PuTTY]] while on Macs it is in the [[X11R6]] package.  Use it to connect to one of the Teer machines.  Note that if that particular machine doesn't connect, close the terminal program and try again with a different Teer machine.
+
* If on Mac, start the Terminal program in the [[XQuartz]] package.  Use it to connect to the login-teer machines.   
* Test the graphics connection by typing <code>xterm &</code> - if the xterm window comes up - great!  If not, note the following:
+
* Test the graphics connection by typing <code>xterm &</code>
*# If the error says display type is not set, you forgot to enable X11 forwarding in [[PuTTY]]
+
** If the xterm window comes up - great!  If not, note the following:
*# If the error says there some protocol issue, close [[PuTTY]] and try connecting to a different machine
+
*** For Macs, you need to type <code>xhost +</code> in a terminal window once -- this generally stays in place for the rest of the time you own that computer...
 
* Once connected to a terminal and testing the graphics, change into your lab 1 directory with:
 
* Once connected to a terminal and testing the graphics, change into your lab 1 directory with:
 
<source lang="text">
 
<source lang="text">
cd EGR53
+
cd EGR103
 
cd lab1
 
cd lab1
 
</source>
 
</source>
or
+
Note: the EGR103 directory will be created during Lab 1.
<source lang="text">
 
cd EGR53/lab1
 
</source>
 
 
* Edit your lab report with [[emacs]] using
 
* Edit your lab report with [[emacs]] using
 
<source lang="text">
 
<source lang="text">
Line 38: Line 41:
 
</source>
 
</source>
 
:Make sure LaTeX compiles!  If not, check what kind of error there is:
 
:Make sure LaTeX compiles!  If not, check what kind of error there is:
** If LaTeX can't see lab1.tex or sits there with two asterisks, hit CTRL-D
+
** If LaTeX can't see lab1.tex or sits there with two asterisks, hit CTRL-D and figure out where the file is.
** If it is some other error, hit CTRL-C, then hit x.  Fix the problem in [[emacs]] and run again.
+
** If it is some other error, hit CTRL-D and identify the error.  Fix the problem in [[emacs]] and run again.
*Once LaTeX succeeds, run [[okular]] with:
+
*Once LaTeX succeeds, run [[dvipdf]] with:
 +
<source lang="text">
 +
dvipdf lab1.dvi
 +
</source>
 +
to create a PostScript file.
 +
* Finally, use [[evince]] to view the pdf file:
 
<source lang="text">
 
<source lang="text">
okular lab1.dvi &
+
evince lab1.pdf &
 
</source>
 
</source>
:Don't forget the &!  There may be a bunch of little warnings and errors that pop up.  Make sure you ran okular on the dvi file and be patient - it will most likely come up eventually.
+
:Don't forget the &!  There may be a bunch of little warnings and errors that pop up.   
*To print, use the print command in okular and select the "lp0" printer.  If your documents are not showing up in your ePrint queue when you swipe your card, see the [[ePrint]] page for troubleshooting info.
+
*To print, use the print command in evince and select the "lp0" printer.  If your documents are not showing up in your ePrint queue when you swipe your card, see the [[ePrint]] page for troubleshooting info.
 +
 
 +
As you are editing your document, you should add a little to the .tex file in the emacs window, save the .tex file, and process it with LaTeX.  If that works, then run the dvipdf command -- if evince is open and viewing the PDF file, it will detect a change in the PDF file and automatically load the latest version.
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Blank Document ===
 +
If 
 +
emacs lab1.tex &
 +
command brings up a blank document!  You probably forgot to get into your lab1 directory.  Be sure to type both parts of
 +
cd EGR103
 +
cd lab1
 +
=== Windows Don't Show Up ===
 +
The
 +
emacs lab1.tex &
 +
command doesn't seem to do anything.  You probably do not have graphics set correctly.  To check, type
 +
xterm
 +
without an ampersand.  If you get an error message about the display not being set or localhost not working or something like that, you need to re-do your session to accept graphics.  For both [[MobaXterm]] and [[XQuartz]], make sure you have the -XY part of the line of code you are typing in to connect to a Teer machine.
 +
<!--make sure [[Xwin]] is running and make sure in [[PuTTY]] that you correctly hit the X11 Forwarding Enabled box in your session. -->
 +
=== The File is Locked ===
 +
If you try to open a file in emacs and at the bottom of the window you get a message:
 +
  ".../EGR103/lab1/lab1.tex locked by NetID@login-t... (pid nnnn): (s, q, p, ?)?"
 +
This usually happens if your connection closed unexpectedly while editing the document.  Navigate to the folder and type:
 +
ls
 +
If there is a file similar to the one you are editing but surrounded by hashtags, that is what is causing the problem.  The easiest solution is, in that little emacs window with the message above, type "s"
  
 
== Questions ==
 
== Questions ==

Revision as of 00:07, 10 January 2018

This page will be a guide to how to get working on things for EGR 103. It has been updated for Spring 2018.


Resources

The main resources for EGR 103 are listed on the bottom of that page. There is also Pratt Pundit's Category:EGR 103, which collects page of special interest to EGR 103 students.

Working from Home / Other Computers

This page is a combination of two old pages on how to get work done, along with some expanded content on how to get work done on personal computers and Duke's public dual-boot MACs. Please note - nothing on this page should cost any additional money to install! One quick note - to access the Duke system (whether ssh connection or mounting a drive) you either need to be on DukeBlue or have a VPN connection. If you are trying to log in or mount a drive and you keep getting permission denied or failure to connect, make sure you haven't been kicked off DukeBlue.

Connecting from Off Campus

If you are connecting from somewhere without DukeBlue access, you will need to install and connect using a Virtual Private Network, or VPN. Instructions for doing that are below:

FALL 2020 AND BEYOND

There are new ways to get work done and we will work on those during EGR labs. Folks in EGR 103 in Fall of 2020 should not look at the items below as some of the processes are different from how EGR 103 is teaching things this semester.

Your Own Windows Computer

This section covers how to get work done if you are working on your own Windows computer.

File Access

You should have Box Drive installed and a Box folder in your C:\Users\USER folder. See https://duke.app.box.com/services/browse/newest/box_drive for installation information. If you want your folder to continuously sync with the cloud, right-click the folder and make the folder available offline. To synchronize, you must either be on Duke internet or have a VPN connection, which is described on the link above.

Connecting to Duke's Linux Machines

If you need to connect to Duke's Linux machines (i.e. login.oit.duke.edu), you can use MobaXterm - more information on that is at the MobaXterm page.

Using LaTeX

In Fall 2020 and beyond, we started using Overleaf to process LaTeX files. It is decidedly less complicated, though you do have to create a project and upload any necessary files to it.

Python

You can install Anaconda by going to Download. Download the Python 3.* version. Be sure you have your Box drive mounted and save your files there while working with Spyder.

MATLAB

There are two main options for using MATLAB -- you can either install MATLAB or connect to Duke's Linux machines and use MATLAB there (using the matlab & command). See OIT's MATLAB & Simulink page and specifically the Download information section for more information. Be sure you have your Box drive mounted and save your files there while working with MATLAB on your own computer.

Your Own MAC Computer

This section covers how to get work done if you are working on your own MAC computer.

File Access

You should have Box Drive installed and a Box folder in your Finder. See https://duke.app.box.com/services/browse/newest/box_drive for installation information. If you want your folder to continuously sync with the cloud, right-click the folder and make the folder available offline. To synchronize, you must either be on Duke internet or have a VPN connection, which is described on the link above.

Connecting to Duke's Linux Machines

If you need to connect to Duke's Linux machines (i.e. login.oit.duke.edu), you can use XQuartz and specifically its Terminal program - more information on that is at the X11 page. Note: For Mac users only - the very first time you open the terminal window, you need to type xhost + to tell your computer to allow incoming graphical windows.

To connect to the virtual Linux machines, simply open your terminal window and type

ssh -XY NetID@login.oit.duke.edu

where NetID is your NetID.

Using LaTeX

In Fall 2020 and beyond, we started using Overleaf to process LaTeX files. It is decidedly less complicated, though you do have to create a project and upload any necessary files to it.

Python

You can install Anaconda by going to Download. Download the Python 3.* version. Be sure you have your Box drive mounted and save your files there while working with Spyder.

MATLAB

There are two main options for using MATLAB -- you can either install MATLAB or connect to Duke's Linux machines and use MATLAB there (using the matlab & command). See OIT's MATLAB & Simulink page and specifically the Download information section for more information. Be sure you have your Box drive mounted and save your files there while working with MATLAB on your own computer.

Chromebooks

Duke is issuing Chromebooks to people who have computers being repaired right now. Chromebooks are excellent at what they do, which unfortunately does not include the ability to run most of the software for this class. The best bet here will be to create a virtual Windows machine with Duke and then use the Chromebook to connect to it.

Initial Steps

There are several initial steps to take to get a virtual machine reserved and running as well as to make it possible for your Chromebook to connect to it.

Cisco AnyConnect

If you are not on the Duke network, you will need to get Cisco AnyConnect from the Chrome Web Store. Once installed and initialized, make a new connection. You can give it whatever name you want ("Duke") seems appropriate and use vpn.duke.edu as the Server Address. After you have added the connection, you can click on the Chromebook settings (bottom right of the screen), click the drop-down box for VPN, and then click the connection you just named. You will need to have multifactor authentication. Note that a session can only last up to 24 hours.

Remote Desktop

You will need to install Remote Desktop 8 from the Chrome Web Store. This is the program that will actually make the connection to your virtual machine.

Making a Reservation

See VCM#Getting_Started for instructions on how to make a reservation. Your reservation will last for a semester and can be renewed.

Using Your VM with Chromebook

  • Be sure you have an active AnyConnect connection
  • Go to https://vcm.duke.edu/ and look at your virtual machine reservation by clicking the link to your virtual machine. If the "Power on" button is available, click it to turn your machine on. Once on, click the "Remote Desktop" link under General Information.
  • Select "Show in folder" to see the file you just downloaded, then right-click the downloaded file, select "Open with...", and select "RD Client" -- if you have the AnyConnect working, after a bit the Remote Desktop program will ask for your name and/or password. Your name is "WIN\NetId" (where NetID is YOUR NetID, but without any @duke.edu) and the password is your password.
  • From this point on, you get to use your virtual Windows machine the same way a person would use a Windows machine. Given that, you can go through the information on using a Windows Computer above.

Duke MACs Booted Into Windows

The Duke dual-boot MACs in Hudson and elsewhere have a Windows partition. See OIT's Locations and Hardware page for more information. There are also 8 dual-boot MACs Pratt's IT department has placed in Teer basement. As of 8/25/2020, not all of the software below has been installed and several of the public machines are to accessible. For Fall of 2020 you will generally need to have your own computer to do work.


PRIOR TO FALL 2020

Your Own Windows Computer

This section covers how to get work done if you are working on your own Windows computer.

File Access

To mount your CIFS folder on your Windows computer, see the OIT page CIFS: How to Connect from Windows. This will allow you to mount your CIFS drive. You must either be on Duke internet or have a VPN connection, which is described on the link above.

  • Notes:
    • For the first step, instead of what the instructions say, start the file explorer by clicking the yellow File Explorer icon at the bottom of the page; after that comes up, click "This PC" on the left side of the File Explorer. At the top of the screen there are three tabs - the middle one is "Computer" - click that. You can now click the Map Network Drive icon and proceed with the rest of the instructions.
    • For step 4, you only need the first part which is \\homedir.oit.duke.edu\users\N\NetID with N as the first letter of your NetID and NetID as your NetID

Connecting to Duke's Linux Machines

For Spring of 2021, you will not need to connect to the Duke Linux machines for any of Dr. G's classes. However, if you need to connect to Duke's Linux machines (i.e. login.oit.duke.edu) for some other reason, you can use MobaXterm - more information on that is at the MobaXterm page.

Using LaTeX

There are two main options for using LaTeX -- you can either connect to Duke's Linux machines and use those tools (emacs to edit, dvipdf to convert, evince to view or to print) or you can use TeXworks. TeXworks is a part of the MiKTeX package for Windows; you should install MiKTeX. Be sure you have your CIFS drive mounted and save your files there while working with TeXworks.

Python

You can install Anaconda by going to Download. Download the Python 3.* version. Be sure you have your CIFS drive mounted and save your files there while working with Spyder.

Another option is to use a Spyder program that has been included with a Duke Docker Container. The downside of this method is that there is currently no mechanism for accessing your CIFS files from the container. There is a workaround for that which we are not quite ready to teach you.

MATLAB

There are two main options for using MATLAB -- you can either connect to Duke's Linux machines and use MATLAB there (using the matlab & command) or you can install MATLAB. See OIT's MATLAB & Simulink page and specifically the Download information section for more information. Be sure you have your CIFS drive mounted and save your files there while working with MATLAB.


Your Own MAC Computer

This section covers how to get work done if you are working on your own MAC computer.

File Access

To mount your CIFS folder on your Windows computer, see the OIT page CIFS: How to Connect from Mac OS. This will allow you to mount your CIFS drive. You must either be on Duke internet or have a VPN connection, which is described on the link above.

Connecting to Duke's Linux Machines

If you need to connect to Duke's Linux machines (i.e. login.oit.duke.edu), you can use XQuartz and specifically its Terminal program - more information on that is at the X11 page. Note: For Mac users only - the very first time you open the terminal window, you need to type xhost + to tell your computer to allow incoming graphical windows.

To connect to the virtual Linux machines, simply open your terminal window and type

ssh -XY NetID@login.oit.duke.edu

where NetID is your NetID.

Using LaTeX

There are two main options for using LaTeX -- you can either connect to Duke's Linux machines and use those tools (emacs to edit, dvipdf to convert, evince to view or to print) or you can use TeXworks. TeXworks requires installation of MacTeX, followed by installation of TeXworks. Be sure you have your CIFS drive mounted and save your files there while working with TeXworks.

Python

You can install Anaconda by going to Download. Download the Python 3.* version. Be sure you have your CIFS drive mounted and save your files there while working with Spyder.

Another option is to use a Spyder program that has been included with a Duke Docker Container. The downside of this method is that there is currently no mechanism for accessing your CIFS files from the container. There is a workaround for that which we are not quite ready to teach you.

MATLAB

There are two main options for using MATLAB -- you can either connect to Duke's Linux machines and use MATLAB there (using the matlab & command) or you can install MATLAB. See OIT's MATLAB & Simulink page and specifically the Download information section for more information. Be sure you have your CIFS drive mounted and save your files there while working with MATLAB.

Duke MACs Booted Into Windows

The Duke dual-boot MACs in Hudson and elsewhere have a Windows partition. See OIT's Locations and Hardware page for more information. There are also 8 dual-boot MACs Pratt's IT department has placed in Teer basement. As of 8/26/2018, not all of the software below has been installed.

This section covers how to get work done if you have logged into that partition.

File Access

Your CIFS folder should automatically be installed as a drive on This PC - just start the File Explorer (double click on the yellow folder a the bottom of the screen) and then select "This PC" from the list at left. Your drive should show up in "Network locations." If it does not, follow the instructions to Mount your drive via windows.

  • Notes:
    • For the first step, instead of what the instructions say, start the file explorer by clicking the yellow File Explorer icon at the bottom of the page; after that comes up, click "This PC" on the left side of the File Explorer. At the top of the screen there are three tabs - the middle one is "Computer" - click that. You can now click the Map Network Drive icon and proceed with the rest of the instructions.
    • For step 4, you only need the first part which is \\homedir.oit.duke.edu\users\N\NetID with N as the first letter of your NetID and NetID as your NetID
    • If you logged into the Windows machine using Duke credentials - for example, you logged into a computer in Fitzpatrick B209 - you can skip steps 6-8 because the computer already knows you as your Duke self.

Connecting to Duke's Linux Machines

If you need to connect to Duke's Linux machines (i.e. login.oit.duke.edu), you can use MobaXterm - this should already be installed on the Windows partition. To find it, either go Start->File Transfer & Remote Access->MobaXterm Personal or simply type Moba in the Cortana search (accessed by clicking the magnifying glass icon at the bottom of the screen). From there, follow the instructions for Creating a Remote Connection.

Using LaTeX

There are two main options for using LaTeX -- you can either connect to Duke's Linux machines and use those tools (emacs to edit, dvipdf to convert, evince to view or to print) or you can use TeXworks. TeXworks is already installed on the Windows partition; however, it is currently (23AUG2018) out of date and the version it has cannot install new packages. Be sure you have your CIFS drive mounted and save your files there while working with TeXworks.

Python

Currently, the Windows partition does not have Anaconda installed -- the version of Python it has is called IDLE and it is lacking many of the modules we will be using for class. To get around this you can install Anaconda on the Windows partition by going to Download. Download the Python 3.* version. Install for "just me" and use all the default options. You do not need to install the Microsoft tools at the end. This process takes about 6 minutes to complete and, unfortunately, only forks for the computer you are sitting at for the session that is currently active. Once you log out, the next time you log in you will start with a clean slate.

Another option is to use a Spyder program that has been included with a Duke Docker Container. The downside of this method is that there is currently no mechanism for accessing your CIFS files from the container. There is a workaround for that which we are not quite ready to teach you.

MATLAB

There are two main options for using MATLAB -- you can either connect to Duke's Linux machines and use MATLAB there (using the matlab & command) or you can start MATLAB on the Windows partition. For the latter, either go to Start->MATLAB R2017a->MATLAB R2017a or simply type matlab in the Cortana search (accessed by clicking the magnifying glass icon at the bottom of the screen).

One-time-only activities

There are a couple things you will do during the in-lab time part of lab 1 that you (should) only have to do once. They are:

  • Setting up your UNIX account - this will be done in lab.
  • Setting up permissions for your directories - this process is described at User:DukeEgr93/WindowsPermission and will also be completed during lab.

Other activities

To work on the lab from your own computer, follow these steps:

  • If on Windows, start MobaXterm
  • If on Mac, start the Terminal program in the XQuartz package. Use it to connect to the login-teer machines.
  • Test the graphics connection by typing xterm &
    • If the xterm window comes up - great! If not, note the following:
      • For Macs, you need to type xhost + in a terminal window once -- this generally stays in place for the rest of the time you own that computer...
  • Once connected to a terminal and testing the graphics, change into your lab 1 directory with:
cd EGR103
cd lab1

Note: the EGR103 directory will be created during Lab 1.

  • Edit your lab report with emacs using
emacs lab1.tex &
Don't forget the &!
  • After saving the file with emacs, process the LaTeX file with
latex lab1.tex
Make sure LaTeX compiles! If not, check what kind of error there is:
    • If LaTeX can't see lab1.tex or sits there with two asterisks, hit CTRL-D and figure out where the file is.
    • If it is some other error, hit CTRL-D and identify the error. Fix the problem in emacs and run again.
  • Once LaTeX succeeds, run dvipdf with:
dvipdf lab1.dvi

to create a PostScript file.

  • Finally, use evince to view the pdf file:
evince lab1.pdf &
Don't forget the &! There may be a bunch of little warnings and errors that pop up.
  • To print, use the print command in evince and select the "lp0" printer. If your documents are not showing up in your ePrint queue when you swipe your card, see the ePrint page for troubleshooting info.

As you are editing your document, you should add a little to the .tex file in the emacs window, save the .tex file, and process it with LaTeX. If that works, then run the dvipdf command -- if evince is open and viewing the PDF file, it will detect a change in the PDF file and automatically load the latest version.

Troubleshooting

Blank Document

If

emacs lab1.tex & 

command brings up a blank document! You probably forgot to get into your lab1 directory. Be sure to type both parts of

cd EGR103
cd lab1

Windows Don't Show Up

The

emacs lab1.tex &

command doesn't seem to do anything. You probably do not have graphics set correctly. To check, type

xterm

without an ampersand. If you get an error message about the display not being set or localhost not working or something like that, you need to re-do your session to accept graphics. For both MobaXterm and XQuartz, make sure you have the -XY part of the line of code you are typing in to connect to a Teer machine.

The File is Locked

If you try to open a file in emacs and at the bottom of the window you get a message:

 ".../EGR103/lab1/lab1.tex locked by NetID@login-t... (pid nnnn): (s, q, p, ?)?" 

This usually happens if your connection closed unexpectedly while editing the document. Navigate to the folder and type:

ls

If there is a file similar to the one you are editing but surrounded by hashtags, that is what is causing the problem. The easiest solution is, in that little emacs window with the message above, type "s"

Questions

Post your questions by editing the discussion page of this article. Edit the page, then scroll to the bottom and add a question by putting in the characters *{{Q}}, followed by your question and finally your signature (with four tildes, i.e. ~~~~). Using the {{Q}} will automatically put the page in the category of pages with questions - other editors hoping to help out can then go to that category page to see where the questions are. See the page for Template:Q for details and examples.

External Links

References