Skip to content

Commit 285b254

Browse files
committed
docs: added files for git and yaml
1 parent 308c48c commit 285b254

File tree

11 files changed

+331
-56
lines changed

11 files changed

+331
-56
lines changed

Bash/commands/README.md

+130-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,130 @@
1-
WIP
1+
- `whereis` - Find the path of that executable file.
2+
3+
### List operation
4+
- `ls` - Shows list.
5+
- `-a` - Hidden file.
6+
- `-l` - Persmission.
7+
- `-R` - Show sub dir.
8+
9+
### Changing dir operation
10+
- `cd <folder-name>` - Change Dir.
11+
- `cd ..` - Go one Directory back.
12+
- `cd` - Go to home.
13+
- `cd ../<foldername>` - Open a previous dir folder.
14+
- `cd <path>` - Open a dir with the path.
15+
16+
### File/Folder Ope.
17+
- `mkdir <new-dir-name>` - Create a new folder.
18+
- `mkdir -p test/test1/test2` - Craete a dir between two directories.
19+
- `touch <new-file-name>` - create a blank file.
20+
- `pwd` - Present working directory.
21+
- `cat <filename>` - Display file content.
22+
- `cat > <new-file-name>` - Create a file.
23+
- `cat >> <filename>` - Append the file.
24+
- `cat <filename> <filename2> ` - Display 2 files at a time.
25+
- `cat <filename> <filename2> > <newfile-name>` - Merge both of file content in a single one.
26+
- `cat <file-name> | tr > <new-file-name>` - Translate the file.
27+
- `cut -c 1-2 <filename>` - cut the file with colum wise
28+
- `echo "Hello" >> <file-name>`
29+
30+
31+
32+
33+
+
34+
###
35+
- `man <commad name>` - Know about the command usages and options.
36+
- `man <commad name>` - know about the command.
37+
38+
### File/Folder operation
39+
- `cp <file-name> <new-fie-name>` - Make a copy of a file in the current location.
40+
- `mv <file-name> <dir-path>` - Move a file from a one dir to a another.
41+
- `mv <file-name> <new-fie-name>` - Rename a file.
42+
- `mv -R <dir-name> <dir-path>` - Move Dir
43+
- `rm <file-name>` - Remove a file
44+
- `rm -R <file-name>` - Delete a folder with dir included.
45+
- `head <file-name>` - Will display first 10 lines of a file.
46+
- `tail <file-name>` - Will display last 10 lines of a file.
47+
-`-n 2` - will display last 2 lines.
48+
- `diff <file-1> <file-2>` - Show diff between the two files.
49+
- `locate <file>` - To find out the file.
50+
- `find <file/folder-name>` - Find a file/folder.
51+
- `find <dir-name>` - Find files inside the dir
52+
- `find .-type d` - Show only dir.
53+
- `.-type f` -Sshow only files.
54+
- `.-type f -name "*.txt"` - Show only files with that specfic name.
55+
- `.-type f -iname "*.txt"` - Show only files with that specfic name - not case sentive (i)
56+
- `.-type f -mmin -20` - Show files which modify less than 20 min ago.
57+
- `.-type f -mmin +20` - show files which modify more than 20 min ago.
58+
- `.-type f -maxdepth 2` - Will only show 1 folder deep.
59+
- `.-size +1k` - will only show file/folder with size of 1kb
60+
61+
62+
### System commands
63+
- `ps aux` - processes which are running
64+
- `df` - Check the capacity and storage details.
65+
- `m` - In megabyte) or
66+
- `hg` - (gigabyte).
67+
- `du` - Disk usages capcity
68+
- `-h` (human readable)
69+
- `echo` - Get a output of a string
70+
- `echo $PATH` - Check the path varibale
71+
- `sudo` - Admin command
72+
- `sudo chown root text.txt` - chnage owner
73+
- `!<command-name>` - Run the pevious command
74+
- `git add .; git commit -m "message"` - Run mutiple commands at a time
75+
- `sort <file-name>"` - sort the file
76+
- `job`
77+
- `wget <url>` - download the file from the URL
78+
- `top` - what processes are running
79+
- `kill <process-id>` -stop that process
80+
- `Uname` -
81+
- `zip <file-1> <file-2>` - Zip Two or more files
82+
- `Unzip <file-name>` - Unzip files
83+
- `useradd <name>`
84+
- `passwd <name>`
85+
- `uname -<flag>` -o -m -r
86+
- `lscpu` - get cpu details
87+
- `free` - free memory
88+
- `vmstat` - virtual memory
89+
- `lsof` - list all the open file
90+
- `xdg-open <file-fath>` - open the folder (graphical window) of a file/folder with path.
91+
- `xdg-open .` - open the folder of the current directory.
92+
- `vi ~/.bashrc` - set your Alias
93+
- `echo -n 'username' | base64`
94+
95+
### Networking
96+
- `nslookup google.com`
97+
- `netstat` -
98+
- `hostname` -
99+
- `whoami` -
100+
- `ping google.com`
101+
102+
103+
### Permissions
104+
- `chmod u=rwx,g=rxw,o=rwx <file-name>` READ, WRITE AND EXECUTE
105+
- `chmod 777 <file-name>` - 4- Read, 2- Write, 1 - Execute
106+
- `find . -perm 777 ` - will only show file/folder with size of 1kb
107+
- `grep <keyword> <file-name>` - To search if the keyword is presnt in the file or not
108+
- `grep -w <keyword> <file-name>` - To search if the keyword is presnt in the file or not (complete word)
109+
- `grep -i <keyword> <file-name>` - To search if the keyword is presnt in the file or not (not case sens)
110+
- `grep -n <keyword> <file-name>` - To search if the keyword is presnt in the file or not (Line number)
111+
- `grep -B <keyword> <file-name>` - Show Line before that keyword
112+
- `grep -win <keyword> ./*.txt` - To search if the keyword is presnt in the file in current dir
113+
- `grep -win -r <keyword> .*`
114+
- `history | grep "ls -l"` - Pipping, we filter out the things
115+
116+
```
117+
histroy
118+
!<number-from-history>
119+
```
120+
121+
# Operators
122+
123+
- `ping google.com & pingfacebook.com`
124+
- `echo "google.com" && echo "facebook.com"` - second will oly run if first is sucessful
125+
- `echo "google.com" && {echo "facebook.com"; eco "pradumnasaraf.co"}`
126+
- `echo "google.com" || echo "pingfacebook.com"`
127+
- `echo "google.com" || echo "pingfacebook.com"`
128+
- `rm -r !(file.txt)`
129+
130+
- `printevnv` - to print all th env.

Git/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
## Concepts
1+
Git is free and open source software for distributed version control. Official [website](https://git-scm.com/)
2+
3+
## Resources
4+
5+
- [learngitbranching.js.org](https://learngitbranching.js.org/)

Git/commands/README.md

+56-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,56 @@
1-
WIP
1+
- Show commit log history
2+
3+
```bash
4+
git log
5+
```
6+
7+
- Show which file git is tracking and are stagged/unstagged
8+
9+
```bash
10+
git status
11+
```
12+
13+
- Stage a file
14+
15+
```bash
16+
git add [file-name]
17+
```
18+
- Make the repo chnages according to that commit
19+
20+
```bash
21+
git reset [commit-hash]
22+
```
23+
- Change the date and time of last commit
24+
25+
```bash
26+
git commit --amend --date="YYYY-MM-DD HH:MM:SS
27+
```
28+
29+
- Remove/reset all the commits
30+
31+
```bash
32+
git update-ref -d HEAD
33+
```
34+
35+
- Check the git config
36+
37+
```bash
38+
git config --list
39+
```
40+
- Create a new brach
41+
42+
```bash
43+
git branch <branch-name>
44+
```
45+
46+
- Checkout a branch
47+
48+
```bash
49+
git checkout <branch-name>
50+
```
51+
52+
- Create and Checkout branch with a single command
53+
54+
```bash
55+
git checkout -b <branch-name>
56+
```

Kubernetes/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ data:
215215
echo -n "value" | base64
216216
```
217217

218+
## StatefulSet
219+
220+
- Any application that stores data to keep it state, like database. In this the name and endpoint stays same when the pods restarted.
221+
222+
218223
## Secret and ConfigMap as volume
219224

220225
We can mount Config and Secret as a volume

Networking/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
## Concepts
1+
## WIP
22

README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Contains all my learning related to DevOps tools and tech.
3434
<br>
3535
<br>
3636

37-
## Bash Scripting
37+
## Bash
3838

3939
<img align="right" src="https://user-images.githubusercontent.com/51878265/200594989-b1406680-ed41-478a-84d5-7c35b287e112.png" height="120" alt="bash">
4040

@@ -47,9 +47,20 @@ Contains all my learning related to DevOps tools and tech.
4747

4848
## Git
4949

50-
<img align="right" src="https://user-images.githubusercontent.com/51878265/200594978-178d2d30-7ef7-45c6-b4db-e24a95c7a067.png" height="120" alt="git">
50+
<img align="right" src="https://user-images.githubusercontent.com/51878265/202784470-2c813581-7160-4aaf-b96c-35187795d05b.png" height="120" alt="git">
5151

5252
- [Notes](Git/README.md)
5353
- [Commands](Git/commands/README.md)
5454

55-
<br>
55+
<br>
56+
<br>
57+
<br>
58+
59+
## YAML
60+
61+
<img align="right" src="https://user-images.githubusercontent.com/51878265/202765143-55758916-b631-4c18-aaad-718b42507d67.png" height="120" alt="YAML">
62+
63+
- [Notes](YAML/README.md)
64+
- [Syntax](YAML/syntax/README.md)
65+
66+
<br>

YAML/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## YAML - YAML Ain't Markup Langugae
2+
3+
- Data format used to exchnage data.
4+
- Similar to XML & JSON.
5+
- We can't add commands.
6+
- Simple and easy to read.
7+
- Strict syntax - (Indentation)
8+
- More powerful to represent complex data.
9+
- Parsing is easy
10+
11+
12+
## Usage
13+
14+
- Use in config files (Docker/Kubernetes)
15+
- used Logs, cache, etc
16+
17+
#### YAML tools
18+
[yamllint](http://www.yamllint.com/) - Check the the format of the file

YAML/syntax/README.md

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
### Key Value pair
2+
3+
```yaml
4+
Name: "Pradumna Saraf"
5+
1: "This a list"
6+
```
7+
8+
### List
9+
10+
```yaml
11+
- apple
12+
- mango
13+
- Banana
14+
- banana
15+
```
16+
or
17+
18+
```yaml
19+
cities: [new delhi, patna,gujrat]
20+
```
21+
22+
### String and Variables
23+
24+
```yaml
25+
name: Pradumna Saraf
26+
fruit: "Mango"
27+
job: 'Advocate'
28+
age: 65
29+
marks: 10.33
30+
booleanValue: No, N, fasle, Fasle, FALSE
31+
```
32+
33+
### Multiline String
34+
35+
```yaml
36+
Address: |
37+
01
38+
Delhi
39+
India
40+
```
41+
Single line in multiple line.
42+
43+
```yaml
44+
message: >
45+
This all
46+
will be in a single
47+
line
48+
49+
```
50+
51+
### Nested Mapping
52+
53+
```yaml
54+
names: Pradumna
55+
role:
56+
age: 22
57+
job: student
58+
```
59+
60+
### Nested Sequence
61+
62+
```yaml
63+
-
64+
- mango
65+
- apple
66+
- banana
67+
-
68+
- marks
69+
- roll
70+
```
71+
72+
##### Specify the data type
73+
74+
```yaml
75+
76+
# Integer
77+
Zero: !!int 0
78+
postiveNumber: !!int 45
79+
negativeNumber: !!int -45
80+
hexa: !!int 0x45
81+
82+
# Float
83+
mark: !!float 56.55
84+
infinity: !!float .inf
85+
not a num: .nan
86+
itNot: !!bool false
87+
88+
# String
89+
string: !!str "hello"
90+
91+
# Null
92+
surnmae: !!null #null or NULL ~
93+
~: this a null key
94+
95+
# Exponential Numbers
96+
myNum: 6.22ES56
97+
98+
# Dates and time
99+
date: !!timestamp 2002-01-02
100+
no Time zone: 2012-12-15T02:59:43
101+
India Time: 2012-12-15T02:59:43 +5:30
102+
```

k8s-deployment/deployemnt.yaml

-21
This file was deleted.

0 commit comments

Comments
 (0)