<?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 Samuel R. Ekpe on Medium]]></title>
        <description><![CDATA[Stories by Samuel R. Ekpe on Medium]]></description>
        <link>https://medium.com/@samuelrekpe?source=rss-388aab7c44ed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*58lEr0j2NfE6xLtOW8BR8g.png</url>
            <title>Stories by Samuel R. Ekpe on Medium</title>
            <link>https://medium.com/@samuelrekpe?source=rss-388aab7c44ed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 11:09:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samuelrekpe/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[Azure Static Website]]></title>
            <link>https://medium.com/@samuelrekpe/azure-static-website-b222b112130f?source=rss-388aab7c44ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/b222b112130f</guid>
            <category><![CDATA[azure-functions]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-services]]></category>
            <dc:creator><![CDATA[Samuel R. Ekpe]]></dc:creator>
            <pubDate>Fri, 07 Feb 2025 13:56:56 GMT</pubDate>
            <atom:updated>2025-02-07T13:56:56.474Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*viPf1OyV6P9Ir9pCWXsvrg.jpeg" /></figure><p>Hello everyone! I’m back with my first Azure project. It will entail creating an Azure storage account and hosting a static website. This post will be short and sweet, as my familiarity with AWS made doing this project easier.</p><h4>Situation</h4><blockquote>1. Create an Azure Storage account and a Blob container.</blockquote><blockquote>2. Upload the provided index.html file to the Blob container.</blockquote><blockquote>3. Configure the Azure Blob container to host a static website. This involves setting the appropriate public access level and specifying the default document.</blockquote><blockquote>4. Verify internet access by navigating to the provided Azure Blob Storage endpoint in a private or incognito browser.</blockquote><h4>Steps</h4><p>To start, I created a free Azure account. If you already have a Microsoft account, you can use it to sign up. <a href="https://youtu.be/TQiqtpYpPnQ?t=199">Here</a> is a video that walks through the steps.</p><p>Next up is the storage account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*FZtSRkH_J-aR6XTpqnQQbQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBxstciTJr6OalddelEYYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d93ivWvDvK0WnlxYsyjCWQ.png" /></figure><p>The resource group holds your Azure resources (VMs, storage accounts, etc.) and makes it easier to manage them. The storage account name must always be unique. Blob storage is like S3 in AWS.</p><p>If you want to keep the Storage account default settings, skip to the Review + Create page. Otherwise, you can modify the settings to your liking. After clicking the Create button, your Storage account will deploy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Vf7iG5wyNZ_lKaUOE070w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x_3Q-M1PvSLS9741qesYJg.png" /></figure><h4>Deployment of Website</h4><p>Once your Storage account finishes deploying, the static website must be enabled for you to set it up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KaBoIljQdk8vFFIvJzOItw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*vPwg19rAVQOhG3VOC0cb_w.png" /></figure><h4>Testing the Static Website</h4><p>If you get the following error page when attempting to get to the Primary Endpoint link, it means you haven’t uploaded your Index document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9FuYgf33mUoVscneleiDJA.png" /></figure><p>After saving the page, you’ll see the primary and secondary endpoints. The primary endpoint is the main access point for an Azure service. The secondary endpoint is a backup access point (located in another region).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*Yq8lOkuRi6_UzanUh0K9Fg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O8EqDa9GhfWfNC_SeSUyXw.png" /></figure><p>Now, you can check if your static website works via the Primary Endpoint link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hYwy6HoycJMuh63bfJgI1w.png" /></figure><p>If you land on this page, you’ve successfully created a static web page in Azure. Thank you for reading and be on the lookout for more projects to come!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b222b112130f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating EC2 Names via Python]]></title>
            <link>https://medium.com/@samuelrekpe/automating-ec2-names-via-python-c8df06efd1b5?source=rss-388aab7c44ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8df06efd1b5</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[script]]></category>
            <dc:creator><![CDATA[Samuel R. Ekpe]]></dc:creator>
            <pubDate>Tue, 21 Jan 2025 07:38:12 GMT</pubDate>
            <atom:updated>2025-01-22T03:53:08.571Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*lfsXr6qALmB0vkbtfPCtjg.jpeg" /></figure><p>Hello everyone! Today’s project deals with Python scripts that give random names to EC2 instances. Let’s jump into it.</p><h4>Intro</h4><p>In programming, scripting allows you to automate tasks and manage processes efficiently. How? By writing small, reusable pieces of code. In our situation, we are working with AWS EC2 instances, which require unique names. Scripting can help automate the provisioning, configuration, and monitoring of EC2 instances.</p><h4>Security</h4><p>Additionally, scripting improves the security of the EC2. It is harder for a hacker to guess the name of an EC2 if it is randomly generated. Furthermore, the unique and random generation of EC2 names makes it harder for bad guys to get an idea of the setup of your infrastructure.</p><h4>Organization</h4><p>Another benefit of scripting is the ease of organization. Rather than allowing EC2 instances to be manually named, there is some sort of naming convention or order in the code to prevent generic or easy-to-guess names.</p><h3>Scenario</h3><blockquote>Several departments share an AWS environment. You need to ensure that the EC2s are properly named and are unique so team members can easily tell who the EC2 instances belong to. Use Python to create your unique EC2 names that the users can then attach to the instances.</blockquote><p>I have written 2 Python scripts to solve this request. The first script is a simpler solution, and the second script is a more advanced solution.</p><p><strong>Simple Solution</strong></p><pre>import string # Allows for the use of sets of characters<br>import random # Command that generates random numbers<br><br># An array of departments for the user to choose from<br>department = [&#39;Marketing&#39;, &#39;Accounting&#39;, &#39;FinOps&#39;, &#39;IT&#39;, &#39;Sales&#39;, &#39;HR&#39;]<br><br>input(&#39;What department are you in? &#39;)<br><br>input(&#39;How many EC2 instances do you want? &#39;)</pre><p><strong>Advanced Solution</strong></p><pre>import random<br>import string<br><br># Function to generate random characters and numbers<br>def generate_random():<br>    return &#39;&#39;.join(random.choices(string.ascii_letters + string.digits, k=12))<br><br># List of departments<br>departments = [&quot;Marketing&quot;, &quot;Accounting&quot;, &quot;FinOps&quot;]<br><br># User input for department and number of EC2 instances<br>user_dept = input(&quot;Enter your department (Marketing, Accounting, FinOps): &quot;)<br><br># The int function converts a string input into integers<br>ec2_num = int(input(&quot;How many EC2 instances do you want to create? &quot;))<br><br># Check if the user input is in the departments list<br>if user_dept in [&#39;Marketing&#39;, &#39;Accounting&#39;, &#39;FinOps&#39;]:<br>    <br>    # Loop through the number of EC2 instances<br>    for x in range(ec2_num):<br><br>        # Combine the user input with the random EC2 instance name<br>        ec2_name = f&quot;{user_dept}-{generate_random()}&quot;<br><br>        # Prints the randomly generated EC2 instance name<br>        print(f&quot;EC2 Instance {x+1} Name: {ec2_name}&quot;)<br>else:<br>    print(&quot;Error: Invalid department. Please enter &#39;Marketing&#39;, &#39;Accounting&#39;, or &#39;FinOps&#39;.&quot;)</pre><p>Some issues I had with this assignment were:</p><ol><li>Semantic errors (mixing up variable names, improper indentation)</li><li>Syntax errors (incorrect commands)</li><li>User inputs that worked for some use cases, but not all (only 1 EC2 name being generated)</li><li>Making my code more efficient</li></ol><p>Here is the link to my Github repository to view the raw code — <a href="https://github.com/wunderkindSE/luit-dec-2024-grey/blob/main/random_name_generator.py">https://github.com/wunderkindSE/luit-dec-2024-grey/blob/main/random_name_generator.py</a></p><p>Shameless plug — feel free to check out the rest of my repository while you’re there. Thanks for reading, and I’ll see you on the next article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8df06efd1b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Access to EC2 Instance via SSH]]></title>
            <link>https://medium.com/@samuelrekpe/access-to-ec2-instance-via-ssh-5312679f5929?source=rss-388aab7c44ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/5312679f5929</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Samuel R. Ekpe]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 08:43:07 GMT</pubDate>
            <atom:updated>2024-10-19T05:24:11.419Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*vmyIkK4pR7_6zyBX8GKFHg.jpeg" /></figure><p>Hello everyone! This is the first Cloud project that I am documenting. I will walk through how to SSH into an EC2 instance. This write-up is geared toward Mac users (sorry Windows folks!).</p><h4>Background</h4><p>SSH stands for Secure Shell, which allows a user to remotely control a machine using the CLI, or command line interface. RDP stands for Remote Desktop Protocol, which enables users to control and access a computer remotely. (Windows users would use RDP).</p><h4>SSH Time!</h4><p>After logging into your AWS IAM account, you would first go to your EC2 app. I’ve pinned mine, but you can also access it via the search bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qwMbyKB8EEqp12FKG2dAwg.png" /><figcaption>AWS home screen after login.</figcaption></figure><p>Click Instances on the left side panel, or Instances (running). Either one will take you to the same place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pquVtRiq1Rm8zAO0MSTDdw.png" /><figcaption>Nothing is running as of now, which is what we expect.</figcaption></figure><p>Next, click Launch Instances. There will be a screen where you can give the EC2 instance a name and tag. After that, choose the Amazon Machine Image (AMI) you’ll use to launch it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*mdRrH1IIGx3fV_A3d8F8jw.png" /><figcaption>After creating a name, we will pick Amazon Linux as our AMI.</figcaption></figure><p>For architecture type (64-bit x86) and Instance type (t2 micro), stick with the default. Create a key pair (we will use RSA) to encrypt your public and private keys. For the private key file format, we will choose .pem, as it works with SSH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*FPw1LlXx9GkMmV8QiWMdvw.png" /><figcaption>RSA and ED25519 are both key pair types. These key pair types have various uses, such as authentication.</figcaption></figure><p>If we had the PuTTYgen tool, you could use the .ppk file format. In the network settings, allow SSH traffic only from your IP. This is a security measure. <strong>Remember, safety first</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*4u_qX4RRZL8dxQDCgSQ_qg.png" /><figcaption>Restricting SSH traffic to your IP helps prevent unauthorized access to your EC2 instance.</figcaption></figure><p>Leave the remaining options on the page as-is, and launch your instance. Once your instance is ready, select it and click Connect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FT3BWxQwCBQKiUYzMnTOHw.png" /><figcaption>The EC2 instance was still booting up, so it wasn’t prepared for use yet.</figcaption></figure><p>When you’re taken to the Connect to Instance page, click on the SSH Client tab and follow the instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GY50jc8aMu4N8JYu7Kc6wA.png" /><figcaption>When running step 3, make sure you’re in the right directory. The SSH command is looking at the PEM file to authenticate it on the server.</figcaption></figure><p>If you run <strong>chmod 400</strong> and nothing happens, great! This means the superuser can only read the PEM file (similar to the admin user on Windows). We have verified that we have the proper file settings for our key pair. Additionally, we know that our key isn’t viewable to the public.</p><p>The “chmod” command sets the permissions (Read, Write, and Execute) for files and directories. (I’ll discuss Linux permissions in another post.)</p><p>When running step 4, use the listed example. If you copy the line of code in step 4, the CLI will say that the command cannot be found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3DmULs7aDjfpO6dKmory_A.png" /><figcaption>We can’t SSH into the EC2 without the calling for the PEM file. Hence why the command was not found.</figcaption></figure><p>To ensure that I’m logged into my EC2 instance, I will type “<strong>whoami</strong>”. If it displays the username I chose earlier (I left it blank, so it defaults to “<strong>ec2-user</strong>”), I have successfully SSH’d into my EC2!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*eX6csVdKns1iAE1xzJBH6Q.png" /><figcaption>The “pwd” command displays the absolute path, which is the exact file or directory that I’m located in.</figcaption></figure><p>Last thing: remember to stop the EC2 instance when you are done using it. It’s good practice to do so. You don’t want a situation where you forget to terminate the use of an AWS tool and end up being charged for it.</p><p>The first time I performed an SSH, I forgot to turn off the EC2 instance. Fortunately for me, I didn’t use any tools that would require me to pay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZfG6E9CljoAhSiRKtZEOvw.png" /><figcaption>Along with Starting and Stopping, you can also Reboot, Hibernate or Terminate an instance.</figcaption></figure><p>To turn off the EC2, click Instances on the left side panel. Next, select the EC2 instance(s) you want to terminate. Then, click Instance State and Stop Instance. It may take a minute for the EC2 instance to stop completely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SdcdFL-wB9teDYWocWXa0g.png" /><figcaption>The EC2 instance I used for this session has stopped.</figcaption></figure><p>If I want to re-use an instance I stopped. I can do so by starting the instance again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e2Fg8-82t7Gw7BbPXOe1pg.png" /><figcaption>When starting, the Instance state will first read “Pending”, then “Running”.</figcaption></figure><p>As Porky Pig would say at the end of Looney Tunes, “That’s all, folks!”</p><p>I hope this guide was helpful to you. Feel free to leave your questions and comments. See you soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5312679f5929" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>