<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aamir qureshi on Medium]]></title>
        <description><![CDATA[Stories by Aamir qureshi on Medium]]></description>
        <link>https://medium.com/@aq702654?source=rss-291272b2f75------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ESN0FALPMfW4uTIDjCNn0g.jpeg</url>
            <title>Stories by Aamir qureshi on Medium</title>
            <link>https://medium.com/@aq702654?source=rss-291272b2f75------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:31:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aq702654/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Create Python Menu-based program, and integrate it with multiple technologies.]]></title>
            <link>https://medium.com/@aq702654/create-python-menu-based-program-and-integrate-it-with-multiple-technologies-a083645bed6a?source=rss-291272b2f75------2</link>
            <guid isPermaLink="false">https://medium.com/p/a083645bed6a</guid>
            <dc:creator><![CDATA[Aamir qureshi]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 08:13:33 GMT</pubDate>
            <atom:updated>2023-07-30T08:13:33.514Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c8odI8XvYvmEbeGW.jpg" /></figure><p>Building a Python Menu-based Program with Integration of Multiple Technologies</p><p>In this tutorial, we’ll create a Python menu-based program that integrates with various technologies. The program will demonstrate functionalities such as File I/O, SQLite database operations, HTTP requests using the requests library, processing JSON data, sending emails, and utilizing the Google Translate API.</p><p>Step 1: Setup</p><p>Before we begin, make sure you have the necessary libraries installed. Install requests, googletrans and smtplib using pip:</p><pre>bashCopy code</pre><pre>pip install requests<br>pip install googletrans==4.0.0-rc1</pre><p>Step 2: Writing the Program</p><pre>pythonCopy code</pre><pre>import os<br>import sqlite3<br>import requests<br>from googletrans import Translator<br>import json<br>import smtplib<br>from email.mime.text import MIMEText</pre><pre># Function to clear the console screen<br>def clear_screen():<br>    os.system(&#39;cls&#39; if os.name == &#39;nt&#39; else &#39;clear&#39;)</pre><pre># Function to display the menu<br>def display_menu():<br>    print(&quot;Menu:&quot;)<br>    print(&quot;1. Read data from a file&quot;)<br>    print(&quot;2. Write data to a file&quot;)<br>    print(&quot;3. Create and query an SQLite database&quot;)<br>    print(&quot;4. Make an HTTP request&quot;)<br>    print(&quot;5. Process JSON data&quot;)<br>    print(&quot;6. Send an email&quot;)<br>    print(&quot;7. Use Google Translate API&quot;)<br>    print(&quot;8. Exit&quot;)</pre><pre># Function to read data from a file<br>def read_file():<br>    filename = input(&quot;Enter the filename to read from: &quot;)<br>    try:<br>        with open(filename, &#39;r&#39;) as file:<br>            data = file.read()<br>            print(&quot;\nFile Contents:&quot;)<br>            print(data)<br>    except FileNotFoundError:<br>        print(&quot;File not found!&quot;)</pre><pre># Function to write data to a file<br>def write_file():<br>    filename = input(&quot;Enter the filename to write to: &quot;)<br>    data = input(&quot;Enter the data to write: &quot;)<br>    with open(filename, &#39;w&#39;) as file:<br>        file.write(data)<br>    print(&quot;Data written successfully!&quot;)</pre><pre># Function to create and query an SQLite database<br>def sqlite_demo():<br>    conn = sqlite3.connect(&#39;sample.db&#39;)<br>    cursor = conn.cursor()</pre><pre>    # Create a table<br>    cursor.execute(&#39;&#39;&#39;<br>        CREATE TABLE IF NOT EXISTS users (<br>            id INTEGER PRIMARY KEY,<br>            name TEXT,<br>            age INTEGER<br>        )<br>    &#39;&#39;&#39;)</pre><pre>    # Insert data<br>    cursor.execute(&quot;INSERT INTO users (name, age) VALUES (?, ?)&quot;, (&#39;John Doe&#39;, 30))<br>    cursor.execute(&quot;INSERT INTO users (name, age) VALUES (?, ?)&quot;, (&#39;Jane Smith&#39;, 25))<br>    conn.commit()</pre><pre>    # Query data<br>    cursor.execute(&quot;SELECT * FROM users&quot;)<br>    rows = cursor.fetchall()<br>    print(&quot;\nSQLite Database Contents:&quot;)<br>    for row in rows:<br>        print(row)</pre><pre>    conn.close()</pre><pre># Function to make an HTTP request<br>def http_request():<br>    url = input(&quot;Enter the URL to make an HTTP GET request: &quot;)<br>    try:<br>        response = requests.get(url)<br>        if response.status_code == 200:<br>            print(&quot;\nHTTP Response:&quot;)<br>            print(response.text)<br>        else:<br>            print(f&quot;HTTP Request failed with status code: {response.status_code}&quot;)<br>    except requests.exceptions.RequestException as e:<br>        print(f&quot;HTTP Request failed: {e}&quot;)</pre><pre># Function to process JSON data<br>def process_json():<br>    json_data = input(&quot;Enter JSON data: &quot;)<br>    try:<br>        parsed_data = json.loads(json_data)<br>        print(&quot;\nParsed JSON:&quot;)<br>        print(json.dumps(parsed_data, indent=2))<br>    except json.JSONDecodeError:<br>        print(&quot;Invalid JSON data!&quot;)</pre><pre># Function to send an email<br>def send_email():<br>    sender_email = input(&quot;Enter your email address: &quot;)<br>    receiver_email = input(&quot;Enter the recipient&#39;s email address: &quot;)<br>    subject = input(&quot;Enter the email subject: &quot;)<br>    message = input(&quot;Enter the email message: &quot;)</pre><pre>    try:<br>        msg = MIMEText(message)<br>        msg[&#39;Subject&#39;] = subject<br>        msg[&#39;From&#39;] = sender_email<br>        msg[&#39;To&#39;] = receiver_email</pre><pre>        # Replace &#39;your_email_password&#39; with your email password or use an app-specific password<br>        password = input(&quot;Enter your email password: &quot;)</pre><pre>        server = smtplib.SMTP(&#39;smtp.gmail.com&#39;, 587)<br>        server.starttls()<br>        server.login(sender_email, password)<br>        server.sendmail(sender_email, receiver_email, msg.as_string())<br>        server.quit()</pre><pre>        print(&quot;Email sent successfully!&quot;)<br>    except smtplib.SMTPAuthenticationError:<br>        print(&quot;Authentication error. Check your email and password.&quot;)<br>    except smtplib.SMTPException as e:<br>        print(f&quot;Failed to send the email: {e}&quot;)</pre><pre># Function to use Google Translate API<br>def translate_text():<br>    text = input(&quot;Enter the text to translate: &quot;)<br>    destination_lang = input(&quot;Enter the destination language (e.g., &#39;es&#39; for Spanish): &quot;)</pre><pre>    try:<br>        translator = Translator()<br>        translated_text = translator.translate(text, dest=destination_lang).text<br>        print(f&quot;\nTranslated Text: {translated_text}&quot;)<br>    except Exception as e:<br>        print(f&quot;Translation failed: {e}&quot;)</pre><pre># Main program<br>if __name__ == &quot;__main__&quot;:<br>    while True:<br>        clear_screen()<br>        display_menu()<br>        choice = input(&quot;\nEnter your choice (1-8): &quot;)</pre><pre>        if choice == &#39;1&#39;:<br>            read_file()<br>        elif choice == &#39;2&#39;:<br>            write_file()<br>        elif choice == &#39;3&#39;:<br>            sqlite_demo()<br>        elif choice == &#39;4&#39;:<br>            http_request()<br>        elif choice == &#39;5&#39;:<br>            process_json()<br>        elif choice == &#39;6&#39;:<br>            send_email()<br>        elif choice == &#39;7&#39;:<br>            translate_text()<br>        elif choice == &#39;8&#39;:<br>            print(&quot;Exiting the program. Goodbye!&quot;)<br>            break<br>        else:<br>            print(&quot;Invalid choice. Please try again.&quot;)</pre><pre>        input(&quot;\nPress Enter to continue...&quot;)</pre><p>Step 3: Using the Program</p><p>When you run the program, a menu with different options will be displayed. Choose an option by entering the corresponding number and follow the instructions for each functionality.</p><p>This Python program showcases the integration of various technologies, making it versatile and valuable for developers exploring different aspects of programming and tech integration.</p><h3>Second method</h3><h3>The Python Tech Menu Program</h3><h3>Overview</h3><p>The Python Tech Menu program is designed to provide users with a user-friendly interface to interact with different technologies and perform various operations. The menu-driven structure makes it easy for users to choose the technology they want to work with and then select the desired operation within that technology.</p><h3>Getting Started</h3><p>Before running the program, ensure that you have the following prerequisites installed on your system:</p><ul><li>Python 3.x</li><li>AWS CLI (for AWS operations)</li><li>Docker (for Docker operations)</li><li>Ansible (for Ansible operations)</li></ul><h3>Program Structure</h3><p>The program consists of several functions, each catering to a specific technology and its corresponding operations. Let’s briefly go through each of these functions:</p><ol><li>display_welcome_text(): Displays a welcome message at the beginning of the program, creating an eye-catching ASCII art using the pyfiglet library.</li><li>display_menu(): Presents the main menu to the user, allowing them to choose a technology to work with.</li><li>aws_operations(): Contains functions for performing AWS-related operations, such as listing instances, creating instances, stopping instances, and terminating instances.</li><li>docker_operations(): Contains functions for Docker-related operations, including listing containers, running containers, stopping containers, and removing containers.</li><li>nsible_operations(): Placeholder function for Ansible operations (not implemented in the provided code).</li><li>linux_operations(): Contains Linux-related operations, such as checking system information, listing files in a directory, creating directories, and removing directories.</li></ol><h3>How it Works</h3><p>The Python Tech Menu program runs in a loop, allowing the user to choose a technology from the main menu. Depending on the selected technology, the user can then choose from a list of operations within that technology.</p><p>For instance, if the user selects AWS Operations, they can perform actions like listing AWS instances, creating instances, stopping instances, or terminating instances. Similarly, for Docker Operations, the user can list Docker containers, run containers, stop containers, or remove containers.</p><p>The program utilizes the subprocess module to execute shell commands related to AWS, Docker, and Linux. For AWS operations, the program calls the AWS CLI commands to interact with AWS services. Similarly, for Docker operations, it invokes Docker commands to manage containers.</p><h3>Detailed Description of Options and Technologies in the Python Tech Menu Program</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*YW2rBYBDphyjE7NI.png" /></figure><p>In the Python Tech Menu program, users can interact with various technologies through a user-friendly menu-driven interface. Let’s explore each option and the technologies they represent in detail:</p><h3>1. AWS Operations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*AiRDIG4TH7146h8F.png" /></figure><p>The AWS Operations option allows users to interact with Amazon Web Services (AWS) through the AWS Command Line Interface (CLI). This technology enables users to access and manage a wide range of AWS services. The following operations are available under this option:</p><p>1.1 List AWS Instances</p><p>This operation lists all the EC2 instances running in the AWS account. EC2 (Elastic Compute Cloud) provides scalable virtual servers in the cloud.</p><p>1.2 Create an AWS Instance</p><p>With this operation, users can create a new EC2 instance. They need to provide details such as the instance type, AMI ID (Amazon Machine Image), and key name (SSH key pair).</p><p>1.3 Stop an AWS Instance</p><p>This operation allows users to stop a specific EC2 instance based on its instance ID. Stopping an instance puts it in a stopped state, and users can start it again later.</p><p>1.4 Terminate an AWS Instance</p><p>This operation permanently terminates an EC2 instance based on its instance ID. Terminating an instance removes it from the AWS account.</p><h3>2. Docker Operations</h3><p>The Docker Operations option enables users to work with Docker containers, which are lightweight and portable environments for running applications. The following operations are available under this option:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*doB_IiOJfL-ruHky.png" /></figure><p>2.1 List Docker Containers</p><p>This operation lists all the Docker containers currently running on the system. Containers are instances of Docker images that execute applications in isolated environments.</p><p>2.2 Run a Docker Container</p><p>Users can run a Docker container using this operation. They need to provide the container name and the image name (the image from which the container is created).</p><p>2.3 Stop a Docker Container</p><p>This operation stops a specific Docker container based on its container name. Stopping a container halts its execution.</p><p>2.4 Remove a Docker Container</p><p>This operation removes a Docker container from the system based on its container name. Removing a container frees up system resources.</p><h3>3. Ansible Operations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Gi3gy0isItjGf1yL.png" /></figure><p>The Ansible Operations option in the Python Tech Menu program offers a set of capabilities to interact with Ansible, a powerful automation tool used for configuration management, application deployment, and task automation on remote hosts:</p><p>3.1 Run Ansible Playbook</p><p>An Ansible playbook is a YAML file that defines a set of tasks and configurations to be applied to remote hosts. With this operation, users can execute an Ansible playbook to orchestrate complex tasks across multiple systems. Playbooks can be tailored to install software, configure services, manage users, and perform various administrative tasks.</p><p>3.2 Install a Package on Remote Host</p><p>This operation allows users to install software packages on remote hosts using Ansible. Ansible’s module system provides pre-defined modules for package management on different operating systems. The package installation task can be executed on multiple hosts simultaneously, ensuring consistency across the infrastructure.</p><p>3.3 Execute a Command on Remote Host</p><p>The ability to execute commands on remote hosts is a fundamental feature of Ansible. With this operation, users can run arbitrary commands or scripts on one or multiple remote hosts, enabling various system administration tasks.</p><h3>4. Linux Operations</h3><p>The Linux Operations option enables users to perform basic operations on a Linux system. These operations are executed through shell commands. The following operations are available under this option:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*3LENKgJkRvjtq9PZ.png" /></figure><p>4.1 Check System Information</p><p>This operation retrieves system information, such as the Linux kernel version and system architecture.</p><p>4.2 List Files in a Directory</p><p>Users can list files in a specified directory using this operation. It provides an overview of the files present in the given directory.</p><p>4.3 Create a Directory</p><p>This operation allows users to create a new directory at the specified path.</p><p>4.4 Remove a Directory</p><p>Users can remove a directory and its contents using this operation.</p><h3>Conclusion</h3><p>The Python Tech Menu program showcases the potential of Python as a versatile language for integrating various technologies seamlessly. By bringing together AWS, Docker, Ansible, and Linux operations under one user-friendly menu, developers can improve productivity and streamline their workflow.</p><p><strong>NOTE: </strong>In the future, I will improve and add more features to the code.</p><p>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a083645bed6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to detect the face of live video Streaming and blur the face Using Opencv]]></title>
            <link>https://medium.com/@aq702654/how-to-detect-the-face-of-live-video-streaming-and-blur-the-face-using-opencv-10af402c19e6?source=rss-291272b2f75------2</link>
            <guid isPermaLink="false">https://medium.com/p/10af402c19e6</guid>
            <dc:creator><![CDATA[Aamir qureshi]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 07:49:17 GMT</pubDate>
            <atom:updated>2023-07-30T07:49:17.482Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FqUXVdB0qUJVJ3zY.png" /></figure><h3>Problem Statment:-</h3><p>To detect the human face from that live video stream and Identify and get it’s/their’s position and blur the part of a detected face and keep the rest part as it is.</p><p>In this problem, we have used the opencv library/tool to resolve this problem.</p><h3>What is Opencv?</h3><p>OpenCV is a great tool for image processing and performing computer vision tasks. It is an open-source library that can be used to perform tasks like face detection, objection tracking, landmark detection, and much more.</p><p><strong>How to install opencv on your system?</strong></p><p>Firstly, open the Command prompt and install the python opencv library using given below command</p><pre>pip install opencv-python</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*eyWM-dGuDt_KyEdJ.png" /></figure><p>and we will also need of Haar cascade classifier file to detect the face of the video. Now we will read about the Haar cascade classifier.</p><p><strong>What is the Haar Cascade Classifier?</strong></p><p>Haar Cascade Classifier is an Object Detection Algorithm used to identify faces in an image or a real-time video. It employs a machine learning approach for visual object detection which is able to process images very quickly and achieve high detection rates.</p><h3>Face Detection with Haar Cascade Classifier -</h3><p>OpenCV uses Haar Feature-based Cascade Classifiers and comes with pre-trained XML files of various Haar Cascades. and Face detection with Haar Cascades algorithm needs a lot of positive images and negative images to train the classifier. The model created from this training is available in the OpenCV GitHub repository <a href="https://github.com/opencv/opencv/tree/master/data/haarcascades">https://github.com/opencv/opencv/tree/master/data/haarcascades</a>.</p><h3>Now, we will start writing the code.</h3><p>Firstly, import the library</p><pre>import cv2</pre><p>Sets the video source to the default webcam, which OpenCV can easily capture.</p><pre>cap = cv2.VideoCapture(0)</pre><p>we capture the video. The read() function reads one frame from the video source, which in this example is the webcam. This returns:</p><ol><li>The actual video frame read (one frame on each loop)</li><li>A return code</li></ol><pre>while True:<br>    ret, img = cap.read()</pre><p>In this code, we will use the detectMultiScale() function to detect the<br>faces of the video.</p><pre>face  = model.detectMultiScale(img)</pre><p>Now, we will find the coordinates in our video. We use these coordinates to blur the face in our video.</p><pre>x1 = face[0][0]<br>y1 = face[0][1]<br>x2 = face[0][2] + x1<br>y2 = face[0][3] + y1 <br>cimg = img[y1:y2 , x1:x2]<br>blur_img = cv2.blur(cimg, (50,50))<br>img[y1:y2 , x1:x2] = blur_img</pre><p>Now, we will show the video using the imshow() function and cv2 waitkey() allows you to wait for a specific time in milliseconds until you press “enter” on the keyword and destroyAllWindows() simply destroys all the windows we created.</p><pre>cv2.imshow(“Blurred Face”,img)<br>if cv2.waitKey(100) == 13:<br>    break<br>cv2.destroyAllWindows()</pre><p>Thank you?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10af402c19e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create an art or image by yourself using arrays and Numpy.]]></title>
            <link>https://medium.com/@aq702654/create-an-art-or-image-by-yourself-using-arrays-and-numpy-612eb98a9f0e?source=rss-291272b2f75------2</link>
            <guid isPermaLink="false">https://medium.com/p/612eb98a9f0e</guid>
            <dc:creator><![CDATA[Aamir qureshi]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 07:42:13 GMT</pubDate>
            <atom:updated>2023-07-30T07:42:13.547Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lets see how to do it…</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/0*DGhSPI1De7lvPa_L.png" /></figure><p>The very first thing ,as we all know , we’ll import <strong><em>numpy</em></strong> , <strong><em>cv2</em></strong> as well as <strong><em>matplotlib.pyplot</em></strong> <strong><em>as plt</em></strong> modules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*9ZKje9GPoVTTNOmJ.png" /></figure><p>Then we’ll create a 3D array of size (1000,1000) with the help of <strong><em>ones()</em></strong> fn. provided by numpy in which all the 3 elements at every pixel will be 1. We’ll also provide the datatype of the values to uint8 since image’s BGR channel only ranges from 0 to 255.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*MD4kYBPdNFZW5imG.png" /></figure><p>As we know that images are 3D arrays , so the above array will also be an image which will be all black since images contains elements in the form of <strong><em>RGB</em></strong> or other channels and every channels range from 0 to 255 . Here 0 means black and 255 will give white colour and since we have created array with the ones() fn. , every channel will contain 1 which is close to 0 which will give black colour.</p><p>Now I’ve tried to create a face with the help of functions provided by cv2 module.</p><p>So we’ll create a circle in the <strong><em>arr1</em></strong> image with the help of <strong><em>circle()</em></strong> fn. with centre (500,500) , radius 400 , colour of the circle white i.e [255,255,255] and thickness -1( thickness is always given positive no. but if we give -1 then the circle will get filled with colour provided to draw the circle.) and store it in the same variable(without storing it any var. it’ll work but it’ll show the o/p in the form of array elements .)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1JxWStyQIsjUQbHr.png" /></figure><p>Then I’ve drawn two eyes with black colour with the help of circle() fn. with centre (350,400) and (650,400) with radius 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*dBmvD0hrj_reyl9M.png" /></figure><p>Next I’ve drawn a circular nose with the help of circle() fn. with centre (500,600), radius 50 , and colour value [42,42,165] which will give brown colour and thickness -1 to fill the circle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ihEDVFfb-d1F5e5O.png" /></figure><p>Then i’ve tried to draw lips in blue colour with the help of<strong><em> line() </em></strong>fn. in which we have to provide image as obvious , two points , colour and thickness .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*s8wE9zcpdisxCUGk.png" /></figure><p>Since we’ve used fn. to draw something on the image with the help of cv2 module , it’ll read the image in BGR channel and I’ve to display image with the help of matplotlib.pyplot module , it’ll read the image in the RGB channel .</p><p>So first we’ll convert image in RGB channel with the help of <strong><em>cvtColor()</em></strong> fn. provided by cv2 module and store it in <strong><em>image</em></strong> variable. In this fn. we’ve to provide image and the code as to which channel you want to convert image to.</p><p>In python you can press <strong><em>shift+tab</em></strong> keys inside fn. to see details/docstring about the fn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*lI24v6HAC81F6S6c.png" /></figure><p>Then with the help of <strong><em>imshow()</em></strong> fn. provided by plt module , we’ll display the image directly in the jupyter notebook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*dfNTRJABAAU7voQs.png" /></figure><p>This is how the image looks like after doing some operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*3Ce_bS-H5ASQRd1P.jpeg" /></figure><p>You can try something different and creative with your artistic mind. I hope you’ll like this blog. I’ll come up again with such interesting blogs .Till then keep learning and keep growing . Do share this blog with your tribe and comment if you’ve any suggestions.</p><p>Thank you</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=612eb98a9f0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Take 2 images and combine it to form a single image & Take 2 images, crop some part of both the…]]></title>
            <link>https://medium.com/@aq702654/take-2-images-and-combine-it-to-form-a-single-image-take-2-images-crop-some-part-of-both-the-997d8e49044?source=rss-291272b2f75------2</link>
            <guid isPermaLink="false">https://medium.com/p/997d8e49044</guid>
            <dc:creator><![CDATA[Aamir qureshi]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 07:37:50 GMT</pubDate>
            <atom:updated>2023-07-30T07:37:50.272Z</atom:updated>
            <content:encoded><![CDATA[<h3>📌<strong> Take 2 images and combine it to form a single image &amp; Take 2 images, crop some part of both the images and swap them.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/0*JblK7LU-S76nUP0K.jpeg" /></figure><h3>To create an image</h3><h3>Create an image</h3><p>first, we have created an image of the hut using some OpenCV functions like Rectangles, Lines, Circles, etc to draw the image. and we have to use some libraries like cv2, matplotlib, NumPy.</p><p><strong>Oh no</strong>, but we have not known about the libraries. so let’s start to know about the libraries.</p><h3>What is cv2</h3><p><strong>OpenCV</strong> is a cross-platform library that is used to develop real-time computer vision applications. It is mainly used for image processing, video capture, face detection, and object detection.</p><h3>What is matplotlib</h3><p><strong>Matplotlib</strong> is a plotting library for the <strong>Python</strong> programming language. Matplotlib is used for data visualization, typically in the form of plots, graphs, and charts.</p><h3>What is NumPy</h3><p>NumPy aims to provide an array object that is 50x faster than traditional Python lists. The array object in NumPy is called ndarray(multidimensional array ), it provides a lot of helper functions that make working with ndarray very easy. Arrays are used in data science, data mining.</p><p>So Let’s Start the Programming Part</p><blockquote><em>import numpy as np<br>import matplotlib.pyplot as plt<br>import cv2</em></blockquote><p>To accomplish the tasks, you can use the Python programming language and the PIL (Python Imaging Library) module, which is now known as “Pillow.” First, make sure you have Pillow installed. If you don’t have it installed, you can install it using pip:</p><pre>pip install Pillow</pre><p>Let’s proceed with each task separately:</p><ol><li>Combine Two Images into a Single Image:</li></ol><pre>from PIL import Image<br><br># Load the two images<br>image1 = Image.open(&quot;image1.jpg&quot;)<br>image2 = Image.open(&quot;image2.jpg&quot;)<br><br># Get the size of the first image<br>width1, height1 = image1.size<br><br># Get the size of the second image<br>width2, height2 = image2.size<br><br># Determine the size of the combined image<br>total_width = width1 + width2<br>max_height = max(height1, height2)<br><br># Create a new blank image with the determined size<br>combined_image = Image.new(&quot;RGB&quot;, (total_width, max_height))<br><br># Paste the first image onto the combined image at (0, 0)<br>combined_image.paste(image1, (0, 0))<br><br># Paste the second image onto the combined image at (width1, 0)<br>combined_image.paste(image2, (width1, 0))<br><br># Save the combined image<br>combined_image.save(&quot;combined_image.jpg&quot;)</pre><p>Crop and Swap Parts of Two Images:</p><pre>from PIL import Image<br><br># Load the two images<br>image1 = Image.open(&quot;image1.jpg&quot;)<br>image2 = Image.open(&quot;image2.jpg&quot;)<br><br># Crop the desired regions from both images<br># (left, upper, right, lower)<br>crop_region1 = image1.crop((0, 0, image1.width // 2, image1.height))<br>crop_region2 = image2.crop((image2.width // 2, 0, image2.width, image2.height))<br><br># Get the size of the cropped regions<br>width1, height1 = crop_region1.size<br>width2, height2 = crop_region2.size<br><br># Determine the size of the combined image after swapping<br>total_width = width1 + width2<br>max_height = max(height1, height2)<br><br># Create a new blank image with the determined size<br>combined_image = Image.new(&quot;RGB&quot;, (total_width, max_height))<br><br># Paste the cropped regions onto the combined image at the swapped positions<br>combined_image.paste(crop_region2, (0, 0))<br>combined_image.paste(crop_region1, (width2, 0))<br><br># Save the combined image with swapped parts<br>combined_image.save(&quot;swapped_image.jpg&quot;)</pre><h3>second method :</h3><h3>Take 2 images, crop some part of the image and swap it.</h3><p>The important thing to note here is the slicing function since images are nothing but 2D/3D arrays we can perform slicing function on them to extract specific sections of the image.</p><p>&lt;cropped_image_variable&gt;=image[starty:endy, startx:endx]</p><p>The starty:endy slice provides the <em>rows</em> (since the <em>y</em>-axis is thenumber of rows) while startx:endx provides the <em>columns</em> (since the <em>x</em>-axis is the number of columns) in the image.</p><p>Below are the images used to perform the task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/278/0*l8WpVgB4nMGZ0bPc.jpeg" /></figure><p>Balls</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/0*hq3ru4mb6Kjnlfvv.jpeg" /></figure><p>A person</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*I_PlQCihNdGPSIJe.png" /></figure><p>Code Snippet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/0*FsOBJTukt0clGymp.png" /></figure><p>Output</p><h3>📌 Take 2 images and combine it to form a single image</h3><p>There are different ways to merge to images in OpenCV using Numpy arrays so one the methods is:</p><h3>hstack() :</h3><p>numpy.<strong>hstack</strong>(<em>tup</em>)</p><ul><li>Stack arrays in sequence horizontally (column wise).</li><li>This is equivalent to concatenation along the second axis, except for 1-D arrays where it concatenates along the first axis. Rebuilds arrays divided by <strong>hsplit</strong>.</li><li>This function makes most sense for arrays with up to 3 dimensions. For instance, for pixel-data with a height (first axis), width (second axis), and r/g/b channels (third axis). The functions <a href="https://numpy.org/doc/stable/reference/generated/numpy.concatenate.html#numpy.concatenate"><strong>concatenate</strong></a>, <a href="https://numpy.org/doc/stable/reference/generated/numpy.stack.html#numpy.stack"><strong>stack</strong></a> and <a href="https://numpy.org/doc/stable/reference/generated/numpy.block.html#numpy.block"><strong>block</strong></a> provide more general stacking and concatenation operations.</li></ul><blockquote><strong><em>Parameters:</em></strong><em> </em><strong><em>tup : </em></strong><em>sequence of ndarrays</em></blockquote><blockquote><em>The arrays must have the same shape along all but the second axis, except 1-D arrays which can be any length.</em></blockquote><blockquote><strong><em>Returns </em></strong><em>: </em><strong><em>stacked: </em></strong><em>ndarray</em></blockquote><blockquote><em>The array formed by stacking the given arrays.</em></blockquote><p>Below are the images used to perform the task:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/163/0*vE-ATj6VRT0XZkf6.jpeg" /></figure><p>img1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/158/0*g1KqD294htyLJ-eW.jpeg" /></figure><p>img2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ga8NJAMr9xegiIWB.png" /></figure><p>Code Snippet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/0*HM0l9rEPrzvb08xP.jpeg" /></figure><p>Output</p><p>Thank you?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=997d8e49044" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Live Streaming Video Chat App without voice using cv2 module of Python And Socket Programming]]></title>
            <link>https://medium.com/@aq702654/live-streaming-video-chat-app-without-voice-using-cv2-module-of-python-and-socket-programming-315755d8d6ad?source=rss-291272b2f75------2</link>
            <guid isPermaLink="false">https://medium.com/p/315755d8d6ad</guid>
            <dc:creator><![CDATA[Aamir qureshi]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 07:12:02 GMT</pubDate>
            <atom:updated>2023-07-30T07:12:02.978Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*C_wywvCn_JNAPeIa" /></figure><p>This Article Is Mainly About Transferring Video using Socket Programming :</p><p>To Perform This Practical We Have to First Setup The Connection Between The Client and Server in this Practical I AM using Single Computer as Client And Server . You Can use other system as well by just changing the client IP but One Necessary Condition is that they Must be in same network .</p><h3>### FOR SERVER SIDE ###</h3><p>STEP 1: CHOOSE PROTOCOL AND ADDRESS FAMILY</p><p>As we Know transfer of any type of Data on the network Use some type Of Protocol Like TCP , UDP etc. and to identify the Target there must be address generally we use IP and Port no but we can use different thing also like ip6 UNIX etc and lastly we have to bind make socket using this two</p><pre>myp =  s.SOCK_STREAM<br>afn = s.AF_INET<br>add_pro = s.socket(afn , myp)</pre><p>STEP 2: NOW WE HAVE TO BIND THE IP ADDRESS AND PORT NO OF SERVER</p><pre>#Binding IP Address and Port No <br>myip = &quot;192.168.43.198&quot;  #server ip<br>port = 1234              #server port<br>bind = add_pro.bind((myip , port))        #Binding ip and port<br>add_pro.listen()       #Starting Listen means start connection</pre><p>STEP 3: NOW WE HAVE TO ACCEPT THE REQUEST FROM THE CLIENT AND ESTABLISH THE CONNECTION BETWEEN THE CLIENT AND SERVER</p><pre>while True:<br>    c , addr = add_pro.accept() <br>    if c:<br>        cv = cv2.VideoCapture(0)  <br>        while(cv.isOpened()):<br>            ret , photo = cv.read()<br>            a = pickle.dumps(photo)<br>            message = struct.pack(&quot;Q&quot;,len(a))+a<br>            c.sendall(message)<br>            cv2.imshow(&quot;Server Side&quot; ,photo)<br>            key = cv2.waitKey(1) &amp; 0xFF<br>            if cv2.waitKey(1) == 13:<br>                cv2.destroyAllWindows()<br>                c.close()<br>                break<br>cv.release()</pre><h3>Here the use of different type of function used here :-</h3><pre>1) add_pro.accept() : - This is  used to accept the request from the Client<br>2) cv2.VideoCapture(0) :- This is generally use to use the internal camera for the laptop<br>3) cv.isOpened() :- Check whether our camera is working fine of not<br>4) cv.read() :- Capture the photo as we Know Image is genrally the Matrix 2D for Grey and 3D for the Color Image and here it is like reading the image<br>5) pickle.dump() :- It is used to save the photo<br>6) struct.package() :-  This is the  function that converts a given list of values into their corresponding string representation<br>7) c.sendall() :- Used to send data to the client<br>8) cv2.imshow() :- This is used to show the image whatever it click<br>9) waitKey(1) :- Used to hold the image for the particular imagae<br>10) c.close() :- Close the connection<br>11) cv.release() :- Close  the Camera<br>12) cv2.destroyAllWindows() :- Close the Displaying Image<br>13) struct.unpack() :- used to unpack the data come from the server</pre><h3>### FOR CLIENT SIDE ###</h3><p>NOTE :- FIRST STEP IS SAME AS THE SERVER</p><p>STEP 2 :- USING SERVER IP AND CLIENT FOR CONNECTION</p><pre>#Binding IP Address and Port No <br>serverip = &quot;192.168.43.198&quot;  #server ip<br>port = 1234              #server port<br>add_pro.connect((myip,port))</pre><p>STEP 3 :- RECEIVING THE DATA FROM THE SERVER</p><pre>while True:<br>    while len(data) &lt; payload_size:<br>        packet = add_pro.recv(4*1024) # 4K<br>        if not packet: break<br>        data+=packet<br>    packed_msg_size = data[:payload_size]<br>    data  ​= data[payload_size:]<br>    msg_size = struct.unpack(&quot;Q&quot;,packed_msg_size)[0]<br>    <br>    while len(data) &lt; msg_size:<br>        data += add_pro.recv(4*1024)<br>    frame_data = data[:msg_size]<br>    data   ​= data[msg_size:]<br>    frame = pickle.loads(frame_data)<br>    cv2.imshow(&quot;Client Side&quot;,frame)<br>    if cv2.waitKey(1) == 13:<br>        cv2.destroyAllWindows()<br>        break</pre><pre>add_pro.close()</pre><h3>USE OF FUNCTION ARE listed Above .</h3><p>Here we are receiving data from from the client and Do unpacking using struct.unpacks and lastly we are showing the image as image is the matrix so we are using array.</p><h3>SECOND Method</h3><h3>GitHub Link-</h3><p><a href="https://github.com/Ersandeep977/LW-Date-10-06-2021-Task-03">GitHub - Ersandeep977/LW-Date-10-06-2021-Task-03</a></p><h3>Socket Programming in Python</h3><p>Socket programming is a way of connecting two nodes on a network to communicate with each other. One socket(node) listens on a particular port at an IP, while other socket reaches out to the other to form a connection. Server forms the listener socket while client reaches out to the server.<br>They are the real backbones behind web browsing. In simpler terms there is a server and a client.</p><p>Sockets are the endpoints of a bidirectional communications channel. Sockets may communicate within a process, between processes on the same machine, or between processes on different continents.</p><p>Sockets may be implemented over a number of different channel types: Unix domain sockets, TCP, UDP, and so on. The <em>socket</em> library provides specific classes for handling the common transports as well as a generic interface for handling the rest.</p><h3>Server :</h3><p>A server has a bind() method which binds it to a specific ip and port so that it can listen to incoming requests on that ip and port. A server has a listen() method which puts the server into listen mode. This allows the server to listen to incoming connections. And last a server has an accept() and close() method. The accept method initiates a connection with the client and the close method closes the connection with the client</p><h3>Simple Client</h3><p>Let us write a very simple client program which opens a connection to a given port 12345 and given host. This is very simple to create a socket client using Python’s <em>socket</em> module function.</p><p>The socket.connect(hosname, port ) opens a TCP connection to <em>hostname</em> on the <em>port</em>. Once you have a socket open, you can read from it like any IO object. When done, remember to close it, as you would close a file.</p><h3>Server Program-</h3><p>#!/usr/bin/python3<br>import socket<br>import cv2<br>import pickle<br>import struct</p><p>#TCP Socket Creation<br>tcp_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)</p><p>tcp_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)<br>tcp_sock.bind((“0.0.0.0”, 2323))</p><p>#Listening To Connections<br>tcp_sock.listen()<br>print(“Accepting Connections…”)</p><p>while True:<br>s, addr = tcp_sock.accept()<br>print(f”Connected to {addr}!!!”)<br>cap = cv2.VideoCapture(0)<br>while(cap.isOpened()):<br>ret, frame= cap.read()</p><p>#Serialise/flattening Data<br>data = pickle.dumps(photo)</p><p>#Bytes Conversion<br>packet = struct.pack(“Q”, len(data))+data<br>s.sendall(packet)<br>cv2.imshow(“Server Side Streaming…”,frame)<br>if cv2.waitKey(10) == 13:<br>cv2.destroyAllWindows()<br>cap.release()<br>break<br>tcp_sock.close()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*pF6JHVbaqdP_RDsJ.png" /></figure><h3>Client Program-</h3><p>#!/usr/bin/python3</p><p>import cv2<br>import socket<br>import pickle<br>import struct</p><p>#TCP Socket Creation</p><p>try:<br>skt = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br>print(“Socket successfully created Now Show …”)<br>except socket.error as err:<br>print(“Socket creation failed with error {}”.formatat(err))</p><p>port = 1234<br>server_ip = “192.168.56.1”<br>skt.connect((server_ip,port))<br>data = b””<br>payload_size = struct.calcsize(“Q”)<br>try:<br>while True:<br>while len(data) &lt; payload_size:<br>packet = skt.recv(4*1024)<br>if not packet: break<br>data += packet<br>packed_msg_size = data[:payload_size]<br>data = data[payload_size:]<br>msg_size = struct.unpack(“Q”,packed_msg_size)[0]</p><p>while len(data) &lt; msg_size:<br>data+= skt.recv(4*1024)<br>img_data = data[:msg_size]<br>data = data[msg_size:]<br>frame= pickle.loads(img_data)<br>cv2.imshow(“Recieving video”, frame)<br>if cv2.waitKey(10) == 13:<br>cv2.destroyAllWindows()<br>break<br>skt.close()<br>except:<br>cv2.destroyAllWindows()<br>skt.close()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*YUcA42I60dWKzh67.png" /></figure><p>Thank you</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=315755d8d6ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Explore the benefits which MNCs are getting from AI/ML]]></title>
            <link>https://medium.com/@aq702654/explore-the-benefits-which-mncs-are-getting-from-ai-ml-b6c7dd90e61?source=rss-291272b2f75------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6c7dd90e61</guid>
            <dc:creator><![CDATA[Aamir qureshi]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 07:02:29 GMT</pubDate>
            <atom:updated>2023-07-30T07:02:29.168Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/312/0*aupn6gN-Ta8lsVqu" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*DC_ZVuDLZY7N5Phw" /></figure><p>Imagine that you were in charge of building a machine learning prediction system to try and identify images between dogs and cats. As we explained above, the first step would be to gather a large number of labelled images with “dog” for dogs and “cat” for cats. Second, we would train the computer to look for patterns on the images to identify dogs and cats, respectively.</p><p>Trained machine learning system capable of identifying cats or dogs.</p><p>Once the machine learning model has been trained, we can throw at it (input) different images to see if it can correctly identify dogs and cats. As seen in the image, a trained machine learning model can (most of the time) correctly identify such queries.</p><p>for example, the image search and translation tools use sophisticated machine learning. This allows the computer to see, listen and speak in much the same way as humans do. Much wow!</p><p>Google uses machine learning algorithms to provide its customers with a valuable and personalized experience. Gmail, Google Search and Google Maps already have machine learning embedded in services. Google is the master of all. It takes advantage of machine learning algorithms and provides customers with a valuable and personalized experience. Machine learning is already embedded in its services like Gmail, Google Search and Google Maps.</p><h3>Uses and Applications of Artificial Intelligence and ML in Business</h3><p><a href="https://www.newgenapps.com/technology/artificial-intelligence/">Artificial intelligence</a> has dramatically changed the business landscape. What started as <a href="https://www.newgenapps.com/blog/what-is-robotic-process-automation-uses-application-benefits/">rule-based automation</a> is now capable of mimicking human interaction. It is not just the <a href="https://www.newgenapps.com/blog/reality-of-artificial-intelligence-will-ai-replace-you-in-job/">human-like capabilities</a> that make artificial intelligence unique. An advanced AI algorithm offers far better speed and reliability at a much lower cost as compared to its human counterparts.</p><p>Artificial intelligence today is not just a theory. It, in fact, has many practical applications. A<a href="https://www.gartner.com/binaries/content/assets/events/keywords/cio/ciode5/top_strategic_predictions_fo_315910.pdf"> 2016 Gartner research</a> shows that by 2020, <strong>at least 30% of companies globally will use AI in at least one fragment of their sales processes.</strong> Today business across the globe are leveraging artificial intelligence to optimize their process and reap higher revenues and profits. We reached out to some industry experts to share their outlook on the applications of artificial intelligence. Here are the insights we received:</p><h3>1. Chatbots —</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/0*KHWyafRbYUZAcA2p" /></figure><p>Artificial intelligence continues to be a hot topic in the technology space as well as increasing its inception into other realms such as healthcare, business, and gaming. <a href="https://www.newgenapps.com/blog/essentials-of-ai-chatbots-what-makes-chatbot-intelligent/">AI-powered chatbots</a> in enterprises will also see an influx of people get more comfortable with how AI can actually benefit businesses versus, say, take away their jobs. From an analytical standpoint, AI can be incorporated into interfaces to change how they receive and understand data.</p><p><a href="https://www.newgenapps.com/blog/7-things-you-wont-know-what-are-chatbots-and-why-do-you-need-it/">Chatbots</a>, in particular, are always on, delivering smart and flexible analytics through conversations on mobile devices using standard messaging tools and voice-activated interfaces.This dramatically reduces the time to collect data for all business users, thereby accelerating the pace of business and streamlines the way analysts use their time, preparing companies for the growing data needs of the near future.</p><h3>2. Artificial Intelligence in eCommerce:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/0*G_F3AhAuu98Dz1ga" /></figure><p><a href="https://www.newgenapps.com/blog/artificial-intelligence-vs-machine-learning-vs-data-science/">Artificial Intelligence technology</a> provides a competitive edge to e-commerce businesses and is becoming readily available to companies of any size or budget. Leveraging machine learning, AI software automatically tags, organizes and visually searches content by labelling features of the image or video.</p><p>AI is enabling shoppers to discover associated products whether it is size, color, shape, or even brand. The visual capabilities AI is improving every year. By first obtaining visual cues from the uploaded imagery, the software can successfully assist the customer in finding the product they desire. Many e-commerce retailers are already becoming more sophisticated with their AI capabilities, and I only expect this to grow in the future.</p><h3>6. Intelligent Cybersecurity —</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/0*X9p9Q4tVjIDYfWDr" /></figure><p>In regard to cybersecurity, Artificial Intelligence is making great strides. Although AI is considered to be in its infancy in cybersecurity and cannot always effectively address all issues, it works successfully in data protection. AI allows companies to detect vulnerabilities or anomalous user behaviour in such business applications as ERP or Financial systems.</p><p>A system of behaviour anomalies analysis in computer systems resembles the world’s most protected airport: when you are on the way to it, the security system has enough time to analyze your identity; you are examined by cameras and in case of any signs of danger, you are intercepted. Deep learning is empowered to see if a user has any suspicious activity. So, even if attackers have penetrated into a victim’s system, they start taking actions that differ from the usual ones and as a result, they do not leave unnoticed and their damage is prevented.</p><p>for example, the image search and translation tools use sophisticated machine learning. This allows the computer to see, listen and speak in much the same way as humans do. Much wow!</p><p>Google uses machine learning algorithms to provide its customers with a valuable and personalized experience. Gmail, Google Search and Google Maps already have machine learning embedded in services.Google is the master of all. It takes advantage of machine learning algorithms and provides customers with a valuable and personalized experience. Machine learning is already embedded in its services like Gmail, Google Search and Google Maps.</p><h4>The 6 Best Examples Of How Companies Use Artificial Intelligence In Practice</h4><h3>1.Machine Learning Case Study on — Dell</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*NVQ9649GgA0mYsmr" /></figure><p>The multinational leader in technology, Dell, empowers people and communities from across the globe with superior software and hardware. Since data is a core part of Dell’s hard drive, their marketing team needed a data-driven solution that supercharges response rates and displays why certain words and phrases outperform others.</p><p>Dell partnered with Persado, the world’s leading technology in AI and ML generated marketing creative, to harness the power of words in their email channel and garner data-driven analytics for each of their key audiences. As a result of this partnership, Dell noticed a 50% average increase in CTR and a 46% average increase in responses from customers. It also generated a 22% average increase in page visits and a 77% average increase in add-to-carts.</p><p>Excited by their success and learnings with email, Dell was eager to elevate their entire marketing platform with Persado. Dell now uses machine learning to improve the marketing copy of their promotional and lifecycle emails, Facebook ads, display banners, direct mail, and even radio content.</p><h3>2. Machine Learning Case Study on — Sky</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/82/0*0ATFA7khQ9fJJsm_" /></figure><p>Sky UK transforms customer experiences with the help of machine learning and artificial intelligence through Adobe Sensei.</p><p>“We have 22.5 million very diverse customers. Even attempting to divide people by their favorite television genre can result in pretty broad segments.” said the Head of Digital Decisioning and Analytics, Sky UK.</p><p>This will:</p><p>· Create hyper-focused segments to engage customers.</p><p>· Use machine learning to deliver actionable intelligence.</p><p>· Improve relationships with customers.</p><p>· Apply AI learnings across channels to understand what matters to customers.</p><p>The company was able to make sense of its large volumes of customer information with the help of machine learning frameworks to recommend them with products and services that resonated the most with each customer.</p><p>“People think of machine learning as a tool for delivering experiences that are strictly defined and very robotic, but it’s actually the opposite. With Adobe Sensei, we’re drawing a line that connects customer intelligence and personalized experiences that are valuable and appropriate” says McLaughlin.</p><h3>3.. Alibaba</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/0*jkoTo_hMo1ZpiMhg" /></figure><p>Chinese company<a href="https://www.alibaba.com/"> Alibaba</a> is the world’s largest e-commerce platform that sells more than Amazon and eBay combined.<a href="https://bernardmarr.com/default.asp?contentID=1536"> Artificial intelligence (AI) is integral in Alibaba’s daily operations</a> and is used to predict what customers might want to buy. With natural language processing, the company automatically generates product descriptions for the site. Another way Alibaba uses artificial intelligence is in its<a href="http://www.wired.co.uk/article/alibaba-city-brain-artificial-intelligence-china-kuala-lumpur"> City Brain project</a> to create smart cities. The project uses AI algorithms to help reduce traffic jams by monitoring every vehicle in the city. Additionally, Alibaba, through its cloud computing division called Alibaba Cloud, is helping<a href="https://www.techinasia.com/alibaba-ai-et-brain-agriculture"> farmers monitor crops</a> to improve yield and cuts costs with artificial intelligence.</p><h3>4. Alphabet — Google</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/0*nsv8f6UNTpN7nxXN" /></figure><p>Alphabet is Google’s parent company.<a href="https://waymo.com/"> Waymo</a>, the company’s self-driving technology division, began as a project at Google. Today, Waymo wants to bring self-driving technology to the world to not only to move people around but to reduce the number of crashes. Its autonomous vehicles are currently shuttling riders around<a href="https://www.fastcompany.com/90372503/waymo-can-now-pick-up-some-california-passengers-in-its-self-driving-vehicles-but-theres-a-catch"> California in self-driving taxis</a>. Right now, the company can’t charge a fare and a human driver still sits behind the wheel during the pilot program. Google signalled its commitment to<a href="https://www.bernardmarr.com/default.asp?contentID=1275"> deep learning</a> when it acquired<a href="https://deepmind.com/about"> DeepMind</a>. Not only did the system learn how to play 49 different Atari games, but the AlphaGo program was also the first to beat a professional player at the game of Go. Another AI innovation from Google is<a href="https://ai.googleblog.com/2018/05/duplex-ai-system-for-natural-conversation.html"> Google Duplex</a>. Using natural language processing, an AI voice interface can make phone calls and schedule appointments on your behalf. Learn even more about<a href="https://bernardmarr.com/default.asp?contentID=1407"> how Google is incorporating artificial intelligence</a> and machine learning into operations.</p><h3>5..Amazon</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*B3xi4Vwcu0GUtvCt" /></figure><p>Not only is Amazon in the artificial intelligence game with its<a href="https://bernardmarr.com/default.asp?contentID=1830"> digital voice assistant, Alexa,</a> but artificial intelligence is also part of many aspects of its business. Another innovative way Amazon uses artificial intelligence is to<a href="https://www.smartdatacollective.com/amazon-wants-predictive-analytics-offer-anticipatory-shipping/"> ship things to you before you even think about buying it</a>. They collect a lot of data about each person’s buying habits and have such confidence in how the data they collect helps them<a href="https://www.bernardmarr.com/default.asp?contentID=712"> recommend items to its customers</a> and now predict what they need even before they need it by using predictive analytics. In a time when many brick-and-mortar stores are struggling to figure out how to stay relevant, America’s largest e-tailer offers a new convenience store concept called<a href="https://www.amazon.com/b?ie=UTF8&amp;node=16008589011"> Amazon Go</a>. Unlike other stores, there is no checkout required. The stores have artificial intelligence technology that tracks what items you pick up and then automatically charges you for those items through the Amazon Go app on your phone. Since there is no checkout, you bring your own bags to fill up with items, and there are cameras watching your every move to identify every item you put in your bag to ultimately charge you for it.</p><h3>6. Apple</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/0*jZhb0o1mqtQ_4bP4" /></figure><p>Apple, one of the world’s largest technology companies, selling consumer electronics such as iPhones and Apple Watches, as well as computer software and online services. Apple uses artificial intelligence and machine learning in products like the iPhone, where it enables the FaceID feature, or in products like the AirPods, Apple Watch, or HomePod smart speakers, where it enables the smart assistant Siri. Apple is also growing its service offering and is using AI to recommend songs on Apple Music, help you find your photo in the iCloud, or navigate to your next meeting using Maps.</p><h3>Summary</h3><p>These case studies of machine learning listed above would have been almost impossible to even think as recently as a decade ago, and yet the pace at which scientists and researchers are advancing is nothing short of amazing. In the coming future, we’ll see that machine learning can recognize, alter, and improve upon their own internal architecture with minimal human intervention.</p><h3>Thank You for Reading</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6c7dd90e61" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenShift Use Cases | Real-Time Industry Based Case Studies]]></title>
            <link>https://medium.com/@aq702654/openshift-use-cases-real-time-industry-based-case-studies-a7002420899c?source=rss-291272b2f75------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7002420899c</guid>
            <dc:creator><![CDATA[Aamir qureshi]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 06:48:22 GMT</pubDate>
            <atom:updated>2023-07-30T06:48:22.997Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/673/0*I7F7zn1cveG6NZlG.png" /></figure><p>In this post, I will be sharing the <strong>OpenShift Use Cases </strong>as per industry norms.</p><p>How is OpenShift benefiting industries? And much more…</p><p>OpenShift fastens application development with the help of tools that large enterprises need to be agile and proficient, Using this technology, you have the advantage of deploying interactive applications quickly for your businesses.</p><h3>What is OpenShift?</h3><p>OpenShift is RedHat’s <strong>open-source</strong>,<strong> cloud-enabled Platform as a Service </strong>offering. It helps enterprises shift their traditional application infrastructure and platform from physical, virtual mediums to the cloud environment. It is convenient in developing cloud-enabled services at a faster rate. Hence, there are numerous OpenShift use cases that benefit the IT industry and all other industries such as automobiles, telecom, fashion designing, manufacturing, etc.</p><h3>OpenShift Benefits</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-Cxkpc9z0nAd9XXX.png" /></figure><p>OpenShift offers a common platform for companies and organizations to host applications on the cloud, independent of operating systems. It offers a user-friendly interface and seamless functionalities. Let’s discuss the benefits of OpenShift.</p><ul><li>OpenShift offers a <strong>self-service platform</strong> for developers to develop and deploy applications on-demand with just a few clicks. Applications developed in OpenShift are packaged up in a container that makes applications extraordinarily portable and lightweight.</li><li>OpenShift has made it possible to work together with <strong>Dev and Ops</strong> without interfering with their individual concerns.</li><li>It brings <strong>consensus to IT organizations</strong>. It means organizations can deliver applications in the market with proper strategies while maintaining the scalability and stability of the app.</li><li>Enterprises always require those vendors who can provide the <strong>entire service stack</strong>. Therefore OpenShift provides Platform as a Service clubbed with Infrastructure as a Service and middleware services for better agility and interoperability.</li><li>It also offers <strong>Rest API support, Built-in Database services, IDE Integration</strong>, remote debugging of applications etc.</li><li>OpenShift makes applications <strong>hyper scalable</strong> because of the containers.</li></ul><h3>OpenShift Use Cases (Case Studies)</h3><p>Many organizations are opting OpenShift and making use of it to the best of their abilities. So let’s have a quick look at OpenShift Use Cases as per industrial requirements.</p><h3>Cisco uses OpenShift</h3><p>To keep up with customer demand, Cisco, a leading provider of network solutions, needs to rapidly implement new IT products and solutions. The challenge is keeping your IT team engaged and productive to drive innovation. With help from Red Hat, Cisco developed its Lightweight Application Environment (LAE), which runs on the Red Hat OpenShift Container Platform, a Platform as a service (PaaS) technology formerly known as Red Hat’s OpenShift Enterprise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MxKcGYL3A4AcYIO0.png" /></figure><ul><li><strong>Challenge faced by Cisco:</strong> Cisco’s ability to quickly offer innovative IT products and solutions to clients is critical to its success. Delays can cost a firm money. Cisco needed to keep its 1,000+ developers actively engaged in creating and implementing apps to encourage speed to market and boost satisfaction while avoiding high employee turnover, low productivity, and delayed reaction times.</li><li><strong>How did they tackle this: </strong>Cisco entrusted Red Hat with the design and development of its LAE, a PaaS deployment that supports hundreds of apps that power a wide range of business operations. Developers can use the IT resources they need to develop apps through a self-service platform, which eliminates manual provisioning.</li><li><strong>Result:</strong> Project provisioning used to take up to three months for Cisco developers. Now, the developers simply press a button, and the service is supplied in a matter of… minutes. Customers will benefit from the speedier delivery of innovative products and services as a result of increased productivity. The approach relieves pressure on limited IT resources and allows developers to devote more time to creative projects</li></ul><h3>Digital Transformation of Lenovo using OpenShift</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/0*lMkg12fXA5VhLmML.png" /></figure><p>Lenovo is a multinational company that manufactures gadgets. Due to the fast-paced technology thrived environment, Lenovo wanted to transform digitally to meet the business requirements and grow exponentially. They needed cloud capabilities to develop efficient applications. Then they shifted to the RedHat OpenShift platform as a service solution that improved their productivity via automation and decreased system deployment time.</p><ul><li><strong>Challenges faced by Lenovo: </strong>Lenovo desired a rapid digital transformation in order to strengthen its capabilities and respond to business demands more quickly. This transformation, on the other hand, necessitated frequent updates and changes to the company’s whole IT environment, and certain outdated systems were unable to keep up. As a result, the team encountered significant hurdles in producing and delivering materials in a timely manner.</li><li><strong>The solution implemented by Lenovo:</strong> Lenovo chose a PaaS solution to integrate cloud computing in order to suit its needs. Lenovo’s Zhenyu Yao, executive director of Integrated Technology Service, said, “We chose PaaS as the preferred solution to gain efficient and agile support for our business team.” Lenovo picked the Red Hat OpenShift Container Platform as its PaaS solution, based on its strong partnership with Red Hat.</li><li><strong>Results</strong>: It enhanced the overall automation and DevOps collaboration for better productivity. Instead of a week, IT personnel may now develop a new IT infrastructure in minutes.</li></ul><h3>BMW Opted OpenShift</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NdlTPxvyVvENuHSF.png" /></figure><p>BMW has been leading the market with its automotive engineering for more than a century. Digital Service Powering functionalities of BMW automobiles were showcased at RedHat Summit. ConnectedDrive system functionalities have been in the market for 20 years, but it requires a more advanced technology-driven delivery system to deliver applications. Therefore in the year 2016, BMW started migrating its full application suite to OpenShift. Now BMW supports more than 1000 web applications for their customers, automobiles, production and sales process etc. This case study states the OpenShift use cases.</p><ul><li><strong>Challenge:</strong> BMW wanted to gain high-performance big data capabilities and a data-driven platform.</li><li><strong>Solution Implemented:</strong> DXC Technology was chosen by the BMW Group to develop a solution for its data and performance concerns. DXC Technology used DXC Robotic Drive, a managed Platform-as-a-Service (PaaS) based on Red Hat OpenShift and other Red Hat technology, to build a Kubernetes-based platform with extensive automation capabilities. With scalable machine learning and big data processing capabilities, this technology aids the BMW Group in developing faster.</li><li><strong>Result:</strong> The BMW Group dramatically cut development time and increased developer productivity by automating repeated operations and giving self-service capabilities. Data gathering, processing, and storage capabilities are also massively scalable on the platform. It has over 230 PB of usable storage and enough processing capacity to simulate 240 million kilometres of test data.</li><li><strong>Q1. What are the uses of OpenShift?</strong></li><li><strong>Ans: </strong>OpenShift allows users to develop, deploy, and manage container-based applications. It is basically a self-service platform that helps create, modify, and deploy on-demand container-based applications using faster development methodologies.</li><li><strong>Q2. Which companies are using OpenShift?</strong></li><li><strong>Ans:</strong> Many big brands are using OpenShift, such as:</li><li>Exxon Mobil</li><li>Lockheed Martin</li><li>Volkswagen</li></ul><p><strong>Q3. Is OpenShift a cloud?</strong></p><p><strong>Ans: </strong>OpenShift is an open-source, Cloud Development Platform as a Service offering from RedHat. Users can quickly develop and deploy applications using it on cloud infrastructure.</p><p><strong>Q4. Is OpenShift Free to use?</strong></p><p><strong>Ans:</strong> OpenShift.io is absolutely free, end-to-end, cloud-native development experience. It offers an integrated set of tools and a unified experience for developers. Hence there are plenty of OpenShift Use cases to practice freely.</p><h3>Conclusion</h3><p>OpenShift is an incredible innovation for cloud-based delivery and robust connectivity globally. It has brought a revolutionary change where enterprise-level businesses can scale up their operations faster, continuously improve services and advance their technology platforms with its pursuit of excellence.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7002420899c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create an AWS EC2 instance  Configure the instance with Apache Webserver.]]></title>
            <link>https://medium.com/@aq702654/create-an-aws-ec2-instance-configure-the-instance-with-apache-webserver-2b46f30c4f9a?source=rss-291272b2f75------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b46f30c4f9a</guid>
            <dc:creator><![CDATA[Aamir qureshi]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 06:32:25 GMT</pubDate>
            <atom:updated>2023-07-30T06:32:25.590Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Create an AWS EC2 instance 🔅 Configure the instance with Apache Webserver. 🔅 Download php application name “WordPress”. 🔅 As wordpress stores data at the backend in MySQL Database server. Therefore, you need to setup a MySQL server using AWS RDS service using Free Tier. 🔅 Provide the endpoint/connection string to the WordPress application to make it work.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*I-DODupqq7O8I_h0" /></figure><h3>Task Overview</h3><p>🔅 Create an AWS EC2 instance</p><p>🔅 Configure the instance with Apache Webserver.</p><p>🔅 Download PHP application name “WordPress”.</p><p>🔅 As WordPress stores data at the backend in MySQL Database server. Therefore, you need to setup a MySQL server using AWS RDS service using Free Tier.</p><p>🔅 Provide the endpoint/connection string to the WordPress application to make it work.</p><h3>Task Description</h3><p>Let’s Begin the Task !!</p><p><strong>Pre-requisites</strong></p><ul><li>Must have account on aws</li></ul><p>Now we are ready to go ..</p><blockquote><em>Step 1 : Create an AWS EC2 instance</em></blockquote><p>Login to AWS Account.</p><p>Go to EC2 Dashboard -&gt;&gt; instances -&gt;&gt; Launch Instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*vv0bq-udK_GfrJlI.png" /></figure><p>a) Select an AMI. Here I am selecting Amazon Linux 2 AMI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*U4c5o_dHOd-1ObgK.png" /></figure><p>c) Configure Instance Details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*2uxm5YLmMple3ndg.png" /></figure><p>Configure Security Group — Here I am adding one more rule for HTTP and allowing everyone to connect with the instance.</p><p><strong>Note: It is not a good practice to allow everyone. We must create custom rules for the security of our instances.</strong></p><p>( I have done this just for the demo )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*-Bv8h2DLlsoyNukN.png" /></figure><p>g) Review and Launch</p><p>Now, If we want to connect with this instance using the ssh protocol we need a key so here I am attaching an existing key. You can create a new one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/0*_-9E-ETt8bkFX-KR.png" /></figure><p>Here we can see, the instance is up !!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*JZ-SoZg-j4ma4uE3.png" /></figure><p>So the step 1 is done. Now move to the step 2 ..</p><blockquote><em>Step 2 : Configure the instance with Apache Webserver</em></blockquote><p>Let’s connect with the instance. There are so many ways to connect with the instance</p><ol><li>Using the browser</li><li>Using ssh</li><li>Using the software like putty etc.</li></ol><p>Here I am using the first way. You can choose any one of the above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1Kw_Hk3RMAJ339UY.png" /></figure><p><strong>Note: All the images do not provide this option to connect.</strong></p><p>Currently we login as ec2-user. This user doesn’t have the admin power so to switch with root user, run the below command</p><pre>sudo su -</pre><p>Let’s Configure Apache Webserver !!</p><p>a) Install the Software</p><pre>yum install httpd -y</pre><p>b) Start the service and make it permanent</p><pre>systemctl start httpd<br>systemctl enable httpd</pre><p>Here we can see, it is successfully configured</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*pevjcJsprPxYFSDB.png" /></figure><blockquote><em>Step 3 : Download PHP application name “WordPress”.</em></blockquote><p><strong>Requirements</strong></p><ul><li>PHP version 7.4 or greater.</li><li>MYSQL version 5.6 or greater <em>OR</em> MariaDB version 10.1 or greater.</li><li>HTTPS support</li></ul><ol><li><strong>Install PHP</strong></li></ol><p>To install php on Amazon Linux 2, we have to first install <strong>amazon-linux-extras </strong>package. ( By default, it is installed )</p><pre>yum install -y amazon-linux-extras</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*6F6YMdOlrz4Pm55I.png" /></figure><p>Enable PHP 7.4 package</p><pre>amazon-linux-extras enable php7.4</pre><p>Now install PHP packages from the repository.</p><pre>yum clean metadata <br>yum install php php-{pear,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip,imap}</pre><p>We can see the installed version of PHP using the below command</p><pre>php -v</pre><p>2. <strong>Download and extract the software</strong></p><pre>wget https://wordpress.org/latest.tar.gz<br>tar -xzvf latest.tar.gz</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*DjPcClH9jFX1ZRmg.png" /></figure><p>3. Upload the WordPress files in the root directory of webserver</p><p><strong>Note: Here I am using Apache webserver so the root directory of the webserver is /var/www/html</strong></p><pre>cp -r wordpress/* /var/www/html/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ZvqSBzCVBhDBxDwV.png" /></figure><h4>http://&lt;public_ip_of_server&gt;/wp-admin/install.php</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*B0P8fdUPVQnjm8VG.png" /></figure><p>Here it will ask for the Database Information so we need to create a DataBase.</p><p>I am creating MYSQL Database using AWS RDS, you can use MariaDB or other databases also as per the requirement.</p><blockquote><em>Step 4: Setup a MySQL server using AWS RDS service using Free Tier.</em></blockquote><p>Go to AWS RDS Service →&gt; Create Database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*H6FmNN6-gU1Syx9C.png" /></figure><p>Select MariaDB Engine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*7U49h47cqKhsfxbp.png" /></figure><p>Templates -&gt;&gt; Free Tier ( You can select as per your requirement )</p><p>Settings -&gt;&gt; Set the Database name, Database User Name and the password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*w0fwxFaehtGF4xW2.png" /></figure><p>Note: Whatever password you set for database, it should be remembered. As we need it in the future.</p><p>Give database a name !</p><p>Note: Whatever password you set for database, it should be remembered. As we need it in the future.</p><p>Give database a name !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*SnKvoJP3_LcWaaZK.png" /></figure><ul><li>Public Accessibility — yes</li><li>Security Group — AllowAll ( You can customize it )</li></ul><p>I Go for the default settings and create the Database for this task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*qu4UtbaI0dD6IF4-.png" /></figure><p>Our database is created. We’ll use this endpoint to connect with wordpress.</p><blockquote><em>Step 5: Provide the endpoint/connection string to the WordPress application to make it work.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*IvmleWmupf612mVz.png" /></figure><p>Or we can manually write these information in the wp-config-sample.php file and rename this file with wp-config.php</p><pre>mv wp-config-sample.php wp-config.php</pre><p>Set Some Basic Information and click on the Installation.</p><p>After Successfully Login you will see the Dashboard of WordPress</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*B12-cwbvo10VELEt.png" /></figure><p>Now we can write the blogs and post them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*DeR6fexKUYhNRR6V" /></figure><p>Hope you find this Article Helpful.</p><p>Thanks for Reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b46f30c4f9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure apache-httpd web server on Docker using Ansible-playbook]]></title>
            <link>https://medium.com/@aq702654/configure-apache-httpd-web-server-on-docker-using-ansible-playbook-656a50a1df5c?source=rss-291272b2f75------2</link>
            <guid isPermaLink="false">https://medium.com/p/656a50a1df5c</guid>
            <dc:creator><![CDATA[Aamir qureshi]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 05:30:33 GMT</pubDate>
            <atom:updated>2023-07-30T05:30:33.877Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LIZffQ39MpDrO-8q" /></figure><h4>Write an Ansible PlayBook that does the following operations in the managed nodes:</h4><p>🔹 Configure Docker</p><p>🔹 Start and enable Docker services</p><p>🔹 Pull the httpd server image from the Docker Hub</p><p>🔹 Copy the html code in /var/www/html directory and start the web server</p><p>🔹 Run the docker container and expose it to the public</p><h4>Before writing the ansible playbook let’s configure the ansible configuration file and the inventory file -</h4><ul><li>So, at first we have to setup the ansible configuration file which is /etc/ansible/ansible.cfg</li></ul><pre>$ vim /etc/ansible/ansible.cfg</pre><ul><li>Now we will update the ip in the inventory file.</li></ul><pre>$ vim /root/ip.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-xbDrxvGXn9HbVQY" /></figure><ul><li>We can check the host is configured or not by listing the hosts, using this command:</li></ul><pre>$ ansible all --list-hosts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/0*TKYhfgYrw7GYLC_w" /></figure><p>Now we can check the connectivity of the worker node using this command</p><pre>$ ansible all -m ping</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/0*kWiVAZyfJQ-RwgU_" /></figure><h4>So the setup is ready, now we can write the ansible playbook.</h4><pre>- name: &quot;configuring httpd on docker&quot;<br>  hosts: web<br>  <br>  tasks:<br>     # from here we will write all the modules as per our requirement</pre><ul><li>For the docker configuration first we have to configure the yum</li></ul><pre>  - name: &quot;Yum configuration of Docker&quot;<br>    yum_repository:<br> <br>      name: docker<br>      description: &quot;docker repository&quot;<br>      baseurl: https://download.docker.com/linux/centos/7/x86_64/stable/<br>      gpgcheck: no</pre><ul><li>for installing docker-ce</li></ul><pre>   - name: &quot;Installing docker&quot;<br><br>     command: &quot;yum install docker-ce --nobest -y&quot;</pre><ul><li>Start and enable Docker services</li></ul><pre>  - name: &quot;Docker service start and enable&quot;<br>      service:<br>        name: docker<br>        state: started<br>        enabled: yes</pre><ul><li>Install docker library</li></ul><pre>   - pip:<br>        name: &quot;docker&quot;<br>  <br>        state: latest</pre><ul><li>Pull the httpd server image from the Docker Hub</li></ul><pre>- name: &quot;Pulling httpd image from docker hub&quot;<br>      docker_image:<br>        name: httpd<br>        source: pull</pre><pre> state: present</pre><ul><li>Creating a folder in the controller node named /var/www/html</li></ul><pre>   - name: &quot;Creation of a directory&quot;<br>     file:<br>        path: &quot;/var/www/html&quot;</pre><pre> state: directory </pre><ul><li>Copying the html file to that location (create a index.html file to the same directory where you are creating this ansible playbook) for</li></ul><pre>   - name: &quot;copping html file&quot;<br>     copy:<br>        src: &quot;index.html&quot;</pre><pre>   dest: &quot;/var/www/html/index.html&quot;</pre><ul><li>Enabeling the firewalld</li></ul><pre>    - name: &quot;firewall for port 80&quot;<br>      firewalld:<br>        port: &quot;80/tcp&quot;<br>        state: enabled<br>        permanent: yes</pre><pre>  immediate: yes</pre><ul><li>Running the docker container</li></ul><pre>    - name: &quot;Launching docker container&quot;<br>      docker_container:<br>        name: webserver<br>        image: httpd<br>        state: started<br>        ports: &quot;8081:80&quot;<br>        volumes: /var/www/html/index.html:/usr/local/apache2/htdocs/index.html</pre><pre> detach: true</pre><p>That’s all! Now we have to run the playbook</p><pre>$ ansible-playbook docker-httpd.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LsanLUotlROXTvqx" /></figure><p>Thank you for reading?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=656a50a1df5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How industries are solving challenges using Ansible]]></title>
            <link>https://medium.com/@aq702654/how-industries-are-solving-challenges-using-ansible-d5fcb5f2c2fb?source=rss-291272b2f75------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5fcb5f2c2fb</guid>
            <dc:creator><![CDATA[Aamir qureshi]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 05:01:27 GMT</pubDate>
            <atom:updated>2023-07-30T05:01:27.739Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*hUvRYab0IcuQVidh" /></figure><h3>What is Ansible?</h3><p>📝Ansible is an open-source automation tool, or platform, used for IT tasks such as configuration management, application deployment, intracervical orchestration, and provisioning. Automation is crucial these days, with IT environments that are too complex and often need to scale too quickly for system administrators and developers to keep up if they had to do everything manually. Automation simplifies complex tasks, not just making developers’ jobs more manageable but allowing them to focus attention on other tasks that add value to an organization. In other words, it frees up time and increases efficiency. And Ansible, as noted above, is rapidly rising to the top in the world of automation tools. Let’s look at some of the reasons for Ansible’s popularity.</p><h3>Why Do We Need Ansible?</h3><p>📝Well before I tell you what is Ansible, it is of utmost importance to understand the problems that were faced before Ansible.</p><p>Let us take a little flashback to the beginning of networked computing when deploying and managing servers reliably and efficiently has been a challenge. Previously, system administrators managed servers by hand, installing software, changing configurations, and administering services on individual servers.</p><p>As data centers grew, and hosted applications became more complex, administrators realized they couldn’t scale their manual systems management as fast as the applications they were enabling. It also hampered the velocity of the work of the developers since the development team was agile and releasing software frequently, but IT operations were spending more time configuring the systems. That’s why server provisioning and configuration management tools came to flourish.</p><p>Consider the tedious routine of administering a server fleet. We always need to keep updating, pushing changes, copying files on them etc. These tasks make things very complicated and time consuming.</p><p>But let me tell you that there is a solution to the above stated problem. The solution is — Ansible.</p><p>But before I go ahead to explain you all about Ansible, let me get you familiarized with few Ansible terminologies:</p><p>📝Ansible Terminologies:</p><ul><li><strong>Controller Machine</strong>: The machine where Ansible is installed, responsible for running the provisioning on the servers you are managing.</li><li><strong>Inventory</strong>: An initialization file that contains information about the servers you are managing.</li><li><strong>Playbook</strong>: The entry point for Ansible provisioning, where the automation is defined through tasks using YAML format.</li><li>Task: A block that defines a single procedure to be executed, e.g. Install a package.</li><li><strong>Module</strong>: A module typically abstracts a system task, like dealing with packages or creating and changing files. Ansible has a multitude of built-in modules, but you can also create custom ones.</li><li><strong>Role</strong>: A pre-defined way for organizing playbooks and other files in order to facilitate sharing and reusing portions of a provisioning.</li><li><strong>Play</strong>: A provisioning executed from start to finish is called a play. In simple words, execution of a playbook is called a play.</li><li>Facts: Global variables containing information about the system, like network interfaces or operating system.</li><li>Handlers: Used to trigger service status changes, like restarting or stopping a service.</li></ul><p>Ansible is a helpful tool that allows you to create groups of machines, describe how these machines should be configured or what actions should be taken on them. Ansible issues all commands from a central location to perform these tasks.</p><p>No other client software is installed on the node machines. It uses SSH to connect to the nodes. Ansible only needs to be installed on the control machine (the machine from which you will be running commands) which can even be your laptop. It is a simple solution to a complicated problem.</p><h3>What is Ansible Architecture?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/0*jfv5YHQDj0KbGQri" /></figure><p>As you can see, in the diagram above, the Ansible automation engine has a direct interaction with the users who write playbooks to execute the Ansible Automation engine. It also interacts with cloud services and Configuration Management Database (CMDB).</p><p>The Ansible Automation engine consists of:</p><ul><li>Inventories: Ansible inventories are lists of hosts (nodes) along with their IP addresses, servers, databases etc. which needs to be managed. Ansible then takes action via a transport — SSH for UNIX, Linux or Networking devices and WinRM for Windows system.</li><li>APIs: APIs in Ansible are used as transport for Cloud services, public or private.</li><li>Modules: Modules are executed directly on remote hosts through playbooks. The modules can control system resources, like services, packages, or files (anything really), or execute system commands. Modules do it by acting on system files, installing packages or making API calls to the service network. There are over 450 Ansible-provided modules that automate nearly every part of your environment. For e.g.</li><li>Cloud Modules like cloudformation which creates or deletes an AWS cloud formation stack;</li><li>Database modules like mssql_db which removes MYSQL databases from remote hosts.</li><li>Plugins: Plugins allows to execute Ansible tasks as a job build step. Plugins are pieces of code that augment Ansible’s core functionality. Ansible ships with a number of handy plugins, and you can easily write your own. For example,</li><li>Action plugins are front ends to modules and can execute tasks on the controller before calling the modules themselves.</li><li>Cache plugins are used to keep a cache of ‘facts’ to avoid costly fact-gathering operations.</li><li>Callback plugins enable you to hook into Ansible events for display or logging purposes.</li></ul><p>There are a few more components in Ansible Architecture which are explained below:</p><ul><li>Networking: Ansible can also be used to automate different networks. Ansible uses the same simple, powerful, and the agentless automation framework IT operations and development are already using. It uses a data model (a playbook or role) that is separate from the Ansible automation engine that easily spans different network hardware.</li><li>Hosts: The hosts in the Ansible architecture are just node systems which are getting automated by Ansible. It can be any kind of machine — Windows, Linux, RedHat etc.</li><li>Playbooks: Playbooks are simple files written in YAML format which describes the tasks to be executed by Ansible. Playbooks can declare configurations, but they can also orchestrate the steps of any manual ordered process, even if it contains jump statements. They can launch tasks synchronously or asynchronously.</li><li>CMDB : It is a repository that acts as a data warehouse for IT installations. It holds data relating to a collection of IT assets (commonly referred to as configuration items (CI)), as well as to describe relationships between such assets.</li><li>Cloud: It is a network of remote servers hosted on the Internet to store, manage, and process data, rather than a local server. You can launch your resources and instances on cloud and connect to your servers.</li></ul><h3>Ansible’s Features and Capabilities:</h3><p>1. Configuration Management: Ansible is designed to be very simple, reliable, and consistent for configuration management. If you’re already in IT, you can get up and running with it very quickly. Ansible configurations are simple data descriptions of infrastructure and are both readable by humans and parsable by machines. All you need to start managing systems is a password or an SSH (Secure Socket Shell, a network protocol) key. An example of how easy Ansible makes configuration management: If you want to install an updated version of a specific type of software on all the machines in your enterprise, all you have to do is write out all the IP addresses of the nodes (also called remote hosts) and write an Ansible playbook to install it on all the nodes, then run the playbook from your control machine.</p><p>2. Application Deployment: Ansible lets you quickly and easily deploy multitier apps. You won’t need to write custom code to automate your systems; you list the tasks required to be done by writing a playbook, and Ansible will figure out how to get your systems to the state you want them to be in. In other words, you won’t have to configure the applications on every machine manually. When you run a playbook from your control machine, Ansible uses SSH to communicate with the remote hosts and run all the commands (tasks).</p><p>3. Orchestration: As the name suggests, orchestration involves bringing different elements into a beautifully run whole operation — similar to the way a musical conductor brings the notes produced by all the different instruments into a cohesive artistic work. For example, with application deployment, you need to manage not just the front-end and backend services but the databases, networks, storage, and so on. You also need to make sure that all the tasks are handled in the proper order. Ansible uses automated workflows, provisioning, and more to make orchestrating tasks easy. And once you’ve defined your infrastructure using the Ansible playbooks, you can use that same orchestration wherever you need to, thanks to the portability of Ansible playbooks.</p><p>4. Security and Compliance: As with application deployment, sitewide security policies (such as firewall rules or locking down users) can be implemented along with other automated processes. If you configure the security details on the control machine and run the associated playbook, all the remote hosts will automatically be updated with those details. That means you won’t need to monitor each machine for security compliance continually manually. And for extra security, an admin’s user ID and password aren’t retrievable in plain text on Ansible.</p><p>5. Cloud Provisioning: The first step in automating your applications’ life cycle is automating the provisioning of your infrastructure. With Ansible, you can provision cloud platforms, virtualized hosts, network devices, and bare-metal servers.</p><h3>Advantages Of Ansible:</h3><ul><li>Free: Ansible is an open-source tool.</li><li>Very simple to set up and use: No special coding skills are necessary to use Ansible’s playbooks (more on playbooks later).</li><li>Powerful: Ansible lets you model even highly complex IT workflows.</li><li>Flexible: You can orchestrate the entire application environment no matter where it’s deployed. You can also customize it based on your needs.</li><li>Agentless: You don’t need to install any other software or firewall ports on the client systems you want to automate. You also don’t have to set up a separate management structure.</li><li>Efficient: Because you don’t need to install any extra software, there’s more room for application resources on your server.</li></ul><h3>What is Ansible in DevOps?</h3><p>In DevOps, as we know development and operations work is integrated. This integration is very important for modern test-driven application design. Hence, Ansible integrates this by providing a stable environment to both development and operations resulting in smooth orchestration. Refer to the image below to see how Ansible fits into DevOps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*01Tl7gDFODtDkWzh" /></figure><p>Let us discuss now how Ansible manages the entire DevOps infrastructure. When developers begin to think of infrastructure as part of their application i.e as Infrastructure as code (IaC), stability and performance become normative. Infrastructure as Code is the process of managing and provisioning computing infrastructure (processes, bare-metal servers, virtual servers, etc.) and their configuration through machine-processable definition files, rather than physical hardware configuration or the use of interactive configuration tools. This is where Ansible automation plays a major role and stands out among its peers.</p><p>In DevOps, Sysadmins work tightly with developers, development velocity is improved, and more time is spent doing activities like performance tuning, experimenting, and getting things done, and less time is spent fixing problems. Refer to the diagram below to understand how the tasks of sysadmins and other users are simplified by Ansible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5fcb5f2c2fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>