31 / 3 / 2024
Task 1 - Javascript
JavaScript, a dynamic scripting language, is widely used for web development to add interactivity and functionality to websites. With its versatility, JavaScript allows for client-side and server-side scripting, enabling dynamic content generation and user interface enhancements. JavaScript's ecosystem boasts extensive libraries and frameworks such as React and Node.js, fostering rapid development and scalability. Its ubiquitous presence across browsers and platforms makes JavaScript a cornerstone of modern web development, empowering developers to create immersive and responsive web experiences.
Task 2 - Asynchronous
- Asynchronous JavaScript allows non-blocking code execution, crucial for managing tasks like data fetching and API calls without halting program flow.
- The program implements a callback-based approach to simulate cooking instructions for a food recipe, with each step represented by a function.
- Each step function invokes the next step via a callback upon completion, ensuring sequential execution and reflecting real-world cooking scenarios.
- Utilizing callbacks maintains a structured flow, enabling the recipe to progress asynchronously while allowing other operations to proceed concurrently, enhancing performance and user experience.
- Asynchronous programming with callbacks is essential in JavaScript development for creating responsive and efficient applications, vital for tasks such as user interactions and server communication.
Task 3 - Promises
-
Clearer Code Structure: Promises provide a cleaner and more readable code structure compared to callback-based approaches, making it easier to understand the flow of asynchronous operations.
-
Error Handling: Promises offer built-in error handling through the use of
.catch()
, allowing developers to handle errors more effectively and ensure smooth execution of the program. -
Chaining and Sequencing: Promises enable chaining of asynchronous operations using
.then()
, simplifying the sequential execution of tasks and reducing callback nesting. -
Asynchronous Parallelism: Promises allow for parallel execution of asynchronous tasks using
Promise.all()
orPromise.race()
, enhancing performance by running multiple tasks concurrently when applicable.
Task 4 - Get familiar with the command line and do the following subtasks
- Created a folder named "test" and navigated into it.
- Generated a blank file named "blank_file.txt".
- Listed files in the folder and created 2600 subfolders.
- Concatenated the contents of two text files using
cat
. - Completed the task successfully within the command line interface.
Task 5 - VI
VI: Navigating the Depths of Text Editing
- In the vast ocean of text editors, VI stands as a beacon of efficiency and reliability, tracing its roots back to the dawn of Unix systems.
- Its minimalist interface belies a powerhouse of functionality, offering a plethora of commands and shortcuts designed to streamline text editing tasks.
- VI's modal editing paradigm, where users seamlessly transition between insert and command modes, epitomizes its user-centric design philosophy.
- Customization is key in VI's realm, empowering users to mold the editor to their unique needs through settings, macros, and plugins.
- Yet, mastering VI is an odyssey in itself, a journey of discovery that rewards persistence with unparalleled speed and precision in text manipulation.
- In the ever-evolving landscape of text editors, VI remains a steadfast companion, a testament to the enduring legacy of simplicity, efficiency, and timeless elegance.
Features:
This is a sample Markdown file created using VI. Below are some key features illustrated:
- Opening a File:
vi .
- Example :
vi trial.txt
.
- Switching Modes:
- Press
i
to enter insert mode (where you can type text). - Press
Esc
to return to normal mode (for navigation and commands).
- Saving and Exiting:
- To save changes and exit, press
Esc
to ensure you're in normal mode, the type:wq
and pressEnter
. - To exit without saving changes, press
Esc
, then type:q!
and pressEnter
.
- Navigation:
- Use arrow keys or
h
,j
,k
,l
for left, down, up and right respectively. - To move to the beginning of a line, press
0
. - To move to the end of a line, press
$
.
- Editing:
- Press
x
to delete the character under the cursor. - Press
dd
to delete the entire line.- Press
yy
to copy the entire line.
- Press
- Undo / Redo:
- To undo changes, press
u
in normal mode. - To redo changes, press
Ctrl + r
in normal mode.
- Searching:
- Press
/
followed by the text to search for it. - Press
n
to find the next occurence, orN
to find the previous occurence.
Task 6 - Linux Continued
The Task was to extract login times within a date/time range from the login logs & pipe this information into a text file and put it into a folder named logs.
-
Understanding Regex and Piping in Linux:
- Regex (regular expressions) is a powerful tool for pattern matching in strings.
- Piping (
|
) allows output from one command to be used as input for another in Linux.
-
Understanding
grep
Command:grep
is a command-line utility for searching text using regex patterns.- It extracts lines from files or standard input that match a specified pattern.
-
Using
grep
to Extract Login Times:- We can use
grep
with regex patterns to extract login times from thelast
command output. - For example,
last | grep 'username'
extracts login information for a specific user.
- We can use
-
Piping Output to a Text File:
- We can pipe the output of
grep
into a text file using the>
operator. - This allows us to store the extracted login times for further processing.
- We can pipe the output of
-
Creating Logs Folder and Archiving:
- We create a folder named "logs" to store the extracted login times text file.
- Then, we use
gzip
andtar
commands to compress the folder into a single archive file for easier storage and transportation.
-
Benefits of Using
grep
and Piping:grep
combined with regex offers a flexible and efficient way to filter and extract specific information from large datasets.- Piping allows seamless integration of multiple commands, enabling complex data processing workflows in Linux.
Task 7 - Introduction to Cloud Computing
The objective of this task is to establish a local file sharing solution between two Windows machines, one running Windows 11 (PC 1) and the other running Windows 7 (PC 2). By the end of this process, users should be able to share files seamlessly between the two devices.
- Go to Network and Sharing Center > Advanced Sharing Settings ---> "Confirm that network discovery and file sharing are enabled on both PCs."
- Go to Services > SSDP Discovery > Properties > "Change the Startup Type to
Automatic
." Repeat the same for UPnP Device Host, Function Discovery Provider Host & Function Discovery Resource Publication.
- Go the Properties of the folder which you want to share > Advanced Sharing > Check "Share this folder" > Go to Permissions > Allow all the Permissions > Click on Share > Give access to Everyone & Permit to Read/Write. Then SHARE :) & access the Shared Folder on the Other PC..!
Task 8 - Introduction to Cybersecurity
Cryptography is the practice and study of techniques for secure communication in the presence of third parties, often referred to as adversaries. It encompasses various methods of encrypting and decrypting information to ensure confidentiality, integrity, and authenticity of data. Through the use of mathematical algorithms and principles, cryptography enables the transformation of plaintext into ciphertext, making it unintelligible to anyone without the proper decryption key. It plays a crucial role in protecting sensitive information transmitted over networks, securing electronic transactions, and safeguarding the privacy of individuals in the digital age.
- Caesar Cipher :
Fbehuvhfxulwb lq Pduyho
- Morse Code :
-.-. -.-- -... . .-. ... . -.-. ..- .-. .. - -.-- / .. -. / -- .- .-. ...- . .-..
- Rail Fence Cipher :
Cbreuiyi avlyescrt nMre
- Playfair Cipher :
MCCHIYHDRYGSSRONVALOEV
(Playfair keyword : Gravity Falls) - Polybius Cipher :
135412154243151345422444542433321142511531
- Pigpen Cipher :