What’s new in ansible 1.6

What’s new in ansible 1.6

Below are the list of new changes , Modules in Ansible 1.6 Major features/changes in Ansible 1.6: The deprecated legacy variable templating system has been finally removed. Use {{ foo }} always not $foo or ${foo}. Any data file can also be JSON. Use sparingly — with great power comes great responsibility. Starting file with…

Read More

Check for Prime Numbers in Python

Check for Prime Numbers in Python A prime number is a number greater than 1 that has no divisors other than 1 and itself. Efficiently checking for primes is a classic coding problem. Efficient Solution (Check up to Square Root) import math def is_prime(n): if n < 2: return False for i in range(2, int(math.sqrt(n))...

Read More

Install Elasticsearch using Repositories

Install Elasticsearch using Repositories You can easily install Elasticsearch using APT and YUM repository – Install Elasticsearch Using APT repository – Install Elasticsearch Using Yum repository Install Elasticsearch 5.0 on Debian: Step 1: Download and Install Elasticsearch Public signin key wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add – Step 2: Installation using APT Repository…

Read More

Install RPM in CentOS

Install RPM in CentOS RPM Package Manager (RPM), originally called the Red-hat Package Manager, is a program to install or uninstall software packages or libraries in Linux. To install RPM in CentOS, first download the RPM: [roop@localhost ~]$ wget ftp://rpmfind.net/linux/centos/6.6/os/x86_64/Packages/opencv-2.0.0-12.el6.x86_64.rpm now check in your directory opencv-2.0.0-12.el6.x86_64.rpm will be available for installation.To install RPM in CentOS…

Read More
Deleting Line Containing Specific String

Deleting Lines Containing Specific string from multiple files

Deleting Lines Containing Specific string from multiple files Deleting Lines Containing Specific string from multiple files recursively Syntax: Example: Below example delete lines containing @license tag from src/main/php directory all files recursively Option Description: -R or –dereference-recursive For each directory operand, read and process all files in that directory, recursively, following all symbolic links. -l…

Read More

Count Character Frequency in Python

Count Character Frequency in Python Counting how many times each character appears in a string is a fundamental problem with many real-world applications, from text analysis to compression algorithms. Best Solution: Using Counter from collections import Counter def char_frequency(s): return Counter(s) result = char_frequency(“hello world”) print(result) # Output: Counter({‘l’: 3, ‘o’: 2, ‘h’: 1, ‘e’:…

Read More
Verified by MonsterInsights