DevOps Notes Documentation Overview
DevOps Notes Documentation Overview
Release 2.0.23
Vinay Hegde
1 Overview 1
1.1 Tech Stack: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 How-To-Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Please Note: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
i
ii
CHAPTER 1
Overview
Welcome to my notes on various topics related to the DevOps / SRE terminology such as -
• Linux Operating Systems
• Networking
• Web / Email / DNS / Database Servers
• GIT
• Configuration Management Tools (Chef, Ansible, Puppet)
• Programming (Python, Ruby, Shell Scripting)..and many more
• reStructuredText (RST) - To write .rst files for the formatting. You can start learning via this
• Sphinx - The engine generating content in HTML, LaTeX, ePub. A beginner’s guide can be found on their
page
• GitHub - For maintaining the source code in version control.
• ReadTheDocs - Hosting my documentation. Refer this excellent document to help you get up and running in
no time.
1.2 How-To-Use
• Please click any link on the Left Hand side of this webpage to read more such as Utilities, CPU, Monitoring
among others.
• Then you will find subsections (varies upon topics) expandable by clicking on the + icon to read them.
1
DevOps-Notes Documentation, Release 2.0.23
• You can find keywords in the Search Box present in the top Left Corner of this webpage to return relevant
results.
• Due to dynamic content for any topic in here, this will forever be a work in progress. Feedback, suggestions and
queries are always appreciated!
• For contributions, please read the guidelines on how to share Contributing to this project.
• At all times, please refer to the Code-of-Conduct guidelines on interacting with other community members in a
respectful and cordial manner.
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
2 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Commands
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.2 CPU
Concepts
• [Link]
• [Link]
4 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Types of Processes
• [Link]
• [Link]
• [Link]
6 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Commands
NoHUP &
• [Link]
• [Link]
8 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
top
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
SAR
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
KILL
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
HTop
• [Link]
10 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
SysDig
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
1 sudo ps -AL --no-headers | awk -F: '{print $3}' | cut -d' ' -f2 | sort | uniq -c |
˓→sort -n | tail -10
1 sudo ps aux | head -1 && sudo ps aux | grep <process-name> | grep -v grep
1.3.3 Memory
Concepts
• [Link]
• [Link]
Commands
• [Link]
• [Link]
• [Link]
• [Link]
Other Commands
• [Link]
12 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
Configuration
• [Link]
• [Link]
1.3.4 Swap
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
Commands
1 for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}'
˓→$file; done | sort -k 2 -nr | head -10
2 for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}'
˓→$file; done | awk '{print $1 " " $2/1024 " MB" }'|sort -k 2 -n -r | head -10
1 sudo nice top (Press Shift+o → p (To sort processes by swap usage)
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.5 Storage
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
14 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
GRUB
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
LVM
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
RAID
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
GlusterFS
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
NFS
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
SCP
• [Link]
• [Link]
• [Link]
Rsync
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
16 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
LsyncD
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
18 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
20 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
ext(2|3|4)
• [Link]
• [Link]
• [Link]
• [Link]
File Descriptors
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
[Link]
22 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
ULimit
• [Link]
• [Link]
• [Link]
• [Link]
Directory Structures
• [Link]
• [Link]
• [Link]
Inodes
• [Link]
• [Link]
• [Link]
• [Link]
Commands
S-Trace command
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.7 Provisioning
24 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.8 Package-Management
Concepts
• [Link]
• [Link]
RPM
• [Link]
• [Link]
• [Link]
• [Link]
YUM
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
DNF
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Delta-RPMs
• [Link]
• [Link]
26 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
APT
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
393215
• [Link]
28 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
1.3.9 Hardware
Dell OMSA
Concepts
• [Link]
• [Link]
• [Link]
[Link]
• [Link]
• [Link]
Commands
Examples :
• Will list all possibly available system / chassis / storage domain commands
1 sudo omconfig system esmlog action=clear (Replace esmlog with alertlog or cmdlog,
˓→esmlog is the hardware log)
Configuration
• [Link]
• [Link]
IPMITool
• [Link]
MegaCLI
• [Link]
• [Link]
1.3.10 SSH
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
30 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
Commands
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
10197697
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
32 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
TMux
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.11 Editors
VIM Basics
• [Link]
• [Link]
• [Link]
Customizing VIM
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
34 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
36 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
AWK Notes
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Markdown
Syntax
• [Link]
• [Link]
Online Editors
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Atom
Configuration
• [Link]
• [Link]
1.3.12 Utilities
Crontab
38 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
40 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
GREP
• [Link]
• [Link]
FIND
User Management
• [Link]
• [Link]
• [Link]
42 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
44 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
File Permissions
• [Link]
• [Link]
46 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
Sudoers
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
48 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
UserMod Command
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
UMask Values
• → UMask contains default permissions for newly created files / directories based on base permissions for those
50 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• → Base permissions for files is 666 (read-write permissions for owner-group-other : execute permissions are
excluded by for files as security measure)
• → Similarly, the base permissions for directories are 777 (read-write-execute permissions for owner-group-
other)
• → The UMask values are inverse to regular file permissions → i.e: chmod
• → UMask values = Base permissions - required permissions All UMasks
• [Link]
• [Link]
• [Link]
SymLinks
Others
XArgs vs Exec
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
666004
52 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
NTP
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
profile–mac-30515
• [Link]
Random Tools
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
54 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
SysCTL
LSOF
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
DIFF
• [Link]
• [Link]
• [Link]
1.3.13 Fundamentals
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Load Balancing
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
56 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
58 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
cURL
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
wGET
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.14 Apache
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
60 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
62 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Virtual Hosting
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Other Optimizations
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
htm
• [Link]
• [Link]
• [Link]
• [Link]
64 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Commands
1 sudo tail -n 10000 <path-to-log-file> | awk '{print $2}' | sort | uniq -c | sort -n
2 sudo grep 'text' <path-to-access-log> | cut -d' ' -f1 | sort | uniq -c | sort -r
• Finding connections to all server IPs source/destination & sorting in ascending order
1 sudo netstat -antulp | awk '{print $4}' | cut -d":" -f1 | sort | uniq -c | sort -n
2 sudo netstat -antulp | awk '{print $5}' | cut -d":" -f1 | sort | uniq -c | sort -n
1.3.15 Nginx
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.16 HAProxy
Concepts
Official Documentation
• [Link]
• [Link]
• [Link]
66 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
SNI on HAProxy
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.17 SSL
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
68 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
FAQs on SSL
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
70 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Commands
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.18 Monitoring
72 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Nagios
• [Link]
• [Link]
• [Link]
• Monitoring of network services (SMTP, POP3, HTTP, NNTP, ICMP, SNMP, FTP, SSH)
• Monitoring of host resources (processor load, disk usage, system logs) on a majority of network operating
systems, including Microsoft Windows with the NSClient++ plugin or Check MK.
• Monitoring via remotely run scripts via Nagios Remote Plugin Executor or through SSH or SSL encrypted
tunnels.
• Contact notifications when service or host problems occur & get resolved (via e-mail, pager, SMS, or any user-
defined method through plugin system)
• The ability to define event handlers to be run during service or host events for proactive problem resolution.
Automatic log file rotation. Support for implementing redundant monitoring hosts
• An optional web-interface for viewing current network status, notifications, problem history, log files, etc. Data
storage via text files rather than database
Configuration
• [Link]
• [Link]
service-and-servicegroups
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
74 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Check HTTP
• [Link]
1.3.19 Graphing
Concepts
Cacti
• [Link]
Metrics
• [Link]
• [Link]
Ganglia
• [Link]
• [Link]
• [Link]
Important points
• Node : SINGLE machine sending data to Ganglia monitoring daemon. (All individual servers are nodes, can
or can’t be part of a cluster)
• Cluster : All nodes that are used for any particular purpose is a CLUSTER.
• Grid : Collection of clusters is a GRID.
• 1. Gmond :
– Ganglia Monitoring daemon (Service that needs to be installed on each & every node that needs to be
monitored)
– Sends data via XML over TCP & main configuration file : /etc/[Link]
• 2. Gmetad :
– Collects data from Gmond daemons & stores in RRD (Round robin database)
– Main configuration file is /etc/[Link] & should be installed on one node of each cluster
• 3. RRD tool :
– Used by Ganglia to store data for visualization (graphing) & store data of particular time intervals & then
graphs the same.
• 4. PHP Front-End :
– A web interface on the master node that displays graphs and metrics from data in the RRD tool.
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.20 Logging
Concepts
• [Link]
• [Link]
• [Link]
76 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Linux Logs
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
Log-rotate
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
ELK Stack
Some useful links to explain the concepts of the ELK stack - ElasticSearch, Logstash and Kibana
• [Link]
• [Link]
ElasticSearch
• [Link]
• [Link]
• [Link]
Logstash
• [Link]
• [Link]
• [Link]
• [Link]
Kibana
• [Link]
• [Link]
• [Link]
• [Link]
1.3.21 Networking
Concepts
• [Link]
78 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Category Cables
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
80 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
TCP
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
UDP
ICMP
• [Link]
• [Link]
• [Link]
VLAN
Simple Overview
• [Link]
Conceptual Overview
• [Link]
html
• [Link]
82 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Commands
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
PING
• [Link]
• [Link]
IFCONFIG
• [Link]
• [Link]
• [Link]
• [Link]
TRACEROUTE
• [Link]
• [Link]
• [Link]
• [Link]
TCPDUMP
• [Link]
• [Link]
• [Link]
• [Link]
NETSTAT
• [Link]
• [Link]
• [Link]
• [Link]
84 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
IFTOP
• [Link]
• [Link]
• [Link]
NMap
• [Link]
• [Link]
• [Link]
• [Link]
Nmap Command - Free IPs in a particular subnet
1 for i in `sudo nmap -sP <subnet/CIDR> | grep -i 'Nmap scan report for' | awk '{print
˓→$5}'`;do ping -c 1 $i;done | grep from
ARP
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
NETCAT
• [Link]
LLDP
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
html
Virtual IPs
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Static Routing
• [Link]
• [Link]
• [Link]
• [Link]
DHCP
• [Link]
• [Link]
• [Link]
• [Link]
VPN
• [Link]
• [Link]
Advanced Configuration
• [Link]
• [Link]
86 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
my/
1.3.22 Security
Concepts
• [Link]
• [Link]
• [Link]
Rootkits
• [Link]
• [Link]
html
• [Link]
Fail2Ban
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
TCP Wrappers
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
SELinux
Concepts of SELinux
• [Link]
• [Link]
• [Link]
DDoS
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.23 IPTables
88 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
IP Conntrack
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.24 Generic
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
90 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
DevOps
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.25 Python
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Python Books
92 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
Online Courses
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Intermediate Python
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
94 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.26 Bash
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
Operators in Bash
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
96 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
48113
• [Link]
98 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.27 Ruby
Concepts
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.28 GIT
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• Update multiple git repos : [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
[Link]
• [Link]
• [Link]
Troubleshooting
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Git on Windows
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
3651867
• [Link]
3580764#3580764
Random Notes
• [Link]
1.3.29 Ansible
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
Official Documentation
• [Link]
Configuration
[Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Ansible Roles
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Troubleshooting
• [Link]
• [Link]
• [Link]
1.3.30 Puppet
Concepts
• [Link]
• [Link]
Official Documentation
• [Link]
• [Link]
Others
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
[Link]
• [Link]
1.3.31 Chef
Concepts
• [Link]
• [Link]
Configuration
Troubleshooting
1.3.32 Docker
• [Link]
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
32622147
• [Link]
• [Link]
• [Link]
Docker Training
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.33 Kubernetes
Concepts
• [Link]
• [Link]
• [Link]
Official Documentation
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Troubleshooting
• [Link]
57161894#57161894
• [Link]
• [Link]
• [Link]
1.3.34 AWS
• [Link]
Concepts
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
s3cmd
• [Link]
• [Link]
• [Link]
AWS Instances
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.35 MySQL
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Commands
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Administration/Maintaining+Log+Files/
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Replication (Master-Master)
• [Link]
Replication (Master-Slave)
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Troubleshooting
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.36 PostgreSQL
Concepts
• [Link]
• [Link]
Commands
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
postgresql-on-a-vps–2
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Troubleshooting
• [Link]
• [Link]
• [Link]
Official Links
• [Link]
• [Link]
1.3.37 NoSQL
Concepts
• [Link]
• [Link]
Configuration
Troubleshooting
1.3.38 Redis
Concepts
• [Link]
Configuration
• [Link]
• [Link]
1.3.39 Kafka
Concepts
• [Link]
• [Link]
Configuration
1.3.40 Email
Concepts
• [Link]
• [Link]
1.3.41 Postfix
Concepts
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
SSL/TLS on Postfix
• [Link]
Queue Management
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Commands
1 sudo mailq| grep '^[A-Z0-9]'| grep <sender-ID>| cut -f1 -d' ' | tr -d \*|sudo
˓→postsuper -h -
1 sudo mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($8 == "
˓→<recipient>") print $1 } ' | tr -d '*!' | sudo postsuper -h -
1 sudo mailq| grep '^[A-Z0-9]'| grep @<domain>| cut -f1 -d' ' | tr -d \*|sudo postsuper
˓→-h -
1 sudo mailq| grep '^[A-Z0-9]'| grep <sender-ID>| cut -f1 -d' ' | tr -d \*|sudo
˓→postsuper -d -
1 sudo mailq| grep '^[A-Z0-9]'| grep @<domain>| cut -f1 -d' ' | tr -d \*|sudo postsuper
˓→-d -
1 sudo mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($8 == "
˓→<recipient-ID>") print $1 } ' | tr -d '*!' | sudo postsuper -h -
1.3.42 Exim
Concepts
Configuration
Queue Management
• [Link]
• [Link]
• [Link]
1.3.43 Dovecot
Concepts
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
1.3.44 Milters
Concepts
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
Concepts
SPF Records
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
html
• [Link]
#ssl
• [Link]
• [Link]
1.3.46 ClamAV
Concepts
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
1.3.47 DNS
Concepts
• Authoritative NS
– When a DNS query is made to a server which has the domain’s data, it is an authoritative NS, other-
wise it will point to other NS or serve cached copies of other NS
• Zone file
– simple text file containing the mapping between domain names and IP addresses, e.g :
[Link]
• Root Servers
– 13 servers - a to h, routed to the nearest mirror of the server
• TLD servers :
– .com [others are : .org, .net, .edu etc]
• Domain Level NS
– the server containing the actual records of the requested domain ([Link], [Link]
etc)
• TTL - Time to live
– A timer. Caching name servers can use this until the TTL runs out
• Records
3 3h; refresh interval - Slave NS waits this period to poll the master NS for changes
4 30m; retry interval - Slave NS will retry querying master NS every this period for
˓→zone transfer updates
5 3w; expiry period - if slave NS can not contact master for this time, it will no
˓→longer return authoritative response for the queried zone
• The original DNS specifications RFC-1034 & RFC-1035 envisaged that slave (or secondary) DNS servers would
poll the master.
• The time between such ‘polling’ is determined by the refresh value on the domain’s SOA Resource Record
• The polling process is accomplished by the ‘slave’ sending a query to the master and requesting its current SOA
record.
• If serial number of this record is higher than the current one maintained by the slave a zone transfer (AXFR) is
requested & done on TCP Port 53.
• DNS uses UDP for to replying to client DNS queries such as client asking DNS server for a Name to IP or IP to
NAME resolution.
• The reason is that UDP is not connection oriented, so its light-weight & fast, resulting in faster data transmission
of results to client compared to TCP.
• At the same time, if needed then DNS can also work over TCP to serve the DNS queries, but UDP is always
preferred because of greater speed.
Why DNS uses TCP for Zone files transfer over port 53
• DNS uses a master & slave architecture, in which one main authoritative Name server having all the entries &
others are replicated (zone files transferred) from master & also serve DNS queries.
• As there can’t be any inconsistency in Zone files, so to transfer these Zone files DNS uses TCP as the commu-
nication protocol, which makes sure that the zone files are transferred reliably.
Resource Records
• A record
– map a host to an IP address
host IN A IPv4_address host IN AAAA IPv6_address
• MX Record
– map a mail exchange used for the domain
IN MX 10 [Link]. (where 10 is record priority. Priority is given to
MX with lower values at DNS lookup)
• PTR
– maps an IP address to a reverse name
• Recursive:
– A DNS server which queries other servers until it finds answer to the queried domain. They maintain
a cache which is initially checked before sending the app’s query to another NS.
• Iterative:
– To be explained
• Authoritative-Only :
– Only answers those queries for which it stores the zones. Does not respond to recursive queries &
cache query results.
• Caching :
– It handles recursive queries from clients which handles queries received from the OS stub resolver
(/etc/hosts).
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• DNS Explained via YouTube
• [Link]
• [Link]
• [Link]
Configuration
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
The `free` command provides a quick overview of memory usage, detailing total, used, and available memory along with swap space. It helps administrators assess how memory is distributed and whether adjustments in allocation are needed . However, it may not always reflect the actual memory availability as it includes buffers and cached data, which can be confusing without understanding how Linux manages memory .
UDP is preferred for DNS queries because it is connectionless and lightweight, allowing faster transmission of data to clients. This enhances the speed of DNS services compared to TCP, which requires establishing a connection before data transfer, leading to possible delays . However, DNS uses TCP for zone file transfers to ensure reliability and prevent inconsistencies in zone files .
Linux environment variables influence system operations by defining settings that affect processes' behavior, such as file paths or user preferences . Modifying these variables without proper understanding may lead to system instability or unintended behavior, as critical paths or configurations might be altered unintentionally .
The `/proc/meminfo` file is crucial for providing detailed information about memory usage on a Linux system. It allows administrators to monitor system health by checking parameters like available memory, buffers, and swap usage . This aids in diagnosing memory issues and optimizing memory allocation for applications .
Challenges with swap space include performance degradation due to disk I/O bottlenecks when swapping occurs frequently, which increases latency . These can be mitigated by ensuring ample physical RAM is available, optimizing applications to use less memory, and configuring swap space appropriately to balance performance and resource usage .
RAID configurations enhance storage reliability by providing fault tolerance through parity and redundancy. They can improve performance by distributing I/O operations across multiple disks . Trade-offs include increased complexity in setup and management, higher cost due to additional hardware requirements, and potential performance overhead in parity calculations for some RAID levels .
Environment variables provide a flexible way to configure software applications, allowing changes in configuration without altering code, thus enhancing portability and maintainability . In contrast, hard-coded paths can lead to rigid applications that require code modification for changes in environment, increasing the chance for errors. Benefits of environment variables include easier configuration management and environmental adaptability .
TLD (Top-Level Domain) servers are part of the DNS hierarchy that handle domain extensions like .com, .org, etc. They assist in directing a query to the appropriate authoritative name server that contains the actual domain records, interacting with root servers to facilitate the query resolution process .
Page faults occur when a program accesses a part of memory that is not currently mapped to physical memory, prompting a retrieval from the disk . They become a performance concern when high rates of page faults indicate insufficient RAM or memory management issues, leading to increased I/O and system sluggishness . Mitigation involves optimizing memory usage and possibly increasing RAM .
LVM provides flexibility in disk management by allowing dynamic resizing of disk partitions, creating snapshots, and combining multiple physical disks into a single logical volume . It is advantageous over traditional partitioning as it allows for easier management of disk space, accommodates growth without downtime, and improves resource utilization .









