cover photo

COURSEWORK

Shreyas's CL-CY-001 course work. Lv 3

Shreyas S RaoAUTHORACTIVE

Level 2 Task Report

31 / 3 / 2024


Task 1 - Javascript.

The objective of this task was to learn the basics of JavaScript (JS) a cross-platform, object-oriented programming language used by developers to make web pages interactive. It allows developers to create dynamically updated content, use animations, pop-up menus, clickable buttons, control multimedia, etc.
In the course of this task, I made use of the reference articles provided and watched Youtube videos to learn the syntax of JS and DOM. I then created a simple webpage using HTML and JS which collects the marks of 10 students as input and displays the Percentage, Ranking, and Class Average in a table. Screenshot 2024-03-31 174951 Screenshot 2024-03-31 175010
Link for the source code


Task 2 - Async JS

  • Asynchronous programming is a technique that enables your program to start a potentially long-running task and still be able to be responsive to other events while that task runs, rather than having to wait until that task has finished. Once that task has finished, your program is presented with the result.
  • In JS, asynchronous programming is done in 3 ways:
    1. CallBacks
    2. Promises
    3. Async/Await
  • Callback function: A JavaScript callback is a function that is to be executed after another function has finished execution. A more formal definition would be - Any function that is passed as an argument to another function so that it can be executed in that other function is called a callback function.

In this task, I have displayed the steps in the making of ice cream using the callback function.

Screenshot 2024-03-30 192119 Link for the code


Task 3 - Promises

The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value. A Promise is a proxy for a value not necessarily known when the promise is created. It allows you to associate handlers with an asynchronous action's eventual success value or failure reason.

  • A promise is one of the following 3 states:
    1. pending: initial state, neither fulfilled nor rejected.
    2. fulfilled: meaning that the operation was completed successfully.
    3. rejected: meaning that the operation failed.
  • .then and .catch are the 2 methods used in promises to perform sequential operations and in error handling.

In this task, I used the same recipe from earlier but executed it using promises and .then method.

Screenshot 2024-03-31 184241
Link for the code

Promises v/s Calbacks

Promises are the preferred choice for handling asynchronous operations in modern JavaScript code. They offer improved readability and error handling, making it easier to manage complex asynchronous workflows.

Benefits of Promises

  • Improves Code Readability
  • Better Handling of Asynchronous Operations
  • Better flow of control definition in asynchronous logic
  • Better Error Handling

Task 4 - Get familiar with the command line

Had decent exposure to the Ubuntu Command Line from the common task.

  • Used the mkdir command to make a blank directory
  • Used the pwd command to print the working directory
  • Used cd and ls command to change the directory and list its contents.
  • Used the touch command to create 2600 files.
  • Used touch command to create a blank .txt file and then entered data into it using echo command.
  • Used the cat command to concatenate the contents of two files and the> redirecting operator to store the contents of these 2 files in the first file. Screenshot from 2024-03-31 00-18-15 Screenshot from 2024-03-31 00-37-25

Task 5 - VI

The default editor that comes with the Linux/UNIX operating system is called vi (visual editor). Using vi editor, we can edit an existing file or create a new file from scratch. we can also use this editor to just read a text file.

  • vi [file_name] opens the file in the vi editor.
  • It consists of two modes, namely Command Mode which opens by default and Insert Mode. Command mode is used to navigate around the file and perform certain commands like y for copy, v for paste, and :wq for save and quit.
  • i is used to enter the insert mode where we enter data into the file. esc is used to exit the insert mode and go back to command mode.

Below is the markdown article that was written in VI:

Screenshot from 2024-03-31 00-41-44

Link


Task 6 - Linux Continued

  • Regex which stands for Regular Expressions, are patterns that describe a set of strings that match the pattern. They are used to match character combinations in strings.
  • Piping is a powerful feature in Linux that allows you to connect the output of one command to the input of another command. This is done using the pipe symbol, which is a vertical bar |
  • The last command in Linux is used to display the list of all the users logged in and out since the file /var/log/wtmp was created.
  • The grep command in Unix/Linux is a powerful tool used for searching and manipulating text patterns within files. Its name is derived from the ed (editor) command g/re/p (globally search for a regular expression and print matching lines), which reflects its core functionality.
  • The Linux tar stands for tape archive, which is used to create Archive and extract the Archive files. The tar command in Linux is one of the important commands that provides archiving functionality in Linux. We can use the Linux tar command to create compressed or uncompressed Archive files and also maintain and modify them.
  • gzip, short for GNU Zip, is a command-line compression tool commonly found on Linux systems. It utilizes the DEFLATE compression algorithm to reduce the size of files, making them more manageable for storage and transmission.

In this task, I used the above commands to create a blank logs directory, fetch the previous login data, and store them in a file within the directory. This is then archived and compressed into a smaller file.

Screenshot from 2024-03-31 01-43-25


Task 7 - Introduction to Cloud Computing

Watched all the video links provided and got a decent understanding of the basics of Cloud Computing, its components, and its benefits. Understood the classifications of cloud computing based on the deployment model and services model and learned their classifications more closely. 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.
Screenshot 2024-03-31 035103 The hands-on activity in this task is to get familiar with a local file-sharing solution. Due to the lack of another computer in the vicinity, could not fully complete the task but watched the resource video provided, and here is my understanding of the procedure to set up file sharing in Windows.

- Go to Network Sharing Center> 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 Cyber Security

Watched the resource videos provided to understand the basic building blocks CIA and how they are achieved in an organisation. Understood the major types of cyber threats, types of cyber specialist and cyber criminals, their motives and the basis for cyber crime in the first place.
Understood the NIST cybersecurity framework, its principles and objectives.

Cryptography is a way to protect digital data and messages using mathematical systems and algorithms. It often uses special keys that only the sender and recipient have access to.

In this hands on task, I have converted the given message Cybersecurity in Marvel into various ciphers listed below.

  1. Morse Code: -.-. -.-- -... . .-. ... . -.-. ..- .-. .. - -.-- / .. -. / -- .- .-. ...- . .-..
  2. Polybius Cipher: 135412154243151345422444542433321142511531
  3. Playfair Cipher: EXGUSOAEEOOUTMINESCAQC Keyword: UVCE
  4. Caesar Cipher: Hdgjwxjhzwnyd ns Rfwajq Shift: 7
  5. Rail fence Cipher:
Cu
ycrnM
beiialest reryv

Rails: 5
6. Pigpen Cipher:
Screenshot 2024-03-31 204015


UVCE,
K. R Circle,
Bengaluru 01