Table of Contents

Corning Community College

CSCS1320 C/C++ Programming

PROJECT: Already Beginning Concepts (ABC0)

OBJECTIVE

To get started on the course and semester. Bootstrap your access and configuration of various resources, following instructions, contributing to documentation, and asking questions in the discord.

EDIT

You will want to go here to edit and fill in the various sections of the document:

ABC0

NOTE: this is a collaborative document among ALL my classes this semester. That means more people editing. Be mindful that only one person can edit the document at a time.

Only task headings have been provided. You are not expected to know how to do the task given just that description (although in some cases it can be adequately figured out). Instead, if no further information is yet present, ASK FOR DETAILS on the discord.

If something is present but needs polish: spruce it up.

If something is present but is incorrect: please fix it.

This is intended to be an informative, useful document that all can benefit from.

Those with prior experience, please be mindful not to gobble up all the low-hanging fruit from the newcomers.

Get on discord and into class channels

You should have received an invite link via student email before the semester began but if you deleted it by mistake you can go to

https://lab46.g7n.org/haas/spring2024/DESIG

Where you replace DESIG with whichever class you're in:

  • unix
  • cprog
  • data
  • comporg
  • sysprog

The Discord invite link will be the first link under the table towards the top of the webpage

Once on the Discord, in #generalchat post your name and affiliated class.
You will then be given the appropriate role to view your class channel

Log into Lab46 (shell)

Open a terminal and enter the following

ssh ggonzale@lab46.g7n.org

Replace username with your name as it appears to the left of your student email
i.e. the jdoe from jdoe@corning-cc.edu

When/ if prompted for a password it will be your CCC ID by default
i.e. C00123456

Change lab46 password

To change your lab46 password, you have to be logged into the lab46 shell. Then, you need to type the following command:

username@lab46:~$ passwd

You will be asked for your current password, then you will have to enter a new password, and retype it to confirm it:

Changing password for username.
Current password:
New password:
Retype new password:
Clone lab46 semester repo on lab46 (fixrepo)

NOTE: This should only be done once per semester

To setup your repository, in the root directory, run the fixrepo command

username@lab46:~$ fixrepo

This command will setup Mercurial on your system to allow for cloning of your work on whatever you are using(pi, vm, etc). Running this command a second time will refresh things to this state potentially removing any unsaved work elsewhere creating confusion.

Log into Lab46 wiki

Assuming you are reading this you are already on the webpage.

In the top right of the page click login
You'll then be prompted for your username and password

Your username will be your CCC email without the domain
i.e. jdoe from jdoe@corning-cc.edu
Your password (unless changed) will be your CCC ID
i.e. C00123456

You may chose at your own discretion Remember me and click Log In

Change lab46 wiki password (can be same as lab46)

On the top right corner of the wiki there is “Update Profile,” click that to update your profile. Once there type your new password twice and your current one once and then click save. You have now changed your password, good job!

Set up personal development system

WSL

In Windows you can type terminal into your search bar and there you go.

It would behoove of you to install Ubuntu. You can do this in your terminal by typing:

wsl --install -d Ubuntu

You then may have to probably close the terminal and open it back up.

In the top right of the screen next to the tab there is a down arrow, click that. That will bring down a menu, click the settings option.

In the settings, in the “Startup” tab there is a “Default Profile” option you can use to make Ubuntu your default profile when opening up your terminal.

Clone lab46 semester repo on your system

On your system of choice: Pi, VM, Linux distro, WSL, etc. open a terminal.

  • If on a Pi or Debian based distro you can use the following two lines (-O is not a zero)
wget -q https://lab46.g7n.org/~wedge/piph/download -O piph
bash ./piph

This will clone and place your src directory into your home directory.

If you're taking more than one course on Lab46 this semester, you'll want to cd into src, cd into spring2024, then make a new directory for each class using mkdir (EX: mkdir comporg). You can then “grabit” assignments for each class in its appropriate directory.

Pass Phrase on system

While you are setting up your semester repository on your system (example being your pi), you will be prompted to create a passphrase for an extra level of security but you don't actually need to enter a passphrase at all unless you desire to. One of the best passphrases to use is “enter phrase”. Security level: extremely strong.

Note: This is different from the password you enter to get onto lab46. so If you decide to use two different passwords, one for your system and one for getting onto lab46, make sure you understand that they are different.

Create info.text file with information

To create a text file in lab46, use a text editor (vim is a great one). Traditionally, the info.text file should contain at least the following four things:

1) Your name

Name: Fava

2) A good way to reach you (for example, email address)

Email: fbean@corning-cc.edu

3) Which university program you are enrolled in

Program: Biological Computer Science

4) Your discord username

BeanBoi985

There are a couple of different ways to create a text file besides using Vim. One way to create and write a text file is with: echo “your text here” > textfilename.txt

Another Way to create a text file is to use: nano “filename you want to use” or vi “filename you want to use.” This will open the file and from there you can write your text.

Create, compile, and execute hello.c
Create

For this first project, you will need to create and compile the very first program that most programmers learn to write: Hello World.

The hello.c file will contain code written in the C programming language. It should output a greeting such as “Hello World” to the terminal.

Compile

To compile your hello.c file run the following on your system:

gcc hello.c -o hello
Execute

To execute your compiled hello file simply run the following on your system:

./hello
Add, Commit, Push changes to repo
hg add, 
hg commit -m "message go brr"
hg push

Pull and Update project changes on Lab46

To pull and update simply run the following command on either lab46 or on your system:

hg pull; hg update

It will then prompt you to do the following:

enter passphrase for key

Submit project files on lab46

You have to be in the project file on Lab46:

username@lab46:~/src/semester/course/project$ submit course project file1 file2 file3...

Where:
semester is the current semester.
course is your class designation.
project is the project you're submitting for.
fileX are the files being submitted, in this case hello.c and info.txt (be sure to submit the C source code NOT the compiled version)

Once you have submitted the assignment, you should see:

Submitting DESIG project “abc0”:

  1. > hello.c(OK)
  2. > info.txt(OK)

SUCCESSFULLY SUBMITTED

You can also check if a project has been successfully submitted by running a submit check: “submitchk DESIG PROJECT” (EX: submitchk unix abc0)

Customize journal title and intro, edit week1 entry

Scroll to the top of the screen and on the left side of the page there is a grey box. In the grey box there is the underlined word “content” in black. Underneath that there is the word “Journal.” Click that to get to your journal.

Above your journal, there is a gray box which reads “MY NAME's spring2024 Journal”, followed by “OPTIONAL SUBTITLE”. Replace “MY NAME” with your name, and you can replace the subtitle (if you want).

The first section of the journal is the “Introduction”, which you can use to write a few sentences about yourself and your interests.

When in your journal you should click the larger “edit” buttons instead of the smaller ones. Also edit the whole “week” and not just the class subsets as if you edit one and not the other points will be taken off. So if you are taking say Unix and Cprog then edit both for credit and not just one.

It is important to note you must also remove the filler text, that alone is worth a significant amount of points and should not be neglected.

Instead of treating your journal as a chore and aimlessly rambling to reach its required word count, it would be wise to treat your journal as a valuable resource for refreshing your memory on each weekly assignment for future reference. Write what you’ve learned, discoveries you’ve made, notes you took, strategies you used, etc. These entries can be very helpful down the road if you take your time to complete each one.

 

SUBMISSION

To be successful in this project, the following criteria (or their equivalent) must be met:

Submit Tool Usage

Let's say you have completed work on the project, and are ready to submit, you would do the following:

lab46:~/src/SEMESTER/DESIG/PROJECT$ submit DESIG PROJECT file1 file2 file3 ... fileN

You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.

RUBRIC

I'll be evaluating the project based on the following criteria:

13:abc0:final tally of results (13/13)
*:abc0:submitted information for project by duedate [3/3]
*:abc0:got situated in and used class discord [3/3]
*:abc0:contributed to project documentation [3/3]
*:abc0:committed project related changes to semester repo [3/3]
*:abc0:logged into lab46 via SSH [1/1]

Pertaining to the collaborative authoring of project documentation

Additionally