Jump to: navigation, search

OPS435 Online Lab1

2,751 bytes added, 15 January
Task 2: Create a project and make a pull request on GitHub
'''Introduction to git,, and Python'''
= Lab Objectives =
:* Using the "git clone" command to clone a repository into a new directory
= Overview =
:*In this lab, you will create an account on and follow the Github "Hello World guide" to create a new public repository on github to and explore the basic workflow of using github to track and manage revisions of software or other contents. The essential operations provided by Github includes:**creating new repository, :**creating a new branch, :**making changes to files, :**creating a pull request, and :**opening and merging a pull request. :*You will then use the git client (git clone) on to access and download the contents of the repository you created on github. Note: if you have your own Linux VM ready, you can also install and use the git client on your VM.:*You will also use the git client on to clone the repository on which hosts the Python scripts for lab 1. :Study *Finally, study, create and execute the simple Python scripts downloaded from the lab 1 repository.
= Reference=
:* Open a pull request, and
:* Merge your pull request
: Please make the following <font color='red'>changes </font> when following the guide::* name the new repository using your <b><u>Seneca user name </u></b> instead of "hello-world".
:* add your full name, and OPS435 section to the README file, do not post any other personal information there.
:* run the following two commands and capture their output to the named files:
git log > ~/ops435/lab1/gitlog.txt
tree -a > ~/ops435/lab1/repo_tree.txt
:* Make sure that gitlog.txt and repo_tree.txt are not emptyand are under the ~/ops435/lab1 directory. Review and study the contents of gitlog.txt and repo_tree.txt :*Download the check script and check your work. Enter the following commands from the bash shell.<source lang="bash"> cd ~/ops435/lab1/ pwd #confirm that you are in the right directory ls -l #confirm that you have the directory for you github repo, the files gitlog.txt and repo_tree.txt ls || wget python3 ./ -f -v lab0a</source>
= Investigation 2 - Python on Matrix =
:* You can access the Python Interpreter on Matrix from a Linux machine or a Windows 10 machine.
=== Login to from a CentOS 7 machine ===
:<font color='red'>This option won't work after September 1, 2020 as had been moved under Seneca's VPN. The latest version of the openconnect client is need to connect to the Seneca VPN. We are working on the instruction on how to do that. In the mean time, please use the Windows 10 as described below to connect to matrix.</font>:* To login to must you must have a active Seneca user account.
:* The following is a screen shot showing the login from a CentOS Linux (host or vm) system with an active Seneca user name: <br /><br />[[image:centos_ssh.png|Ssh to matrix from Linux]]
=== Login to from a Windows 10 machine ===
:* Please follow the instruction at [ Seneca Student VPN] to download and install the GlobalProtect VPN client and connect to the Seneca VPN to your Windows Machine.
:* Login to with your Seneca user name from Windows 10's run box.<br /><br />[[image:window10_ssh.png|ssh to matrix from Windows 10]]
:** <source>python3 2>/dev/null</source>
:** <source>python3 test 2>/dev/null </source>
:*Download the check script and check your work. Enter the following commands from the bash shell.<source lang="bash">
cd ~/ops435/lab1/
pwd #confirm that you are in the right directory
ls -l ~/ops435/ #confirm that you have create the directory structure under ~/ops435
ls || wget
python3 ./ -f -v lab0b
= Investigation 3 - exploring and using Python's built-in functions =
=LAB 1 SIGN-OFF Upload the following files individually to Blackboard=
:* gitlog'''Run the script and capture the result'''<source>python3 ./ -f -v &> lab1_[seneca_id].txt</source> : contains Submit the output of the command "git log" from Task 3following files individually to Blackboard::* repo_tree.txt: contains the output of the command <span style="tree color:green;font-asize:1.5em;" from Task 3>&#x2713;</span> <code>lab1_[seneca_id].txt</code>:* lab1_check.txt: contains the output of the command <span style="python3 color:green;font-size:1.5em;">&#x2713;</checkLab1span> <code>gitlog.txt, repo_tree.txt,, -f -v",</code>
= Lab Review =
:# What is the name of the definitive branch in a git repository?
:# What is a "pull request" related to a branch in a git repository?
:# Write Python code that when run, will perform the following tasks:<ol type="a"><li>Contain a she-bang line</li><li>Display a greetings message to the user</li><li>display an empty line ('''hint:''' use the special character '''\n''' to print the a new-line character)</li><li>Display text, '''"Your current directory is:"''' (You are NOT required to display quotation marks)</li><li>Display the current working directory pathname (using an appropriate command)</li><li>Display another empty line</li></ol>
:# How do you execute a Python script when you are within the interactive <u>python3</u> shell? (Hint: make use of a function provided by the os python module.)
:# How do you execute a Python script when you are in the <u>Bash</u> Shell (i.e. NOT within the python3 shell)?
:# Write the pipeline command to check if the checking script exists, and download it from the location:<br>

Navigation menu