MTU CS Lab:FAQ
From CSL Wiki
[edit] Computer Access
[edit] Which labs and machines can I access?
You can use pizza, scifi, icu and language labs at the CS department. The access to some special purpose labs (and machines) requires a CS faculty member to sponsor. The undergrad students can log in to any machines in the csl.mtu.edu domain and the grad students can also access machines in the cs.mtu.edu domain.
[edit] Who do I see if I can't log into my account?
See the Lab Administrator.
[edit] Why do I pay a course fee when I already paid a basic fee for the same equipment and software?
If we charged only a basic computing fee, then only majors would pay for the computing equipment - non-majors would use it for free. This would mean that the CS majors would have to pay a lot more than they do now. The only way to get non-majors to help pay is to charge a course fee, and there is no way to charge only non-majors the fee - all students, both majors and non-majors who are enrolled in the course must pay it. If you are not enrolled in any classes during a particular term, and you do not pay your basic computing fee to keep your account active, your CS account will be turned off.
[edit] How long is my account active for?
Your account is active as long as you are enrolled in a course at the CS department.
[edit] How to remote login from home?
It is recommended that you login to wopr.csl.mtu.edu using ssh. If you are trying to access from windows machine, there are a lot of softwares available for this purpose. One such software is PuTTY. You can download it from http://www.putty.nl/latest/x86/putty.exe.
[edit] How to transfer files from home?
You can transfer files using ssh or sftp. The recommended host is wopr.csl.mtu.edu. For windows, WinSCP is perhaps the most common software used for this purpose. Visit http://winscp.net/eng/download.php to download WinSCP.
[edit] How to login to guardian?
Guardian is a SUN machine running Solaris Operating System. Some classes, for example cs3911, may require students to do projects using software under Solaris Operating System. Currently guardian is located in a secure server room and students do not have access to the physical machine. There are a couple of ways to remote log in to guardian:
- If you are using the CS lab machines or any Unix/Linux machines within the MTU network, first log in to the local PC, them open a terminal and type the command ssh guardian. Then when prompted, enter your NIS password - which is your M-number initially.
- If you are using a Windows machine within MTU network, you can use putty to login to guardian. (The host name would be guardian.)
- If you need to login to guardian from home, you can try ssh or putty as in the steps above. Because of the access control set up on guardian, you may get "connection refused"; it depends what ISP you use. If so, please login to the remote server (wopr.csl.mtu.edu or joshua.csl.mtu.edu) first and then run the command ssh guardian.csl.mtu.edu.
- Note: Depending on where you are logging in from, you may get away with including less of the name on the command line. For example, if you are using ssh to login from off campus, you will need the full name guardian.csl.mtu.edu. If you are logging in from campus, but not the CS lab, you can use guardian.csl. And finally, if you are logging in from the CS lab, you can just use guardian.
If you still have problems to login after trying, contact csmaint@mtu.edu with detailed error description.
To verify that you have logged into guardian, use the hostname command. (See How to check the name of the computer you are using? listed below.)
[edit] Printing
[edit] Where are the printers located?
The printers laser112, laser112A are in room 112 and laser113 is in room 113. Printers labeled with a "d" at the end print on both sides of the page and are the same physical printers as ones with the same name minus the "d".
[edit] How to print a PDF file?
Adobe Acrobat Reader is the default program for pdf files. To print a file from Acrobat, select print from file menu or click printer icon on the toolbar. Then select printer from drop down list. Adjust other properties as per your requirements and click OK. The screenshot below uses laser113.
[edit] How to print a PDF file from command line?
Use the following command:
$lpr -Pprinter_name filename.pdf
If you want to print a file named assignment.pdf at printer laser112:
$lpr -Plaser112 assignment.pdf
If you don't specify the printer, the file is printed at the default printer. The default printer is the nearest printer from your computer. It is set in the environment variable PRINTER. You can view the current default printer using the following command:
$echo $PRINTER
[edit] My PDF prints smaller and smaller pages, how can I fix that?
The problem has to do with Adobe's duplexing not working with our printing setup. The solution is to turn off Adobe's duplexing and just send the document to one of our duplexing print queues.
To turn off Adobe Reader's duplexing function for a document:
- Click on "File" on the menu bar.
- Select "Print..." from the dropdown menu.
- In the Print Dialog window, select one of the duplex printing queues (The duplex printing queues have a "d" at the end of the printer name.)
- Click on the "Properties" button in the upper right corner of the Print Dialog window. (It may take a while for the Properties window to open up.)
- Where it says "Duplex Printing", change the option to "Off".
- Click "OK" to save the change.
- Make any other adjustments you desire and then click "OK" to print the document.
[edit] How to print using double column for source code?
Use the following command:
$enscript -2Gr -Pprinter_name filename
If you don't specify the printer, default printer is used. Default printer is specified by the environment variable PRINTER and it will be your nearest printer.
[edit] How to print a PS file?
Evince is the default program for postscript files. To print a file from evince, select print from file menu and select the appropriate printer. You can also use the the program gv for postscript files (it works for pdf files too). To print from gv, select print marked to print the current page or print all to print the whole document. In the print command dialog box, enter lpr -P<printer_name>. You can just enter lpr if you want to use the default printer.
[edit] How to print openoffice presentation handouts?
Click on View -> Handout page.
Then Format -> Slide Layout and click on the number of slides you want per page.
Then select File -> Print, click on options, and in the contents select Handouts (unselect Drawing).
[edit] How to change page orientation in OpenOffice?
Apparently changing between protrait and landscape in OpenOffice's print dialog box doesn't work. Use the following steps:
- Click on the "Format" menu.
- Select "Page..." from the popup menu.
- Select the "Page" tab.
- Change the page layout to the appropriate orientation (Portrait/Landscape).
- Make sure the "Format" is set correctly (typically "Letter" unless you want to print on legal paper or some other special size paper).
[edit] What do I do if I have problems with printing?
Contact the lab consultants on duty or email csmaint@mtu.edu.
[edit] Storage
[edit] How do I recover a deleted file?
A checkpoint copy of your home directory is made every day between 11am and 1pm. The past 3 days of checkpoint copies are kept, so if the file existed between 11am and 1pm in any of the past 3 days, you can restore the file yourself by following the steps below. If the file had been deleted more than 3 days ago, then follow this link to <a href='http://wiki.cec.mtu.edu/wiki/index.php/Backups'>the CEC's File Recovery Request page</a> with the name and location of the file you want restored, and a date of when the file existed. If it was created and deleted in the same day and you've already removed it from the trash, then there is no way the file can be restored.
To restore file from checkpoint copy:
- Using the GUI interface
- Double click on your home directory folder that should be on your desktop.
- Press Ctrl+L or click on "file" and then select "Open Location...".
- Add /.ckpt to the location given.
- Double click on the folder most likely to contain the file that you want. Folders are labeled with the date and time (YYYY_MM_DD_hh.mm.ss_EDT).
- Navigate to where the file is stored and then just drag and drop it onto your desktop or whereever you want to restore it to.
- Using a terminal window.
- Open a terminal window in your home directory.
- Change directory to the .ckpt directory (cd .ckpt).
- Change to the directory with the date that is most likely to have the file to be restored. Folders are labeled with the date and time (YYYY_MM_DD_hh.mm.ss_EDT).
- Navigate to where the file was stored and then copy it to your home directory, or whereever you want to restore it to.
Make sure you're copying it to your home directory and not elsewhere in the checkpoint directory.
[edit] How much storage space is available?
For majors the soft limit is 150 MB and hard limit is 220 MB. Similarly for non-majors soft limit is 40 MB and hard limit is 50 MB. Generally, you can exceed soft limit upto the hard limit for a grace period of one week after which the soft limit becomes the hard limit. There is no quota for grad students
[edit] How do I view the disk usage?
You can use the command quota -v to view your disk usage. The output will be similar to the following:
Disk quotas for user yourid (uid 33232):
Filesystem blocks quota limit grace files quota limit grace
colossus.csl.mtu.edu:/export/major
4688 150000 220000 244 0 0
The above output shows that the user yourid has used 4688 blocks (1000 blocks = 1MB), the soft limit is 150000 blocks (150 MB) and the hard limit is 220000 blocks (220 MB). Grace will be number of days you are allowed to be over soft limit. It is not applicable as long as you are under quota. Similarly, files are the total number of files owned by the current user. There is no quota on the number of files. I don't have much files, but still my quota shows high usage. What is the problem?
The spaces might have been occupied by the hidden files and directories. Filenames begining with . are hidden. To view all files use the option -a with the ls command. You can also clear the browser cache, the object files (.o files), and executable files to save disk space. $ls -a Typical output of the command is as follows. Note that the names begining with . are hidden.
. .. .gconf .ppracer .AbiSuite .gconfd .qt .Trash .gnome2_private .rhosts (some other files)
.dmrc .mozilla bin .eclipse .mplayer Desktop
You can use the du command to view the total space occupied by a directory. If you want to view the total disk space used by a directory named Desktop in your home directory,
$du -sh Desktop 208M Desktop
The -s option is for summary and -h option is to print sizes in human readable format (e.g., 1K, 234M, 2G)
[edit] What if I need more storage temporarily?
If you want more storage for temporary purpose, you can use the /scratch directory. Unlike the home directories, the /scratch directory is specific to a machine and not backed up.
[edit] How to Burn a CD?
The lab machines have k3b, a cd burning tool, installed. Type k3b in command line to open the k3b window. You can also open K3b in Gnome from Applications->Sound & Video->K3b.
[edit] How to use USB flash memory?
Plug in the USB into the box. An icon pops up at the desktop indicating the USB flash memory. The mount point is /mnt/usb. Remember to unmount after you are done. To unmount right click the usb icon and select unmount or use the command umount /mnt/usb at the shell prompt. Remember to close all the windows accessing the flash before unmount. If you are using the command line be sure to cd to another directory before issuing the umount command.
[edit] WWW
[edit] How do I make a personal web page?
The personal site is stored in your ~/.WWW directory. Home.html is the index page. The URL of personal page is http://www.csl.mtu.edu/~yourid . Example for editing your personal site-
$cd ~/.WWW $vi Home.html
- You can use your favorite editor in place of vi.
- Note that you might get error message while accessing your page. Make sure that your home directory has execute permissions for others (recommended 711) and .WWW directory has read and execute permissions for others (recommended 755).
The output of the ls command should be similar to the following, note the permissions
$ls -ld ~ drwx--x--x 66 yourid student 3072 Feb 21 12:13 /home/grad/yourid
$ls -ld ~/.WWW drwxr-xr-x 3 yourid student 512 Feb 21 13:07 /home/grad/yourid/.WWW
Use chmod command to change permissions.
$chmod 711 ~ $chmod 755 ~/.WWW $man chmod for details
[edit] How to clean up your web browser cache?
For firefox, Click on Edit, go to preferences. Then click Privacy icon. After that click on cache. Click clear to clean the current cache contents. It is recommended that you set only 1024 KB for cache.
[edit] Mozilla/Firefox will not allow me to open a new browser window?
After a crash, mozilla and firefox may have a lock file that didn't get cleaned up and prevent opening a new window. Mozilla lock file is located at ~/.mozilla/[Profile Name]/lock and firefox lock file is located at ~/.mozilla/firefox/[Random String.Profile Name]/lock. You have to delete the lock files if these programs complain during startup.
Also, Firefox will sometimes tell you that you already have a browser window open when you don't and won't let you open a new one. This is due to an internal file called .parentlock. Simply use the following command to find the offending file and then use the rm command to delete the found file(s).
find . -name .parentlock
[edit] Firefox opens, but when I try to check my mail or surf to a new page, it closes?
Check your disk usage. Odds are that you are over your quota.
[edit] Other Software
[edit] How to use submit?
Log on to any machines in the csl domain. Change the current working directory to the one having the file to submit. Then type submit on the command line. Then select the requires class, section and assignment. Then press space to mark the required file and press return to submit. Filenames of the files you submit should not contain any whitespace characters.
You should get a verification email after submiting your assignment.
[edit] How to use vi?
Vi is the most common text editor on UNIX systems. Vi stands for "visual editor", it is pronounced "vee-eye". Enter the command vi at the shell prompt to run the program. You can also pass the name of the file you want to edit as an argument to vi. There are two main modes the command mode and the input mode. Press i to enter the input mode. From input mode press [ESC] to return back to command mode. Commands start with :. To save the current file, type in :wq [RETURN]. To exit without saving, enter :q! [RETURN]. The one installed in the lab machines is called vim (Vi improved). There is also a graphical version called gvim. For details read the man page of vi. There is also an interactive tutorial of vi. Type vimtutor at the shell prompt to run the tutorial. You can also visit http://www.vim.org/docs.php for various vi documents.
[edit] I am having weird problems with some software XYZ, what do I do?
First check whether you have exceeded your quota. It is always a good idea to leave some free space in your home directory. If that doesn't help contact csmaint.
[edit] Eclipse won't open, what should I do?
Eclipse might complain about the lock files after a crash. The lock file is located at .metadata/.lock in the current workspace. Delete any files in that directory.
Also, eclipse doesn't work if you are over quota, so be sure to check your disk usage. (See How do I view the disk usage? section above.)
[edit] Simple System Administration
[edit] How to change your PATH enviroment variable?
$setenv PATH ${PATH}:/your/new/path
If you want this change to reflect every time you login, include the above line in the file .cshrc in your home directory.
[edit] How to kill a program?
Find the process id of the program using the ps command. Then use the kill command to kill the required process.
For Linux, use $ps -ef to list the currently running processes.
For Solaris, use $ps -aux to list the currently running processes.
$kill -[signal] #processid
Use the -9 signal only as a last resort.
[edit] How do I change my default shell?
The default shell is /bin/tcsh. If you want to change your default shell, use the command ypchsh. It will ask for your password and the shell you want to make default. You are advised not to do this unless you know what you are doing.
You can use other shells temporarily by typing the name of the shell. For example, if you want to use the bash shell, type bash at the command prompt. Use exit to return to the previous shell.
[edit] How do I convert an MS-DOS text file to a Unix/Linux text file?
Short answer: dos2unix
Long explanation:
Unix/Linux text file uses one character (0x0a, decimal number 10) to indicate a new line of text. On the other hand, MS-DOS text file uses two characters linefeed (LF, 0x0d) and carriage return (CR, 0x0a) to represent a new line of text.
If you use software (such as winftp) to transfer individual files from Windows to Unix, the chance is the software will convert the file format for you correctly.
If you use USB memory key to transfer files from Windows to Unix, the chance is the file format stays as DOS text file.
Some applications can recognize and preserve the style consistent automatically (such as vim on Fedora), so the users will not have trouble to work with a MS-DOS file.
But not all applications will do so. For example, Fortran compiler will have trouble to work with MS-DOS format file. Since Fortran is a semi-line oriented language, it can interpreter CR/LF as two lines, one ended by CR and the other by LF. Consequently, the continuation line is broken.
So it is better to make sure that you use the right format.
The utility dos2unix can convert a DOS text file to UNIX text file:
$dos2unix dos_file.txt newfile.txt
Also, the utiltity unix2dos can use used to convert a unix text file to MS-DOS text file.
For more info, type man dos2unix or man unix2dos.
To check if a file is MS-DOS on Fedora Linux, type file [filename],
[ruihong@mushroom ~]$ file ms_dos.txt
ms_dos.txt: ASCII text, with CRLF line terminators
To check if a file is MS-DOS on Solaris OS, type vi filename and you will see a ^M at the end of each line.
[edit] How to check the name of the computer you are using?
In the terminal window, enter the command hostname.
[ruihong@mushroom ~]$ hostname mushroom
[edit] How to check the operating system of the computer you are using?
In the terminal window, enter the command uname -a.
For example, mushroom is running FC7.
[ruihong@mushroom ~]$ uname -a Linux mushroom 2.6.23.15-80.fc7 #1 SMP Sun Feb 10 17:29:10 EST 2008 i686 i686 i386 GNU/Linux
Guardian is runing Solaris 8.
[ruihong@guardian ~]$ uname -a SunOS guardian 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-2
[edit] MSDNAA
[edit] How to get MSDNAA account?
All the students of CS department are eligible for MSDNAA account. The SAs create MSDNAA accounts for all new eligible students at the beginning of each semester. You shall receive an email including instructions and your initial password when your account was created. Your account will be removed if you are no longer eligible.
[edit] What if the software I want to download from MSDNAA is not listed?
Visit http://msdn07.e-academy.com/elms/Storefront/Home.aspx?campus=mtu_cs and log in with your MSDNAA account to find out what software are free for download. If the software you want to download is not listed, send an email to csmaint. The software will be added to the download list if available.
[edit] How to request for redownload in MSDNAA?
Fill out the online form which is shown when you try to redownload a software. You will get a confirmation email when the system is ready to allow redownload.
