<?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 Nischal Vooda on Medium]]></title>
        <description><![CDATA[Stories by Nischal Vooda on Medium]]></description>
        <link>https://medium.com/@nischalvooda?source=rss-39d520c4c1f7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dklkqNuhK_3_NWGxZAwtnw.jpeg</url>
            <title>Stories by Nischal Vooda on Medium</title>
            <link>https://medium.com/@nischalvooda?source=rss-39d520c4c1f7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 10:21:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nischalvooda/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[Vision of the Future User Interface]]></title>
            <link>https://nischalvooda.medium.com/vision-of-the-future-user-interface-f5c7b313f68d?source=rss-39d520c4c1f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5c7b313f68d</guid>
            <category><![CDATA[hci]]></category>
            <category><![CDATA[jonathan-goudinho]]></category>
            <dc:creator><![CDATA[Nischal Vooda]]></dc:creator>
            <pubDate>Sun, 10 Dec 2023 05:17:00 GMT</pubDate>
            <atom:updated>2023-12-10T05:17:00.762Z</atom:updated>
            <content:encoded><![CDATA[<h3>Human-Computer Interaction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*j96CJB_7FA5dN8g9.jpg" /></figure><p><strong>Vision of the future user interface</strong></p><p>In the 1950s, computer interfaces were rudimentary, consisting of simple black screens where users had to input commands, and the system would process these commands and return results. Recognizing that the average person found command-based systems challenging, the development of personal computers began, aimed at creating more user-friendly interfaces. This era gave birth to operating systems like Windows, which significantly improved the user experience. Additionally, interactive word-processing programs and the invention of the mouse marked notable advancements in the 1950s.</p><p>Fast-forwarding to the 21st century, artificial intelligence (AI) has rapidly evolved from being a mere technical term into a formidable field. One of AI’s groundbreaking moments arrived with AlphaGo, it is the first AI program to beat a proficient human Go player. Subsequently, innovations like Tesla’s powerful AI-driven autonomous driving system have further demonstrated AI’s transformative potential. Today, ChatGPT stands as a prominent example of AI application, offering responses and results based on textual prompts.</p><p>Looking ahead, the future of user interfaces appears poised for extensive automation, where users can simply articulate their requirements to the system, and tasks will be effortlessly executed. Imagine requesting a calculator app and having it created instantly before your eyes based on your specifications. The landscape is already teeming with automation AI tools like Hyperwrite Ware, which follow instructions to complete tasks promptly. Sending emails, for instance, can now be accomplished within seconds through such automated systems.</p><p><strong>key problems with the current user interface</strong></p><p>The historical evolution of computing, as gleaned from the paper, reveals an initial emphasis on hardware during the nascent stages of computer development. However, as personal computers entered the scene, the significance of user interface and front-end components began to garner recognition.</p><p>Furthermore, there’s often a scarcity of comprehensive tutorials or readily accessible help resources for complex software. While some applications are intricate in nature, the availability of tutorials to demystify their usage remains limited.</p><p>Moreover, the issue of customization overload looms large. An excessive profusion of settings and options can lead to a cluttered and unwieldy interface, complicating the user experience. It is imperative that the design of user interfaces evolves to address these shortcomings, promoting accessibility and usability for all individuals, regardless of their technical proficiency.</p><p><strong>The Role of Prompt-Based Design</strong></p><p>Indeed, ChatGPT-like software is poised to play a pivotal role in the future of user interfaces. Since the release of ChatGPT, a wave of specialized AI tools has emerged, each excelling in specific tasks. Noteworthy examples include Mubert for generating music, Midjourney for crafting images, and Beautiful.ai for creating visually striking presentations, among many others. These AI-driven tools exhibit remarkable speed and accuracy, surpassing the capabilities of over 60% of human operators.</p><p>Recent research even demonstrated ChatGPT’s prowess by successfully cracked a Google interview, underlining the potential of AI tools in saving valuable time and effort. However, it’s essential to address a significant drawback: the substantial cost, estimated at approximately $700,000 per day, associated with these AI systems. This cost underscores the urgency of shifting focus towards enhancing hardware infrastructure.</p><p>The key to a more efficient and cost-effective future lies in developing affordable and highly efficient processors. Quantum computing stands out as a promising solution, holding the potential to revolutionize the industry by making advanced AI more accessible.</p><p>Looking ahead, it’s conceivable that voice assistants such as Amazon Echo and Google Nest Mini will harness the power of AI knowledge to eliminate the need for manual data input. Users will simply need to voice their requests, and the information they seek will be at their fingertips, ushering in a seamless and intuitive era of human-computer interaction.</p><p><strong>Examples</strong></p><p>Generative AI:</p><p>In the domain of Generative AI, ChatGPT has emerged as a universal tool in recent times. It operates as a generative AI platform, accepting text commands as prompts and returning text outputs in various desired formats. Additionally, a plethora of tools have surfaced, extending generative capabilities to generate audio, images, videos, and more. Take, for instance, Midjourney, a popular tool renowned for creating images based on textual prompts.</p><p>Anticipating the future, Generative AI holds the potential to revolutionize software development. Imagine providing a simple text command like “I need complete details and resources to initiate an E-commerce website,” and the AI could furnish a comprehensive package to kickstart the entire website creation process. This transformative capability is poised to become a reality in the near future, as Generative AI adapts to fulfill diverse needs, whether it’s generating images, performing calculations, or achieving even more complex tasks.</p><p><a href="https://www.getshogun.com/shopify-ai-website-builder/?utm_source=google&amp;utm_medium=cpc&amp;utm_campaign=gg_all_dg_search_generic_test2_pagebuilder&amp;utm_term=ai%20website%20builder&amp;utm_content=ai_website_builder&amp;device=c&amp;placement=&amp;network=g&amp;creative=670562380518&amp;adgroupid=153459609820&amp;gclid=CjwKCAjwu4WoBhBkEiwAojNdXqb8VGowvRYnAveUGV141Gkb5UnI2-wHEVp_V-sS803wQXmq3j_9-RoC2EQQAvD_BwE">Shopify AI Website Builder | Free Plan Available | Shogun (getshogun.com)</a></p><p>ARVR:</p><p>ARVR will be the future user interface. As everyone knows that Meta invested millions in it.</p><p>For example, if you are in a random street and trying to get a good motel to stay and everyone knows the struggle to find a good and resalable motel but using this ARVR device, we can get all the information about ratings, prices, and reviews, seamlessly integrating digital information into their physical surroundings.</p><p><strong>Key Differentiators</strong> are The main distinctions between the two examples lie in their applications and outputs. In the first example, Generative AI responds to textual prompts and generates a wide range of text-based outputs. It essentially delivers what we request through text input.</p><p>On the other hand, the second example, ARVR, centers around 3D modeling and the immersive visualization of the physical world using advanced technology. In this scenario, we provide textual input to AI, and it transforms it into a visual representation, often involving augmented reality or virtual reality experiences.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FD89NSJlqklg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DD89NSJlqklg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FD89NSJlqklg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e849244e5356fe21d3f2c3c5e082d707/href">https://medium.com/media/e849244e5356fe21d3f2c3c5e082d707/href</a></iframe><p><strong>References</strong></p><p>Grudin, J., 1990, March. The computer reaches out: The historical continuity of interface design. In <em>Proceedings of the SIGCHI conference on Human factors in computing systems</em> (pp. 261–268).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5c7b313f68d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Everything you should know about denial-of-service (DDoS) attack]]></title>
            <link>https://nischalvooda.medium.com/everything-you-should-know-about-denial-of-service-ddos-attack-a2e2b5f0deba?source=rss-39d520c4c1f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2e2b5f0deba</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[csm]]></category>
            <category><![CDATA[ddos-attack]]></category>
            <dc:creator><![CDATA[Nischal Vooda]]></dc:creator>
            <pubDate>Sun, 10 Dec 2023 05:06:27 GMT</pubDate>
            <atom:updated>2023-12-10T05:06:27.434Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BfiUw_ZvkyRBfXBg.png" /></figure><p><strong>Abstract</strong></p><p><strong>Safeguarding the Digital Realm — Lessons from DDoS Encounters</strong></p><p>In the dynamic expanse of the digital landscape, the threat of Distributed Denial of Service (DDoS) attacks looms large. This abstract encapsulates the narratives woven through discussions on DDoS attacks, their impacts on businesses, and the strategies employed to navigate these virtual tempests.</p><p>The journey begins with an exploration of the mechanics behind DDoS attacks, stripping away complexity to reveal the simple analogy of a digital battering ram. The motives driving these attacks, from hacktivism to competitive advantage, are unraveled with straightforward language, illustrating the diverse faces of cyber adversaries.</p><p>Real-world examples unfold, each a chapter in the saga. GitHub, a digital haven disrupted by a HTTP flood attack, mirrors the tangible consequences businesses face — downtime, revenue loss, and the enduring scars on brand reputation. The narrative expands to cloud giants like Google, where resilience becomes a beacon against a 2.5 Tbps onslaught, showcasing the power of advanced DDoS protection and adaptive strategies.</p><p>The abstract concludes with distilled wisdom — a spartan set of guidelines for businesses navigating the digital seas. Invest in advanced defenses, prioritize scalability and redundancy, stay vigilant, and adapt — simple yet profound principles to weather the unseen storms. These lessons are not wrapped in corporate jargon but echo the language of a vigilant sentinel adjusting its gaze in the ever-shifting cyber landscapes.</p><p>As businesses fortify their digital fortresses, these narratives become guiding stars, illustrating the resilience needed to navigate the cyber seas. The abstract serves as a compass, directing the digital defenders towards a secure future, where simplicity, vigilance, and adaptability stand as constants against the unseen storms on the digital horizon.</p><p><strong>Introduction</strong></p><p><strong>Defending the Digital Ramparts Against DDoS Onslaughts</strong></p><p>In the vast expanse of the digital realm, where businesses, services, and even cat videos find their place, a lurking menace exists — the Distributed Denial of Service (DDoS) attack. Unbeknownst to many, this clandestine assault can bring down the mightiest of digital fortresses, leaving chaos and disruption in its wake.</p><p><strong>What is a DDoS Attack?</strong></p><p>Let’s decode the digital enigma. DDoS stands for Distributed Denial of Service. Think of it as a horde of invisible invaders bombarding a digital castle with relentless, overwhelming force. Unlike a single hacker banging on the gates, a DDoS attack harnesses a legion of compromised computers, forming a zombie army known as a botnet. These zombies mindlessly follow the hacker’s orders, flooding the target with traffic until it crumbles under the weight.</p><p><strong>How is it Used?</strong></p><p>Now, imagine a traffic jam, not on the congested streets, but on the data highways. DDoS attackers exploit vulnerabilities in our interconnected world, weaponizing the very structure that keeps our digital lives humming along. They may seek revenge, wield digital activism, or simply disrupt operations for financial gain. Picture a bully blocking the school entrance, preventing anyone from getting in — that’s the essence of a DDoS attack.</p><p><strong>Potential Damage Caused by DDoS Attacks</strong></p><p>The fallout from a successful DDoS raid is not just confined to the digital realm. It spills over into the tangible world, affecting businesses, services, and the unsuspecting users caught in the crossfire. Financial losses pile up as downtime stretches its voracious claws. Imagine your favorite online store suddenly closing shop because of a relentless DDoS onslaught — no shopping carts, no virtual window shopping, just a digital ghost town.</p><p><strong>Their Significance in the Cybersecurity Landscape</strong></p><p>Why should the average digital denizen care about DDoS attacks? Because they are the battering rams of the virtual age, threatening the very foundations of our online existence. As we traverse the vast landscapes of cyberspace, we rely on the accessibility of websites and services. DDoS attacks, like marauding bandits, disrupt this harmony, posing a substantial threat to the stability of our digital world.</p><p>In the labyrinth of cybersecurity, DDoS attacks represent a formidable adversary. They force us to reassess our digital defenses, highlighting vulnerabilities we might have overlooked. No longer can we rely on outdated digital moats; we must employ advanced strategies to thwart these digital onslaughts.</p><p>As the digital landscape evolves, so do the methods of those who seek to exploit it. DDoS attacks are not relics of a bygone era; they are the arrows in the quiver of modern cyber warfare. Recognizing their significance is the first step in fortifying our digital citadels against the impending storms.</p><p>In the pages that follow, we will delve deeper into the mechanics of DDoS attacks, dissect real-world examples of their impact, explore the economic repercussions, and unveil the strategies to withstand these virtual sieges. Welcome to the frontline of the digital battlefield, where vigilance is the armor, and knowledge is the sword.</p><p><strong>Unmasking the Digital Siege</strong></p><p>In the vast expanse of ones and zeros that make up our digital world, a shadowy menace known as a Distributed Denial of Service (DDoS) attack prowls, wreaking havoc on the very fabric of the internet. To understand this modern-day siege, we must first strip away the tech jargon and peer into the mechanics beneath.</p><p><strong>Defining DDoS Attacks:</strong></p><p>DDoS, or Distributed Denial of Service, is like a digital battering ram. It’s not a lone hacker banging on the gates; it’s an army, a legion of compromised computers acting in unison. Picture it as a mob, but in the virtual realm. These compromised computers, often unknowingly enlisted into service, form what’s called a botnet, a horde at the command of a malicious puppeteer.</p><p><strong>Basic Mechanics:</strong></p><p>Now, let’s delve into the nitty-gritty of how a DDoS attack unfolds. Imagine your favorite website as a serene café where you sip your digital coffee. Everything is running smoothly until, suddenly, a tidal wave of traffic hits. This isn’t ordinary traffic; it’s like trying to sip from a firehose.</p><p>Here’s the trick: the attacker orchestrates this chaos using the army of compromised computers, the botnet. Each computer in the botnet is like a soldier awaiting orders. When the attack begins, these digital minions flood the target website or online service with more requests than it can handle.</p><p>It’s akin to everyone in a stadium trying to buy a hotdog at the same time. The overwhelmed vendor can’t keep up, and chaos ensues. In the digital realm, this chaos means the website can’t distinguish between genuine visitors and the flood of malicious traffic. The servers buckle under the strain, and the once-accessible website becomes an inaccessible fortress.</p><p><strong>Rendering the Target System Inaccessible:</strong></p><p>Think of a DDoS attack as a barricade on a digital highway. Legitimate users, the ones who want to access a website or service, are stuck in a traffic jam created by the malicious flood. They honk their horns (send requests), but the road is clogged, and they can’t get through.</p><p>Meanwhile, the attacker grins from the shadows. The goal isn’t always to breach the fortress but to lock everyone out. It’s a disruptive tactic, a virtual protest, or sometimes just digital vandalism. The website or service becomes a ghost town, devoid of its usual hustle and bustle.</p><p><strong>The Unseen Chaos:</strong></p><p>What makes DDoS attacks particularly insidious is their covert nature. It’s like an invisible army attacking in the dead of night. The owners of the compromised computers, the unwitting foot soldiers of this digital army, might not even realize they are part of the onslaught. They are innocent bystanders roped into a virtual skirmish without their knowledge.</p><p>In the aftermath, when the dust settles and the digital sirens cease, the target is left picking up the pieces. It’s not just about a momentary inconvenience; it’s about the aftermath. Imagine the café struggling to reopen after a chaotic rush. It’s not just about lost sales; it’s about rebuilding the shattered trust of customers who faced an unexpected barricade.</p><p>In this section, we’ve peeled back the layers of the DDoS mystery, exposing the mechanics of this digital siege. It’s not the work of a lone hacker but a symphony of chaos orchestrated by a legion of compromised computers. In the digital landscape, where accessibility is key, a DDoS attack is akin to a sudden roadblock on the information highway. As we venture further, we will explore why hackers deploy these virtual battering rams and the real-world consequences of their disruptive exploits.</p><p><strong>The Dark Motives and Crafty Tactics Behind DDoS Attacks</strong></p><p>In the clandestine world of cyber warfare, DDoS attacks are not mere random storms; they are targeted strikes orchestrated with motives as diverse as the digital landscape itself. To grasp the art of this virtual skirmish, we must unravel the cloak of secrecy shrouding the hacker’s motives and the crafty tools they employ.</p><p><strong>Motives Behind DDoS Attacks:</strong></p><p>Picture DDoS attacks as the digital graffiti on the walls of the internet. Hackers have motives aplenty, and these range from hacktivism, extortion, to seeking a competitive edge. Hacktivism, a fusion of hacking and activism, involves using DDoS attacks as a form of protest or digital disobedience. It’s like a virtual picket line, disrupting digital operations to make a statement.</p><p>On the flip side, some cyber rogues have dollar signs in their digital eyes. Extortion is a sinister game where attackers demand a ransom to stop the DDoS onslaught. It’s akin to a digital protection racket, where the cost of peace is paid in cryptocurrency. Others, driven by a more cutthroat motive, employ DDoS attacks as a smokescreen to gain a competitive edge. It’s the digital equivalent of sabotage, where disrupting a rival’s online presence becomes a tactical advantage.</p><p><strong>Crafty Techniques:</strong></p><p>Now, let’s peek into the hacker’s toolkit, where the weapons of choice are as varied as the motives. First on the list is the infamous botnet, the backbone of many DDoS attacks. A botnet is a swarm of compromised computers, unwittingly enlisted into a hacker’s army. These digital minions, each with its marching orders, flood the target with a tidal wave of traffic, overwhelming its defenses.</p><p>Then there’s the amplification attack, a sneaky maneuver in the hacker’s playbook. It’s like turning up the volume on a whisper until it becomes a roar. In the digital realm, attackers exploit vulnerabilities in certain online protocols, making small requests that trigger much larger responses. The result? A deluge of data raining down on the target, drowning it in a sea of requests.</p><p>Enter the realm of application layer attacks, a tactic that targets the very heart of a website or service. Imagine a relentless interrogator bombarding a server with a barrage of intricate queries. The server, preoccupied with deciphering these complex questions, becomes too overwhelmed to respond to legitimate requests. It’s not about brute force but surgical precision, disrupting the core functions of a digital entity.</p><p><strong>The Chessboard of Cyber Warfare:</strong></p><p>Understanding these motives and techniques is akin to deciphering the moves on a chessboard. Each attack is a pawn in a larger game, where hackers strategically deploy their weapons for maximum impact. It’s not just chaos for chaos’s sake; it’s a calculated dance in the digital shadows.</p><p>In this murky landscape, DDoS attacks cease to be random acts of digital vandalism; they become strategic maneuvers in a virtual battleground. Hacktivists raise their digital banners, extortionists demand their digital tribute, and rivals deploy digital smoke screens. The motives may vary, but the tools remain eerily effective.</p><p>As we journey deeper into the realm of DDoS attacks, we will unravel more layers of this digital intrigue. We will explore real-world instances where these motives and tactics collide, leaving a trail of disrupted websites, rattled businesses, and a digital landscape forever altered by the invisible hand of cyber warfare.</p><p><strong>Real-world Example: Dyn (2016) — A Digital Avalanche and the Quest for Defense</strong></p><p>In the digital chronicles of 2016, one incident shook the virtual ground, leaving a $120 million crater in its wake — the Dyn DDoS attack. This digital tempest wasn’t just an isolated event; it was a storm brewed by a Mirai botnet, an army of compromised Internet of Things (IoT) devices.</p><p><strong>The Dyn DDoS Attack:</strong></p><p>Picture Dyn as the traffic cop of the internet, directing the flow of digital vehicles. In October 2016, this virtual traffic cop found itself in the crosshairs of a relentless DDoS attack. The weapon of choice: the Mirai botnet, a legion of compromised IoT devices, from smart fridges to security cameras, enlisted by unseen hands.</p><p>The attackers exploited a vulnerability using a UDP amplification attack. It’s like someone yelling into a microphone and the whole city hearing it. In the digital realm, attackers manipulated the Domain Name System (DNS), directing a flood of requests to Dyn. The servers, unprepared for this deluge, struggled to distinguish the legitimate cries for access from the cacophony of malicious noise.</p><p>The result? A digital avalanche. Popular websites, including GitHub, Netflix, and PayPal, crumbled under the weight of the attack. The virtual traffic lights went out, and chaos ensued. The estimated loss, a staggering $120 million, wasn’t just monetary; it was a wake-up call for the digital guardians.</p><p><strong>Preventing the Onslaught:</strong></p><p>In the aftermath of this digital cataclysm, the question lingers — how could Dyn have fortified its digital fortress against the Mirai onslaught? Here’s a simple breakdown.</p><p><strong>1. Fortify the Digital Ramparts:</strong></p><p>To withstand a DDoS attack, one must fortify the digital ramparts. This involves deploying robust firewalls and intrusion prevention systems. It’s like having sturdy gates and vigilant guards to filter out the malicious hordes. Dyn could have invested in advanced security measures to detect and deflect the incoming storm.</p><p><strong>2. Embrace Traffic Filtering:</strong></p><p>Imagine sifting through a heap of rubble to find a hidden gem. In the digital world, traffic filtering is akin to separating the gems from the rubble. Dyn could have implemented stringent traffic filtering policies, identifying and blocking the malicious noise before it reached the critical servers.</p><p><strong>3. Seek Shelter in the Cloud:</strong></p><p>In the face of a digital storm, seeking shelter in the cloud can be a game-changer. Cloud-based services offer scalability and redundancy, dispersing the load across multiple servers. Dyn might have considered migrating its critical infrastructure to cloud platforms, minimizing the impact of a concentrated DDoS attack.</p><p><strong>Guidelines for the Digital Guardians:</strong></p><p>Learning from the Dyn debacle, digital guardians must adhere to simple yet crucial guidelines to steer clear of the storm.</p><p><strong>1. Stay Vigilant:</strong></p><p>Vigilance is the cornerstone of digital defense. Regularly assess and update security protocols to stay one step ahead of evolving threats. It’s like tightening the bolts on the castle gates to ensure they can withstand the battering ram.</p><p><strong>2. Collaborate and Share Intel:</strong></p><p>In the digital realm, solidarity is strength. Digital guardians should collaborate and share threat intelligence. It’s like neighboring castles warning each other of approaching invaders. Information sharing can help preemptively prepare for potential attacks.</p><p><strong>3. Conduct Regular Drills:</strong></p><p>Preparedness is born from practice. Digital guardians should conduct regular DDoS attack drills, simulating various scenarios to test the resilience of their defenses. It’s like a fire drill for the digital age, ensuring everyone knows what to do when the alarm sounds.</p><p>In the evolving saga of cyber warfare, the Dyn DDoS attack remains a cautionary tale. It emphasizes the need for digital fortifications, vigilant guardians, and a proactive stance against the unseen threats that lurk in the digital shadows. As we navigate the digital frontier, the lessons from Dyn serve as a compass, guiding us away from the pitfalls of complacency and into the realm of fortified resilience.</p><p><strong>Real-world Example: Amazon Web Services (AWS) — Navigating the Storm in the Cloud (2020)</strong></p><p>In the digital clouds that power our online lives, even giants like Amazon Web Services (AWS) are not immune to the tempests of Distributed Denial of Service (DDoS) attacks. In February 2020, AWS faced a digital deluge, the largest ever recorded, with a peak of 2.3 terabytes per second (Tbps). This onslaught, powered by a Connectionless Lightweight Directory Access Protocol (CLDAP) reflection attack, left an indelible mark on the digital landscape.</p><p><strong>The AWS DDoS Onslaught:</strong></p><p>Imagine AWS as the bustling city in the digital sky, providing shelter to countless digital entities. Now, picture a storm rolling in, not with thunder and lightning, but with a relentless torrent of data. This was the AWS DDoS attack of 2020, a storm that peaked at a staggering 2.3 Tbps, targeting a specific, yet unnamed AWS customer.</p><p>The attackers employed a CLDAP reflection attack, a tactic akin to using mirrors to amplify sunlight. In the digital realm, they exploited vulnerabilities in the CLDAP protocol to magnify their attack, overwhelming the target with a tsunami of data requests. The scale of the attack was unprecedented, challenging even the mighty infrastructure of AWS.</p><p><strong>Mitigating the Storm:</strong></p><p>In the face of this digital maelstrom, AWS was not left defenseless. The cloud giant had erected digital bulwarks in the form of DDoS protection services. Picture these as virtual shields that can deflect the arrows of a digital siege. While the financial loss from the attack remains unknown, the fact that AWS could mitigate an assault of such magnitude underscores the importance of robust defenses.</p><p><strong>Preventing the Onslaught:</strong></p><p>In the aftermath of this gargantuan attack, the question arises — how could AWS have fortified its virtual citadel against the CLDAP reflection assault? Here’s a glimpse into the realm of prevention.</p><p><strong>1. Strengthening Protocols:</strong></p><p>In the digital realm, protocols are like the rules of engagement. Strengthening protocols, such as CLDAP in this case, involves patching vulnerabilities and fortifying the digital handshake. AWS could enhance the robustness of its protocols, making it harder for attackers to exploit weaknesses.</p><p><strong>2. Scaling Defenses with Traffic Analysis:</strong></p><p>Imagine traffic lights that can analyze the flow of vehicles and adapt in real-time. In the digital world, AWS could employ advanced traffic analysis tools. These tools would scrutinize incoming data traffic, identifying patterns indicative of an impending attack. By scaling defenses based on this analysis, AWS could potentially thwart attacks before they reach peak intensity.</p><p><strong>3. Redundancy in the Cloud:</strong></p><p>In the cloud, redundancy is resilience. AWS could enhance its defense strategy by dispersing critical infrastructure across multiple servers and geographic regions. This redundancy ensures that even if one node succumbs to an attack, others stand ready to shoulder the load, maintaining service continuity.</p><p><strong>Guidelines for the Digital Skykeepers:</strong></p><p>Learning from the AWS encounter with the digital tempest, guidelines emerge for those entrusted with safeguarding the digital skies.</p><p><strong>1. Invest in Advanced Defenses:</strong></p><p>The digital guardians of cloud services should invest in advanced DDoS protection services. It’s like having a digital shield that can adapt to evolving threats, ensuring the resilience of the virtual city against unforeseen storms.</p><p><strong>2. Continuous Vigilance:</strong></p><p>Vigilance is the sentinel on the virtual watchtower. Regularly assess and update security measures, keeping a watchful eye on emerging threats. It’s like maintaining a sturdy umbrella in the digital downpour, ready to shield against unexpected storms.</p><p><strong>3. Collaborate for Collective Defense:</strong></p><p>In the interconnected realm of cloud services, collaboration is strength. Digital skykeepers should collaborate and share threat intelligence, creating a united front against potential assaults. It’s like neighboring cities pooling resources to withstand a common threat.</p><p>In the ever-expanding skies of the digital frontier, the AWS DDoS encounter serves as a testament to the importance of constant vigilance and fortified defenses. As we navigate these virtual clouds, the lessons learned become beacons, guiding the way to a resilient and secure digital future.</p><p><strong>Real-world Example: GitHub — Weathering the Digital Storm (2018)</strong></p><p>In the digital landscape where lines of code build the foundations of our online world, GitHub stands as a fortress. However, in December 2018, this coding sanctuary faced a relentless onslaught — a Distributed Denial of Service (DDoS) attack that lasted three days. The attack, a HTTP flood attack, surged to a peak of 1.35 terabytes per second (Tbps), causing a disruption that rippled through the digital corridors and resulting in an estimated loss of $1.3 million. The assailants behind this digital tempest were identified as the notorious hacking group Fancy Bear.</p><p><strong>The GitHub DDoS Onslaught:</strong></p><p>Envision GitHub as a vast library where developers gather to share and collaborate on code. In December 2018, this digital haven became the target of a HTTP flood attack. Picture it as a floodgate suddenly opened, inundating GitHub with a massive surge of seemingly legitimate web requests.</p><p>The attack, attributed to Fancy Bear, a group notorious for its cyber exploits, peaked at a staggering 1.35 Tbps. For three days, GitHub grappled with the digital deluge, and the disruption was palpable. Services were hampered, the usual flow of collaboration interrupted, and the financial toll reached an estimated $1.3 million.</p><p><strong>Mitigating the Digital Deluge:</strong></p><p>In the face of this prolonged and intense digital storm, GitHub employed measures to mitigate the impact. The details of the defense strategies used are not extensively disclosed, but it is acknowledged that GitHub’s response was swift, showcasing the importance of a robust defense in the digital realm.</p><p><strong>Preventing the Onslaught:</strong></p><p>Reflecting on this formidable attack, one might wonder how GitHub could have strengthened its digital bastion against the Fancy Bear assault. Let’s glimpse into the realm of prevention.</p><p><strong>1. Traffic Filtering and Rate Limiting:</strong></p><p>Imagine a vigilant guard at the entrance of a bustling market, ensuring only a manageable flow of people enter. In the digital world, GitHub could implement robust traffic filtering and rate-limiting mechanisms. By distinguishing between legitimate and malicious traffic and setting limits on incoming requests, GitHub could potentially thwart the scale of the HTTP flood.</p><p><strong>2. Scalable Infrastructure:</strong></p><p>In the virtual realm, scalability is resilience. GitHub could enhance its infrastructure to scale dynamically in response to increased traffic. Imagine a library that magically expands its shelves when a horde of readers arrives. A scalable infrastructure ensures that the services remain accessible even during a surge in traffic.</p><p><strong>3. Collaborative Threat Intelligence:</strong></p><p>In the interconnected landscape of cybersecurity, collaboration is key. GitHub, like a vigilant neighborhood watch, could engage in collaborative threat intelligence sharing. This involves sharing insights and warnings about potential threats with other platforms. A united front against cyber adversaries strengthens the overall resilience of the digital community.</p><p><strong>Guidelines for Digital Fortresses:</strong></p><p>As the echoes of the GitHub DDoS attack resonate in the digital corridors, guidelines emerge for those entrusted with guarding digital fortresses against similar onslaughts.</p><p><strong>1. Vigilance and Rapid Response:</strong></p><p>Vigilance is the watchword of digital guardians. Regularly monitor traffic patterns and respond swiftly to anomalies. It’s akin to a librarian spotting a sudden rush of visitors and taking immediate action to ensure order.</p><p><strong>2. Continuous Improvement of Defenses:</strong></p><p>In the dynamic realm of cybersecurity, continuous improvement is paramount. Regularly update and enhance defense mechanisms to stay ahead of evolving threats. It’s like reinforcing the walls of a fortress to withstand new methods of attack.</p><p><strong>3. Learn from the Past:</strong></p><p>The GitHub DDoS episode is a valuable chapter in the digital archives. Digital guardians should learn from such incidents, analyzing the strategies employed, and fortify their defenses accordingly. It’s like a seasoned general studying past battles to refine tactics for future conflicts.</p><p>In the ever-evolving landscape of cyber threats, the GitHub DDoS encounter serves as a stark reminder of the importance of vigilance, collaboration, and fortified defenses. As digital fortresses continue to stand tall, the lessons from this encounter become keystones, reinforcing the walls against the unseen storms that may loom on the digital horizon.</p><p><strong>The Digital Tsunami: Unraveling the Fallout of DDoS Attacks on Businesses</strong></p><p>In the vast expanse of the digital marketplace, a shadowy threat looms — the Distributed Denial of Service (DDoS) attack. This digital tempest, while often invisible, leaves an indelible mark on businesses, triggering a cascade of consequences that reverberate far beyond the virtual realm.</p><p><strong>1. Downtime:</strong></p><p>Imagine a storefront suddenly shuttered, the lights turned off, and the doors locked. This is the immediate aftermath of a successful DDoS attack — downtime. Businesses rely on constant accessibility for their digital storefronts, websites, and services. A DDoS attack disrupts this flow, rendering the digital avenues inaccessible to customers. It’s akin to a “Closed” sign hanging on the door, turning away potential visitors.</p><p><strong>2. Revenue Loss:</strong></p><p>In the digital marketplace, time is money. When a business grapples with downtime due to a DDoS attack, the financial toll is swift and substantial. Customers unable to access services mean transactions halted, and revenue streams dry up. It’s like a shopkeeper standing idle while potential customers turn away. The estimated losses can escalate rapidly, leaving businesses counting the costs long after the virtual storm has passed.</p><p><strong>3. Damage to Brand Reputation:</strong></p><p>Trust is the currency of the digital era. A DDoS attack doesn’t just interrupt services; it tarnishes the brand’s reputation. Customers, frustrated by the unavailability of services, may question the reliability and security of the business. It’s like a crack in the storefront window, casting doubt on the overall integrity of the establishment. Rebuilding trust becomes a formidable task, as the shadows of the digital storm linger in the minds of customers.</p><p><strong>4. Potential Legal Implications:</strong></p><p>In the wake of a DDoS attack, businesses may find themselves navigating treacherous legal waters. Customers, partners, and stakeholders may seek restitution for financial losses incurred during the downtime. The legal implications can be akin to a tempestuous sea, with businesses facing lawsuits and regulatory scrutiny. The aftermath of a DDoS attack extends beyond the digital realm, with legal battles becoming an unwelcome consequence.</p><p><strong>5. Broader Economic Impact:</strong></p><p>Zooming out from individual businesses, the economic impact of widespread DDoS attacks paints a picture of systemic disruption. In a connected ecosystem, the ripple effects are felt across industries. Imagine a chain reaction where disrupted businesses affect suppliers, service providers, and even the broader economy. The fallout is not confined to individual storefronts; it permeates the interconnected web of commerce, influencing economic stability on a larger scale.</p><p>In this digital age, where businesses thrive or wither based on their online presence, the consequences of DDoS attacks are profound. The immediate impact of downtime and revenue loss can cripple a business. The lasting effects on brand reputation and potential legal battles cast a long shadow. When these storms become widespread, the economic fabric begins to unravel, revealing the interconnected vulnerability of the digital marketplace.</p><p>As businesses continue to build their digital fortresses, the lessons from the aftermath of DDoS attacks serve as blueprints for resilience. In a landscape where trust is fragile and downtime is costly, businesses must fortify their defenses, not only for their own survival but for the collective stability of the digital economy.</p><p><strong>Case Studies of Successful Prevention:</strong></p><p><strong>Guardians of the Virtual Realm: Prevailing Against DDoS Assaults</strong></p><p>In the ever-evolving landscape of cyber threats, tales emerge of businesses thwarting the ominous specter of Distributed Denial of Service (DDoS) attacks. One such digital paragon is Google Cloud, a fortress in the cloud that successfully navigated a colossal DDoS assault in 2018, setting a precedent for resilience in the face of virtual tempests.</p><p><strong>The Battleground in the Cloud:</strong></p><p>Google Cloud, a colossal presence in the digital skies, faced a formidable adversary — a DDoS attack that loomed larger than any seen before, peaking at a staggering 2.5 terabytes per second (Tbps). This wasn’t just an attack; it was a virtual tsunami aimed at inundating the cloud provider. The assailants sought to breach the fortress and disrupt the services that countless businesses depend on.</p><p><strong>Swift and Robust Defense:</strong></p><p>In the face of this digital juggernaut, Google Cloud stood firm. The key to their success lay in a combination of swift response and robust defense mechanisms. Like a well-drilled army, their defenses adapted to the scale of the attack. It wasn’t just about weathering the storm; it was about actively repelling the onslaught.</p><p><strong>Advanced DDoS Protection Offering:</strong></p><p>At the heart of Google Cloud’s resilience was its advanced DDoS protection offering. This wasn’t a mere digital shield; it was a sophisticated defense system designed to detect, analyze, and deflect malicious traffic. Picture it as a guardian at the gates, equipped with the ability to distinguish between legitimate visitors and the horde of digital invaders.</p><p><strong>Scalability and Redundancy:</strong></p><p>In the virtual battleground, scalability is synonymous with resilience. Google Cloud’s infrastructure was not a static fortress; it could scale dynamically to absorb the impact of the attack. This scalability acted as a virtual bulwark, distributing the load across multiple servers to ensure that no single point bore the full brunt of the assault.</p><p>Moreover, redundancy played a pivotal role. Imagine a city with multiple entrances; if one gate falls, others remain standing. Google Cloud’s redundant infrastructure ensured that even if one node succumbed to the attack, others seamlessly took over, maintaining business continuity.</p><p><strong>Continuous Vigilance and Adaptive Measures:</strong></p><p>The key to triumphing over DDoS attacks lies in constant vigilance and adaptability. Google Cloud’s defenders didn’t rest on their laurels; they continuously monitored the evolving threat landscape. When faced with the unprecedented scale of the 2.5 Tbps attack, they adapted their defense strategies in real-time. It’s akin to a vigilant watchtower adjusting its focus to spot threats on the horizon.</p><p><strong>Lessons for the Digital Defenders:</strong></p><p>As we unravel the narrative of Google Cloud’s triumph over the digital Goliath, several lessons emerge for businesses navigating the cyber frontier.</p><p><strong>1. Invest in Advanced DDoS Protection:</strong></p><p>A robust defense begins with advanced DDoS protection. Businesses should invest in solutions that go beyond the basics, offering a comprehensive shield against evolving threats. It’s like arming the fortress with state-of-the-art weaponry to repel digital marauders.</p><p><strong>2. Prioritize Scalability and Redundancy:</strong></p><p>In the digital realm, scalability and redundancy are the twin pillars of resilience. Businesses should build infrastructures capable of scaling dynamically and dispersing the load. It’s like constructing a city with multiple paths, ensuring that the closure of one route doesn’t paralyze the entire operation.</p><p><strong>3. Stay Vigilant and Adaptive:</strong></p><p>Vigilance is the linchpin of digital defense. Regularly monitor traffic patterns, stay abreast of emerging threats, and adapt defense strategies accordingly. It’s akin to maintaining a vigilant sentinel, adjusting the focus of the watchtower to spot potential threats.</p><p>In the digital saga of thwarting DDoS attacks, Google Cloud stands as a beacon of resilience. As businesses navigate the cyber seas, the lessons from this encounter become guiding stars, illuminating the path to a secure and unwavering digital future.</p><p><strong>Conclusion:</strong></p><p>In the ever-shifting landscapes of the digital frontier, the tales of triumph and tribulation against Distributed Denial of Service (DDoS) attacks echo through the virtual canyons. From the cataclysmic disruptions faced by GitHub to the unyielding resilience of Google Cloud, these stories paint a vivid picture of the digital battles waged by businesses in the cyber realms.</p><p>When the virtual tempests strike, downtime becomes a silent adversary, revenue trickles to a halt, and brand reputations sway in the turbulent winds. The impact transcends the individual, casting shadows on the broader economic fabric where interconnected businesses navigate the digital tides.</p><p>Yet, amidst the digital storms, there are beacons of hope and lessons learned. The likes of Google Cloud, standing against a 2.5 Tbps onslaught, showcase the power of robust defenses, advanced DDoS protection, and a vigilant adaptability that mirrors a watchful sentinel adjusting its gaze.</p><p>As businesses continue to fortify their digital bastions, the experiences of GitHub and Google Cloud become guiding stars. Traffic filtering, rate limiting, scalability, and redundancy emerge as the fundamental bricks in the construction of resilient digital fortresses. It’s not about complex jargon or elaborate strategies; it’s about simple, effective defenses that stand the test of virtual tempests.</p><p>In the digital chronicles of DDoS encounters, these narratives serve as compass points for businesses navigating the cyber seas. The digital defenders learn from each clash, refining their tactics, and fortifying their defenses. The journey continues, where vigilance, adaptability, and a commitment to resilience become the constants in the ever-evolving saga of safeguarding the virtual realms against the unseen storms that may linger on the horizon.</p><p><strong>Reference</strong></p><p>· Nazario, J., 2008. DDoS attack evolution. <em>Network Security</em>, <em>2008</em>(7), pp.7–10.</p><p>· Douligeris, C. and Mitrokotsa, A., 2004. DDoS attacks and defense mechanisms: classification and state-of-the-art. <em>Computer networks</em>, <em>44</em>(5), pp.643–666.</p><p>· Zaroo, P., 2002. A survey of DDoS attacks and some DDoS defense mechanisms. <em>Advanced Information Assurance (CS 626)</em>.</p><p>· Somani, G., Gaur, M.S., Sanghi, D., Conti, M. and Buyya, R., 2017. DDoS attacks in cloud computing: Issues, taxonomy, and future directions. <em>Computer Communications</em>, <em>107</em>, pp.30–48.</p><p>· Mahjabin, T., Xiao, Y., Sun, G. and Jiang, W., 2017. A survey of distributed denial-of-service attack, prevention, and mitigation techniques. <em>International Journal of Distributed Sensor Networks</em>, <em>13</em>(12), p.1550147717741463.</p><p>· Hoque, N., Bhattacharyya, D.K. and Kalita, J.K., 2015. Botnet in DDoS attacks: trends and challenges. <em>IEEE Communications Surveys &amp; Tutorials</em>, <em>17</em>(4), pp.2242–2270.</p><p>· Dyn (2016) — A Digital Avalanche and the Quest for Defense: <a href="https://en.wikipedia.org/wiki/DDoS_attacks_on_Dyn">https://en.wikipedia.org/wiki/DDoS_attacks_on_Dyn</a></p><p>· largest DDoS attack ever recorded <a href="https://www.theverge.com/2020/6/18/21295337/amazon-aws-biggest-ddos-attack-ever-2-3-tbps-shield-github-netscout-arbor">https://www.theverge.com/2020/6/18/21295337/amazon-aws-biggest-ddos-attack-ever-2-3-tbps-shield-github-netscout-arbor</a></p><p>GitHub — Weathering the Digital Storm (2018) <a href="https://medium.com/technology-hits/how-github-survived-the-biggest-ddos-attack-ever-recorded-6907ba6f5c98">https://medium.com/technology-hits/how-github-survived-the-biggest-ddos-attack-ever-recorded-6907ba6f5c98</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*2ubKPeAUtKlJO7cG.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2e2b5f0deba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Configuration Manager — Helm]]></title>
            <link>https://nischalvooda.medium.com/kubernetes-configuration-manager-helm-bd3c0d593a87?source=rss-39d520c4c1f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd3c0d593a87</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Nischal Vooda]]></dc:creator>
            <pubDate>Sat, 27 Aug 2022 13:32:15 GMT</pubDate>
            <atom:updated>2022-08-27T13:32:15.691Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Configuration Manager — Helm</h3><p>For example, to deploy the Nginx-alpine application 4 resource manifests were necessary: Namespace, Deployment, Service, and Configmap. However, this suite of manifests represents the deployment to a single environment, e.g sandbox. The application should be propagated through staging and production environment, which reference a separate set of manifests. It is essential to ensure that the application configuration is tailored for each environment, such as allocating more CPU and memory to the application in production since it handles more traffic or has a different number of replicas for each cluster. In this case, an engineering team ends up managing 3 sets of manifests, 1 for each cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*73QXv5ogLkmgv7xd" /></figure><p>However, the number of manifests grows exponentially when the application is distributed across multiple regions. As such, if the application is released in AP(Asia Pacific) and the US, a team ends up managing 9 different sets of manifests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fzphdj-IgH5ks4wP" /></figure><p>To Solve the challenge to manage multiple manifests we can take the help of Configuration Management tools like Helm</p><p>Helm is a package manager, that manages Kubernetes configuration with Charts. A Helm chart is a collection of YAML files that describe the state of multiple Kubernetes resources. These files can be parametrized using the Go template.</p><p>Pre-Configuration:</p><ol><li>Kubernetes Cluster</li><li>Helm</li></ol><p>Helm Chart</p><p>A Helm chart is composed of the following files:</p><pre>.<br>├── Chart.yaml<br>├── templates<br>│   ├── configmap.yaml<br>│   ├── deployment.yaml<br>│   ├── namespace.yaml<br>│   └── service.yaml<br>├── values-prod.yaml<br>├── values-staging.yaml<br>└── values.yaml</pre><ul><li>Chart.yaml — expose chart details, such as description, version, and dependencies</li><li>templates/ folder — contains templates YAML manifests for Kubernetes resources</li><li>values.yaml — default input configuration file for the chart. If no other values file is supplied, the parameters in this file will be used.</li></ul><blockquote><em>Chart.yaml</em></blockquote><p>A Chart.yaml file contains the apiVersion, description, description, version, and maintainer details.</p><p>Let’s take this as an example we are going to deploy Nginx deployment on Kubernetes with Helm</p><pre>apiVersion: v1<br>name: nginx-deployment<br>description: Install Nginx deployment manifests<br>keywords:<br>- nginx<br>version: 1.0.0<br>maintainers:<br>- name: siva naik<br>  email: sivanaikk0903@gmail.com</pre><ul><li>version is the version of the Chart</li></ul><blockquote><em>templates directory</em></blockquote><p>The templates directory contains the templated manifest files of Kubernetes resources. The template files expect the input, we pass inputs with values files</p><pre>templates/<br>├── configmap.yaml<br>├── deployment.yaml<br>├── namespace.yaml<br>└── service.yaml</pre><ul><li>configmap.yaml is contains the manifest to create a config map</li></ul><pre>apiVersion: v1<br>data:<br>  {{ .Values.configmap.data }}<br>  #version: alpine<br>kind: ConfigMap<br>metadata:<br>  name: nginx-version<br>  namespace: {{ .Values.namespace.name }}</pre><p>The values in {{ .. }} syntax are the variables. we have to give the reference of variables present in values.yaml file</p><p>The Value for the variable namespace is from the file under the namespace block as the name. These manifests can be templated using Go template. For example, instead of hardcoding the name of the Namespace, it can be parameterized as follows:</p><pre>namespace: {{ .Values.namespace.name }}</pre><ul><li>namespace.yaml</li></ul><p>Namespace file contains the manifest for Kubernetes namespace for Nginx.</p><pre>apiVersion: v1<br>kind: Namespace<br>metadata:<br>  labels:<br>    tier: test<br>  name: {{ .Values.namespace.name }}</pre><ul><li>service.yaml</li></ul><p>This file contains the manifest to create a service in Kubernetes</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  labels:<br>    app: nginx<br>    tag: alpine<br>  name: nginx-alpine<br>  namespace: {{ .Values.namespace.name }}<br>spec:<br>  ports:<br>  - port: {{ .Values.service.port }}<br>    protocol: TCP<br>    targetPort: {{ .Values.service.port }}<br>  selector:<br>    app: nginx<br>    tag: alpine<br>  type: {{ .Values.service.type }}</pre><ul><li>deployment.yaml</li></ul><p>This file has the manifest to create Nginx deployment</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  labels:<br>    app: nginx<br>    tag: alpine<br>  name: nginx-alpine<br>  namespace: {{ .Values.namespace.name }}<br>spec:<br>  replicas: {{ .Values.replicaCount }}<br>  selector:<br>    matchLabels:<br>      app: nginx<br>      tag: alpine<br>  strategy:<br>    rollingUpdate:<br>      maxSurge: 25%<br>      maxUnavailable: 25%<br>    type: RollingUpdate<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx<br>        tag: alpine<br>    spec:<br>      containers:<br>      - image: {{ .Values.image.repository }}:{{ .Values.image.tag }}<br>        imagePullPolicy: {{ .Values.image.pullPolicy }}<br>        name: nginx-alpine<br>        resources:<br>{{ toYaml .Values.resources | indent 12 }}</pre><blockquote><em>values.yaml file</em></blockquote><p>The values.yaml file contains default input parameters for a Helm chart. The parameters are consumed by the templated YAML manifests through the .Values object.</p><p>We can use multiple values files to pass as arguments based on the environment where we are going to deploy. Let’s say sandbox, stagging, and production.</p><ul><li>values.yaml</li></ul><pre>namespace:<br>  name: demo<br></pre><pre>service:<br>  port: 8111<br>  type: ClusterIP<br></pre><pre>image:<br>  repository: nginx<br>  tag: alpine<br>  pullPolicy: IfNotPresent<br></pre><pre>replicaCount: 3<br></pre><pre>resources:<br>  requests:<br>    cpu: 50m<br>    memory: 256Mi<br></pre><pre>configmap:<br>  data: &quot;version: alpine&quot;</pre><ul><li>values-staging</li></ul><pre>namespace:<br>  name: staging<br></pre><pre>service:<br>  port: 8111<br>  type: ClusterIP<br></pre><pre>image:<br>  repository: nginx<br>  tag: 1.18.0<br>  pullPolicy: IfNotPresent<br></pre><pre>replicaCount: 1<br></pre><pre>resources:<br>  requests:<br>    cpu: 50m<br>    memory: 128Mi<br></pre><pre>configmap:<br>  data: &quot;version: 1.18.0&quot;</pre><ul><li>values-prod.yaml</li></ul><pre>namespace:<br>  name: prod<br></pre><pre>service:<br>  port: 80<br>  type: ClusterIP<br></pre><pre>image:<br>  repository: nginx<br>  tag: 1.17.0<br>  pullPolicy: IfNotPresent<br></pre><pre>replicaCount: 2<br></pre><pre>resources:<br>  requests:<br>    cpu: 70m<br>    memory: 256Mi<br></pre><pre>configmap:<br>  data: &quot;version: 1.17.0&quot;</pre><p>The values files have different values based on the environment in the resource are deployed</p><p>Let’s Install the Helm chart we created</p><pre>helm install  [name]  [ helm chart path ]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P4tnT5rf4uPkfyzh" /></figure><ul><li>list installed helm charts</li></ul><pre>helm list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tMUSgIQJI_EJec14" /></figure><p>Thank you!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*GbdqNBwlQcL1qst7qB6m1Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd3c0d593a87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate Kubernetes Cluster Using Ansible and launching WordPress MySQL]]></title>
            <link>https://nischalvooda.medium.com/automate-kubernetes-cluster-using-ansible-and-launching-wordpress-mysql-307deff4bef2?source=rss-39d520c4c1f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/307deff4bef2</guid>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Nischal Vooda]]></dc:creator>
            <pubDate>Sat, 27 Aug 2022 13:29:22 GMT</pubDate>
            <atom:updated>2022-08-27T13:29:22.316Z</atom:updated>
            <content:encoded><![CDATA[<h3>Task Description:-</h3><p>📌 Automate Kubernetes Cluster Using Ansible</p><p>🔅 Launch ec2-instances on AWS Cloud eg. for master and slave.</p><p>🔅 Create roles that will configure the master node and slave node separately.</p><p>🔅 Launch a WordPress and MySQL database connected to it in the respective slaves.</p><p>🔅 Expose the WordPress pod and the client is able to hit the WordPress IP with its respective port.</p><p>So let’s begin with the launching of the ec2 instance</p><p>Step 1:- Launching ec2 instance using Ansible</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fVXklyKw3I1rRLaV" /></figure><h3>Step 2:- Let’s launch the K8s master and Slave using Ansible</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HRb-v_t5XRxclNcW" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AIqxAqJJ-eFPDh0z" /></figure><h3>now lets launch slave</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JcqsqEq8koDL7Snd" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MxlKILlBUoasmRjM" /></figure><h3>Step 3:- Let’s launch the WordPress and SQL database</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ki86wY5mPRLQZ3Ek" /></figure><p>let’s run the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8LktJ38nj-Ibre1D" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Tinmngc6zp-lEwgC" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tOMEsZZ6nCU-WZlk" /></figure><h3>Step 4:- let’s connect to our WordPress account</h3><pre>Publicip of slave :port no</pre><p>In my case it is</p><pre>ip of slave:32130</pre><p>This above port can differ as in the above image we can see it is 32130 in highlighted external ip so you can check your port with the same command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3hfW_FmGimPtIX1u" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bTf0z2MxaGy4fxti" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LaJlYu25Dr8LjxUb" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D6XLBSu69dF2sRoq" /></figure><p>Let’s configure the things here we need to provide the database Host it is the IP of the database pod.</p><p>we get IP while running the playbook for installation of WordPress and MySQL database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l3u-yH2yatBCXXkx" /></figure><p>from here but in my case it is in creating state only so i login to the master and taken the IP from it using Kubernetes command</p><pre>kubectl get pods -o wide</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zQROp3aFhw01lzBr" /></figure><p>here we get the IP for the database so that it copy-paste the IP and that it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XZn2wQdaCUBvRF0I" /></figure><p>provide the details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_NYCi0WWYeqFxN_Q" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dZAKBg5c9WVRLQhO" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zRJ6Dz6ha2hJE9U3" /></figure><p>and that its. done!!</p><p>Hope you like it.</p><p>for Any Suggestions or difficulties DM me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*GbdqNBwlQcL1qst7qB6m1Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=307deff4bef2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Run GUI Software on Docker Container]]></title>
            <link>https://nischalvooda.medium.com/run-gui-software-on-docker-container-426480a0eb6?source=rss-39d520c4c1f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/426480a0eb6</guid>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Nischal Vooda]]></dc:creator>
            <pubDate>Sat, 27 Aug 2022 13:26:44 GMT</pubDate>
            <atom:updated>2022-08-27T13:26:44.609Z</atom:updated>
            <content:encoded><![CDATA[<h3>Task Description -</h3><p>Run a Docker container that can run GUI (Graphical User Interface) Programs</p><ol><li>Launch a container on docker in GUI mode.</li><li>Run any GUI software on the container</li></ol><h3>Prerequisite</h3><ol><li>Docker Installed on your system.</li><li>Docker Host should be GUI-based.</li></ol><p>Note: I’m Using RedHat Enterprise Linux V8 in this practical.</p><blockquote><em>What is Docker?</em></blockquote><p>Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production. (source: <a href="https://docs.docker.com/get-started/overview/">docs.docker.com</a>)</p><p>Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allow you to run many containers simultaneously on a given host. Containers are lightweight and contain everything needed to run the application, so you do not need to rely on what is currently installed on the host. You can easily share containers while you work, and be sure that everyone you share with gets the same container that works in the same way.</p><blockquote><em>Developing with Docker</em></blockquote><p>Developing apps today requires so much more than writing code. Multiple languages, frameworks, architectures, and discontinuous interfaces between tools for each lifecycle stage create enormous complexity. Docker simplifies and accelerates your workflow while giving developers the freedom to innovate with their choice of tools, application stacks, and deployment environments for each project.</p><h3>Problem</h3><p>Sometimes we need to run GUI programs in containers to debug or test the things but most of the people stuck there that How to run GUI programs in a docker container.</p><h3>So, Lets get Started</h3><p>It is very easy to run GUI programs in a docker container.</p><p>So, first, we have to Launch a Container from some base image, here I’m using the official centos Linux docker image. And while launching container give environment variable $DISPLAY to container and in Volume of container mount the path of x11 server/display. Give a name to your container and launch it.</p><pre>docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix/ --name GUIcontainer centos</pre><p>That’s all we need to do, Now we can Run any GUI program in this container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8IZGnN4YsSMXeuhC" /></figure><p>So, in this practical I’m gonna Run —</p><ol><li>Firefox (Web browser)</li><li>Jupyter notebook (python IDE)</li><li>Gedit (Text editor)</li></ol><blockquote><em>Run Firefox Web Browser</em></blockquote><p>Firefox is a Graphical user interface program. For this program we need a graphical display to Run.</p><p>So, first we have to install ‘Firefox’ browser in our launched container.</p><pre>yum install firefox -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5ktvgt3AYqY2r0Ci" /></figure><p>Install Firefox browser</p><p>Now, Run ‘firefox’ command to launch browser.</p><pre>firefox</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g6xP9evOtLkHxiEC" /></figure><blockquote><em>Run Jupyter Notebook</em></blockquote><p>For launching ‘Jupyter notebook’ we need ‘python3’ interpreter/package to be installed in container. so, first install python package by running below command.</p><pre>yum install python3 -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bf3i7w2KImoXn9CL" /></figure><p>Now, through ‘pip3’ command install ‘jupyterlab’ for jupyter notebook.</p><pre>pip3 install jupyterlab</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VoztUkZLVKw10Rzu" /></figure><p>Install ‘jupyterlab’</p><p>Now after installing ‘jupyterlab’ Run ‘jupyter notebook’.</p><p>Here see carefully, we have to run ‘jupyter notebook’ with root privilege, by adding ‘ — allow-root’ option in ‘jupyter notebook’ command.</p><pre>jupyter notebook --allow-root</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kABydwOBp5Giy34d" /></figure><p>Here, we can see jupyter notebook is launched successfully. we can write our python code here and Run it very easily.</p><p>Jupyter notebook is a web app, this is why it launched in ‘Firefox’ browser, that’s why we need to install Firefox browser before running jupyter notebook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kyHicegtItZuJjv1" /></figure><blockquote><em>Launch Gedit (Text Editor)</em></blockquote><p>Now install ‘gedit’ package in container. It is a GUI based Text editor.</p><pre>yum install gedit -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FTo9spRagvOcTg9N" /></figure><p>After Installing gedit, run it, and write anything whatever you want to write.</p><p>Using gedit text editor is very easy.</p><pre>####  gedit &lt;text_file_name&gt;  ####gedit docker</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UaI6gOztq8qkFZZb" /></figure><p>Write anything you want to write in this file and save it.</p><p>Here I have written a very simple python code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zfNBgosa93LCsjCK" /></figure><p>If you have written some code then you can execute/run it.</p><p>Or if you have written something else then you can see that by using ‘cat’ command or by again opening gedit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xLTTSrXcrBtowuVZ" /></figure><p>My python code is executed successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*GbdqNBwlQcL1qst7qB6m1Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=426480a0eb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ansible playbook that will update the Container IP (dynamically inventory) and Configure Webserver…]]></title>
            <link>https://nischalvooda.medium.com/ansible-playbook-that-will-update-the-container-ip-dynamically-inventory-and-configure-webserver-9e2c84a3153b?source=rss-39d520c4c1f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e2c84a3153b</guid>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Nischal Vooda]]></dc:creator>
            <pubDate>Sat, 27 Aug 2022 13:22:46 GMT</pubDate>
            <atom:updated>2022-08-27T13:22:46.169Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ansible playbook that will update the Container IP (dynamically inventory) and Configure Webserver inside the Container</h3><h3>Task Description:</h3><p>14.2 Further in ARTH — Task 10 have to create an Ansible playbook that will retrieve new Container IP and update the inventory. So that further Configuration of Webserver could be done inside that Container.</p><p>Task 10: <a href="https://gursimar27.medium.com/configure-web-server-in-docker-and-start-services-using-ansible-playbook-30cd8eaff22c">Configure Web Server in Docker and start services using Ansible Playbook | by Gursimar Singh | Medium</a></p><h3>Let’s jump into the task</h3><p><strong>Initially the inventory file is empty</strong></p><pre>$ vim /etc/ansible/ansible.cfg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/0*K-IxMPVloaJcucxm" /></figure><h3>Ansible Playbook for container setup and auto updating of the inventory file:</h3><pre>$ vim play.yml</pre><p>The playbook:</p><pre>- hosts: localhost<br>  vars_prompt:<br>    - name: container_name<br>      prompt: &quot;Docker Container Name:&quot;<br>      private: no<br>  vars:<br>          - image_name: centos:v1<br>  tasks:<br>    - name: Creating Repo for yum<br>      yum_repository:<br>        name: docker<br>        file: docker<br>        description: Docker Yum Repo<br>        baseurl: <a href="https://download.docker.com/linux/centos/7/x86_64/stable/">https://download.docker.com/linux/centos/7/x86_64/stable/</a><br>        gpgcheck: no<br>    - name: Install Docker-CE<br>      command: &quot;yum install -y  docker-ce --nobest&quot;<br>    - name: starting docker services<br>      service:<br>        name: &quot;docker&quot;<br>        state: started<br>        enabled: yes<br>    - name: Installing Docker Library<br>      command: &quot;pip3 install docker-py&quot;<br>    - name: pull an image<br>      docker_image:<br>        name: &quot;{{ image_name }}&quot;<br>        source: pull<br>    - name: &quot;Launching {{ container_name }} Container&quot;<br>      docker_container:<br>        name: &quot;{{ container_name }}&quot;<br>        image: &quot;{{ image_name }}&quot;<br>        state: started<br>        interactive: yes<br>        detach: yes<br>        tty: yes<br>    - name: &quot;Container Info&quot;<br>      docker_container_info:<br>        name: &quot;{{ container_name }}&quot;<br>      register: docker_info- debug:<br>        var: docker_info.container.NetworkSettings.IPAddress<br>    - name: &quot;Retriving IP dynamically and updating in the inventory&quot;<br>      template:<br>        src: &quot;ip.txt&quot;<br>        dest: &quot;/root/dockerip.txt&quot;</pre><h3>Ansible Playbook to configure web page into the container:</h3><pre>$ vim web.yml</pre><p>The Playbook:</p><pre>- hosts: docker<br>  tasks:<br>    - name: &quot;Installing Httpd service&quot;<br>      package:<br>        name: &quot;httpd&quot;<br>        state: present- name: &quot;Creating html file&quot;<br>      copy:<br>        content : &quot;&lt;b&gt;&lt;center&gt;Webserver successfully configured&lt;/center&gt;&lt;/b&gt;&quot;<br>        dest: &quot;/var/www/html/index.html&quot;- name: &quot;Starting Httpd Service&quot;<br>      command: &quot;/usr/sbin/httpd&quot;</pre><h3>Lets Run the Playbooks:</h3><p>First let’s setup the container and set up the inventory file’</p><pre>$ ansible-playbook play.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jn4RWw3uIP3dRXxd" /></figure><p>Inventory file is dynamically updated:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/0*6OzD1m0htonxj8ho" /></figure><h3>Now, let’s setup the webserver</h3><pre>$ ansible-playbook web.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NNNggyA5oyua5tMb" /></figure><pre>&quot;&lt;IP&gt;/web.html&quot;</pre><p>We have successfully completed the task and we can verify it by opening the webpage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e2c84a3153b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ansible roles for configuring Apache Webserver and HAProxy LoadBalancer]]></title>
            <link>https://nischalvooda.medium.com/ansible-roles-for-configuring-apache-webserver-and-haproxy-loadbalancer-ba0fb2de12f2?source=rss-39d520c4c1f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba0fb2de12f2</guid>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Nischal Vooda]]></dc:creator>
            <pubDate>Sat, 27 Aug 2022 13:07:14 GMT</pubDate>
            <atom:updated>2022-08-27T13:07:14.131Z</atom:updated>
            <content:encoded><![CDATA[<p>Ansible roles are used to simplify Ansible playbook which means we can break a complex Ansible playbook in independent and reusable roles that are used to automatically load certain var_files, tasks, and handlers as per pre-defined file structure. We can call the roles in any Ansible playbook as it is reusable and independent of each other. We can also share the configuration template using roles easily. As mentioned roles need a standardized file structure that means at least one of the directories exists and must have a main.yml however we can remove other directories if not in use. The default location of roles is “/etc/ansible/roles”.</p><p>We have a command ‘ansible-galaxy init &lt;ROLE_NAME&gt;’ to create a role skeleton for us. It creates pre-defined directories structure and files as below:</p><p><strong>Syntax:</strong></p><p>$ ansible-galaxy init nginx_role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/0*xpjDm5mBOx___wn8.png" /></figure><p><strong>Explanation:</strong> In the above example, we have created a role called ‘nginx_role’ and used tree command to see the directories structure of the newly created role. Most of the directories have main.yml file that works as the entry point for correspondence directories of the role.</p><h3>Functions of Ansible Roles</h3><p>Let’s understand the functionality of each folder :</p><ul><li><strong>Tasks:</strong> We keep our tasks or the plays that will be performed by the roles however we can keep tasks in other folders separately as well for readability and better manageability and can be added to the roles using include if required. If this directory is being used in the role then it must contain main.yml.</li><li><strong>Vars:</strong> It stores variables that are used within the roles. It has the highest level of precedence and we can only override by passing variables via the command line (CLI). It also has a main.yml file.</li><li><strong>Defaults:</strong> It also stores the variables but default variables that mean it supposed to be changed while running the play however role is going to use the default variable if it is not defined or passed. It has the lowest level of precedence.</li><li><strong>Handlers:</strong> It contains handlers that may be flagged to run using the notify keyword, notify keyword-only flags the handler if a task makes changes and handler will be triggered only once besides notified by multiple tasks. It is not only used by the same roles in which it defined but anywhere outside that role.</li><li><strong>Files:</strong> The file directory contains static files that can be deployed via this role. It does not contain var files or templates as it is for simple ordinary files. We can reference the files within this directory without the path. It does not have the main.yml file in it.</li><li><strong>Templates:</strong> It contains templates that we can deploy via this role. It does not have the main.yml file as well.</li><li><strong>Meta: </strong>We can configure role dependencies and other configurations such as allow_duplicates etc.</li></ul><h3>What is HAproxy ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*V2-IuUKw0GQRcv5g.jpeg" /></figure><p>HAProxy is a free, amazingly fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for extremely high traffic web sites and powers quite a number of the world’s most visited ones. Over the years it has become the de-facto standard opensource load balancer, is now shipped with most mainstream Linux distributions, and is often deployed by default in cloud platforms. Its mode of operation makes its integration into existing architectures very easy and riskless, while still offering the possibility not to expose fragile web servers to the internet.</p><h3>Task Description :</h3><blockquote><em>Create an ansible role myapache to configure Httpd WebServer.</em></blockquote><blockquote><em>Create another ansible role myloadbalancer to configure HAProxy LB.</em></blockquote><blockquote><em>We need to combine both of these roles controlling webserver versions and solving challenge for host ip’s addition dynamically over each Managed Node in HAProxy.cfg file.</em></blockquote><h3>Let’s jump into the task:</h3><p>Let’s create a folder and set the roles path in the ansible configuration file,</p><pre>$ mkdir myroles$ vim /etc/ansible/ansible.cfg<br>  <br>     role_path=&lt;/path&gt;</pre><p>Let us create two ansible roles:</p><pre>$ ansible-galaxy init myapache$ ansible-galaxy init myloadbalancer</pre><p>Let us configure the myapache role,</p><pre>$ ls$ vim tasks/main.yml---<br>- name: &quot;Installing apache server&quot;<br>  package:<br>    name: &quot;{{ p_name }}&quot;<br>    state: present- name: &quot;Copying the webpage&quot;<br>  copy:<br>    src: files/index.html<br>    dest: /var/www/html/index.html<br>  register: x- name: &quot;Starting service&quot;<br>  service:<br>    name: &quot;{{ s_name }}&quot;<br>    state: started<br>  when: x.changed</pre><p>The variables used here are fetched from vars directory’s main.yml file:</p><pre>$ vim vars/main.yml---<br> p_name: &quot;httpd&quot;<br> s_name: &quot;httpd&quot;</pre><p><strong>Let’s move on to ”myloadbalancer” role to configure haproxy,</strong></p><pre>$ cd myroles/$ ls$ cd myloadbalancer/$ vim tasks/main.yml<br>---<br>- name: &quot;installing haproxy software&quot;<br>  package:<br>          name: &quot;{{ p_name }}&quot;<br>          state: present- name: &quot;setting up configuration file&quot;<br>  template:<br>          src: &quot;files/haproxy.cfg.j2&quot;<br>          dest: &quot;/etc/haproxy/haproxy.cfg&quot;- name: &quot;starting the firewalld services&quot;<br>  service:<br>          name: &quot;firewalld&quot;<br>          state: started- name: &quot;exposing the port of proxy&quot;<br>  firewalld:<br>          port: &quot;{{ port_no }}/tcp&quot;<br>          state: enabled<br>          permanent: yes<br>          immediate: yes- name: &quot; disabling selinux&quot;<br>  command: &quot;setenforce 0&quot;- name: &quot;starting service&quot;<br>  service:<br>          name: &quot;{{ s_name }}&quot;<br>          state: started<br>          enabled: yes</pre><p>The variables used here are fetched from vars directory’s main.yml file,</p><pre>$ vim vars/main.yml---<br>p_name: &quot;haproxy&quot;<br>s_name: &quot;haproxy&quot;<br>port_no: 8080</pre><p>Now, let’s configure the haproxy config file,</p><pre>$ vim  files/haproxy.cfg.j2#---------------------------------------------------------------------<br># Example configuration for a possible web application.  See the<br># full configuration options online.<br>#<br>#   <a href="https://www.haproxy.org/download/1.8/doc/configuration.txt">https://www.haproxy.org/download/1.8/doc/configuration.txt</a><br>#<br>#---------------------------------------------------------------------#---------------------------------------------------------------------<br># Global settings<br>#---------------------------------------------------------------------<br>global<br>    # to have these messages end up in /var/log/haproxy.log you will<br>    # need to:<br>    #<br>    # 1) configure syslog to accept network log events.  This is done<br>    #    by adding the &#39;-r&#39; option to the SYSLOGD_OPTIONS in<br>    #    /etc/sysconfig/syslog<br>    #<br>    # 2) configure local2 events to go to the /var/log/haproxy.log<br>    #   file. A line like the following can be added to<br>    #   /etc/sysconfig/syslog<br>    #<br>    #    local2.*                       /var/log/haproxy.log<br>    #<br>    log         127.0.0.1 local2chroot      /var/lib/haproxy<br>    pidfile     /var/run/haproxy.pid<br>    maxconn     4000<br>    user        haproxy<br>    group       haproxy<br>    daemon# turn on stats unix socket<br>    stats socket /var/lib/haproxy/stats# utilize system-wide crypto-policies<br>    ssl-default-bind-ciphers PROFILE=SYSTEM<br>    ssl-default-server-ciphers PROFILE=SYSTEM#---------------------------------------------------------------------<br># common defaults that all the &#39;listen&#39; and &#39;backend&#39; sections will<br># use if not designated in their block<br>#---------------------------------------------------------------------<br>defaults<br>    mode                    http<br>    log                     global<br>    option                  httplog<br>    option                  dontlognull<br>    option http-server-close<br>    option forwardfor       except 127.0.0.0/8<br>    option                  redispatch<br>    retries                 3<br>    timeout http-request    10s<br>    timeout queue           1m<br>    timeout connect         10s<br>    timeout client          1m<br>    timeout server          1m<br>    timeout http-keep-alive 10s<br>    timeout check           10s<br>    maxconn                 3000#---------------------------------------------------------------------<br># main frontend which proxys to the backends<br>#---------------------------------------------------------------------<br>frontend main<br>    bind *:{{ port_no }}<br>    acl url_static       path_beg       -i /static /images /javascript /stylesheets<br>    acl url_static       path_end       -i .jpg .gif .png .css .jsuse_backend static          if url_static<br>    default_backend             app#---------------------------------------------------------------------<br># static backend for serving up images, stylesheets and such<br>#---------------------------------------------------------------------<br>backend static<br>    balance     roundrobin<br>    server      static 127.0.0.1:4331 check#---------------------------------------------------------------------<br># round robin balancing between the various backends<br>#---------------------------------------------------------------------<br>backend app<br>    balance     roundrobin<br>   {% for ip in groups[&#39;webservers&#39;] %}<br>    server app {{  ip }}:80 check<br>   {% endfor %}</pre><p>Here we are using jinja2 embedded code for dynamically fetching the new webserver IP with HAproxy loadbalancer.</p><h3>Now let’s jump ahead to testing the roles we just created,</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*XE4Rg9eakI36WDZr.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*aZ1UDcHZisjxSio_.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*MnvrARbzXc9qDu2_.png" /></figure><h3>We successfully completed the task. We can verify it by running the web page.</h3><p><strong>We can notice the IP is switching even though the IP address which we are using at browser is same. This proves that the HAproxy is working fine.</strong></p><p>Now, let’s add one more IP address into the inventory file to check the handler added into the myloadbalancer role is working or not.</p><p>Let’s run the playbook again and check if the HAProxy server automatically adds the new target node in its configuration file or not.</p><p>Here, we can the tasks are changed for the new target node. Now, let us visit the HAproxy once again and check if it has recognized and updated its configuration file with the new target node or not.</p><p>From the output , we can see that IPs are switching, which means that the extra target node is also automatically added in the configuration file of HAproxy and new web page also copied into the target node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*GbdqNBwlQcL1qst7qB6m1Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba0fb2de12f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Chat App using Python and UDP]]></title>
            <link>https://nischalvooda.medium.com/creating-a-chat-app-using-python-and-udp-9513025855ff?source=rss-39d520c4c1f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/9513025855ff</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Nischal Vooda]]></dc:creator>
            <pubDate>Sat, 27 Aug 2022 13:04:15 GMT</pubDate>
            <atom:updated>2022-08-27T13:04:15.874Z</atom:updated>
            <content:encoded><![CDATA[<h3>Task Description</h3><p>Create your own chat servers, and establish a network to transfer data using socket programing by creating both server and client machines as sender and receiver. Do this program using the UDP data transfer protocol.</p><p>Use multi-threading concept to get and receive data parallelly from both the server sides. Observe the challenges that you face to achieve this using UDP.</p><h3>First, let us define a few terms</h3><p><em>In simple words, network programming means transferring data through the network.</em></p><h3>What is a Server?</h3><p>A server is either a program, a computer, or a device that is devoted to managing network resources. Servers can either be on the same device or computer or locally connected to other devices and computers or even remote. There are various types of servers such as database servers, network servers, print servers, etc.</p><h3>What is a Client?</h3><p>A client is either a computer or software that receives information or services from the server. In a client-server module, clients requests services from servers. The best example is a web browser such as Google Chrome, Firefox, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*lh8WuV6Fq6cc0v7P" /></figure><h3>Sockets</h3><p>Sockets are the backbone of networking. They make the transfer of information possible between two different programs or devices. For example, when we open up a browser, we as clients are creating a connection to the server for the transfer of information. A single network will have two sockets, one for each communicating device or program. These sockets are a combination of an IP address and a Port. A single device can have ’n’ number of sockets based on the port number that is being used.</p><h3>Some of the common methods,</h3><p><strong>socket()</strong>: This method is used to create the socket and takes two arguments first is a family or domain like AF_INET (IPv4) or INET6 (IPv6) and the second defines the type of sockets like SOCK_STREAM ( TCP ) or SOCK_DGRAM ( UDP ).</p><p><strong>bind()</strong>: This method is used to bind your socket with a specific host and port which will be passed as an argument to this function and that means your socket will be sitting at a specific location where the client socket can send its data.</p><p><strong>recvfrom()</strong>: This method can be used with a UDP server to receive data from a UDP client or it can be used with a UDP client to receive data from a UDP server. It accepts a positional parameter called <em>bufsize</em> which is the number of bytes to be read from the UDP socket. It returns a byte object read from a UDP socket and the address of the client socket as a tuple.</p><p><strong>sendto()</strong>: It is a method of Python’s socket class that is used to send datagrams to a UDP socket. The communication could be from either side. It could be from client to server or from the server to a client. The data to be sent must be in bytes format. If the data is in string format, the str. encode() method can be used to convert the strings to bytes. We must also pass a tuple consisting of IP address and port number.</p><h3>Socket Programming</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 the other socket reaches out to the other to form a connection. The server forms the listener socket while the client reaches out to the server.</p><h3>UDP:</h3><p>User Datagram Protocol (UDP) is a Transport Layer protocol. UDP is a part of the Internet Protocol suite, referred to as UDP/IP suite. Unlike TCP, it is an unreliable and connectionless protocol. So, there is no need to establish a connection prior to the data transfer.</p><h3>Features of UDP</h3><p>· Supports bandwidth-intensive applications that tolerate packet loss</p><p>· Less delay</p><p>· It sends the bulk quantity of packets.</p><p>· Possibility of data loss</p><p>· Allows small transaction (DNS lookup)</p><h3>Now, let’s jump right into the task</h3><p>First, let us look at the chatapp without multithreading</p><pre>import socket<br>import os<br>import time<br>from pyfiglet import Figletos.system(&quot;clear&quot;)<br>pyf = Figlet(font=&#39;puffy&#39;)<br>a = pyf.renderText(&quot;UDP Chat App without Multi-Threading&quot;)<br>os.system(&quot;tput setaf 3&quot;)<br>print(a)s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) <br>     <br>ip=input(&quot;Enter your IP: &quot;)<br>port=int(input(&quot;Enter your port number: &quot;))sendip=input(&quot;Enter sender IP: &quot;)<br>sendport=int(input(&quot;Enter sender port number: &quot;))s.bind((ip,port))while True:<br>  i=input(&quot;Enter your message:&quot;)<br>  s.sendto(i.encode(), (sendip,sendport))<br>  x=s.recvfrom(20)<br>  clientip=x[1][0]data=x[0].decode()print(clientip + &quot; : &quot; + data)</pre><p>We use the modules os, time and socket for the chatapp. The pyfiglet module is just for displaying the logo.</p><pre>s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)</pre><p>We define the type of protocol i.e. UDP and the IP address format which is IPv4.</p><p>First, we enter our IP address and port number and then the receiver’s IP address and port number.</p><p>The IP and port number are bonded together.</p><p>The recvfrom function reads incoming data on both connected and unconnected sockets and captures the address from which the data was sent. This function is typically used with connectionless sockets. The local address of the socket must be known. For server applications, this is usually done explicitly through bind.</p><p>Finally, a while loop for sending and receiving the messages.</p><h3>Let us look at the chatapp with multi-threading,</h3><p>Let us first define multi-threading,</p><h3>Multi-Threading</h3><p>A thread is an entity within a process that can be scheduled for execution. Also, it is the smallest unit of processing that can be performed in an OS. In simple words, it is a sequence of such instructions within a program that can be executed independently of other code. Multithreading is defined as the ability of a processor to execute multiple threads concurrently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/0*8YnWiND_4PtK2Ous" /></figure><p>In our chat application, every machine acts as both the client and the server. Hence, the functions send and receive must be executed concurrently. Multithreading must be used to achieve this.</p><p>To create a new thread, we create an object of the Thread class. It takes the following arguments:</p><p>· <strong>target</strong>: the function to be executed by the thread</p><p>· <strong>args</strong>: the arguments to be passed to the target function</p><p>Once a thread object is created, its activity must be started by calling the thread’s start() method. This invokes the run() method in a separate thread of control.</p><p><strong>Let us look at our program,</strong></p><pre>import os<br>from pyfiglet import Figletos.system(&quot;clear&quot;)<br>pyf = Figlet(font=&#39;puffy&#39;)<br>a = pyf.renderText(&quot;UDP Chat App with Multi-Threading&quot;)<br>os.system(&quot;tput setaf 3&quot;)<br>print(a)# importing modules for the chat appimport socket<br>import time<br>import threading<br>import sys# AF_INET = Network Address Family : IPv4<br># SOCK_DGRAM = DataGram Socket : UDP# Function for receiving<br>def receiver():<br>    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)<br>    s.bind((ip_sender, port_sender)) #binding the IP address and port number<br>    while True:<br>        msg = s.recvfrom(1024)<br>        print(&quot;\n&quot;+msg[0].decode())<br>        if &quot;exit&quot; in msg[0].decode() or &quot;bye&quot; in msg[0].decode():<br>            sys.exit()#Function for sending<br>def sender():<br>    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)<br>    text = &quot;hello&quot;<br>    while True:<br>        if &quot;bye&quot; in text or &quot;exit&quot; in text or &quot;finish&quot; in text:<br>            exit()<br>        else:<br>            text = input(f&#39;{name}:&#39;)<br>            text = name+&quot;:&quot;+text<br>            s.sendto(text.encode(), (ip_receiver, port_receiver))print(&quot;Initializing....&quot;)ip_receiver = input(&quot;\nEnter the IP of reciever: &quot;)<br>port_receiver = int(input(&quot;\nEnter the port of the reciever: &quot;))ip_sender = input(&quot;\nEnter the IP of your system : &quot;)<br>port_sender = int(input(&quot;\nEnter the port of your system: &quot;))name = input(&quot;Enter your name: &quot;)print(&quot;Waiting for client....&quot;)<br>time.sleep(1)<br>print(&quot;Connection established....&quot;)# Using Multi-threading<br>send = threading.Thread(target=sender)<br>receive = threading.Thread(target=receiver)send.start()<br>receive.start()</pre><p>In the above code, we have declared an infinite loop so that the application can work continuously.</p><p>If the user types bye or exit then the program will terminate and close the application.</p><p>We defined two functions, sender and receiver for communication.</p><p>At the end of the program, we simply apply multi-threading to the receiver and sender so that both ends will work simultaneously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*GbdqNBwlQcL1qst7qB6m1Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9513025855ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying WordPress in ec2 using the database as Amazon RDS]]></title>
            <link>https://nischalvooda.medium.com/deploying-wordpress-in-ec2-using-the-database-as-amazon-rds-f7da9fbe1a35?source=rss-39d520c4c1f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7da9fbe1a35</guid>
            <category><![CDATA[rds]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Nischal Vooda]]></dc:creator>
            <pubDate>Sat, 27 Aug 2022 12:53:32 GMT</pubDate>
            <atom:updated>2022-08-27T12:53:32.031Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploying WordPress using Amazon RDS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*-LQLV4Hm-ZqSLRaqR4az8w.png" /></figure><h3>Task Description</h3><ul><li>Create an AWS EC2 instance.</li><li>Configure the instance with Apache Webserver.</li><li>Download PHP application named “WordPress”.</li><li>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.</li><li>Provide the endpoint/connection string to the WordPress application to make it work.</li></ul><h3>What is Amazon RDS?</h3><p><strong>Amazon Relational Database Service (Amazon RDS)</strong> makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while automating time-consuming administration tasks such as hardware provisioning, database setup, patching and backups. It frees you to focus on your applications so you can give them the fast performance, high availability, security and compatibility they need.</p><p>Amazon RDS is available on several database instance types — optimized for memory, performance or I/O — and provides you with six familiar database engines to choose from, including Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle Database, and SQL Server. You can use the AWS Database Migration Service to easily migrate or replicate your existing databases to Amazon RDS.</p><h3>What is WordPress?</h3><p><strong>WordPress</strong> is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database. Features include a plugin architecture and a template system, referred to within WordPress as Themes. WordPress was originally created as a blog-publishing system but has evolved to support other web content types including more traditional mailing lists and forums, media galleries, membership sites, learning management systems and online stores. WordPress is used by more than 40.5% of the top 10 million websites as of March 2021, WordPress is one of the most popular content management system solutions in use. WordPress has also been used for other application domains, such as pervasive display systems.</p><h3>What is MySQL?</h3><p><strong>MySQL</strong> is an open-source relational database management system (RDBMS). Its name is a combination of “My”, the name of co-founder Michael Widenius’s daughter, and “SQL”, the abbreviation for Structured Query Language. A relational database organizes data into one or more data tables in which data types may be related to each other; these relations help structure the data. SQL is a language programmers use to create, modify and extract data from the relational database, as well as control user access to the database. In addition to relational databases and SQL, an RDBMS like MySQL works with an operating system to implement a relational database in a computer’s storage system, manages users, allows for network access and facilitates testing database integrity and creation of backups.</p><h3>Let’s jump into the task:</h3><p>Step 1 : Create the MySQL RDS.</p><ul><li>Services -&gt; Database -&gt; RDS.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*2eKMQM3Fs_ULSVry.png" /></figure><ul><li>Click on Create database.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*qJwjcytb3HV5VHT1.png" /></figure><ul><li>Select MySQL</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*pbNBpN1hRG5IcisW.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*x1zqD3J_ZapHYFVv.png" /></figure><ul><li>Select latest version of MySQL. Next select free tier so that we don’t get charged.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*64oP2D5gCaa4waT8.png" /></figure><ul><li>Name your database and set the user name and password for the database.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*lSDA98Aft8QYrL5y.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*u7VeR7I6Sytiz2UM.png" /></figure><ul><li>Leave rest of settings as default and in the Public access we need to select yes or else we won’t be able to connect to WordPress.</li><li>We have to choose the security group if we have already created any, otherwise we can create a new one.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*m8amVfiSf7OhzY2f.png" /></figure><ul><li>Now, click on create database.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*jfokQ6PtoffkGrcb.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*jkhsaWJW2Xies-PY.png" /></figure><ul><li>It will take few minutes to launch the database. So, wait for some time.</li></ul><p>Step 2: Launch EC2 instance and configure WordPress.</p><ul><li>Create EC2 instance either by GUI or CLI</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1z9J4xFI4cwPFUx_.png" /></figure><ul><li>Click on connect, to connect to the EC2 instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*EA0-j3r_EhLUZVZd.png" /></figure><ul><li>Run the following command:</li></ul><p>$ sudo su - : to become root user so that you can run all the command with root privilege.</p><ul><li>To setup the WordPress we need to install some software.</li></ul><p>$ yum install httpd -y : to install apache webserver</p><p>$ yum install mysql -y : to install mysql</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*35YQRhD6A5PkWLqb.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*LAFcqVIKSPPlfies.png" /></figure><ul><li>Run the following command:</li></ul><p>$ amazon-linux-extras install php7.4 : to get command to install PHP</p><ul><li>Now go to the official site of WordPress <a href="https://wordpress.org/download/">https://wordpress.org/download/</a> and copy the download link.</li><li>Go to the <em>“cd /var/www/html/”</em> folder.</li><li>Run the command to download the wordpress software.</li></ul><p>$ wget <a href="https://wordpress.org/latest.tar.gz">https://wordpress.org/latest.tar.gz</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*mb1KgC_OCE5Muyw2.png" /></figure><ul><li>Use the command to unzip the Wordpress software.</li></ul><p>$ tar -xf latest.tar.gz</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*r74iqqvDokVsXuvf.png" /></figure><ul><li>Enable the httpd service</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*VQpHh6HvppmzmzQR.png" /></figure><ul><li>Enter your public IP of EC2 instance on browser followed by the wordpress folder <em>“publicIP/worpress”.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*tDiDdDP0lAMjDNna.png" /></figure><p>Step 3 : Check the RDS MySQL database connectivity.</p><ul><li>Copy the database endpoint.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*sCT0ffCMKgUw7Dor.png" /></figure><ul><li>Run the below command to connect your database. Enter the correct endpoint, username and password in this command.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1y-0l2LWFxyIEVdZ.png" /></figure><ul><li>We can run MySQL commands to check database and tables.</li><li>We can open the WordPress server in the browser now.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*lqEUcR8zyT6yWoWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*iL-yZrVtbD0YYl67.png" /></figure><ul><li>As soon as we hit we get the following error which depicts that our work of configuring is not done yet.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*QVsMOBislDUA-4NO.png" /></figure><ul><li>Login to and go to the wordpress folder and copy <em>wp-config-sample.php</em> to<em> wp-config.php</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*AVC_ZcfA9-Cy4MxS.png" /></figure><ul><li>now open this <em>wp-config.php</em> file and enter the database name, user , password and endpoint of RDS mysql database.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*AXQXw2mtVYeVO1JY.png" /></figure><ul><li>Restart httpd and mysql service.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*wQICr1RgViBIG3FG.png" /></figure><ul><li>Now again go to the browser and refresh the page and enter the details and click on install wordpress.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*uNMSRgBS98OskBuH.png" /></figure><ul><li>Login to WordPress site.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CiMcD4A1IvFXCUe5.png" /></figure><ul><li>Click on <em>“view your site”.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*9w0BDX3d4qqlCudK.png" /></figure><ul><li>Now click on Edit to edit your wordpress site accordingly.</li><li>Now again login to your Mysql database to verify if the data is being stored or not.</li><li>Go to the WordPress database (sqldb in my case) and see the tables.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ZVC2m1rZ1PKbCHss.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*C8sCQMQgxz8AG4CN.png" /></figure><ul><li>If we print the <em>wp_posts, we’</em>ll to able to see the content.</li><li>If we print the data of <em>wp_comments, we’</em>ll see the comments.</li></ul><p>Thus we also verified that RDS MySQL and WordPress are working good together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*GbdqNBwlQcL1qst7qB6m1Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7da9fbe1a35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Image manipulation using OpenCV in Python]]></title>
            <link>https://nischalvooda.medium.com/image-manipulation-using-opencv-in-python-67a1163bbc34?source=rss-39d520c4c1f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/67a1163bbc34</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[opencv]]></category>
            <dc:creator><![CDATA[Nischal Vooda]]></dc:creator>
            <pubDate>Sat, 27 Aug 2022 12:43:58 GMT</pubDate>
            <atom:updated>2022-08-27T12:43:58.464Z</atom:updated>
            <content:encoded><![CDATA[<p>Task Description</p><ul><li>Create an image by yourself Using Python Code.</li><li>Take 2 images, crop some part of both images and swap them.</li><li>Take 2 images and combine them to form a single image. For example collage.</li></ul><p>First we will be exploring various details about image processing and OpenCV library in python.</p><h3>What is Image processing?</h3><p>Images are multi-dimensional arrays in the computer world. 2D arrays for Black and white images and 3D arrays for RGB.</p><p>Colored images are stored in the form of three-dimensional (3D) arrays in the computer, where only 0–255 values are stored furthermore 0 and 255 represent black and white color respectively.</p><p><strong>Image processing</strong> deals with manipulation of digital images through a digital computer. Image processing focuses on developing a computer system that is able to perform processing on an image. The input of that system is a digital image and the system process that image using efficient algorithms, and gives an image as an output.</p><p><strong>Pixel</strong> is the smallest unit of an image. Technically it is an entry inside an array at a particular position of row and column. Each pixel consists of three colors namely, Red, Green, and Blue. Upon combining these different colors are formed. Multiple pixels together form a complete image.</p><p><strong>Video processing</strong> means, performing operations on the video frame by frame. Frames are nothing but just the particular instance of the video i.e. an image in a single point of time. We may have multiple frames even in a single second. Video is nothing but a continuous stream of images. The repeated loop of capturing the image and displaying it gives out a video which can also be processed inside the loop to get a processed video.</p><p>Python provides lots of libraries for image processing, including −</p><ul><li><strong>OpenCV</strong> − Image processing library mainly focused on real-time computer vision with application in wide-range of areas like 2D and 3D feature toolkits, facial &amp; gesture recognition, Human-computer interaction, Mobile robotics, Object identification and others.</li><li><strong>Numpy and Scipy libraries</strong> − For image manipuation and processing.</li><li><strong>Sckikit</strong> − Provides lots of alogrithms for image processing.</li><li><strong>Python Imaging Library (PIL)</strong> − To perform basic operations on images like create thumnails, resize, rotation, convert between different file formats etc.</li></ul><h3>Here we will be using OpenCV module.</h3><ul><li>OpenCV is one of the most popular computer vision libraries. If you want to start your journey in the field of computer vision, then a thorough understanding of the concepts of OpenCV is of paramount importance.</li><li><strong>OpenCV</strong> is a huge open-source library for computer vision, machine learning, and image processing. OpenCV supports a wide variety of programming languages like Python, C++, Java, etc. It can process images and videos to identify objects, faces, or even the handwriting of a human. When it is integrated with various libraries, such as <a href="https://www.geeksforgeeks.org/python-numpy/">Numpy</a> which is a highly optimized library for numerical operations, then the number of weapons increases in your Arsenal i.e whatever operations one can do in Numpy can be combined with OpenCV.</li><li>The general color code is RGB but the color code format is used in OpenCV is BGR(Blue Green Red).</li></ul><h3>Install OpenCV</h3><p>To install OpenCV on your system, run the following pip command:</p><pre>pip install opencv-python</pre><h3>Rotate an Image</h3><p>First of all, import the cv2 module.</p><pre>import cv2</pre><p>Now to read the image, use the imread() method of the cv2 module, specify the path to the image in the arguments and store the image in a variable as below:</p><pre>img = cv2.imread(&quot;pyimg.jpg&quot;)</pre><p>The image is now treated as a matrix with rows and columns values stored in img.</p><p>Actually, if you check the type of the img, it will give you the following result:</p><pre>&gt;&gt;&gt;print(type(img))&lt;class &#39;numpy.ndarray&#39;&gt;</pre><p>It’s a <a href="https://likegeeks.com/numpy-array-tutorial/">NumPy array</a>! That why image processing using OpenCV is so easy. All the time you are working with a NumPy array.</p><p>To display the image, you can use the imshow() method of cv2.</p><pre>cv2.imshow(&#39;Original Image&#39;, img) cv2.waitKey(0)</pre><p>The waitkey() functions take time as an argument in milliseconds as a delay for the window to close. Here we set the time to zero to show the window forever until we close it manually.</p><p>To rotate this image, you need the width and the height of the image because you will use them in the rotation process as you will see later.</p><pre>height, width = img.shape[0:2]</pre><p>The shape attribute returns the height and width of the image matrix. If you print</p><pre>img.shape[0:2]</pre><p>Okay, now we have our image matrix and we want to get the rotation matrix. To get the rotation matrix, we use the <em>getRotationMatrix2D()</em> method of cv2. The syntax of <em>getRotationMatrix2D()</em> is:</p><pre>cv2.getRotationMatrix2D(center, angle, scale)</pre><p>Here the <strong>center</strong> is the center point of rotation, the <strong>angle</strong> is the angle in degrees and <strong>scale</strong> is the scale property which makes the image fit on the screen.</p><p>To get the rotation matrix of our image, the code will be:</p><pre>rotationMatrix = cv2.getRotationMatrix2D((width/2, height/2), 90, .5)</pre><p>The next step is to rotate our image with the help of the rotation matrix.</p><p>To rotate the image, we have a cv2 method named <em>wrapAffine</em> which takes the original image, the rotation matrix of the image and the width and height of the image as arguments.</p><pre>rotatedImage = cv2.warpAffine(img, rotationMatrix, (width, height))</pre><p>The rotated image is stored in the rotatedImage matrix. To show the image, use imshow() as below:</p><pre>cv2.imshow(&#39;Rotated Image&#39;, rotatedImage)cv2.waitKey(0)</pre><h3>Capturing Image using WebCam:</h3><pre>import cv2 cap = cv2.VideoCapture(0) # here, 0 — to access internal webcam &amp; 1 to access external webcam ret , photo = cap.read() # clicks the photoret cv2.imwrite(“my”,photo) # stores in a filecap.release() cv2.imshow(“my”, photo) # displays the photocv2.waitKey() # used to set the expiry time for the picture to be displayedcv2.destroyAllWindows() #used to destroy or close the picture window without crashing it</pre><p>Video Streaming using WebCam:</p><pre>import cv2<br>cap = cv2.VideoCapture(0)<br>ret, photo = cap.read()<br>while True:<br> ret, photo = cap.read()<br> cv2.imshow(&#39;hi&#39;, photo)<br> if cv2.waitKey(10) ==13:<br>  break<br>cv.destroyAllwindows()</pre><h3>Convert image to grayscale (Black &amp; White)</h3><p>The easy way to convert an image in grayscale is to load it like this:</p><pre>img = cv2.imread(&quot;pyimg.jpg&quot;, 0)</pre><p>There is another method using BGR2GRAY.</p><p>To convert a color image into a grayscale image, use the BGR2GRAY attribute of the cv2 module. This is demonstrated in the example below:</p><p>Import the cv2 module:</p><pre>import cv2</pre><p>Read the image:</p><pre>img = cv2.imread(&quot;pyimg.jpg&quot;)</pre><p>Use the cvtColor() method of the cv2 module which takes the original image and the COLOR_BGR2GRAY attribute as an argument. Store the resultant image in a variable:</p><pre>gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)</pre><p>Display the original and grayscale images:</p><pre>cv2.imshow(&quot;Original Image&quot;, img)cv2.imshow(&quot;Gray Scale Image&quot;, gray_img)cv2.waitKey(0)</pre><h3>Resize an Image</h3><p>To resize an image, you can use the resize() method of openCV. In the resize method, you can either specify the values of x and y axis or the number of rows and columns which tells the size of the image.</p><p>Import and read the image:</p><pre>import cv2img = cv2.imread(&quot;pyimg.jpg&quot;)</pre><p>Now using the resize method with axis values:</p><pre>newImg = cv2.resize(img, (0,0), fx=0.75, fy=0.75)cv2.imshow(&#39;Resized Image&#39;, newImg)cv2.waitKey(0)</pre><p>Now using the row and column values to resize the image:</p><pre>newImg = cv2.resize(img, (550, 350))cv2.imshow(&#39;Resized Image&#39;, newImg)cv2.waitKey(0)</pre><p>We say we want 550 columns (the width) and 350 rows (the height).</p><h3>Creating an image using Python code</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FAbvTp7iLxZLfdQD.png" /></figure><p>The output is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/0*4Agd-lAJC_fuGRy0.png" /></figure><p>Take 2 images, crop some part of both images and swap them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mFh3GBJMkARU1r74.png" /></figure><p>The result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*0dJqRpFma05YiUdt.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R2Pq3sDMmFie9De_.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f1d1QSFTtaMr5Nru.png" /></figure><p>Take 2 images and combine them to form a single image. For example collage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/0*q14rNLGeAapfdsL1.png" /></figure><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MeuHPaPeyhtyKML5.png" /></figure><p>Horizontal Collage</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/0*zhd2jpabUuOWSYUt.png" /></figure><p>Vertical Collage</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*GbdqNBwlQcL1qst7qB6m1Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67a1163bbc34" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>