Tuesday, July 29, 2025

Excel



Formula for matches
=IF(A1=B1, "Match", "No Match")
=IF(A1=B1, "Sama", "Beda")
Formula for difference
=ABS(A1-B1)
=IF(A1<>B1, "No Match", "Match")

Formula for sum
=SUM(A1:A10)

Formula for average
=AVERAGE(A1:A10)
Formula for count
=COUNT(A1:A10)
Formula for maximum
=MAX(A1:A10)
Formula for minimum
=MIN(A1:A10)

View
Excel-View-Freeze-panes-freese top

Outlook



Spent 20 min to play your day/Week
Outlook do a daily planning & Do a weekly planning

Search
from:
to:
from:<mail-id> subject:<subject> <keyword> hasattachment: yes

folder: inbox



Set your Calander work hours and Location
Setting -> Calander

Create shortcut
Ctrl +1 Mail
Ctrl +2 Calander
Ctrl +3 People
Ctrl +4 To do

Views
Conditional Forwarding
View
View settings
conditional forwarding
Add new (Give Name)
Select Font size/format(Bold)/Colour(Red)/Bigger
Check Sample and click ok
Condition when it will apply from<Name>


View-> message privew -> 3 lines

view -> show as conversation (All Mail Folder)

Mail -> select mail -> Drag and drop in task /calander

Outlook -> mail -> followup(icon) select time to follow-up

New Outlook
Click follow-up (icon) Right click mail-> snooze -> time from custom


Template
message -> view template
Add New Template, Type name and message

How to Load Template
Draft go to view template select -> Select Template name


Meetings
Meetings that needs follow-up
Ctrl + drap (meetings) To a new slot, this create a duplicate of that meeting

Mac Tricks



cmd + tab and press q, it will quit the app
cmd + tab and use UP arrow key, then use left and right key and press enter to select



Google Chrome
Function + shift + delte
To delete the saved/listing user names listing



Enable Touch ID (iterm)
# vi /etc/pam.d/sudo
auth sufficient pam_tid.sp




FN + E to enable emoji 😁

VScode Tips & Tricks

 VS Code 




Settings
cmd + shift + p => Command Palette
Cmd+Shift+p => Install Extension


Wrap Tabs
settings => Search for "workbench.editor.wrapTabs" and enable it



Remove
settings => Search for "editor.minimap.enabled" and disable it
"Enable Telemetry"

Themes
Cmd+Shift+p => Product Icon Themes

Window
cmd+n => Open New Tab
ctrl+tab => To switch between Tab
cmd+b => Toggle SideBar
cmd+w Close Current tab
cmd +shift+t Reopen the last close tab
cmd+p open the file from project directory



Navigate
cmd + shift + ] To switch between the open files
cmd + shift + [ To switch between the open files
cmd + shift + o => Go to Symbol in File
ctrl+ ~ => In built terminal
cmp+p :<no> # navigate to that line
option + up (or) down arrow key # move the line up or down
cmd+p search button
cmd+ [ => Indent the line
cmd+ ] => outdent the line
ctrl + d => select the word
cmd + d => select the next occurrence of the word
cmd + shift + l => select all occurrences of the word
cmd+opt+enter => Replace All


Remove Empty lines
cmd+opt+f =>
In the find box type: ^\n choose Regular Expression then replace with: (leave it empty)


cmd+L+delete => Delete the current line
cmd+shift+L => Select all occurrences of the current line
cmd+shift+f => Find in files
cmd+shift+h => Replace in files

Duplicate Lines
Shift+ Alt+Down Arrow => Duplicate the line below
Shift+ Alt+Up Arrow => Duplicate the line above


Single click new tab
settings => Search for "workbench.editor.enablePreview" and disable it

Nesting
settings => Search for "workbench.editor.enablePreviewFromQuickOpen" and disable it

WrapTabs
settings => Search for "workbench.editor.wrapTabs" and enable it


Compare 2 files
code --diff file1 file2

Wednesday, July 9, 2025

Ansible Plugin

 Plugins are pieces of code that augment(அதிகப்படுத்து) Ansible’s core functionality.

Ansible uses a plugin architecture to enable a rich, flexible and expandable feature set.

Ansible ships with several handy plugins, and you can easily write your own.

This section covers the various types of plugins that are included with Ansible:

  • Action plugins
  • Become plugins
  • Cache plugins
  • Callback plugins
  • Cliconf plugins
  • Connection plugins
  • Docs fragments
  • Filter plugins
  • Httpapi plugins
  • Inventory plugins
  • Lookup plugins
  • Modules
  • Module utilities
  • Netconf plugins
  • Shell plugins
  • Strategy plugins
  • Terminal plugins
  • Test plugins
  • Vars plugins
Action Plugins
Action plugins act in conjunction with modules to execute the actions required by playbook tasks. They usually execute automatically in the background doing prerequisite work before modules execute.

The ‘normal’ action plugin is used for modules that do not already have an action plugin. If necessary, you can create custom action plugins.

You can enable a custom action plugin by either dropping it into the action_plugins directory adjacent to your play, inside a role, or by putting it in one of the action plugin directory sources configured in ansible.cfg.

Action plugins are executed by default when an associated module is used; no additional action is required.


Become plugins

Become plugins work to ensure that Ansible can use certain privilege escalation systems when running the basic commands to work with the target machine as well as the modules required to execute the tasks specified in the play.

The --become-method command line option, you can use the become_method keyword in a play or, if you need to be ‘host specific’, the connection variable ansible_become_method to select the plugin to use.


Cache plugins
Cache plugins allow Ansible to store gathered facts or inventory source data without the performance hit of retrieving them from the source.

You can use different cache plugins for inventory and facts. If you enable inventory caching without setting an inventory-specific cache plugin, Ansible uses the fact cache plugin for both facts and inventory.


Callback plugins
Callback plugins enable adding new behaviors to Ansible when responding to events. By default, callback plugins control most of the output you see when running the command line programs

There are three types of callback plugins:
  1. stdout callback plugins:
  2. aggregate callback plugins:
  3. notification callback plugins:
stdout callback plugins:    These plugins handle the main console output. Only one can be active. They always get the event first; the rest of the callbacks get the event in the order they are configured.

aggregate callback plugins:    Aggregate callbacks can add additional console output next to a stdout callback. This can be aggregate information at the end of a playbook run, additional per-task output, or anything else.

notification callback plugins:Notification callbacks inform other applications, services, or systems. This can be anything from logging to databases, informing on errors in Instant Messaging applications, or sending emails when a server is unreachable.


Cliconf plugins
Cliconf plugins are abstractions over the CLI interface to network devices. They provide a standard interface for Ansible to execute tasks on those network devices.

These plugins generally correspond one-to-one to network device platforms. Ansible loads the appropriate cliconf plugin automatically based on the ansible_network_os variable.

Connection plugins
Connection plugins allow Ansible to connect to the target hosts so it can execute tasks on them. Ansible ships with many connection plugins, but only one can be used per host at a time.

By default, Ansible ships with several connection plugins. The most commonly used are the paramiko SSH, native ssh (just called ssh), and local connection types. All of these can be used in playbooks and with /usr/bin/ansible to decide how you want to talk to remote machines. If necessary, you can create custom connection plugins. To change the connection plugin for your tasks, you can use the connection keyword.

The basics of these connection types are covered in the getting started section.

ssh plugins
Because SSH is the default protocol used in system administration and the protocol most used in Ansible, SSH options are included in the command line tools.

You can set the connection plugin globally with configuration, at the command line (-c, --connection), as a keyword in your play, or by setting a variable, most often in your inventory. For example, for Windows machines, you might want to set the winrm plugin as an inventory variable.

ansible_host
The name of the host to connect to, if different from the inventory hostname.

ansible_port
The ssh port number, for ssh and paramiko_ssh it defaults to 22.

ansible_user
The default username to use for log in. Most plugins default to the ‘current user running Ansible’.


Docs fragments
Docs fragments allow you to document common parameters of multiple plugins or modules in a single place.


Filter plugins
Filter plugins manipulate data.

With the right filter, you can extract a particular value, transform data types and formats, perform mathematical calculations, split and concatenate strings, insert dates and times, and do much more. Ansible uses the standard filters shipped with Jinja2 and adds some specialized filter plugins.

Httpapi plugins
Httpapi plugins tell Ansible how to interact with a remote device’s HTTP-based API and execute tasks on the device.

Inventory plugins
Inventory plugins allow users to point at data sources to compile the inventory of hosts that Ansible uses to target tasks, either using the -i /path/to/file and/or -i 'host1, host2' command line parameters or from other configuration sources.

Most inventory plugins shipped with Ansible are enabled by default or can be used with the auto plugin.

[inventory]
enable_plugins = host_list, script, auto, yaml, ini, toml

Lookup plugins
Lookup plugins are an Ansible-specific extension to the Jinja2 templating language. You can use lookup plugins to access data from outside sources (files, databases, key/value stores, APIs, and other services) within your playbooks.

vars:
file_contents: "{{ lookup('file', 'path/to/file.txt') }}"


Modules
Modules are the main building blocks of Ansible playbooks. Although we do not generally speak of “module plugins”, a module is a type of plugin. For a developer-focused description of the differences between modules and other plugin

You can enable a custom module by dropping it into one of these locations:

any directory added to the ANSIBLE_LIBRARY environment variable ($ANSIBLE_LIBRARY takes a colon-separated list like $PATH)

~/.ansible/plugins/modules/
/usr/share/ansible/plugins/modules/


Module utilities
Module utilities contain shared code used by multiple plugin


Netconf plugins
Netconf plugins are abstractions over the Netconf interface to network devices. They provide a standard interface for Ansible to execute tasks on those network devices.


Shell plugins
Shell plugins work to ensure that the basic commands Ansible runs are properly formatted to work with the target machine and allow the user to configure certain behaviors related to how Ansible executes tasks.




Strategy plugins
Strategy plugins control the flow of play execution by handling task and host scheduling.

export ANSIBLE_STRATEGY=free

ansible.cfg
[defaults]
strategy=linear

- hosts: all
strategy: debug


Terminal plugins
Terminal plugins contain information on how to ensure that a particular network device’s SSH shell is properly initialized to be used with Ansible. This typically includes disabling automatic paging, detecting errors in output, and enabling privileged mode if the device supports and requires it.


Test plugins
Test plugins evaluate template expressions and return True or False. With test plugins you can create conditionals to implement the logic of your tasks, blocks, plays, playbooks, and roles. Ansible uses the standard tests shipped as part of Jinja and adds some specialized test plugins

vars:
is_ready: '{{ task_result is success }}'

tasks:
- name: conditionals are always in 'template' context
action: dostuff
when: task_result is failed

- name: pass a positional parameter to match test
action: dostuff
when: myurl is match("https://example.com/users/.*/resources")

Vars plugins

Vars plugins inject additional variable data into Ansible runs that did not come from an inventory source, playbook, or command line. Playbook constructs like ‘host_vars’ and ‘group_vars’ work using vars plugins. For more details about variables in Ansible

Tuesday, July 1, 2025

DevOps Linux Troubleshooting Process Management

 


To find the top 10 CPU-consuming processes

# ps -e --sort=-pcpu -o pid,pcpu,comm 

# ps -e --sort=-pcpu -o pid,pcpu,comm | head -n <noumber>

# ps -eo pid,comm,%mem,%cpu --sort=-%cpu | head -n <number>



To find the top 10 memory-consuming processes

# ps -e --sort=-pmem -o pid,pmem,comm

# ps -e --sort=-pmem -o pid,pmem,comm | head -n <number>

# ps -eo pid,comm,%mem,%cpu --sort=-%mem | head -n <number>



To find the uptime of the process 

# ps -eo comm,lstart,etime,user 

# ps -eo comm,lstart,etime,user | grep -i <service-name>

DevOps Key words

 


Multitenancy

Multitenancy in the cloud means using shared services and resources for multiple clients. (eg) It's a pattern where a single application instance is utilized by multiple customers at the same time. 


Confluence (சங்கமம்/பெருங்கூட்டம்)

Confluence is a web-based corporate wiki developed by Atlassian.

Confluence is a collaborative documentation tool.

Conflunece is a team workspace where knowledge and collaboration meet.


JIRA

Jira is a software product developed by Atlassian that allows bug tracking, issue tracking, and agile project management


Jira is primarily a project management and issue-tracking software.

CDN => Content Delivery Network

 


CDN makes your website faster. 


Increase in speed, which is achieved by reducing the amount of distance between the user and the content or the servers providing the content.


The users can retrieve the content directly from their closest geographical location.


Indirect benefit:

We are reducing the load, or the reduction in the amount of capacity that you need to serve all these users. 

Increase in Security through obscurity (the state of being unknown)


CDN are geographically distributed networks of Proxy servers, serving content to users more quickly

Observability/Monitoring

 


Observability is a property of your system that helps you understand what's going on with it.


Monitoring

·     Looking at what happened a long time ago

·     Looking at the past

·     Monitoring is passive watching.

·     Monitoring is slightly delayed.

 

Observability

Observability is active.

Observability is asking questions right now.

 

·     How the system is acting

·     What is the state of the system, and reacting fast

Three Pillars of Observability

1.       Metrics

2.       Logs

3.       Traces


You need to be able to understand what's going on, and really, that is what observability is all about.





Linux Journalctl for DevOps Support

 journalctl


To show you all of the journal entries that have been collected since the most recent reboot.

# journalctl -b


To Save Past boots, Some distro/version savves them by default 

# mkdir -p /var/log/journal

# vi /etc/systemd/journald.conf

Under the [Journal] section, set the Storage= option to “persistent” to enable persistent logging:

. . .

[Journal]

Storage=persistent

# journalctl --list-boots


journal from the previous boot, use the -1

# journalctl -b -1


journalctl --dmesg

journalctl -u chronyd -b


Display kernal messages

# journalctl -k

# journalctl -k --since today. # -S for Since 

# journalctl -k --since "2025-06-17 12:00:00"

Time Window (YYYY-MM-DD HH:MM:SS)

# journalctl --since "2025-06-17 12:00:00"

# journalctl --since "2015-01-10" --until "2015-01-11 03:00" # -U for Until

# journalctl --since yesterday

If you received reports of a service interruption starting at 9:00 AM and continuing until an hour ago, you could type:

# journalctl --since 09:00 --until "1 hour ago"


By Unit 

# journalctl -u nginx.service

# journalctl -u nginx.service --since today

# journalctl -u nginx.service -u php-fpm.service --since today


By Process, User, or Group ID 

# journalctl _PID=8088

hashtag

#journalctl _UID=<UID> --since today


Component Path

# journalctl /usr/bin/bash

will display all of the entries that involve the executable in question. For instance, to find those entries that involve the bash executable

Priority

# journalctl -p err

# journalctl -p warning

# journalctl -p crit

# journalctl -p emerg

# journalctl -p alert 


 0: emerg

 1: alert

 2: crit

 3: err

 4: warning

 5: notice

 6: info

 7: debug

# journalctl -p 3

# journalctl -p 3..5

# journalctl -p 3..5 --since today 

 The journal implements the standard syslog message levels. You can use either the priority name or its corresponding numeric value.


output format 

journalctl -b -u nginx -o json

journalctl --no-pager

journalctl -b -u nginx -o json-pretty

The following formats can be used for display:


 cat: Displays only the message field itself.

 export: A binary format suitable for transferring or backing up.

 json: Standard JSON with one entry per line.

 json-pretty: JSON formatted for better human-readability

 json-sse: JSON formatted output wrapped to make add server-sent event compatible

 short: The default syslog style output

 short-iso: The default format augmented to show ISO 8601 wallclock timestamps.

 short-monotonic: The default format with monotonic timestamps.

 short-precise: The default format with microsecond precision

 verbose: Shows every journal field available for the entry, including those usually hidden internally.


# journalctl -b -u nginx -o short-iso

# journalctl -b -u nginx -o short-precise

# journalctl -b -u nginx -o verbose 



Recent Log Entries

# journalctl -n 100

# journalctl -n 100 --no-pager

# journalctl -f

# journalctl -f --no-pager

# journalctl -f -u nginx.service

# journalctl -f -u nginx.service --no-pager

# journalctl -f -u nginx.service --no-pager --since today

# journalctl -f -u nginx.service --no-pager --since "2025-06-17 12:00:00"

# journalctl -f -u nginx.service --no-pager --since yesterday

# journalctl -f -u nginx.service --no-pager --since "2025-06-17 12:00:00" --until "2025-06-17 13:00:00"

# journalctl -f -u nginx.service --no-pager --since "2025-06-17 12:00:00" --until "1 hour ago"



# journalctl --rotate

# journalctl --disk-usage

Delete old Logs

# journalctl --vacuum-size=1G

# journalctl --vacuum-time=1month 

# journalctl --vacuum-files=4

# journalctl --vacuum-size=200M


--facility=help

journalctl --facility=mail


--file [journal filename] This names a specific journal file in /var/log/journal/<journal subdirectory>.

--sync This writes all unwritten journal entries (still in RAM but not in /run/log/journal) to the persistent filesystem. All journal entries known to the journaling system at the time the command is entered are moved to persistent storage.


Adding journal entries

[root@testvm1 ~]# echo "Hello world" | systemd-cat -p info -t myprog

[root@testvm1 ~]# journalctl -n 10