7 / 2 / 2023
The Level 1 task in the cybersecurity/cloud computing domain provided me with a comprehensive introduction to various topics including JavaScript; asynchronous programming; the command line; vi; regular expressions; and piping in Linux. I was able to understand the basics of these topics and implement them in small projects.
These tasks helped me lay a strong foundation in these areas and equipped me with the skills and knowledge necessary to tackle more advanced topics in the future. It was an engaging and challenging task that broadened my horizons and helped me grow as a programmer. I am confident that the knowledge and experience I have gained will be valuable to me in my future endeavors in the field of cybersecurity and cloud computing.
the tasks are explained briefly and mostly in layman terms
In this task; I learned the basics of JavaScript and created a small webpage that takes the names and marks of ten students and calculates: - The percentage of each student - The class average - The rankings of the students.
The following code demonstrates my understanding of basic JavaScript programming:
https://gist.github.com/vodori6161/dad3566e7d90ab1b1ce76bf01827c1bc
In this task; I learned about asynchronous JavaScript and implemented a small callback-based program that displays the steps of a food recipe (consisting of at least 10 steps).
The following code demonstrates my understanding of asynchronous JavaScript programming:
https://gist.github.com/vodori6161/5f4e1640c719f77c1f34f0118b5ade0f
This code defines an array recipeSteps that contains the 10 steps of a food recipe. Then; it defines a function displayRecipe that takes a callback function as a parameter and displays the recipe steps one by one. Finally; the code calls the displayRecipe function and provides a callback function that logs a message to the console after the recipe steps have been displayed. This implementation uses a forEach loop to iterate over the recipeSteps array and display each step. The use of a callback function ensures that the message \Enjoy your delicious cake!" is displayed only after all the recipe steps have been displayed.
In this task; I implemented the above recipe program with promises and listed the potential benefits and improvements of using promises.
Here is the code for the promise based program:
https://gist.github.com/vodori6161/1505bd46a4dcad501661bf0c82488533
The use of promises has several benefits and improvements over using callbacks:
- Better error handling: Promises provide a clear way to handle errors and exceptions. In the example code; if an error occurs while displaying the recipe steps; the promise is rejected and the error message is logged to the console.
Improved readability: Promises make the code easier to read and understand; especially for asynchronous code. The use of the then and catch methods makes it clear what should happen after the promise is resolved or rejected.
Chaining: Promises can be easily chained together to perform multiple asynchronous operations in a concise and readable way. For example; you could add a step to the food recipe that saves the recipe to a database; and chain that step to the displayRecipe promise to ensure that it only runs after the recipe has been displayed.
Better performance: Promises are designed to be more efficient than callbacks; especially when dealing with a large number of asynchronous operations. This can lead to faster and more responsive applications.
Linux is a free and open-source operating system that is used in a wide variety of settings; including personal computers; servers; and embedded devices.
a. To create a new folder in Linux; we can use the mkdir command. For example; to create a new folder called "myfolder"; the following command is use
mkdir myfolder
You can also create multiple folders at once by specifying the names of the folders separated by spaces. For example:
mkdir folder1 folder2 folder3
By default; the mkdir command will create the new folder in the current working directory. If you want to create the folder in a different location; you can specify the path to the desired location as an argument to the mkdir command. For example: > mkdir /home/user/documents/myfolder
B. To navigate to a specific folder in the Linux filesystem; we can use the cd command. For example; to navigate to the Linux kernel folder; which is typically located at /usr/src/linux; we can use the following command:
cd /usr/src/linux
This will change your current working directory to the Linux kernel folder. Once you are in the kernel folder; you can use other Linux commands to list the contents of the folder; create new files or folders; and perform other operations.
C. create a blank file without using any text editor
To create a blank file in Linux without using a text editor; you can use the touch command. This command allows you to create an empty file with a specified name. For example; to create a blank file called "myfile.txt"; you would use the following command:
touch myfile.txt
D. listing the files in the folder
To list the files in a folder in Linux; you can use the ls command. This command allows you to view the contents of a directory and displays a list of the files and subdirectories it contains. By default; the ls command lists the files and subdirectories in the current working directory. To list the files in a different directory; you can specify the path to that directory as an argument to the ls command. For example; to list the files in the /etc directory; you would use the following command: ls /etc > for i in {1..2600}; do mkdir MB66$i; done >** # the link to video of the same**
F. concatenate two text files containing any random text and display them on the terminal.
the cat and less commands are useful tools for concatenating and displaying text files on the terminal in a Linux environment. You can use these commands to easily view and manipulate the contents of text files from the command line. - cat command to concatenate the two text files. - When the combined output is too long to fit on one screen; we can use the less command to display the output one page at a time. > cat file1.txt file2.txt | less > cat file1.txt file2.txt
[VIVIVIVIV](https://www.howtogeek.com/wp-content/uploads/2012/01/vi-tutorial-6.png?trim= &bg-color=000&pad= )
In this task; I learned the basics of Vi and created a markdown file in Vi illustrating the various features of Vi that I found to be fascinating. Here is an example of a markdown file created in vi that illustrates the various features of vi that are fascinating:
https://gist.github.com/vodori6161/8d3cc361b978b93bff092b5338baadb5
In this task; I learned the basics of regex and piping in Linux.I used grep to extract login times within a date/time range from the login logs using the last command. Then piped this information into a text file and put it into a folder named logs. Finally; I zipped this folder using gzip and tar.
https://gist.github.com/vodori6161/be2760eb451bc1b1606d49227ac7fa44 "