Complete the lab help form then email it to the link below.
Email: cslabadmin@cs.iusb.edu
Phone: (574) 520-4335
The Lab Supervisor office is NS203, stop by if more help is needed.
-
How to
-
- Compile your program with debug information, and give it a name. -g is the option that allows the program to run in a debugger
- g++ -g -o filename filename.cc
- Start debugging program. Include execution name of program on command line.
- gdb filename
- Use break line number or break function name to add a break point.
- Type run to start running the program.
- Type clear to erase the breakpoint on the current line when the program stops at a break point.
- Type bt to see the backtrack of function calls when the execution stops at a break point.
- Type print expression to see the value of a variable or expression.
- Type step to execute one line of code or cont to continue the execution of the program until the next break point.
- Type stop to stop the execution of the program or quit to exit gdb altogether.
We have the gdb debugger installed, as well as Eclipse, which is an integrated IDE with a GUI similar to VisualStudio and contains a debugger. gdb is the GNU debugger and can be run directly from the command line (terminal).
Follow these steps
gdb may also attach to an actively running process to monitor it's execution. First acquire the PID (Process ID) of the process you want to debug, then start the gdb program and enter the following from the prompt. This is useful when debugging client/server style programs…
-
(gdb) attach
pid
Additional Debuggers on Linux
ddd - Stands for Data Display Debugger. This is a graphical interface frontend for the GNU Debugger (by default), or can be used in conjunction with other command-line debuggers as follows...
-
ddd binaryFilename ‐‐debugger debuggerName
lldb - Newly available on RHEL 7, lldb is a newer debugger capable of debugging C, C++, Objective C, and Objective C++. Developers accustomed to MacOS users may be familiar with lldb as the default debugger in Xcode.
-
lldb binaryFilename
Users may request that additional debuggers be installed on the system to provide more specific functionality.
Contact the CS Systems Administrator via Email (cslabadmin@cs.iusb.edu) to request any new software packages.
- Compile your program with debug information, and give it a name. -g is the option that allows the program to run in a debugger
-
A Linux installation CD or DVD can be created in any operating system.
First, acquire a CD/DVD image, which is usually a disk image file with the extension .iso, from any trusted distribution site. Here are some of the popular distributions:
- Red Hat Enterprise Linux (RHEL) - The distribution currently in our labs, developed by Red Hat and targeted towards the commercial market. RHEL is available only through a paid subscription service that provides access to software updates and varying levels of technical support, however IU Students have access to all releases of RHEL and can acquire a RHEL support community account through the following IU Knowledge Base webpage:
Knowledge Base or IU Site Index of /linux - Fedora - A free collection of software, including an operating system based on the Linux kernel, developed by the community-supported Fedora Project and owned by Red Hat. Fedora's main objective is not only to contain software distributed under a free and open source license, but also to be on the leading edge of such technologies, usually making upstream changes instead of applying fixes specifically for Fedora. Think of Fedora as a "prototypical version" of the future of RHEL.
- Ubuntu - A free distribution form Canonical, very popular and easy to use, with cloud and mobile support.
- Community Enterprise Operating System (CentOS) - A Linux distribution that attempts to provide a free enterprise class computing platform which has 100% binary compatibility with its upstream source, Red Hat Enterprise Linux (RHEL). One could easily think of CentOS as "The Free Version" of RHEL since CentOS developers use Red Hat's source code to create a final product very similar to RHEL. CentOS possesses an extensive open source support community.
- Linux Mint - A Debian and Ubuntu based distribution, popular, easy to use, with great support.
- Oracle Linux is a free Linux distribution provided by Oracle.
- Red Hat Enterprise Linux (RHEL) - The distribution currently in our labs, developed by Red Hat and targeted towards the commercial market. RHEL is available only through a paid subscription service that provides access to software updates and varying levels of technical support, however IU Students have access to all releases of RHEL and can acquire a RHEL support community account through the following IU Knowledge Base webpage:
-
-
- Download the .iso file for the chosen distribution.
- Insert a blank DVD in your writable optical drive.
- Right-click on the DVD Icon when it appears on the desktop.
- Click Open on the menu.
- Drag the .iso file you wish to burn into the window.
- Give your new install/live media disc a name and click Write to Disc.
- You will be prompted to select HOW you want your media burned.
- Burn as File only copies your .iso file to the disc for later access, but this burn format will NOT “boot- up” as an installation or live media.
- Burn Contents will burn the .iso to your disc so it will "boot-up", or "run" when you insert the media. ~This is most likely what you want~
- Verify that your .iso is selected in the Select a disc image to write box.
- Verify that your burn disc is selected in the Select a disc to write to box.
- Click Burn, and wait for your media to finish.
-
- Insert a blank DVD in your writable optical drive
- Right-click on the .iso file and select Burn disk image.
- Check the box, Verify disc after burning to make sure the .iso was burned without any errors.
- Click Burn, and wait for your media to finish.
Windows 10
-
- Insert a blank DVD in your writable optical drive.
- Open a Terminal window.
- In the Terminal Window, navigate to the directory where your .iso exists.
- cd/Users/username/Downloads
- Use the hdiutil command to burn the .iso file to a disc as follows…
- hdiutil burn filename.iso
- Wait for your media to finish.
MacOS X
-
All C.S. students who have enrolled in CSCI-C 151 are assigned user accounts on the Computer Science Linux network, and are granted a maximum disk quota of 2.0 GB (2.0 GB Soft Limit, and 2.25 GB Hard Limit). If a user exceeds the "hard limit" of 2.25 GB, the user's write permissions will be temporarily suspended until they reduce their data usage to less than 2.0 GB. If a user exceeds only the "soft limit" of 2.0 GB, they will have a grace period of 7 days to remove excessive data from their home directory before their write permissions are suspended. Students who desire more than 2.0 GB of disk space can request quotas larger than 2.0 GB, however this requires prior approval from a member of Faculty or the CS Systems Administrator.
-
- Open a terminal or console.
- Use the command quota or quota -v
- your current disk usage,
- whether your account quota is in violation of the hard limit, or
- how long you have before your account exceeds the soft limit grace period.
- If you're working with large amounts of data, it is advised that you use the quota command frequently.
- If:
- your account appears to be “locked”,
- your write permissions have been revoked, or
- your account is at risk of exceeding the soft limit grace period…
- Use the suggestions below to free space in your account.
-
- Suggestions For Lowering Disk Usage
- Identify the locations with the largest amount of data
- You may run the following command to view the how much disk space each file in your current directory is using...
- Used correctly, you can start in your home directory to track down and remove the largest offending data files in your account.
- Remove your core dump files.
- These files are created when a process exits abnormally, and can be safely deleted. Run...
- to find all core files in your home directory.
- Steps to proactively reduce Firefox web browser cache.
- NOTE** This will not help reduce your current disk usage! It will only reduce future data usage.
- Start Firefox
- Select Preferences from the Edit menu
- Click on Advanced
- Click on Network
- Under Cached Web Content click on Clear Now. You can also do the same with Offline Web Content and User Data
- You can also reduce the amount of space used for cache by checking the box Override automatic cache management and selecting how much space you want to allow for it.
- Remove Backup Files.
- If you edit a file named foo.c Unix will create a backup copy named foo.c~
- You can find these files by running...
- Remove Orphan Files.
- These files are left when a process is killed unexpectedly. To find them run...
- Compress Larger Files.
- If you have a file named foo.c,
- will compress the file and replace it with one named foo.c.gz Use...
- to uncompress it, or...
- to view it without needing to uncompress
cd; du ‐s .[A‐z]* * | sort ‐n
find ~/. ‐name core
cd; find . ‐name \*~
cd; find . ‐name #\*#
gzip foo.c
gzip ‐d foo.c.gz
zcat foo.c.gz
-
Check for Linux compatibility. Many are not supported by Linux.
In most cases, plugging in the USB drive or CD will cause it to be automatically mounted. The icon will appear on the desktop in that case.
The mount point is most likely goind to be /media/usb or /media/CD or some other similar name.
-
- Change the permissions of your home directory using a relative path
- Create the public_html directory in your home directory if it doesn’t exist
- Change the permissions of your public_html directory using a relative path
- Your home page file should be named “index.html”. Create this file as
- Populate your public_html directory with your web page files
- All files you want visible on the Internet in your public_html directory should be world readable
- Test your new web site. First start your web browser (e.g. firefox, chrome), then enter the URL
Follow these steps to set up your personal web site accessible from your Linux account.
chmod o+x ~
mkdir ~/public_html
chmod o+x ~/public_html
touch ~/public_html/index.html
chmod o+r ~/public_html/*
www.cs.iusb.edu/~yourAccountName
-
-
Standard user accounts may either select the appropriate printer from the file-print menu of whatever text editor or word processor they’re using, or if a terminal method is preferred, users may employ the lpr command to print a file to their current lab’s default printer. The printers and their corresponding CS Labs are as follows...
Printer Name IP Address CS Lab Number
cslp1 149.161.65.128 NS207A
cslp2 149.161.65.144 NS207B
cslp3 149.161.65.160 NS209
You may print a file from the command line on Linux by typing the following… lpr <filename>
You may view your Linux workstation's printer queue to see what jobs are waiting to print by typing the following… lpq or lpq –P<printer name>
Users may attempt to delete their own print jobs from the print queue by typing the following... cancel or lprm –P<printer name><print job number>
Printing From Windows or MacOS
There are no special procedures required. However, when the "Print" dialog box appears ensure that the printer name (cslp1, cslp2, or cslp3) is selected.
Printing Issues
Users may attempt to clear their own print jobs from their workstations’ print queues, however the printer queue on a workstation is “jammed” with backlogged print jobs from another user(s) and they’ll need to request that the CS Systems Administrator clear the jobs for them since Standard Users are not permitted to tamper with other users'print jobs.
If a printer is not responding to print jobs sent from a workstation and nobody else in the Lab is printing, users may attempt to flush the printer's physical memory by unplugging the printer's power cable. Wait at least 15 seconds before restoring power, in order to allow the printer's capacitors to fully discharge and flush the RAM. If the printer is still not responding to print jobs, users will need to contact the CS Systems Administrator (either knock on the NS 203 door, or send an Email to cslabadmin@cs.iusb.edu) for further assistance.
- No special procedures required. However, when the Windows "Print" dialog box appears check that cslp1, 2, or 3 is the default printer, depending on the lab where you are. If it is not, enter "cslp1", 2, or 3 in the "Printer Name" box.
-
- Help: github.com
- Learning Resources: Git and GitHub learning resources
- Simulation Environment: github.io
- Pro Git Book: github book
- Command Cheat Sheet and Reference: Reference
- Tutorial Video
-
Linux Basics
- What is Unix and how to user it?
- Vi/Vim Text Editor (Help Vim, Tutorial Video, Cheat Sheet)
- Emacs Text Editor (Guided Tour, Cheat Sheet)