Saturday, May 6, 2017

Notes2

droppedbyte="$(iptables -L -v -n --line-number | grep DROP | awk '$1 = 5 {print $3}')"


droppedbyte="$(iptables -L -v -n --line-number | grep DROP | awk '$1 = 5 {print $3}')"
echo "$droppedbyte"

================================

python
What are the different types of modules , you have used
How does cnn.com work
What are the different infrastructure components involved

how long does a browser or an infrastructure equipment remember the ip address
This is based on the TTL { Time to Live}

what are the different areas , where the ip address could be cached ?
server , DNS cache , router , browser , at the ISP level

how do yu parse a /etc/hosts file

Explain about SSL

how to capture the specific fileds using python from a file
--------------------------------

awk command  to print a specific field
How to use it and how to implement it using python

GIL- what is it
*args , did you use it ?

do you use any OAM in python ?
no object oriented programming so far

Difference between django and flask and why did you use flask

Where are you in terms of using flask ?


What happens , when a guy gets under your skin

what is one difficult or exciting project tha tyou have worked on ?

How do you install a piece of software on a lot of servers ?
use a shared drive mount , that is common to all the servers

Use puppet , that identifies the servers , based on the domain name

How does puppet work - based off of an agent ?
how long does the agent take to gather the configuration from the master

Any other scripting languages ?
shell , python , little ruby


What is the type of error you get , if the /etc/hosts file doesnt exist and you are trying to open it , please explain in detail
Try catch statement ,
We get an IO error , which states that , there is no such file or directory

IO error is for the input error- when the file doesnt exist
How to debug io issues
WHAT’S THE BEST PATH TO FIXING AN I/O BOTTLENECK?
how to find n/w issues
rsync issues , if this is a new job thats running

-----
So in TCP , while doing a communication , what are the things , that need to be considered
i mean , there are 4 things that are necessary , that are necessary
ip of the host and client , port of the host and client
-----------------------------
SSL - symmetric and assymetric
explain it clearly
--------------
What is load average
What is the hardware cloud and virtualization
Complete thing about docker
Amazon security groups
coding question about the sorting algorithm - load averages

========================================

tell me about yourself
======================

What is docker , how do you use it
cow
do you know how docker works
what it does at kernel level

================================
how is the application looking

the complexity of the algorithms

the time complexity O nlog(n)

the complexity

What type of software do you use for installing docker
------------------------------

swarm

docker compose , do you know which language are these written in ?

splunk Apps , which language are these written in
Where does python come into picture

------------------------------------------

How fast is splunk
------------------------------------------

perfect forward secrecy
When the SSL means, what is the information that is shared
the ips of the host and ip of the client , the port of the client and the port of the client
Do you know what is the complexity
Do you know how docker works
Do you know what is Sha1 , Sha2
Do you know this
Do you know that
Do you know which algorithm , you want to write
Do you know about binary algorithms
Binary trees , what are the different binary trees
which binary tree algorithm do you use
counting sort
Which sorting algorithm do you use

what is SSL
What happens , when you do a ssl handshake

The initial handshake happens with assymetric keys
After the keys are exchanged , then the symmetric keys are exchanged and then the encrypted data is exchanged
CSR

What is tcp /ip
in tcp /ip , what are the two pairs of information that is exchanged
in

Coding problem

===============================

Where does docker come into picture

==================================

Where do you use splunk
Do you remember any key words that are part of the splunk
Do you use splunk Cloud ?
How is splunk implemented in your company ?
What are the different things that you have done ?

====================================
What did you do as part of your job ?
How is the code reviewed ?

load averages - How are load averages calculated ?
1,5,15 minutes
it depends on the number of cores of the computer - if the load averages exceed the number of processes , that could
be handled by the cpus present , then we do have an issue

route ?
SSL - how does it work ?
What is the underlying architecture for docker ? - How does it work ?
groups , some part of pids , some network , some cpu , some memory
Everything is divided and assigned to the containers ,
This is how docker works


=================================

























Monday, March 6, 2017

Ansible Notes

Sample Commands:

Ansible - Scripting using playbooks is the main critereon

Puppet - Module
Chef - Cookbook
Ansible - Playbook

Playbooks are used to perform many actions on multiple machines

Playbooks are written in YAML language

Playbooks are divided into three sections:
===========================================

1. Target Section
   Similar to nodes.pp in puppet
              runlist  in Chef
   Target hosts defines on which hosts, this playbook will be executed and how it will be executed

2. Variable Definition
   Define your variables, which can be used from the playbooks

3. Tasks Section
   What do you intend to do on the target hosts
   List all the modules that you intend to run in the order.

As ansible is agentless, we dont need any angent on the remote host


The playbook Syntax:
Always starts with ---
It is very particular about intendation and spacing

---
 - hosts: hostname.example.com
   




The tasks title in puppet is the name in playbook
Use the copy module , source and destination to copy the stuff

Saturday, July 9, 2016

Ansible post install

ansible --version
ansible-playbook --version
ansible-galaxy --version

Now , we have the Ansible installed
Now we need the inventory
The inventory file needs to be managed by ansible

Every change to the inventory file should be able to be tracked


we can have this inventory file anywhere
Lets say that , the inventory file is in our home directory  by the name dev
The inventories are grouped by their function and the name of the Function being their role/Function

Now we know that their role/Function is what the group name is , it is easier to track the hosts in the Inventory

As we know the name of the file dev


executing this command

ansible --list-hosts all  , will check the list of the hosts from the Default system inventory which is
/etc/ansible/hosts

If we want to display the names of the hosts from a particular locaiton in the inventory , then we do tha following
We source in the name of the inventory file from the location where it is

ansible -i  filename  --list-hosts all

This will display the hosts that are in the filename

COMMANDS:
ansible --list-hosts all     and   ansible -i filename --list-hosts  all








Ansible Installation

yum install bind-utils

nslookup www.google.com

yum install htop

Tuesday, July 5, 2016

Installation Commands on Cent OS

  402  yum update
  403   yum -y install python-pip
  404  curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
  405   yum -y install python-pip
  406  python get-pip.py
  407  pip -V
  408  id
  409  pwd
  410  docker ps
  411  docker ps -a
  412  id
  413  pwd
  414  pip -V
  415  id
  416  su -
  417  cd
  418  hostname
  419  docker ps
  420  docker ps -a
  421  pip -V
  422  yum install ansible
  423  yum update
  424  which ansible
  425  yum install ansible
  426  sudo apt-get update
  427  sudo yum update
  428  id
  429  su -
  430  id
  431  pwd
  432  bash
  433  bash
  434  docker ps
  435  pwd
  436  cd docker
  437  ls
  438  ls -ltra
  439  cd ..
  440  pwd
  441  cd python
  442  ls
  443  ls -ltra
  444  more getCpu_count.py
  445  ls
  446  id
  447  pwd
  448  ansible
  449  ansible -v
  450  ulimit -a
  451  ulimit
  452  sudo launchctl limit maxfiles unlimited
  453  launchctl
  454  launch
  455  ulimit
  456  ulimit -help
  457  ulimit -maxfiles
  458  ulimit - maxfiles
  459  ulimit
  460  ulimit -a
  461  pwd
  462  cd ..
  463  ls
  464  mkdir ansible
  465  cd ansible/
  466  git clone git://github.com/ansible/ansible.git --recursive
  467  id
  468  su -
  469  cd /opt
  470  docker ps
  471  id
  472  pwd
  473  cd /opt/apps
  474  ls
  475  bash
  476  bash
  477  pwd
  478  ls
  479  cd
  480  ls
  481  hostname
  482  pwd
  483  ls
  484  cd
  485  cd /opt/apps
  486  ls
  487  cd ansible/
  488  ls
  489  cd ansible/
  490  ls
  491  cd ..
  492  ls
  493  pwd
  494  ls
  495  git clone git://github.com/ansible/ansible.git --recursive
  496  mv ansible/ ansible.o
  497  git clone git://github.com/ansible/ansible.git --recursive
  498  ifconfig -a | grep inet
  499  ifconfig -a
  500  id
  501  pwd
  502  nslookup
  503  which nslookup
  504  yum install nslookup
  505  id
  506  pwd
  507  id
  508  pwd
  509  nslookup dns
  510  nslookup dns.example.com
  511  cd /etc/
  512  vi resolv.conf
  513  pwd
  514  ls
  515  ls 0ltra
  516  ls -ltra
  517  ls -ltra | resolv.conf
  518  ls -ltra resolv.conf
  519  date
  520  which ansible
  521  history
  522  pwd
  523  cd /var/tmp
  524  history > history_file

Ansible Tut1

The Following are the steps , that we need to follow to install ansible on OSX

1) Check ulimit -n
They should be unlimited

2) sudo easy_install pip
pip gets installed , which is a package manager

3) Ansible is a python Application
Packages available through package repo

4)sudo pip install ansible
Now Install ANSIBLE  using pip , which is a python package manager

5) Ansible uses Native OPEN SSH for communication

6) Using Open SSH enables Control Persist - which is a performance feature , Kerberos and options in ~/.ssh/config  such as Jump Host setup