cover photo

COURSEWORK

Jeff's CL-CY-001 course work. Lv 2

Jeff Jacob JohnAUTHORACTIVE
This Report is yet to be approved by a Coordinator.

Level 1 Task Report

1 / 4 / 2024


Task 1 - JavaScript

The objective of this task was to learn JavaScript and to make a webpage that takes in the names and marks of ten students and calculates the:
Percentage of each student Class average
Rankings of the students
JavaScript is suitable for this task because JavaScript is a versatile programming language commonly used for web development. It runs directly in the browser, allowing for dynamic interaction with web pages without needing to rely on server-side processing.
image
image
Link to code:

Task 2 - Async JS

Asynchronous programming is a programming paradigm that allows multiple tasks to be executed concurrently, rather than sequentially. In an asynchronous program, tasks can start and complete independently of each other, and the program doesn't have to wait for one task to finish before starting another.

Common patterns and mechanisms for asynchronous programming include:
1. Callbacks: Functions that are passed as arguments to other functions and are called once an asynchronous operation completes.

2. Promises: Objects representing the eventual completion or failure of an asynchronous operation. They allow attaching callbacks to handle the success or failure of the operation.
3. Async/Await: A more recent addition to JavaScript, async functions enable writing asynchronous code in a synchronous-like manner using the async and await keywords, making it easier to work with asynchronous code and handle errors.
Here for this task, we use callback functions in JavaScript. A callback function is a function that is passed as an argument to another function and is executed at a later point in time or under specific conditions.

![Untitled video - Made with Clipchamp (1)(https://github.com/JeffJohn424/Level2/assets/118456282/0a940cc0-a2b1-4466-add9-b7077157a08a) Link to code:

Task 3 - Promises

Here, instead of using callback based approach we use promise based approach to solve the task

**1. Callback-based Approach:**In the callback-based approach, the displayStep function accepts a callback function as an argument. This callback function is executed after the step is displayed. The cookRecipe function recursively calls itself, passing a callback function to displayStep for each step.

**2. Promise-based Approach:**In the promise-based approach, the displayStep function returns a promise that resolves after a delay. The cookRecipe function uses reduce to chain promises for each step. The .then() method ensures that each step is displayed sequentially.
function displayStep(step, callback) { setTimeout(() => { // Display the step callback(); // Execute the callback function }, 1000);}function cookRecipe(steps, index) { if (index < steps.length) { displayStep(index, function() { cookRecipe(steps, index + 1); // Call cookRecipe recursively }); } else { console.log(\Recipe complete! Enjoy your dish!\"); }}

Key features of promises:

*Promises offer cleaner and more readable code compared to nested callbacks, especially when dealing with multiple asynchronous operations.

*Promises provide built-in error handling through the .catch() method, making it easier to handle errors in asynchronous code.

*Promises offer utility methods like Promise.all , which allows executing multiple promises concurrently and handling their results collectively.
Link to code:

Task 4 - Get familiar with the command line and do the following subtasks:

These are some of the commands that were used to perform various functions. I created 2600 files in a particular folder called test (using loops). Also concatenated two .txt files.

2. **cd:** change directory/path.  
3. **mkdir:** as the name suggests, it creates a new directory.  
4. **touch:** create an empty file.  
5. **ls:** shows the list of files in the folder.  
6. **ls-l:** displays other information of the file such as size, last modification date. 
7. **cat:** it is used to concatenate and display the contents of the file.  
8. **echo:** to display text or to concatenate and display multiple lines of text.<br />  ```
![image](https://github.com/JeffJohn424/Level2/assets/118456282/c976e5be-94c9-4577-9c4c-38817f12107f)  
![image](https://github.com/JeffJohn424/Level2/assets/118456282/d5664e75-34b9-4f73-9239-36e22a9f3737)  
# Task 5 - VI
The default editor that comes with the UNIX operating system is called vi (visual editor).  Learnt the basics of VI, created an md file that contains an article about VI and its features .<br />  
![WhatsApp Image 2024-04-03 at 10 46 38](https://github.com/JeffJohn424/Level2/assets/118456282/8c5dfb36-c014-43d5-9ca2-4aebff7130d6)
![WhatsApp Image 2024-04-03 at 10 46 38 (1)](https://github.com/JeffJohn424/Level2/assets/118456282/74c76ed2-9dd1-4c5b-87e4-91db56ca7995)
[link to markdown file: ](https://github.com/JeffJohn424/Level-2/blob/main/marveltask.md)
# Task 6 - Linux Continued
Got a basic understanding about regex, piping and grep working. The task required us to extract login times within a date/time range from the login logs. Used the last command. Had to create a folder called logs and the extracted information was put into a .txt file. And then this folder was zipped using gzip and tar.<br />  
![WhatsApp Image 2024-04-03 at 10 20 56](https://github.com/JeffJohn424/Level2/assets/118456282/2f052763-5558-4ab5-a3aa-2b61c67b9243)
![WhatsApp Image 2024-04-03 at 10 20 56 (1)](https://github.com/JeffJohn424/Level2/assets/118456282/3c57b0f5-4756-45b0-b429-84d95836adb3)
# Task 7 - Introduction to Cloud Computing
Watched the videos provided to understand the basic benefits, components of cloud computing. <br />  
***Cloud Computing*** refers to data and applications being stored and run on the cloud rather than on your local computer. The data and applications on the cloud are accesed by using internet. So the workload is no longer on the local computer but on the cloud. Cloud is a big building filled with computers ie. servers.<br />     
There are **3 service models** of cloud computing i.e. 
1. **Iaas**(Infrastructure as a service)
2. **Paas**(Platform as a service) 
3. **Saas**(Software as a service).<br />  
Also got good exposure to the services offered by the big 3 Cloud Service Providers AWS, Microsoft Azure, and Google Cloud Platform and which one is preferred by major businesses.
![60620c16c5f94ad437447fa1_Comparison-table](https://github.com/JeffJohn424/Level2/assets/118456282/d375e322-7b93-4824-a87f-dbe5412344c7)<br />  The objective of the task was to get familiar with the process of setting up a local file sharing solution. Here is the procedure to do the same:
```- Go to Network Sharing Center & gt; 
Advanced Sharing settings and ensure network discovery and file sharing are enabled in both systems. - Services > SSDP Discovery > Properties > Startup type must be set to Automatic- The same must be done for the UPnP device host, Function Discovery Provider Host, and Function Discovery Resolution Publication.  - Head to Properties of the file to be shared and then go to Advanced Settings. Select `Share this folder` > Permissions > Allow all permissions. Click on `Share`. Provide access to everyone and permit to read/write and then share. The file will be visible on the receiver system. ```
# Task 8: Introduction to Cybersecurity
***Cybersecurity*** is the practice of protecting systems, networks, and programs from digital attacks. These cyberattacks are usually aimed at accessing, changing, or destroying sensitive information; extorting money from users via ransomware; or interrupting normal business processes.<br />  
***Cryptography*** is technique of securing information and communications through use of codes so that only those person for whom the information is intended can understand it and process it. Thus preventing unauthorized access to information. The prefix “crypt” means “hidden” and suffix “graphy” means “writing”. In Cryptography the techniques which are use to protect information are obtained from mathematical concepts and a set of rule based calculations known as algorithms to convert messages in ways that make it hard to decode it.<br />  Conversion of  "Cybersecurity in Marvel"  into various ciphers:
```1. Caesar Cipher: F C E H U V H F X U L W B
2. Pigpen Cipher: ⨁⨂⨂⊡⊓⨅⨂⊔⨂⊓⊡⨅⨂⊓⊔⨅⊔⨂⨅⊓⊓⨅⨂⊓⊡⊔
3. Morse Code: -.-. -.-- -... . .-. ... . -.-. ..- .-. .. -.-- / .. -. / -- .- .-. ...- . .-..
4. Rail Fence Cipher (3 Rails): CERSY ENIUAVBRLM
5. Polybius Square Cipher: 33 54 12 15 52 53 33 35 15 24 53 45 31 14 24 45 11 13 54 15 42 52 15 33 21
6. Playfair Cipher: G V Z R V K S Z R U S Q A N K V U```"

UVCE,
K. R Circle,
Bengaluru 01