100% found this document useful (1 vote)
300 views136 pages

DevOps Notes Documentation Overview

This document is an overview of Vinay Hegde's DevOps-Notes documentation. It introduces the tech stack used, how to use the documentation, and some notes for users. The tech stack includes reStructuredText, Sphinx, GitHub and ReadTheDocs. Users can click links on the left to read topics and use the search box. The documentation is a work in progress and contributions are welcome when following the guidelines. [END SUMMARY]

Uploaded by

kalaiarasan tk
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
300 views136 pages

DevOps Notes Documentation Overview

This document is an overview of Vinay Hegde's DevOps-Notes documentation. It introduces the tech stack used, how to use the documentation, and some notes for users. The tech stack includes reStructuredText, Sphinx, GitHub and ReadTheDocs. Users can click links on the left to read topics and use the search box. The documentation is a work in progress and contributions are welcome when following the guidelines. [END SUMMARY]

Uploaded by

kalaiarasan tk
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
  • Overview
  • Boot Process
  • Monitoring Tools

DevOps-Notes Documentation

Release 2.0.23

Vinay Hegde

Nov 29, 2022


Basic-Concepts

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

1.1 Tech Stack:

• 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.

1.3 Please Note:

• 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.

1.3.1 Boot Process

Some useful links to explain the concepts of the Boot Process

Concepts

Overview of the Linux Boot process

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Difference between commands for bringing down a linux server

• [Link]

Difference between GRUB / LILO

• [Link]

Is a separate boot partition necessary in Linux OS?

• [Link]

2 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

1.3. Please Note: 3


DevOps-Notes Documentation, Release 2.0.23

Commands

Configuration

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Troubleshooting & Log Parsing

1.3.2 CPU

Some useful links to explain the concepts of CPU processing

Concepts

• [Link]
• [Link]

4 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

1.3. Please Note: 5


DevOps-Notes Documentation, Release 2.0.23

Types of Processes

• [Link]

Output of ps command - Explained

• [Link]

• [Link]

6 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Commands

NoHUP &

• [Link]
• [Link]

1.3. Please Note: 7


DevOps-Notes Documentation, Release 2.0.23

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]

Nice / Renice / IOnice

• [Link]
• [Link]

KILL

• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 9


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]

HTop

Visual representation of all HTop parameters

• [Link]

10 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

HTop command - Explained

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

SysDig

• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 11


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]

Configuration

Troubleshooting & Log Parsing

• Find the most number of processes running on the system

1 sudo ps -AL --no-headers | awk -F: '{print $3}' | cut -d' ' -f2 | sort | uniq -c |
˓→sort -n | tail -10

• Check for zombie processes with PPID

1 sudo ps axo stat,ppid,pid,comm | grep -w defunct

• View Column Headers in ps output

1 sudo ps aux | head -1 && sudo ps aux | grep <process-name> | grep -v grep

1.3.3 Memory

Some useful links to explain the concepts of Memory

Concepts

• [Link]
• [Link]

Commands

Free Command - Explained

• [Link]
• [Link]
• [Link]
• [Link]

Other Commands

• [Link]

12 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]

Configuration

• [Link]

Create a RAM Disk

• [Link]

Troubleshooting & Log Parsing

1.3.4 Swap

Some useful links to explain the concepts of Swap

Concepts

• [Link]
• [Link]
• [Link]
• [Link]

Commands

• Check total swap space used & sort it descending

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

• Alternatively - run below command

1.3. Please Note: 13


DevOps-Notes Documentation, Release 2.0.23

1 sudo nice top (Press Shift+o → p (To sort processes by swap usage)

Configuration

• [Link]
• [Link]
• [Link]

Troubleshooting & Log Parsing

• [Link]
• [Link]
• [Link]
• [Link]

1.3.5 Storage

Some useful links to explain the concepts of Storage, I/O

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]

1.3. Please Note: 15


DevOps-Notes Documentation, Release 2.0.23

• [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]

Explanation of [Link] parameters

• [Link]
• [Link]

1.3. Please Note: 17


DevOps-Notes Documentation, Release 2.0.23

Max User Watches Error of Lsyncd

• [Link]
• [Link]

18 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

1.3. Please Note: 19


DevOps-Notes Documentation, Release 2.0.23

Configuration

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Creating & mounting a 2nd Hard drive in linux

• [Link]

Good explanation fstab parameters

• [Link]

20 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Troubleshooting & Log Parsing

• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 21


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]

Online Visual RAID Calculator

• [Link]
• [Link]

1.3.6 File Systems

Some useful links to explain the concepts of File Systems

Concepts

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

ext(2|3|4)

• [Link]
• [Link]
• [Link]
• [Link]

File Descriptors

• [Link]
• [Link]
• [Link]

Proc File Systems

• [Link]
• [Link]
• [Link]
[Link]

22 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

1.3. Please Note: 23


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

Some useful links to explain the concepts of Cobbler / Kickstart


• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
html

24 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3.8 Package-Management

Some useful links to explain the concepts of Package-Management

Concepts

• [Link]
• [Link]

Difference between yum update / yum upgrade

RPM

• [Link]
• [Link]

1.3. Please Note: 25


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]

YUM

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

DNF

• [Link]
• [Link]

Configuration

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Rollback or Revert YUM Changes

• [Link]
• [Link]
• [Link]

Downloading packages for RPM based OS

• [Link]

Delta-RPMs

• [Link]
• [Link]

26 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Troubleshooting & Log Parsing

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

APT

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Working With Packages

• [Link]
• [Link]
• [Link]

Configuration

• [Link]
• [Link]

1.3. Please Note: 27


DevOps-Notes Documentation, Release 2.0.23

• [Link]

Troubleshooting & Log Parsing

Is apt-get autoremove safe

• [Link]
393215

Difference between apt-get update / apt-get upgrade

• [Link]

28 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

1.3.9 Hardware

Some useful links to explain the concepts of Hardware (Dell / SuperMicro)


• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Dell OMSA

Concepts

• [Link]
• [Link]
• [Link]
[Link]
• [Link]
• [Link]

Commands

• We use 2 commands to monitor / change parameters in Dell servers

1 omreport - Checks the server details via specified parameters.


2

3 omconfig - Modifies the server details via specified parameters.

1.3. Please Note: 29


DevOps-Notes Documentation, Release 2.0.23

Examples :

• Will list all possibly available system / chassis / storage domain commands

1 sudo omreport system -? | omreport chassis -? | omreport storage -?

• Retrieve general system information

1 sudo omreport system summary | less

• Display the Hardware logs

1 sudo omreport system esmlog

• Retrieve the RAID configuration

1 sudo omreport storage vdisk controller=0

• Clearing the logs

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

Some useful links to explain the concepts of SSH

Concepts

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

30 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]

Commands

Configuration

SSH key-based logins

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
10197697

Tuning & Hardening

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 31


DevOps-Notes Documentation, Release 2.0.23

Correct permissions of .ssh directory

• [Link]

32 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Run same commands via SSH on multiple servers

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

TMux

Some useful links to cover the working of TMux.

1.3. Please Note: 33


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Troubleshooting & Log Parsing

1.3.11 Editors

Some useful links to explain the concepts of Editors

VIM Basics

• [Link]
• [Link]
• [Link]

Customizing VIM

VIM Color Schemes

• [Link]
• [Link]
• [Link]
• [Link]

Making your own .vimrc

• [Link]

34 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

1.3. Please Note: 35


DevOps-Notes Documentation, Release 2.0.23

VI Editor Cheat Sheet

36 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

To delete all lines in vim

SED && AWK

• [Link]

Converting New-Lines to Spaces

• [Link]
• [Link]
• [Link]
• [Link]

AWK Notes

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Markdown

Syntax

• [Link]

1.3. Please Note: 37


DevOps-Notes Documentation, Release 2.0.23

• [Link]

Online Editors

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Atom

Configuration

• [Link]
• [Link]

1.3.12 Utilities

Environment Variables {ENV}

Some useful links to explain the concepts of Environment Variables


• [Link]
• [Link]
• [Link]
• [Link]

Crontab

Some useful links to cover the working of Crontab


• [Link]
• [Link]
• [Link]

38 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]

1.3. Please Note: 39


DevOps-Notes Documentation, Release 2.0.23

40 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Online Utilities to generate crons

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

GREP

Some useful links to cover the working of Grep


• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Grepping ps output without showing the grep process

• [Link]
• [Link]

1.3. Please Note: 41


DevOps-Notes Documentation, Release 2.0.23

FIND

Some useful links to cover the working of Find


• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

User Management

• [Link]
• [Link]
• [Link]

42 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]

1.3. Please Note: 43


DevOps-Notes Documentation, Release 2.0.23

44 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

File Permissions

Some useful links to cover the working of File Permissions


• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Why sudo cd <path-to-dir> doesn’t work

• [Link]

1.3. Please Note: 45


DevOps-Notes Documentation, Release 2.0.23

• [Link]

46 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

1.3. Please Note: 47


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]

1.3. Please Note: 49


DevOps-Notes Documentation, Release 2.0.23

UserMod Command

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

SetUID and SetGID

• [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

Some useful links to cover the working of SymLinks


• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Others

XArgs vs Exec

• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 51


DevOps-Notes Documentation, Release 2.0.23

• [Link]
666004

52 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

NTP

• [Link]
• [Link]
• [Link]

Renaming / Deleting multiple files

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 53


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]

Rename multiple files with different extensions

• [Link]

Command Prompt Tweaks

• [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

Some useful links to cover the working of SysCTL


• [Link]
• [Link]
• [Link]
• [Link]

LSOF

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

DIFF

• [Link]

Comparing difference between files / directories on 2 servers

• [Link]
• [Link]

1.3.13 Fundamentals

Some useful links to explain the concepts of Web-Servers

Concepts

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 55


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]

Load Balancing

• [Link]
• [Link]
• [Link]

HTTP request lifecycle overview

• [Link]

Difference between http 443 and https 80

• [Link]

56 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

1.3. Please Note: 57


DevOps-Notes Documentation, Release 2.0.23

HTTP status codes

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

58 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

1.3. Please Note: 59


DevOps-Notes Documentation, Release 2.0.23

Check website-availability issues - Tools

• [Link]
• [Link]
• [Link]

cURL

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

wGET

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3.14 Apache

Some useful links to explain the concepts of Apache

Concepts

• [Link]
• [Link]
• [Link]
• [Link]

60 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Information about MPM (Multi Processing Modules)

• [Link]
• [Link]
• [Link]

1.3. Please Note: 61


DevOps-Notes Documentation, Release 2.0.23

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]

HTaccess checks and guides

• [Link]
• [Link]
• [Link]
• [Link]

Tuning & Hardening

Apache Server Status Page

• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 63


DevOps-Notes Documentation, Release 2.0.23

Other Optimizations

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Troubleshooting & Log Parsing

Find Original IPs of sites using CDNs like Cloudflare

• [Link]

Levels of traffic with Apache access log

• [Link]
• [Link]
• [Link]
• [Link]
htm
• [Link]
• [Link]
• [Link]
• [Link]

64 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Commands

• Find hits by IP to server from access log in ascending order

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

Some useful links to explain the concepts of NGinx

Concepts

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Configuration

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 65


DevOps-Notes Documentation, Release 2.0.23

Nginx with HTTPS using SSL via LetsEncrypt

• [Link]
• [Link]
• [Link]

Visual Editor for NGinx Config

• [Link]

Tuning & Hardening

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Troubleshooting & Log Parsing

• [Link]
• [Link]

1.3.16 HAProxy

Some useful links to explain the concepts of 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]

Tuning & Hardening

SNI on HAProxy

• [Link]
• [Link]
• [Link]
• [Link]

Troubleshooting & Log Parsing

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 67


DevOps-Notes Documentation, Release 2.0.23

1.3.17 SSL

Some useful links to explain the concepts of SSL

Concepts

• [Link]
• [Link]
• [Link]
• [Link]

68 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 69


DevOps-Notes Documentation, Release 2.0.23

FAQs on SSL

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Server Name Indication

• [Link]
• [Link]
• [Link]

Configuration

Basics of OpenSSL Commands for CSR, Keys & Certs

• [Link]

Wildcard SSL on sub-domain

• [Link]
• [Link]
• [Link]

Switching from HTTP to HTTPs

• [Link]
• [Link]
• [Link]

Creating SAN SSL certificate

• [Link]

70 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Tuning & Hardening

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Hardening Your Web Server’s SSL Ciphers

• [Link]
• [Link]
• [Link]

Troubleshooting & Log Parsing

• [Link]
• [Link]
• [Link]
• [Link]

Commands

• [Link]
• [Link]
• [Link]
• [Link]

Free SSL Certificates : LetsEncrypt

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 71


DevOps-Notes Documentation, Release 2.0.23

1.3.18 Monitoring

Some useful links to explain the concepts of Monitoring

72 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Concepts

1.3. Please Note: 73


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Nagios

• [Link]
• [Link]
• [Link]

What Nagios does

• 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

Host / Service Monitoring

• [Link]
• [Link]
service-and-servicegroups

Deploying SSH Checks For Nagios

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

74 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Check HTTP

• [Link]

1.3.19 Graphing

Some useful links to explain the concepts of Graphing

Concepts

Cacti
• [Link]
Metrics
• [Link]
• [Link]

Ganglia

• [Link]
• [Link]
• [Link]

What Ganglia does

• Graph different properties of a server such as CPU,memory,load,etc


• Compare the graphing trend of those properties with previous trend & identify which node or host is causing
the issue easily from the trend.
• Make custom metrics for graphing for different process.
• Machines from different data centers which are part of one single cluster must be represented in that single
cluster in a single interface.

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.3. Please Note: 75


DevOps-Notes Documentation, Release 2.0.23

Parts of Ganglia Monitoring Tool

• 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]

Troubleshooting & Log Parsing

• [Link]
• [Link]

1.3.20 Logging

Some useful links to explain the concepts of 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]

Troubleshooting & Log Parsing

• [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]

1.3. Please Note: 77


DevOps-Notes Documentation, Release 2.0.23

Logstash

• [Link]
• [Link]
• [Link]
• [Link]

Kibana

• [Link]
• [Link]
• [Link]
• [Link]

1.3.21 Networking

Some useful links to explain the concepts of Networking Protocols

Concepts

OSI Model Mnemonic : Please Do Not Teach Students Pointless Acronyms

• [Link]

78 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]

Finding optimum MTU (Maximum Transmission Unit) size

• [Link]
• [Link]
• [Link]

1.3. Please Note: 79


DevOps-Notes Documentation, Release 2.0.23

Category Cables

• [Link]
• [Link]
• [Link]

MAC Addresses : Explained

Private / Public / LocalHost IPs:

• [Link]
• [Link]
• [Link]
• [Link]

80 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]

TCP

States of a TCP Connection

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

LIST of TCP / UDP Ports

• [Link]

UDP

ICMP

• [Link]

1.3. Please Note: 81


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]

VLAN

Simple Overview

• [Link]

Conceptual Overview

• [Link]
html

Difference between access & trunk ports

• [Link]

82 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Commands

• [Link]
• [Link]

1.3. Please Note: 83


DevOps-Notes Documentation, Release 2.0.23

• [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

Basic NIC configuration & Bonding

• [Link]
• [Link]
• [Link]

1.3. Please Note: 85


DevOps-Notes Documentation, Release 2.0.23

• [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]

Tuning, Troubleshooting & Log Parsing

Advanced Configuration

• [Link]
• [Link]

86 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]

Digging deeper into the Linux Networking stack

• [Link]
• [Link]
• [Link]

Disable Network Manager in Linux

• [Link]

Disable Network Manager from over-writing [Link] in Linux

• [Link]
my/

1.3.22 Security

Some useful links to explain the concepts of Security in Linux OS

Concepts

• [Link]
• [Link]
• [Link]

Rootkits

• [Link]
• [Link]
html
• [Link]

Fail2Ban

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 87


DevOps-Notes Documentation, Release 2.0.23

• [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

Some useful links to explain the concepts of 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]

Tuning and Hardening

• [Link]

IP Conntrack

• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 89


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]

1.3.24 Generic

Some useful links to explain the concepts of Programming

Concepts

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Configuration

Online Interpreter for Multiple Languages

• [Link]

90 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

DevOps

1.3. Please Note: 91


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3.25 Python

Some useful links to explain the concepts of Python

Concepts

• [Link]
• [Link]
• [Link]
• [Link]

Official Python Documentation

• [Link]
• [Link]

Python Books

A Byte of Python - [Link]


Learn Python the Hard Way - [Link]

92 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Online Courses

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Intermediate Python

• [Link]
• [Link]
• [Link]

Solving Python Problems to Learn Concepts

• [Link]

Configuration

• [Link]
• [Link]
• [Link]

1.3. Please Note: 93


DevOps-Notes Documentation, Release 2.0.23

• [Link]

94 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]

Visual IDE for Python

• [Link]
• [Link]

1.3.26 Bash

Some useful links to explain the concepts of Bash Scripting

Concepts

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 95


DevOps-Notes Documentation, Release 2.0.23

Conditional Statements, Loops

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Editing & Formatting Text

• [Link]
• [Link]
• [Link]
• [Link]

Configuration

Online IDE for Bash Scripts

• [Link]
• [Link]

Operators in Bash

• [Link]
• [Link]
• [Link]
• [Link]

Avoid Temp files in Shell scripts

• [Link]

Variables, Functions in Bash

• [Link]
• [Link]
• [Link]

96 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]

Configure Bash History Retention

• [Link]

• [Link]
48113

1.3. Please Note: 97


DevOps-Notes Documentation, Release 2.0.23

• [Link]

98 Chapter 1. Overview
DevOps-Notes Documentation, Release 2.0.23

Troubleshooting & Log Parsing

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3.27 Ruby

Some useful links to explain the concepts of Ruby

Concepts

Official Ruby Documentation

• [Link]
• [Link]

Configuration

• [Link]
• [Link]
• [Link]
• [Link]

Troubleshooting & Log Parsing

• [Link]
• [Link]
• [Link]
• [Link]

1.3.28 GIT

Some useful links to explain the concepts of GIT

Concepts

Official Git Documentation

• [Link]
• [Link]

1.3. Please Note: 99


DevOps-Notes Documentation, Release 2.0.23

• [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]

100 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• Update multiple git repos : [Link]

Self-hosted GitHub Clones

• [Link]
• [Link]
• [Link]

Reviews || Configuration of the above

• [Link]
• [Link]
• [Link]
[Link]
• [Link]
• [Link]

Troubleshooting

• [Link]
• [Link]
• [Link]

Remove local commits NOT pushed to remote

• [Link]
• [Link]

Understanding .gitignore file

• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 101


DevOps-Notes Documentation, Release 2.0.23

Git Operations (Stash, Merge, Diff, Rebase)

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

102 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

Git on Windows

• [Link]
• [Link]
• [Link]

Better GIT Workflow

• [Link]
• [Link]
• [Link]

1.3. Please Note: 103


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
3651867
• [Link]
3580764#3580764

Random Notes

• [Link]

1.3.29 Ansible

Some useful links to explain the concepts of Ansible

Concepts

• [Link]
• [Link]
• [Link]
• [Link]

Official Documentation

• [Link]

Configuration

[Link]

• [Link]
• [Link]
• [Link]
• [Link]

104 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

Run one Task - Ansible Playbook

• [Link]

1.3. Please Note: 105


DevOps-Notes Documentation, Release 2.0.23

106 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

Basic Ansible Tutorials

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Ansible Roles

• [Link]

Managing Users with Ansible

• [Link]
• [Link]
• [Link]

NGinx Setup via Ansible

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Troubleshooting

• [Link]
• [Link]
• [Link]

1.3.30 Puppet

Some useful links to explain the concepts of Puppet

Concepts

• [Link]
• [Link]

1.3. Please Note: 107


DevOps-Notes Documentation, Release 2.0.23

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

Some useful links to explain the concepts of Chef

Concepts

• [Link]
• [Link]

Configuration

Troubleshooting

1.3.32 Docker

Some useful links to explain the concepts of Docker

108 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

Official Docker Documentation

• [Link]

Concepts

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Good Explanation of Namespaces : needed for Docker

• [Link]

Difference between containers and VMs

• [Link]

1.3. Please Note: 109


DevOps-Notes Documentation, Release 2.0.23

110 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

Docker Image Layers : Easy Explanation

• [Link]

Docker Swarm Working

• [Link]

Configuration

• [Link]
• [Link]
• [Link]

1.3. Please Note: 111


DevOps-Notes Documentation, Release 2.0.23

112 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]

Troubleshooting & Log Parsing

• [Link]
• [Link]
32622147
• [Link]

Tuning & Hardening

• [Link]
• [Link]

Training & Certification

Docker Training

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Docker Certified Associate

• [Link]
• [Link]
• [Link]

1.3.33 Kubernetes

Some useful links to explain the concepts of Kubenetes

Concepts

• [Link]
• [Link]
• [Link]

1.3. Please Note: 113


DevOps-Notes Documentation, Release 2.0.23

Official Documentation

• [Link]
• [Link]

Configuration

• [Link]
• [Link]
• [Link]
• [Link]

Tuning & Hardening

• [Link]

Troubleshooting

• [Link]
57161894#57161894
• [Link]
• [Link]

• [Link]

114 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

1.3. Please Note: 115


DevOps-Notes Documentation, Release 2.0.23

1.3.34 AWS

Some useful links to explain the concepts of AWS

Official AWS Documentation

• [Link]

Concepts

• [Link]
• [Link]
• [Link]

Configuration

• [Link]
• [Link]
• [Link]
• [Link]

s3cmd

• [Link]
• [Link]
• [Link]

AWS Instances

• [Link]

Troubleshooting & Log Parsing

• [Link]
• [Link]

Tuning & Hardening

• [Link]
• [Link]
• [Link]

116 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

Training & Certification

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3.35 MySQL

Some useful links to explain the concepts of MySQl

Concepts

• [Link]
• [Link]
• [Link]

Difference between MyISAM and InnoDB Storage engines

• [Link]
• [Link]

Commands

• [Link]

Configuration

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
Administration/Maintaining+Log+Files/
• [Link]

1.3. Please Note: 117


DevOps-Notes Documentation, Release 2.0.23

Backing Up | Restore Databases via Command Line

• [Link]
• [Link]
• [Link]
• [Link]

Configuring MariaDB for remote access

• [Link]

Removing a MySQL user with his privileges

• [Link]
• [Link]

Information on MySQL Bin logs

• [Link]

Replication (Master-Master)

• [Link]

Replication (Master-Slave)

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Reset forgotten MySQL password

• [Link]
• [Link]
• [Link]
• [Link]

118 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

Tuning & Hardening

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

To change the value of expire_log_days without MySQL restart

• [Link]

To enable various logs via [Link] or on the fly without restart

• [Link]

Perl script to analyses system MySQL variables & optimize accordingly

• [Link]

Tool to convert xls files into SQL

• [Link]

Troubleshooting

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Checking for replication Lags

• [Link]
• [Link]

1.3. Please Note: 119


DevOps-Notes Documentation, Release 2.0.23

Various MySQL error codes

• [Link]
• [Link]

Fix for the ERROR 1396

• [Link]

1.3.36 PostgreSQL

Some useful links to explain the concepts of PostgreSQl

Concepts

• [Link]
• [Link]

Commands

• [Link]

Configuration

• [Link]
• [Link]
• [Link]
• [Link]

120 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]
postgresql-on-a-vps–2

Replication using Slony

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Tuning & Hardening

• [Link]
• [Link]

Troubleshooting

• [Link]

FAQ - When pg-cancel-backend / pg-terminate-backend doesn’t work

• [Link]

Removing PostgreSQL queries on TCP Level - when pg-cancel-backend / pg-terminate-backend fails

• [Link]

Official Links

• [Link]
• [Link]

1.3.37 NoSQL

Some useful links to explain the concepts of NoSQL

1.3. Please Note: 121


DevOps-Notes Documentation, Release 2.0.23

Concepts

• [Link]
• [Link]

Configuration

Troubleshooting

1.3.38 Redis

Some useful links to cover the concepts of Redis

Concepts

Official Redis Documentation

• [Link]

Configuration

Tuning & Hardening

• [Link]

Troubleshooting & Log Parsing

• [Link]

1.3.39 Kafka

Some useful links to cover the concepts of Kafka

Concepts

• [Link]

Official Kafka Documentation

• [Link]

122 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

Configuration

Tuning & Hardening

Troubleshooting & Log Parsing

1.3.40 Email

Some useful links to explain the concepts of Email

Concepts

E-Mail status Codes

• [Link]

Article on E-Mail Ports

• [Link]

1.3.41 Postfix

Some useful links to explain the concepts of Postfix

Concepts

Configuration

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

SSL/TLS on Postfix

• [Link]

1.3. Please Note: 123


DevOps-Notes Documentation, Release 2.0.23

Troubleshooting & Log Parsing

Queue Management

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Commands

• Sorting queued mails by From address

1 sudo mailq | awk '/^[0-9,A-F]/ {print $7}' | sort | uniq -c | sort -n

• Holding queued mails by From address

1 sudo mailq| grep '^[A-Z0-9]'| grep <sender-ID>| cut -f1 -d' ' | tr -d \*|sudo
˓→postsuper -h -

• Holding queued mails by To address

1 sudo mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($8 == "
˓→<recipient>") print $1 } ' | tr -d '*!' | sudo postsuper -h -

• Holding queued mails by Domain

1 sudo mailq| grep '^[A-Z0-9]'| grep @<domain>| cut -f1 -d' ' | tr -d \*|sudo postsuper
˓→-h -

• Holding emails from the [active|deferred] queue based on subject

1 sudo find /var/spool/postfix/[active|deferred]/ -type f -exec grep -il '<subject>' '


˓→{}' \; | xargs -n1 basename | sudo postsuper -h -

• Removing Mails based on sender Address

1 sudo mailq| grep '^[A-Z0-9]'| grep <sender-ID>| cut -f1 -d' ' | tr -d \*|sudo
˓→postsuper -d -

• Removing Mails based on Domain

1 sudo mailq| grep '^[A-Z0-9]'| grep @<domain>| cut -f1 -d' ' | tr -d \*|sudo postsuper
˓→-d -

• Delete mails to a specific mail address

1 sudo mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($8 == "
˓→<recipient-ID>") print $1 } ' | tr -d '*!' | sudo postsuper -h -

124 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

1.3.42 Exim

Some useful links to explain the concepts of Exim

Concepts

Configuration

Queue Management

• [Link]
• [Link]
• [Link]

1.3.43 Dovecot

Some useful links to explain the concepts of Dovecot

Concepts

• [Link]
• [Link]

Configuration

• [Link]
• [Link]
• [Link]
• [Link]

Troubleshooting & Log Parsing

1.3.44 Milters

This section covers the basics of how Milters works

Concepts

Email RBLs (real-time block-hole lists) Primer

• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 125


DevOps-Notes Documentation, Release 2.0.23

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Configuration

Check multiple global RBLs online

• [Link]
• [Link]
• [Link]

126 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

Troubleshooting & Log Parsing

1.3.45 SPF & DKIM

Some useful links to explain the concepts of SPF & DKIM

Concepts

SPF Records

• [Link]
• [Link]
• [Link]

Configuration

• [Link]
• [Link]
html
• [Link]
#ssl
• [Link]
• [Link]

Troubleshooting and Log Parsing

1.3.46 ClamAV

Some useful links to explain the concepts of ClamAV

Concepts

• [Link]
• [Link]

Configuration

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

1.3. Please Note: 127


DevOps-Notes Documentation, Release 2.0.23

Troubleshooting & Log Parsing

1.3.47 DNS

Some useful links to explain the concepts of 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

1 [Link]. IN SOA [Link]. [Link]. (


2 12083 ; serial number - incremented on zone file change, slave NS checks if master
˓→NS serial > cached serial & if yes, slave NS requests for updated zone else serves

˓→same zone file.

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

6 1h ; negative TTL - a NS will cache errors for this period


7 )

Domain Transfer (AXFR)

• 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.

128 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

• 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 DNS queries over 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

How do resolvers work

• What happens when you set resolvers in PC (Windows) And / Or Router


– A browser 1st checks its internal cache of recent queries which it checks initially otherwise it asks the
system resolver for DNS queries (/etc/hosts) else it forwards requests to another resolver.

1.3. Please Note: 129


DevOps-Notes Documentation, Release 2.0.23

Types of DNS Servers

• 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 :

130 Chapter 1. Overview


DevOps-Notes Documentation, Release 2.0.23

– 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

Why are there are only 13-root DNS servers

• [Link]
• [Link]
• [Link]

Configuration

Bind Configuration / Tweaks

• [Link]
• [Link]

Managing DNS Better

• [Link]
• [Link]

1.3. Please Note: 131


DevOps-Notes Documentation, Release 2.0.23

Troubleshooting & Log Parsing

• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Check DNS Propagation Issues

• [Link]
• [Link]
• [Link]
• [Link]

132 Chapter 1. Overview

Common questions

Powered by AI

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 .

DevOps-Notes Documentation
Release 2.0.23
Vinay Hegde
Nov 29, 2022
Basic-Concepts
1
Overview
1
1.1
Tech Stack: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ii
CHAPTER 1
Overview
Welcome to my notes on various topics related to the DevOps / SRE terminology such as -
• Linux Operating
DevOps-Notes Documentation, Release 2.0.23
• You can find keywords in the Search Box present in the top Left Corner of this we
DevOps-Notes Documentation, Release 2.0.23
1.3. Please Note:
3
DevOps-Notes Documentation, Release 2.0.23
Commands
Configuration
• http://www.if-not-true-then-false.com/2012/delete-remove-o
DevOps-Notes Documentation, Release 2.0.23
1.3. Please Note:
5
DevOps-Notes Documentation, Release 2.0.23
Types of Processes
• http://www.gmarik.info/blog/2012/orphan-vs-zombie-vs-daemon-p

You might also like