-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit db78591
Showing
109 changed files
with
6,168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
On the first day, I learned the following things about Git. | ||
|
||
- `git init` will only track a particular directory in which git is initialized. | ||
- `git status` will show the status of the files that are newly created, modified or deleted. | ||
- `git add filename` OR `git add .` will add a particular or all the files into the staging area and it can now be tracked them before committing them into Git. | ||
- `git commit -m "add a message"` will commit the changes in the git. | ||
- `git commit -am "add a message"` will add the files into the staging area and commit it also. | ||
- `git restore --staged filename` will move the files from the staging area to the unstaging area. In this way, the data will be reverted back. | ||
- `git log` will show the history of all the git commits. | ||
- `git reset hash value` will move the data from the committing area to the unstaging area. Provide the previous hash value if you want to delete the next one. | ||
- `git stash` will store the data temporarily somewhere in the memory. The changes won't be committed. Instead it has to be added to the staging area and then it can go to the stashing area. | ||
- `git stash push -m "add a message"` will store the data temporarily in the git stash. | ||
- `git stash list` will show the list of data that are temporarily stored. | ||
- `git stash clear` will delete the list of data that are present in the git stash. | ||
- `git stash apply index number` will call the stashing in which you want to make changes. | ||
- `git stash drop index number` will delete a specific data from the stashing list. | ||
- `git stash pop index number` will transfer the specific index number data out of the stashing area so that it can be further committed. It means that the data is now able to be added into the staging area and committed also. | ||
- `rm -rf .git` will unintialize the git. It means that all the branches will be deleted from Git. | ||
|
||
## **Explaining it in a video** | ||
|
||
Here you can get an explanation in a video. [1/60 Day of DevOps Challenge]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
On the tenth day, I learned the following things about Networking. | ||
|
||
Click Here: | ||
|
||
- 🌐 [Day No. 10 of Learning Networking](../PDFs/Computer-Networking-7.pdf) | ||
|
||
## **Explaining it in a video** | ||
|
||
Here you can get an explanation in a video. [10/60 Day of DevOps Challenge]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
On the eleventh day, I learned the following things about Networking. | ||
|
||
Click Here: | ||
|
||
- 🌐 [Day No. 11 of Learning Networking](../PDFs/Computer-Networking-8.pdf) | ||
|
||
## **Explaining it in a video** | ||
|
||
Here you can get an explanation in a video. [11/60 Day of DevOps Challenge]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
On the twelveth day, I learned the following things about Linux. | ||
|
||
- The command line interface will communicate with the kernel and it will give the input to the kernel to do a certain task and as a result the kernel will perform that operation. | ||
- In the command prompt, the path will be given to you that has two parts. | ||
|
||
**1.** The first is the user part and | ||
|
||
**2.** the second is the host part. In between them, there is a separater **"@"** | ||
|
||
<p align="center"> | ||
<img src="../Images/path.png" alt="100-Days-Of-DevOps" width="30%" height="50%"> | ||
<p> | ||
|
||
- `where filename` will show you the list of directories in which a file is present. | ||
- `open .` will open all the files present in a specific directory. | ||
- `echo $PATH` When one types a command to run, the system looks for it in the directories specified by PATH. It will display the files and folders paths by the difference of colon **:** It will check the executable command in one of these paths. | ||
- `echo "Hey" > file.txt` will override the text in a file. | ||
- `echo "Hey" >> file.txt` will append the text in a file. | ||
- `export MY_PATH="Bilal"` will create another path that will contain the string. But this is not permanent | ||
|
||
- `pwd` will show the present working directory in which you're currently present. | ||
- `ls` will show you the list of all the files present in a specific directory. | ||
- `ls -a` will show you the list of all the hidden files present in a specific directory. Hidden files are starting from dot **.** | ||
- `ls -l` will show you the list of files with long details present in a specific directory. | ||
- `ls -la` will show you the list of more files including hidden files with long details present in a specific directory. | ||
- `ls -R` will find all the folders and sub folders and so on recursively. | ||
- Dot **.** means current directory, **..** double dot means previous directory. | ||
- `cd `(change directory) will change the path location from one directory to another. | ||
- `cat filename `(concatenate) will print all the content of a file in a standard output. | ||
- `cat > filename` will create a new file if it is not present and allow us to enter the text also. | ||
- `tr` will translate the characters from one string to another string. | ||
- `cat lower.txt | tr a-z A-Z > upper.txt`, the output of the first command is the input of the second command. | ||
- `man command-name` will show you the details of a specific command. | ||
- `mkdir directory-name` will create a new directory. | ||
- `mkdir -p random/middle/hello` will create a middle directory b/w two directories. `-p` is used for parent's command. | ||
- `touch filename` will create a new file. | ||
- `cp file.txt copy_file.txt` will make a copy of the file.txt | ||
- `cp -R test random` will copy the test directory into the random directory. | ||
- `mv file.txt random` will move the file.txt to the random folder. | ||
- `mv file.txt new_file.txt` will rename the file.txt to new_file.txt. | ||
- `mv test renamedTest` will rename the directory. | ||
- `rm file.txt` will remove a file from your computer permanently. | ||
- `rm -R directory-name` will remove the directory recursively. | ||
- `rm -rf directory-name` will forcefully remove the directory. | ||
|
||
## **Explaining it in a video** | ||
|
||
Here you can get an explanation in a video. [12/60 Day of DevOps Challenge]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
On the thirteenth day, I learned the following things about Linux. | ||
|
||
- `sudo` (super user do) will be used when some commands require administrative permission. If you want to access some files that require admin permission then you will use `sudo` to enter the password and give the permssion. | ||
- `df` is used to find the disk storage capacity. | ||
- `df -m` will show the data size in MBs. | ||
- `df -mh` will show the data in MBs and in human readable format. | ||
- `du` will estimate the disk space usage statistics. | ||
- `du -h` will give the file usage space in human-readable format. | ||
- `head` will print the first few lines of a file. | ||
- `head -n 4 file-name` will print the first four lines of a file. | ||
- `tail` will print the few lines from the bottom of a file. | ||
- `diff` will compare content of the files line by line and see if there is any difference. | ||
- `locate` will find the files by name. | ||
- `find` search all the files present in a directory. | ||
- `find . -type d` will only find the directories that are present in a current directory. | ||
- `find . -type f` will only find the files that are present in a current directory. | ||
- `find . -type f -name "file-name"` will only find the files that are present in a current directory and the name of the file is given. | ||
- `-name` is case sensitive but if you don't want to use the case sensitive then use `-iname`. | ||
- `mmin` (last modified n minutes ago) `find . -type f -mmin -20` will show only the files that are modified in a current directory less than 20 minutes ago. | ||
- `find . -type f -mmin +15` will show only the files that are modified in a current directory more than 15 minutes ago. | ||
- `find . -type f -mmin +2 -mmin -10` will show only the files that are modified in a current directory more than 2 minutes ago and less than 10 minutes ago. | ||
- `find . -type f -mtime -10` will show only the files that are modified in a current directory less than 10 days ago. | ||
- `find . -type f -maxdepth 1` will only show the files that are present in the first directory. It is not going recursively. | ||
If you want to recursively search then make the maxdepth equal to 2, 3, and so on. | ||
- `find . -size +1M` will find all the files that has a size more than 1 MB. | ||
- `find . -empty` will find all the empty files. | ||
- `find . -perm 777` will find the files that has 7(read), 7(write), and 7(execute) permission. | ||
|
||
|
||
If you find the long detail of a file, the read, write and execute permissions have 3 hyphens. The first hyphen shows the user permission which has a value 4. The second hyphen shows the group permission which has value 2 and the third one shows the permission of all the other users and it has a value 1. `0` stands for no permission. | ||
|
||
Let's say if a file has only read and write permission then it will be equal to 4+2=6. | ||
|
||
You can change the permissions by writing | ||
- `chmod u=rwx,g=rx,o=r file-name` | ||
|
||
If I write `777`, it will assign read, write, and execute permission to every hyphen of a file. | ||
- `chmod 777 file-name` | ||
|
||
If I write `577`, it will assign read, and execute permission to the first three hyphens and read, write and execute permission to the remaining hyphens of a file. | ||
- `chmod 577 file-name` | ||
|
||
How to perform a functionality on many files? | ||
Let's you want to find multiple files and delete them. | ||
|
||
- `find . -type f -name "*.txt" -exec rm -rf {} +` will find and remove all the files. `{}` will contain a list of all the files. | ||
|
||
- `whoami` will print the person username who is logged in. | ||
|
||
**grep(global regular expression print)** | ||
|
||
- `grep "text" filename` will find the text in a file and it is case-sensitive. | ||
|
||
- `grep -w "text" filename` will find the complete word written in a file. | ||
|
||
- `grep -i "text" filename` will find the text in a file even if it is not case-sensitive. | ||
|
||
- `grep -n "text" filename` will find the text with a line number in a file. | ||
|
||
- `grep -B 3 "text" filename` will find the lines that came before the given text. | ||
|
||
- `grep -rwin "text" .` will find the text recursively in a current directory. | ||
|
||
- `grep -wirl "text" .` will find all the files that contain the given text. | ||
|
||
- `grep -wirc "text" .` will count the files that contain the given text. | ||
|
||
- `history` will show the history of all the commands that has been used. | ||
|
||
- `history | grep "ls"` will show history of all the **ls** command that are used. | ||
|
||
- `grep -P "regular expression" filename` will find the specific text in a file by using regex. | ||
|
||
## **Explaining it in a video** | ||
|
||
Here you can get an explanation in a video. [13/60 Day of DevOps Challenge]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
On the forteenth day, I learned the following things about Linux. | ||
|
||
- In Linux, an alias is **a shortcut that references a command.** | ||
Aliases are mostly used to replace long commands, improving efficiency and avoiding potential spelling errors. | ||
|
||
- `alias` will show you all the aliases that are generated. | ||
|
||
- `alias <key>="<value>"` will make a new alias and after that, if you type a key, a functionality according to a value will be performed. | ||
|
||
- `unalias <key>` will remove an alias from the memory and after that, the key will not be functional. | ||
|
||
**Q. What if you want to create multiple aliases at once?** | ||
|
||
**A.** You can store them in a file. | ||
|
||
- `nano ~/.zshrc` will open up a *zsh* file in which you can store the aliases. | ||
|
||
- `alias <key>="<value>"` is the format of giving an alias to a file. | ||
|
||
- `source ~/.zshrc` will activate the alias that you saved in a file. Without activation you can't execute the alias. | ||
|
||
**Note:** The same pattern will be applied to the bash terminal also. You just need to write `~/.bashrc` instead of `~/.zshrc`. | ||
|
||
- `Ctrl+A` will move you to the first point of the command. | ||
- `Ctrl+E` will move you to the end point of the command. | ||
- `Ctrl+U` will delete everything that you entered. | ||
- `Ctrl+K` will delete the command from the back of the cursor. | ||
- `Ctrl+R` will search for the previous command. | ||
- `TAB button` will auto complete the command without writing it as a whole. | ||
- `!<number>` will take a number from the history and run it to access that command. | ||
- `!<command>` will take a command from the history that was used last time and run it to access that command. | ||
- `;` will help you to add multiple commands in one line. | ||
- `sort file-name` will sort the data in an alphabetical order. | ||
- `sort -r file-name` is the reverse of the sort. | ||
- `sort -n file-name` will return the data in a numerical order. | ||
- `jobs` will display all the current processes that are running. | ||
- `ping website` will display all the data packets from a particular server. | ||
- `wget <URL>` will download files from the internet. | ||
- `wget -O file-name <URL>` will save the downloaded file under a different name. | ||
- `top` will show that how many processes are running and how much CPU usage is consuming? | ||
- `kill process ID` will close the process. | ||
- `uname` will display the kernel name. | ||
- `uname -o` will print the operating system. | ||
- `uname -m` will print the architecture. | ||
- `uname -v` will print the kernel version. | ||
- `cat /etc/os-release` will give the information of your operating system. | ||
- `lscpu` will give you the CPU details. | ||
- `free` will show you the free memory. | ||
- `vmstat` will display the virtual memory state. | ||
- `id` will print the IDs, group ids and stuff. | ||
- `getent group username` will look up the user details on Linux. | ||
- `zip zip-file.zip text-file.txt` will zip the *text-file.txt* into *zip-file.txt*. | ||
- `unzip zip-file.zip` will unzip the file. | ||
- `hostname` will show the hostname. | ||
- `hostname -i` will show the ip-address. | ||
- `useradd username` will add a new user. | ||
- `passwd username` will give a password to the user. | ||
- `userdel username` will delete a username. | ||
- `lsof` will list all the open files. | ||
- `lsof -u username` will list the files that are opened by a username. | ||
|
||
- `nslookup website` will give the ip-address of a website. | ||
- `netstat` will give the details of all the active ports. | ||
- `ps aux` will give a snapshot of the current processes. | ||
- `cut -c 1-2 file-name` will remove sections from each line of files. | ||
- `ping website1 & ping website2` **"&"** operator will fetch multiple sites data. | ||
- `echo "first" && echo "second"` **"&&"** operator will say if the first command is executed then execute the second command. | ||
- `echo "hey" && {echo "hi"; echo "I am good"}` will say that if the first echo is executed then execute the commands in curly braces. | ||
- `echo "first" || echo "second"` **"||"** operator will say if the first command is not executed then execute the second one. | ||
- `| (pipe)` will send the output from the first command to the second command. | ||
|
||
## **Explaining it in a video** | ||
|
||
Here you can get an explanation in a video. [14/60 Day of DevOps Challenge]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
On the fifteenth day, I learned the following things about YAML. | ||
|
||
Click Here: | ||
|
||
- ⌨️ [Day No. 15 of Learning YAML](../PDFs/YAML-1.pdf) | ||
|
||
## **Explaining it in a video** | ||
|
||
Here you can get an explanation in a video. [15/60 Day of DevOps Challenge]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
On the sixteenth day, I learned the following things about YAML. | ||
|
||
## Starting and ending point | ||
|
||
'---' is the starting point | ||
'...' is an ending point | ||
|
||
**Note: YAML doesn't support multi-line comment. It only supports '#' to be written with each line like this** | ||
|
||
# This is the first line | ||
# This is the second line | ||
# This is the third line | ||
|
||
## Write key value pair | ||
|
||
**Syntax:** ***key: value*** | ||
|
||
--- | ||
name: Bilal Khan | ||
1: This is a number | ||
{fruit: mango, age: 12} | ||
... | ||
|
||
## Write a list | ||
--- | ||
- apple | ||
- mango | ||
- orange | ||
- Apple | ||
... | ||
|
||
## Write data in block style | ||
|
||
--- | ||
cities: | ||
- city1 | ||
- city2 | ||
- city3 | ||
|
||
cities: [city1, city2, city3] | ||
... | ||
|
||
## String values | ||
**YAML provide 3 types of string values** | ||
|
||
--- | ||
name: Bilal Khan | ||
fruit: "this is a mango" | ||
job: 'software engineering' | ||
... | ||
|
||
## Write data in separate lines by inserting '|' sign | ||
--- | ||
bio: | | ||
"My name is Bilal" | ||
"I am a developer" | ||
... | ||
|
||
## Write single line in multiple lines by inserting '>' sign | ||
|
||
--- | ||
message: > | ||
this is a single | ||
line that I am | ||
writing in multiple | ||
lines | ||
... | ||
|
||
## YAML will automatically detect the data type | ||
|
||
--- | ||
number: 43 | ||
float: 34.65 | ||
boolean: Y # y, true, True, n, N, false, False | ||
... | ||
|
||
## Write data types | ||
**Integer data type** | ||
|
||
--- | ||
zero: !!int 0 | ||
positiveNum: !!int 54 | ||
negativeNum: !!int -54 | ||
binaryNum: !!int 0b1011 | ||
octalNum: !!int 05346 | ||
hexaDecNum: !!int 0x54 | ||
commaVal: !!int 25_000 # is equal to 25,000 | ||
exponentialVal: !!int 6.02E54 | ||
... | ||
|
||
**Float data type** | ||
|
||
--- | ||
marks: !!float 54.65 | ||
infinite: !!float .inf | ||
not a num: .nan | ||
... | ||
|
||
**String and boolean data type** | ||
|
||
--- | ||
string: !!str "this is a string" | ||
--- | ||
boolean: !!bool True | ||
... | ||
|
||
**Null data type** | ||
|
||
--- | ||
null: !!null Null # !!null Null ~ | ||
~: this is also a key | ||
... | ||
|
||
**Date data type** | ||
|
||
--- | ||
date: !!timestamp 2002-12-14 | ||
pakistan time: 2001-12-15T02:59:43.10 + 8:13 | ||
not a time zone: 2001-12-15T02:59:43.1Z | ||
... | ||
|
||
## **Explaining it in a video** | ||
|
||
Here you can get an explanation in a video. [16/60 Day of DevOps Challenge]() |
Oops, something went wrong.