My D's P's L's Js _ Day7 _ Git and GitHub {6}; Getting Familiar {3}; CS50'sT {1}; Other Developments {7}.
\\ Let's Begin... \\
Git and GitHub {6}_
Git: Become an Expert in Git & GitHub in 4 Hours (1) :
Source: udemy.
Git was created by a same person who created Linux. no need to mention their name!.
Git Bash vs Bash Shell :
Git Bash is a software application that provides a Bash emulation used to run Bash commands on Windows operating systems.
Git Bash provides a terminal-like environment that allows you to run Git commands, as well as various other shell commands that are typically available in a Linux/Unix environment.\
Bash (Bourne-Again SHell) is the default shell on many Linux and macOS systems.
Bash is native to Linux and macOS, and it provides a more comprehensive and feature-rich environment compared to the Windows command prompt or PowerShell.
Bash Shell on Windows :
Turn On (\check) Windows subsystems for Linux (WSL) by going to "Turn windows features on or off". (as bash shell isn't native or default shell of/in windows) (Restarting will apply those features).
Download\install Unix Shell\Terminal:
By launching ubuntu it'll open up the Bash terminal.
Using the Bash shell on Windows through WSL has several advantages:
It provides a more native Linux-like environment, allowing you to use the same shell and tools you would on a Linux system.
It supports a wide range of Linux distributions, giving you flexibility in choosing the one that best suits your needs.
The integration between Windows and WSL is improving, making it easier to access files and share resources between the two environments.
In summary, using the Bash shell on Windows through WSL is a viable option, especially if you need a more comprehensive Linux-like environment. However, for simple Git-related tasks, Git Bash may be a more straightforward and easier-to-use solution.
Difference between Linux distributions :
let's dive into the key differences between the top 3 recommended Linux distributions: Ubuntu, Debian, and CentOS/RHEL.
Ubuntu:
Based on Debian, with a focus on user-friendliness and ease of use.
Provides a polished desktop environment (e.g., GNOME) and a wide range of pre-installed applications.
Releases new versions every 6 months, with a new Long-Term Support (LTS) version every 2 years.
Designed for a wide range of users, from beginners to experienced professionals.
Widely used in desktop, server, and cloud environments.
Debian:
Known for its stability, security, and commitment to free and open-source software.
Offers three main branches: Stable, Testing, and Unstable, with the Stable branch being the most secure and reliable.
Releases new stable versions every 2-3 years, with long-term support.
Preferred for servers, mission-critical systems, and environments that prioritize stability over the latest software versions.
Provides a solid foundation for learning and exploring Linux, especially for more technical users.
CentOS/RHEL (Red Hat Enterprise Linux):
Based on the source code of Red Hat Enterprise Linux (RHEL), providing a free and community-supported alternative.
Focused on enterprise-level features, stability, and security.
Releases new major versions every 3-4 years, with long-term support.
Widely used in enterprise and server environments, particularly for mission-critical applications.
Offers commercial-grade support and extensive documentation, making it a popular choice for IT and system administration professionals.
Key differences:
Ubuntu is more user-friendly and geared towards a broader audience, while Debian and CentOS/RHEL are more technical and oriented towards enterprise and server environments.
Ubuntu has a faster release cycle, with new versions every 6 months, while Debian and CentOS/RHEL have longer release cycles focused on stability and long-term support.
Debian is known for its commitment to free and open-source software, while CentOS/RHEL is based on the commercial RHEL distribution.
CentOS/RHEL offers enterprise-level features, stability, and commercial-grade support, making it a preferred choice for mission-critical systems and IT professionals in enterprise settings.
In summary, Ubuntu is the most user-friendly and versatile of the three, Debian is the most secure and stable, and CentOS/RHEL is the most enterprise-focused and feature-rich, with commercial-grade support and documentation.
Getting Familiar {3}_
Covering Keywords Relating to Linux (1) :
# CLI and Shell Scripting :
Let's dive into the world of Linux command-line interface (CLI) and shell scripting, where you'll learn how to navigate and interact with your computer's operating system using simple yet powerful commands.
CLI (Command-Line Interface):
The CLI is a text-based interface that allows you to interact with your computer by typing in commands.
It provides a more direct and efficient way to perform various tasks, from managing files and folders to running programs.
Basic CLI Commands:
ls (list): This command allows you to view the contents of a directory. For example, typing
ls
in the terminal will show you all the files and folders in your current directory.cd (change directory): Use this command to navigate through your computer's file system. For example,
cd
Documents will take you to the "Documents" folder.mkdir (make directory): Create a new directory (folder) using this command. For example,
mkdir
newFolder will create a new folder called "newFolder".touch: This command is used to create a new file. For example,
touch newFile.txt
will create a new text file called "newFile.txt".rm (remove): Use this command to delete files or directories. For example,
rm newFile.txt
will remove the "newFile.txt" file.cat (concatenate): This command is used to display the contents of a file. For example,
cat newFile.txt
will show the contents of the "newFile.txt" file.
Shell Scripting:
Shell scripting is the process of writing a series of commands in a text file, which can then be executed as a program.
Shell scripts are written in a specific programming language, such as Bash (Bourne-Again SHell), which is the most commonly used shell in Linux.
Basic Shell Scripting:
Creating a script:
Open a text editor and create a new file, for example,
myScript.sh
.Type in the commands you want to execute, one by one.
Save the file.
Making the script executable:
In the terminal, navigate to the directory where your script is located.
Use the
chmod
(change mode) command to make the script executable. For example,chmod +x
myScript.sh
.
Running the script:
- In the terminal, type
./
myScript.sh
to execute the script.
- In the terminal, type
Example Shell Script:
bash
#!/bin/bash
echo "Hello, World!"
echo "This is my first shell script."
In this example, the first line #!/bin/bash
tells the system to use the Bash shell to interpret the script. The echo
command is used to print the specified text to the console.
# Package Managers:
Linux package managers are an essential part of the Linux operating system. They help you install, update, and manage software packages on your computer. Let's dive into the details:
What are Linux Package Managers?
Package managers are tools that automate the process of installing, upgrading, configuring, and removing software packages on a Linux system.
They maintain a database of available software packages, their versions, dependencies, and other relevant information.
The most popular Linux package managers are:
apt
(Advanced Packaging Tool) for Debian-based distributions like Ubuntu.yum
(Yellowdog Updater, Modified) for Red Hat-based distributions like CentOS.dnf
(Dandified YUM) for newer Red Hat-based distributions like Fedora.pacman
for Arch Linux.zypper
for SUSE-based distributions.
Benefits of using a Package Manager:
Automatic dependency management: Package managers ensure that all required dependencies are installed when you install a package.
Easy updates and upgrades: You can easily update or upgrade your installed packages to the latest versions.
Centralized package repositories: Package managers provide access to a centralized database of software packages, making it easy to find and install new software.
Consistent installation: Package managers follow a standardized process for installing, configuring, and removing software, ensuring a consistent experience.
Security and stability: Package managers often provide security updates and bug fixes for the software they manage, keeping your system secure and stable.
# Linux: A Platform for a Thriving Open-Source Ecosystem:
Linux is more than just an operating system; it's a platform that enables a thriving ecosystem of open-source software. Let's break it down in simple terms:
Open-Source Software:
Open-source software is software whose source code (the behind-the-scenes instructions that make the software work) is freely available for anyone to view, modify, and distribute.
This means that developers around the world can contribute to the development and improvement of the software, making it more robust, feature-rich, and secure over time.
Linux as a Platform:
Linux is an operating system, just like Windows or macOS, but it's different in a few key ways.
Linux is open-source, which means anyone can access the source code, modify it, and create their own versions (called "distributions") of the operating system.
This openness and flexibility make Linux a great platform for developers and software creators to build and distribute their applications.
The Linux Ecosystem:
Because Linux is open-source and freely available, it has become a hub for a vast array of software applications and tools.
Developers from all over the world create and contribute to a wide range of software, including:
Desktop applications (word processors, media players, web browsers, etc.)
Server software (web servers, databases, content management systems, etc.)
Programming tools (compilers, interpreters, IDEs, etc.)
System utilities (file managers, text editors, terminal emulators, etc.)
And much more!
Benefits of the Linux Ecosystem:
The open-source nature of Linux and its ecosystem means that most software is available at no cost, which can save users a lot of money.
The software is often highly customizable and can be tailored to meet specific needs, making it more versatile than proprietary software.
The large and active community of developers and users means that bugs and security issues are quickly identified and fixed, resulting in more stable and secure software.
Users can often find alternatives to proprietary software, giving them more choice and control over the tools they use.
In summary, Linux is not just an operating system; it's a platform that enables a vast and diverse ecosystem of open-source software, allowing users and developers alike to benefit from the flexibility, cost-effectiveness, and community support that this ecosystem provides.
HarvardX CS50T {1}_
CS50's Understanding Technology.
Resource Or Reference : HarvardX CS50T
Hardware :
#Binary :
#Q: How do computers represent info with just binary?
Consider the decimal number (what we human typically use) 123
We have 100 x 1 + 10 x 2 + 1 x 3 = 100 + 20 + 3 = 123
Inside a computer, the binary 000 would represent 0, just like in our human world!
In the human world (decimal) we use powers of 10 for place values
- 100 = 1, 101 = 10, 102 = 100, 103 = 1000, etc.
In the computer world (binary) we use powers of 2 for place values
- 2^0 = 1, 2^1 = 2, 2^2 = 4, 2^3 = 8, etc.
The difference between decimal numbers and binary numbers is changing the base i.e. 10 or 2.
For the binary number 000, we have 4 x 0 + 2 x 0 + 1 x 0 = 0 + 0 + 0 = 0!
Consider the binary number 001:
- We have 4 x 0 + 2 x 0 + 1 x 1 = 0 + 0 + 1 = 1
How do we represent the decimal number 2 in binary?
We don’t need a 4, be we need a 2, and also no 1
This gives us 4 x 0 + 2 x 1 + 1 x 0 = 0 + 2 + 0 = 2
Likewise, the number 3 would be:
As we need a 2 and a 1
Thus, 4 x 0 + 2 x 1 + 1 x 1 = 0 + 2 + 1 = 3
What about 7?
- 4 x 1 + 2 x 1 + 1 x 1 = 4 + 2 + 1 = 7
What about 8?
We can’t count to 8 without another bit (binary digit)
We run into this in the real world too if we need a four-digit number vs a 3-digit number
- Start with the 1s, 10s, 100s place and add the 1000s
Here we’ll add the next power of 2, 8
8 x 1 + 4 x 0 + 2 x 0 + 1 x 0 = 8
Even though computers only use binary, they can count as high as humans can!
They do it with a smaller vocabulary, just 1 and 0.
- This is because it’s easier to represent two states in the physical world
Using the transistors we can store values, store data, compute, and do everything we can with computers
So far all that we can represent is numbers
A decision needs to be made on what pattern of 1s and 0s to represent letters, words, and paragraphs
To represent letters, we need a mapping of 0s and 1s to characters
ASCII (American Standard Code for Information Interchange) does this
65 -> A, 66 -> B, 67 -> C, etc.
97 -> a, 98 -> b, 99 -> c, etc.
ASCII also has mapping for punctuation symbols
Programs like notepad, textedit, and MicroSoft Word decide weather to display patterns of bits as letters or words
Computers only store 0s and 1s, but the programs interpret those bits in a certain way
- For example, if MicroSoft word sees a pattern of buts representing the number 65, it will interpret that as “A”
ASCII is limited
Original ASCII is 7 bits, thus giving 128 characters
- Extended ASCII is 8 bits, yielding 256 characters
Many symbols are not represented
UNICODE is a bigger set of characters that includes written languages other than English and even emoji! 😲
- All are still represented by a pattern of bits
Consider this pattern of bits: 01001000 01001001
- 16 bits or 2 bytes (1 byte = 8 bits)
0 x 128 1 x 64 0 x 32 0 x 16 1 x 8 0 x 4 0 x 2 0 x 1
0 x 128 1 x 64 0 x 32 0 x 16 1 x 8 0 x 4 0 x 2 1 x 1
1 x 64 + 1 x 8 = 72 1 x 64 + 1 x 8 + 1 x 1 = 73
1 x 64 + 1 x 8 = H 1 x 64 + 1 x 8 + 1 x 1 = I
- Using ASCII we get the word “HI”
Other Developments {7} _
Recap, Ques, & Other Notes :
Recaps.
- Versatile open source VS Propritory Software.
Ques.
- Linux! why not.?!
Other Notes.
#Joplin_
To encase any #script like java script or bash script: include it in between Sequence of three Grave accents at top and same closing at bottom of script code.
Example JavaScript code:
function hello() {
alert('hello');
}
Subscribe to my newsletter
Read articles from Raghuu' directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by