<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Saad Fazal</title>
    <description>The latest articles on DEV Community by Saad Fazal (@mrsaadfazal).</description>
    <link>https://dev.to/mrsaadfazal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1719501%2F1b6e1399-c045-4242-aea6-76d1ce2fd111.jpeg</url>
      <title>DEV Community: Saad Fazal</title>
      <link>https://dev.to/mrsaadfazal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mrsaadfazal"/>
    <language>en</language>
    <item>
      <title>Exploring DevOps: A New Adventure</title>
      <dc:creator>Saad Fazal</dc:creator>
      <pubDate>Fri, 05 Jul 2024 20:31:36 +0000</pubDate>
      <link>https://dev.to/mrsaadfazal/exploring-devops-a-new-adventure-21ke</link>
      <guid>https://dev.to/mrsaadfazal/exploring-devops-a-new-adventure-21ke</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hey everyone!  As you know, I've always been a data guy, diving deep into the realms of data science. But recently, I've decided to give DevOps a try. Why, you ask? Well, thanks to the amazing DevOps community and a special shoutout to "kubeden" for enlightening me on how fascinating this field can be, I thought, why not explore it? So, I decided to take a detour from my data journey and spend some time in the DevOps world.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Background
&lt;/h2&gt;

&lt;p&gt;I’ve been a developer for three years now, with some experience in cloud computing and AWS. So, I figured learning DevOps might be a bit easier given my background. Here’s a rundown of what I’ve learned in the past four days during my free time:&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS
&lt;/h2&gt;

&lt;h3&gt;
  
  
  IAM
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Users&lt;/strong&gt;: Managing user accounts and permissions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Groups&lt;/strong&gt;: Organizing users into groups for easier management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Policies (Permissions)&lt;/strong&gt;: Defining and assigning permissions to users and groups.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Amazon Elastic Container Service (ECS) and ECR
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Deploy Docker Container&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create Cluster&lt;/strong&gt;: Setting up a new ECS cluster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service API&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tasks&lt;/strong&gt;: Running individual containers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Load Balancer&lt;/strong&gt;: Distributing traffic among containers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Health Checker&lt;/strong&gt;: Monitoring container health.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Elastic Beanstalk
&lt;/h3&gt;

&lt;p&gt;Deploying and managing applications without worrying about the underlying infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Basics
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Installation of Docker CLI and Desktop&lt;/strong&gt;: Getting Docker up and running on my machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Understanding Images vs. Containers&lt;/strong&gt;: Learning the difference between Docker images and containers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Running Ubuntu Image in Container&lt;/strong&gt;: Starting a container with Ubuntu.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple Containers&lt;/strong&gt;: Managing multiple containers simultaneously.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port Mappings&lt;/strong&gt;: Mapping container ports to host ports.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment Variables&lt;/strong&gt;: Setting environment variables for containers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dockerization of Node.js Application&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dockerfile&lt;/strong&gt;: Creating a Dockerfile for a Node.js app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Caching Layers&lt;/strong&gt;: Using caching to speed up builds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Publishing to Hub&lt;/strong&gt;: Pushing images to Docker Hub.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Advanced
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Docker Compose&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Services&lt;/strong&gt;: Defining multi-container applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port Mapping&lt;/strong&gt;: Configuring port mappings for services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Env Variables&lt;/strong&gt;: Setting environment variables for services.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Networking&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bridge&lt;/strong&gt;: Default network driver.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Host&lt;/strong&gt;: Using the host’s networking stack.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volume Mounting&lt;/strong&gt;: Persisting data using volumes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient Caching in Layers&lt;/strong&gt;: Optimizing Dockerfile for caching.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Multi-Stage Builds&lt;/strong&gt;: Using multi-stage builds to reduce image size.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Nginx
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Setting Up
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Launching an EC2 Instance&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create and configure a virtual machine using EC2&lt;/strong&gt;: Choosing an instance type and region.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assign a static IP&lt;/strong&gt;: Ensuring consistent access.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set up security groups&lt;/strong&gt;: Allowing HTTP and HTTPS traffic.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Configuration
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Accessing the EC2 Instance&lt;/strong&gt;: Connecting via SSH.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Updating and Installing Necessary Packages&lt;/strong&gt;: Keeping everything up-to-date.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloning the Project Repository&lt;/strong&gt;: Downloading my Node.js app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Installing Project Dependencies&lt;/strong&gt;: Using npm install.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Running the Node.js Application&lt;/strong&gt;: Managing with pm2.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Setting Up a Domain&lt;/strong&gt;: Registering and pointing a domain to my Elastic IP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuring Nginx&lt;/strong&gt;: Proxying requests to the Node.js app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Setting Up SSL with Let's Encrypt&lt;/strong&gt;: Using Certbot for SSL certificates.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Kafka
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Key Concepts
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;High Throughput and Less Storage&lt;/strong&gt;: Optimized for large data streams.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Components&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Producers and Consumers&lt;/strong&gt;: Sending and receiving messages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Topics and Partitions&lt;/strong&gt;: Organizing messages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consumer Groups&lt;/strong&gt;: Managing multiple consumers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Models
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Queue and Pub/Sub&lt;/strong&gt;: Handling different messaging patterns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zookeeper&lt;/strong&gt;: Managing Kafka infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Admin, Producers, and Consumers&lt;/strong&gt;: Setting up and using Kafka.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Serverless
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;No Server Management&lt;/strong&gt;: Focusing on code, not servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event-Driven Execution&lt;/strong&gt;: Functions triggered by events.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic Scaling&lt;/strong&gt;: Scaling based on load.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pay-per-Invocation&lt;/strong&gt;: Billing based on function usage.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Practical Example
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Creating a Lambda Function&lt;/strong&gt;: Deploying a function to AWS Lambda.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trigger Setup&lt;/strong&gt;: Using API Gateway to invoke the function.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing&lt;/strong&gt;: Verifying with a browser and Postman.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What's Next: My Learning Plan for the Next 4 Days
&lt;/h2&gt;

&lt;p&gt;In the next four days, I plan to dive deeper into the following areas:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;More AWS Services&lt;/strong&gt;: Expanding my knowledge of various AWS services beyond the basics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure&lt;/strong&gt;: Getting familiar with Microsoft's cloud platform and its unique features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terraform&lt;/strong&gt;: Learning infrastructure as code to manage cloud resources efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ansible&lt;/strong&gt;: Exploring configuration management and automation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD&lt;/strong&gt;: Strengthening my understanding of continuous integration and continuous deployment practices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Workflows&lt;/strong&gt;: Refining my skills in creating and managing workflows on GitHub.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So in these days, my free time goes to learning about DevOps and  I will be sharing more about what I have learned, and in a new post, I will share the resources too.&lt;/p&gt;

&lt;p&gt;For the DevOps community: Do let me know your thoughts and what should I need to put more focus on in this DevOps realm?&lt;/p&gt;

&lt;p&gt;Stay curious, keep learning, and happy coding!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
    </item>
    <item>
      <title>I lost $93 while testing the newly released Open AI vision</title>
      <dc:creator>Saad Fazal</dc:creator>
      <pubDate>Tue, 02 Jul 2024 18:38:17 +0000</pubDate>
      <link>https://dev.to/mrsaadfazal/i-lost-93-while-testing-the-newly-released-open-ai-vision-1k20</link>
      <guid>https://dev.to/mrsaadfazal/i-lost-93-while-testing-the-newly-released-open-ai-vision-1k20</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hey everyone! It's Saad Fazal here, and today I want to talk about something that I've been noticing more and more on GitHub: the alarming lack of security awareness among some developers. As much as I love the collaborative spirit of open-source, it's crucial that we all take security seriously.&lt;br&gt;
I was messing around on GitHub, just doing some casual searches, and guess what I found? Yep, OpenAI API keys scattered around in public repos like confetti at a New Year's party. If you're thinking, "Oh no, not me!"—think again. Here's the search query I used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(path:*.xml OR path:*.json OR path:*.properties OR path:*.sql OR path:*.txt OR path:*.log OR path:*.tmp OR path:*.backup OR path:*.bak OR path:*.enc OR path:*.yml OR path:*.yaml OR path:*.toml OR path:*.ini OR path:*.config OR path:*.conf OR path:*.cfg OR path:*.env OR path:*.envrc OR path:*.prod OR path:*.secret OR path:*.private OR path:*.key) AND (access_key OR secret_key OR access_token OR api_key OR apikey OR api_secret OR apiSecret OR app_secret OR application_key OR app_key OR appkey OR auth_token OR authsecret) AND ("sk-" AND (openai OR gpt))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2FqmzFQcF%2FScreenshot-2024-07-01-095638.png%2Fimage.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2FqmzFQcF%2FScreenshot-2024-07-01-095638.png%2Fimage.png" alt="Search Result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This is a Big Deal
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Financial Risks
&lt;/h3&gt;

&lt;p&gt;Exposing your API keys is like leaving your wallet on the sidewalk. Sure, someone might just ignore it, but chances are, someone’s going to pick it up and go on a spending spree with your hard-earned cash. And trust me, those OpenAI bills can rack up fast!&lt;/p&gt;

&lt;h4&gt;
  
  
  My Funny Mishap with OpenAI Vision
&lt;/h4&gt;

&lt;p&gt;So, I was once testing the newly released OpenAI Vision using the API, and in a classic "whoops" moment, I accidentally put my Python code in a loop. It kept taking screenshots of my desktop and sending POST requests to the OpenAI Vision API. Within just 5 minutes, I was charged $93. Talk about an expensive lesson in debugging!&lt;/p&gt;

&lt;h3&gt;
  
  
  Security Breaches
&lt;/h3&gt;

&lt;p&gt;Leaving your keys out in the open can lead to unauthorized access to your systems. It’s not just about the money—you could be giving hackers the keys to your kingdom. They can wreak havoc, steal data, or worse.&lt;/p&gt;

&lt;h3&gt;
  
  
  Professional Reputation
&lt;/h3&gt;

&lt;p&gt;Imagine a potential employer or client stumbling upon your exposed keys. Awkward, right? It doesn’t exactly scream “I’m a responsible developer.” Keeping your credentials secure is a must for maintaining your professional image.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to Secure Your API Keys
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Use Environment Variables
&lt;/h3&gt;

&lt;p&gt;Store your keys in environment variables instead of hardcoding them in your files. This keeps them out of your source code and reduces the risk of accidental exposure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Git Ignore
&lt;/h3&gt;

&lt;p&gt;Make sure your &lt;code&gt;.gitignore&lt;/code&gt; file is properly configured to exclude sensitive files like &lt;code&gt;.env&lt;/code&gt;. This prevents them from being committed to your repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Secrets Management
&lt;/h3&gt;

&lt;p&gt;Use secrets management tools provided by cloud providers or services like AWS Secrets Manager, Azure Key Vault, or HashiCorp Vault. These tools help you manage and access your secrets securely.&lt;/p&gt;

&lt;h3&gt;
  
  
  Regular Audits
&lt;/h3&gt;

&lt;p&gt;Regularly audit your repositories for accidental exposures. Use tools like TruffleHog, GitGuardian, or similar to scan your codebase for sensitive information.&lt;/p&gt;

&lt;h3&gt;
  
  
  Private Repos Aren't Safe Either
&lt;/h3&gt;

&lt;p&gt;Just because a repository is private doesn't mean it's safe to store your credentials there. If your account gets compromised, so do all your private repos. Treat them with the same level of security as you would a public repo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Let's all take a moment to reflect on our security practices. It's easy to overlook these details, but the implications can be severe. By taking proactive steps, we can protect our projects, our finances, and our reputations.&lt;/p&gt;

&lt;p&gt;I hope this blog post helps raise awareness about the importance of security on GitHub. Let's work together to make our projects safer and more secure. If you have any thoughts or additional tips, feel free to share them!&lt;br&gt;
Stay secure, stay vigilant, and happy coding!&lt;/p&gt;

</description>
      <category>github</category>
      <category>gitlab</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
