Skip to content

Commit 860d1d4

Browse files
todays ansible
1 parent 1387c5d commit 860d1d4

File tree

4 files changed

+179
-2
lines changed

4 files changed

+179
-2
lines changed

Diff for: DAY29.md

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767

6868
## Lemmatization
6969
* it creates a meaningful word from a collection of words
70+
* Used for sentimental analysis
7071

7172
## Task
7273
* Take picture of a newspaper and extract text + apply nltk + remove stop words and plot top 10 frequency graph(cv2 + )

Diff for: DAY30.md

+39
Original file line numberDiff line numberDiff line change
@@ -1 +1,40 @@
11
# DAY 30
2+
3+
## Notes:
4+
* Use Dialogflow to make chatbots
5+
* Rasa can be used for chatbot as well
6+
* Watson can also be used(developed by IBM)
7+
8+
9+
## Lematization
10+
### Spacy
11+
* needs data of NLTK that is nlp_data
12+
* it can be used to find all kind of pronoun,noun,verb,determiners etc
13+
14+
15+
## Sentimental Analysis using NLP
16+
* remove all stopwords
17+
[DATA] - > [Tokenize] - > [Remove Stopwords] - > [find Lemma] - > [find polarity]
18+
* polarity varies from -1 to +1
19+
* this can be done using Text Blob module
20+
21+
## API
22+
* 4 famous API's are :
23+
1. Facebook
24+
2. Linkedin
25+
3. Instagram
26+
4. Twitter
27+
* A website is developed by three categories of team :
28+
1. Security Analyst
29+
2. Developer
30+
3. Cloud Enginneer
31+
32+
### Twitter Server Architecture
33+
* Webserver is connected to Storage device with chunks of distrubuted storages inside
34+
* user is verified by 2 step verification and only after verification the storage device sends the data to the user
35+
* the process of collecting data from twitter account through an API is known as OAuth.
36+
* OAuth is done using consumer key and pass & access token and access key
37+
38+
39+
## Tasks
40+
* Collect all general keyword

Diff for: ansible_practice.md

+138-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,141 @@
4242
* Go to security Credentials download security access token file
4343
* run command ``` aws configure ```
4444
* enter your credentials from file
45-
*
45+
*
46+
-----
47+
48+
# ansible
49+
50+
* ansible --version # shows the version of ansible
51+
* ansible all -m ping # used to run command on all ip in hosts file
52+
* ssh-copy-id ip-address # used to send the ssh of your system to other systems you want to get access to
53+
* to ssh-copy you will need the password of all those os
54+
* always write ansible playbooks in a directory
55+
* Syntax
56+
```
57+
---
58+
- hosts:192.168.10.41 # play1
59+
tasks:
60+
- name: running database
61+
command: date
62+
63+
- hosts:192.168.10.72 # play2
64+
tasks:
65+
- name: running database
66+
command: cal
67+
```
68+
* multi-play - > when to run different command on different os
69+
* always make a sample playbook of yml
70+
71+
```
72+
---
73+
- hosts: all # all is used when need to work on all ip in hosts file
74+
vars:
75+
x: date
76+
tasks:
77+
- name: running
78+
command: "{{ x }}"
79+
register: variable-name # register store the output of above command inside it
80+
81+
- name: to print data of var
82+
debug: var=out # printing the data stored in variable above
83+
84+
- name: to print date command output clearly
85+
debug: var=out.stdout # by default out is a json format and thus we can find easily using dictionary pattern
86+
87+
- name: to print date command output with some message
88+
debug: msg="hello my output is {{ out.stdout }} "
89+
90+
- name: to store output of command in a file
91+
copy: content=" {{ variable }}" dest=output.txt
92+
```
93+
* ansible-playbook playbook-name.yml -v # shows the output of command
94+
* ansible-playbook playbook-name.yml -e x=command , used to change variable value for x written in ansible playbook
95+
* to check ansible playbook
96+
```ansible-playbook --syntax-check play-book name```
97+
98+
* importing variables from a file
99+
100+
* hosts file is known as inventory
101+
* to run different inventory file
102+
```
103+
ansible-playbook playbook-name.yml -i /etc/hosts1 # hosts1 is inventory name
104+
105+
* to change default settings of ansible
106+
```
107+
/etc/ansible/ansible.cfg
108+
```
109+
* By default ansible is service less, it reads the conf file from present working directory initially
110+
* ```ssh ip -t "command to run "``` shows output on your own system that is run on other system
111+
* Inventory Variable
112+
* in inventory file or hosts file
113+
```
114+
[group-name:vars]
115+
x=date
116+
```
117+
* to make different group have same variable make children or group in hosts file
118+
```
119+
[ok:children]
120+
a
121+
b
122+
```
123+
* to define group variables
124+
```
125+
[ok:vars]
126+
x=date
127+
```
128+
* to apply vars for all ips , make a directory named vars
129+
130+
* for more info
131+
```
132+
slashdevops.blogspot.com
133+
```
134+
* search for ansible
135+
136+
## Ansible facts
137+
* to know different variables existing on self system
138+
```
139+
ansible localhost -m setup
140+
```
141+
* facts module is not required to be mentioned
142+
143+
```
144+
---
145+
- hosts: localhost
146+
tasks:
147+
- name: using system facts
148+
debug: msg="my os name is {{ ansible_distribution }}"
149+
150+
- name: finding address details of other os
151+
debug: msg="my os ip details are {{ansible_default_ipv4}} {{ ansible_default_ipv4.macaddress }}"
152+
153+
- name: copy address details of other os
154+
copy: content="my os ip details are {{ansible_default_ipv4}} {{ ansible_default_ipv4.macaddress }}" dest=/root/ip.txt
155+
```
156+
* name of selinux in ubuntu is apparmor
157+
* ansible_apparmor is ansible fact used for accessing selinux of other system
158+
159+
160+
* to install
161+
```
162+
---
163+
- hosts: localhost
164+
tasks:
165+
- name: install
166+
yum:
167+
name: telnet
168+
state: present
169+
register: y
170+
171+
- name: output
172+
debug: var=y
173+
```
174+
175+
* by default ansible gathers facts and to make sure it does not do that
176+
```
177+
gather_facts: no #under hosts file
178+
```
179+
* official website of ansible
180+
```
181+
docs.ansible.com
182+
```

Diff for: rhel8.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ ps -aux --sort=pcpu
493493
```
494494
/dev/mapper/vdo1 path-to-mount xfs defaults,x-systemd.requires=vdo.service 0 0
495495
```
496-
496+
497497
----
498498
499499
# RHEL 8 exam tips ( NOTHING IS RIGID ... SAMEY KE SAATH PARIVARTAN NISHCHIT HAI )

0 commit comments

Comments
 (0)