cover photo

COURSEWORK

maxus_red's CL-CY-001 course work. Lv 1

maxus_redAUTHORACTIVE

Level 1 tasks report

22 / 4 / 2023


Task 1 - Javascript

Learn the basics of javascript and create a small webpage which takes the names and marks of ten students and calculates the

Images showing the working of the website

  • The interface of the web page img1
  • Entering data img2
  • Expected result img3

Task 2 - Async JS

Learn about asynchronous javascript and implement a small callback based program that displays the steps of a food recipe (consisting of at least 10 steps).
Topics learnt:

Images showing the working of website

  • The interface of the web page img1
  • Clicking on submit button img2

Task 3 - Promises

img Benefits of using promise over callback functions

  • Promises are better than Callbacks as callbacks create a situation called callback hell
  • Code is readable and better maintained when promises are used to handle async code than when callbacks are used.
  • Error handling is quite easy with JavaScript promises.

    The Same code for task 2 has been re-written with help of promises

Github link for source code


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

  • Create a folder named test.
  • cd into that folder.
  • Create a blank file without any using any text editor.
  • list the files in that folder
  • create 2600 folders in this folder where each folder is named like . For example, M90 or B56.
  • concatenate two text files containing any random text and display them on the terminal

Images showing the terminal commands and folders


Task 5 - VI

Learn the basics of vi and create a markdown file in vi illustrating the various features of vi that you found to be fascinating.

1. Some features of VI

  • Full-screen editing and scrolling capability
  • Separate text entry and edit modes
  • Global substitution and complex editing commands using the underlying ex commands.

    2. Some commands of VI
  • In command mode, enter i to insert/edit file
  • Enter x to delete character
  • Enter dd to delete complete line
  • Enter :wq to save and quit the file

Images showing terminal commands and VI in working


Task 6 - Linux Continued

Learn the basics of regex and piping in Linux. Using the knowledge gained from the above two topics, learn how grep works. Use grep to extract login times within a date/time range from the login logs using the 'last' command. Pipe this information into a text file and put it into a folder named logs. Zip this folder using gzip and tar.

Learnings

  • Regex: Regex (regular expressions) is a powerful pattern matching technique used in Linux for precise text search and manipulation.
  • Piping: Piping in Linux connects the output of one command to the input of another, enabling the seamless flow of data and facilitating complex operations.
  • Grep: Grep is a versatile command in Linux that utilizes regex patterns to search and filter text efficiently, making anit an invaluable tool for extracting specific information from files or streams.
    img What i did :
  • created a folder named logs
  • created an empty text file named task6
  • used the last command to get login information, piped the info with grep command to search pattern
  • the search pattern was to search for login details where date was 24th of month and time was between 1 pm to 7 pm, the result of this command was written into the task6 file
  • moved the task6 file into logs folder
  • archived the logs folder with tar
  • finally compressed the tar file with gzip

    Github link for the source code

UVCE,
K. R Circle,
Bengaluru 01