<?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 Melvin Laguren on Medium]]></title>
        <description><![CDATA[Stories by Melvin Laguren on Medium]]></description>
        <link>https://medium.com/@mlaguren?source=rss-5f4bc7631e34------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Oj8SRHB_n2oAFR07.jpg</url>
            <title>Stories by Melvin Laguren on Medium</title>
            <link>https://medium.com/@mlaguren?source=rss-5f4bc7631e34------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 23:55:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mlaguren/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[Introducing P.O.O.L. — A Reusable AI Infrastructure Platform on Oracle Cloud]]></title>
            <link>https://mlaguren.medium.com/introducing-p-o-o-l-a-reusable-ai-infrastructure-platform-on-oracle-cloud-41199e540a7a?source=rss-5f4bc7631e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/41199e540a7a</guid>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Melvin Laguren]]></dc:creator>
            <pubDate>Sat, 01 Aug 2026 14:57:52 GMT</pubDate>
            <atom:updated>2026-08-01T14:57:52.297Z</atom:updated>
            <content:encoded><![CDATA[<p>If you work in software today, you’ve probably integrated AI into at least part of your daily workflow. For many of us, it started with tools like ChatGPT or Claude. Before long, curiosity led to running models locally with Ollama, experimenting with frameworks like LlamaIndex, and building AI-powered side projects.</p><p>The challenge is that every new project seems to begin with the same setup: provisioning infrastructure, deploying models, configuring APIs, selecting a vector store, and wiring everything together before you can even start building the application itself.</p><p>That’s the motivation behind <strong>P.O.O.L.</strong> — <strong>Pulumi, Oracle Cloud, Ollama, and LlamaIndex</strong>. Rather than treating each AI project as a one-off experiment, I wanted a reusable platform that could serve as the foundation for multiple applications. Whether it’s a chatbot, a document search engine, a community outreach platform, or even a daily horoscope generator, the underlying infrastructure is largely the same.</p><p>One of the more interesting decisions was choosing Oracle Cloud. Most tutorials focus on AWS, Azure, or Google Cloud, but Oracle Cloud’s Always Free tier offers enough resources to make self-hosting AI surprisingly practical for personal projects. Combined with Pulumi for Infrastructure as Code, Docker for packaging, Ollama for local model serving, and LlamaIndex for retrieval, it became an excellent platform to experiment without immediately worrying about cloud costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWTmD1epFzOKZwt9BWXJvQ.png" /></figure><h3>What is P.O.O.L.?</h3><p>P.O.O.L. isn’t an application — it’s a reusable AI infrastructure platform.</p><p>The goal is to deploy the core building blocks once and reuse them across multiple projects:</p><ul><li>Infrastructure provisioned with Pulumi</li><li>Dockerized AI services</li><li>Ollama for serving open-source language models</li><li>LlamaIndex for retrieval and orchestration</li><li>A public API for AI-powered applications</li><li>A vector database for semantic search</li><li>Monitoring and observability as the platform evolves</li></ul><p>Instead of rebuilding this stack every time inspiration strikes, new projects can simply plug into an existing platform.</p><h3>What to Expect</h3><p>In this series, I’ll walk you through how I built <strong>P.O.O.L.</strong> from scratch using Python, Docker, Pulumi, and Oracle Cloud’s Always Free resources. Along the way, I’ll share why I chose technologies like Ollama and LlamaIndex, why Oracle Cloud turned out to be such an interesting platform for self-hosted AI, and how you can use the same foundation to build your own AI-powered applications.</p><p>We’ll cover topics such as:</p><ul><li>Deploying infrastructure with Pulumi</li><li>Running Ollama in Docker</li><li>Hosting AI services on Oracle Cloud</li><li>Integrating LlamaIndex</li><li>Adding a vector database</li><li>Monitoring the platform</li><li>Building applications on top of the infrastructure</li></ul><p>By the end of the series, you’ll have a reusable AI platform that can power far more than a single project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41199e540a7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building A Digital Push Pin Map]]></title>
            <link>https://mlaguren.medium.com/building-a-digital-push-pin-map-7feca71b2524?source=rss-5f4bc7631e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/7feca71b2524</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[leaflet-map]]></category>
            <category><![CDATA[push-pin-maps]]></category>
            <category><![CDATA[jamstack]]></category>
            <category><![CDATA[hello-kitty]]></category>
            <dc:creator><![CDATA[Melvin Laguren]]></dc:creator>
            <pubDate>Mon, 21 Jul 2025 22:54:57 GMT</pubDate>
            <atom:updated>2025-07-21T22:54:57.203Z</atom:updated>
            <content:encoded><![CDATA[<p>Last Summer (June 2024), we stopped by the Gudetama Cafe in Buena Park, California. My daughter thought it was nice, but I could tell that the die-hard Hello Kitty fan wasn’t super excited. As soon as I mentioned a Hello Kitty Cafe just 30 minutes south in Irvine, her eyes lit up. That began our journey to visit every Hello Kitty cafe that we could.</p><p>This summer, we visited our third Hello Kitty Cafe and to celebrate it, I started building a digital push pin map to mark each cafe we visited and will visit. Push pin maps are a great way to track places that you have visited, but instead of hanging a map on the wall, I will show how I built an online version using Jekyll and Leaflet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BUBrpZCVDSUw9x5RtaYxew.png" /><figcaption>Created using ChatGPT</figcaption></figure><h3>What Is Jekyll?</h3><p><a href="https://jekyllrb.com/">Jekyll</a> is a static site generator written in Ruby. Netlify describes a static site generator as:</p><blockquote>Think of a static site generator as a script which takes in data, content and templates, processes them, and outputs a folder full of all the resultant pages and assets.</blockquote><p>Jekyll is part of the JAMstack architecture, which decouples the web experience layer from data and business logic. The result? Better flexibility, performance, scalability, and maintainability.</p><h3>What is Leaflet?</h3><p><a href="https://leafletjs.com/">Leaflet</a> is a lightweight, open-source JavaScript library for creating interactive maps. It’s mobile-friendly, easy to use, and perfect for visualizing simple datasets-like Hello Kitty Caf locations!</p><h3>Setting Up a Jekyll Project</h3><p>There are two common ways to start a Jekyll project.</p><p><strong>Option 1: Use Jekyll CLI</strong></p><pre>gem install bundler jekyll<br>jekyll new push-pin-map<br>cd push-pin-map<br>bundle exec jekyll serve</pre><p>Visit <a href="http://localhost:4000/">http://localhost:4000</a> to see your new static site.</p><p><strong>Option 2: Use a Custom Gemfile (my preferred method)</strong></p><p>Create a Gemfile in your project folder and run:</p><pre>bundle install</pre><h3>Installing Leaflet</h3><p>To add Leaflet to your Jekyll site, include the CSS and JavaScript from the Leaflet CDN.</p><p>In the &lt;head&gt; section:</p><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;https://unpkg.com/leaflet/dist/leaflet.css&quot; /&gt;</pre><p>Just before the closing &lt;/body&gt; tag:</p><pre>&lt;script src=&quot;https://unpkg.com/leaflet/dist/leaflet.js&quot;&gt;&lt;/script&gt;</pre><h3>Configuring the Map</h3><p>Add this to your main stylesheet or inside the &lt;head&gt;:</p><pre>&lt;style&gt;<br>#map {<br>height: 500px;<br>width: 100%;<br>}<br>&lt;/style&gt;</pre><p>Then, in your &lt;body&gt;:</p><pre>&lt;div class=&quot;container&quot;&gt;<br>&lt;div id=&quot;map&quot;&gt;&lt;/div&gt;<br>&lt;/div&gt;</pre><h3>Initializing the Map</h3><p>Add this script after loading Leaflet:</p><pre>&lt;script&gt;<br>const map = L.map(&#39;map&#39;).setView([37.779379, -122.418433], 6);<br>L.tileLayer(&#39;https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png&#39;).addTo(map);<br>&lt;/script&gt;</pre><p>This example centers the map around San Francisco using OpenStreetMap tiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jyZclOFT-OHORwzYS1ryzA.png" /></figure><h3>The Power of Jekyll</h3><p>Jekyll is often used for blogs, but its true power lies in how it processes content. For this project, I create <em>posts</em> for each caf visit by placing markdown files inside a folder called _pins.</p><p>Here’s an example markdown file:</p><pre>---<br>title: &quot;Hello Kitty Grand Caf - Irvine, CA&quot;<br>lat: 36.1044<br>lng: -115.1716<br>date_visited: 2024-07-05<br>---</pre><p>File: _pins/2024-06-24-irvine.mdCreating a /pins.json Endpoint</p><p>Jekyll can build a JSON endpoint from a template file. Create pins.json in the root of your project:</p><pre>---<br>layout: null<br>permalink: /pins.json<br>---<br>[<br>{% assign sorted_pins = site.pins | sort: &#39;date_visited&#39; | reverse %}<br>{% for pin in sorted_pins %}<br>{<br>&quot;title&quot;: {{ pin.title | jsonify }},<br>&quot;lat&quot;: {{ pin.lat | jsonify }},<br>&quot;lng&quot;: {{ pin.lng | jsonify }},<br>&quot;date&quot;: {{ pin.date_visited | date_to_xmlschema | jsonify }}<br>}{% unless forloop.last %},{% endunless %}<br>{% endfor %}<br>]</pre><p>Start Jekyll and visit <a href="http://localhost:4000/pins.json">http://localhost:4000/pins.json</a>. You should see something like:</p><pre>[<br>{<br>&quot;title&quot;: &quot;Hello Kitty Caf - MGM Park&quot;,<br>&quot;lat&quot;: 36.13,<br>&quot;lng&quot;: -115.17,<br>&quot;visited&quot;: &quot;2024-07-05&quot;<br>},<br>{<br>&quot;title&quot;: &quot;Hello Kitty Grand Caf - Irvine, CA&quot;,<br>&quot;lat&quot;: 36.1044,<br>&quot;lng&quot;: -115.1716,<br>&quot;visited&quot;: &quot;2024-07-05&quot;<br>},<br>{<br>&quot;title&quot;: &quot;Hello Kitty Caf - Fashion Show Mall&quot;,<br>&quot;lat&quot;: 33.6846,<br>&quot;lng&quot;: -117.8265,<br>&quot;visited&quot;: &quot;2024-06-24&quot;<br>}<br>]</pre><h3><strong>Rendering the Pins</strong></h3><p>Update your map initialization script to include the following:</p><pre>&lt;script&gt;<br>const map = L.map(&#39;map&#39;).setView([38.47, -113.30], 5);<br>L.tileLayer(&#39;https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png&#39;, {<br>attribution: &#39; OpenStreetMap contributors&#39;<br>}).addTo(map);<br><br>// retrieve the pin data<br>fetch(&#39;/pins.json&#39;)<br>.then(response =&gt; response.json())<br>.then(pins =&gt; {<br>pins.forEach(pin =&gt; {<br>const { lat, lng, title, date } = pin;<br>L.marker([lat, lng])<br>.addTo(map)<br>.bindPopup(`&lt;strong&gt;${title}&lt;/strong&gt;&lt;br&gt;${new Date(date).toLocaleDateString()}`);<br>});<br>});<br>&lt;/script&gt;</pre><p>Restart Jekyll, refresh your browser, and you should now see interactive pins with popups!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*3_dtkXXBp8PPXUDAxLBwEQ.png" /></figure><h3>Adding a New Location</h3><p>The next time my daughter and I visit a Hello Kitty Cafe, I simply add a new markdown file to the _pins folder-and the map updates automatically on the next build.</p><h3>Summary</h3><p>Creating a digital push pin map with Jekyll and Leaflet has been a fun and meaningful way to document our Hello Kitty Cafe adventures. Check out the repo below to start your own digital push pin map-and follow along as I continue adding not just new cafes, but also new features to enhance the experience and make it even more kawaii.</p><h3>GitHub Repo</h3><p>🔗 <a href="https://github.com/mlaguren/push-pin-map">https://github.com/mlaguren/push-pin-map</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7feca71b2524" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I created a “Now” page]]></title>
            <link>https://mlaguren.medium.com/why-i-created-a-now-page-aa459f7d53fb?source=rss-5f4bc7631e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa459f7d53fb</guid>
            <category><![CDATA[status]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[personal-development]]></category>
            <dc:creator><![CDATA[Melvin Laguren]]></dc:creator>
            <pubDate>Wed, 25 Jun 2025 18:27:53 GMT</pubDate>
            <atom:updated>2025-06-25T18:31:29.749Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*xd9Jc41iG-sy2C_GkKkeHg.png" /></figure><p>While updating and reorganizing my website, I felt like something was missing. My homepage was essentially a blog feed, highlighting posts I had written on Medium, Beehiiv, or LinkedIn. I had the obligatory About page that gave visitors a sense of who I am. But it still felt incomplete-like my site didn’t fully reflect where I was right now.</p><p>After doing some research, I came across the concept of a Now page.</p><p><strong>What’s a “Now” Page?</strong></p><p>The concept was popularized by <a href="https://sive.rs/now2">Derek Sivers</a>. A Now page is a simple section on your site that answers the question:</p><blockquote>What are you focused on right now?</blockquote><p>Answering this question not only helps others understand what you’re doing at the moment, but also what you’re actively learning, building, or thinking about in this current season of your life. It’s a snapshot of your present priorities-updated every month or so.</p><p><strong>1. It Gives Context That a Bio Can’t</strong></p><p>Your About page shares your background. Your Resume or Projects page shows your experience. But neither of those reveals your *current* focus. Are you building a startup? Taking time off? Deep in a new skill?</p><p>A Now page bridges that gap. It adds dimension to who you are *right now*.</p><p><strong>2. It Builds Authentic Connection</strong></p><p>In a world of curated timelines and professional highlights, A Now page is refreshingly real. It shows that you’re a work in progress, just like everyone else. Sharing what you’re focused on now-your goals, your challenges, your shifts in direction-helps others relate to you. For those looking to collaborate, hire, or follow your work, it gives them a clearer picture of what you’re about at this moment.</p><p><strong>3. It Helps You Stay Accountable</strong></p><p>A Now page isn’t just for others. It’s for you. Publicly stating your current focus can be a subtle but powerful motivator. You’ll find yourself reflecting more often:</p><ul><li>Am I still working on what I said I was?</li><li>Has my focus changed?</li></ul><p>Even just checking in once a month to update it becomes a form of personal alignment.</p><p><strong>What Should You Include?</strong></p><p>There are no rules, but here’s what many people share:</p><ul><li>Current work or projects</li><li>What you’re learning or reading</li><li>Personal goals or experiments</li><li>What you’re intentionally saying no to</li><li>Travel plans or major life changes</li></ul><p>Check out my <a href="https://laguren.net/now">now page</a>.</p><p>Your website doesn’t have to be frozen in time. A Now page adds life. It makes your site more honest, more dynamic, and more *you*. It’s one of the simplest ways to make your digital presence feel more human. So go ahead-add a `/now` page to your site. Start with a paragraph or two. Update it when it feels right. And if you like the idea, consider joining the growing directory of Now pages at <a href="https://nownownow.com/">nownownow.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa459f7d53fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Every SDET Should Master the Pangram Coding Question]]></title>
            <link>https://mlaguren.medium.com/why-every-sdet-should-master-the-pangram-coding-question-948b75ad6dab?source=rss-5f4bc7631e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/948b75ad6dab</guid>
            <category><![CDATA[interview-tips]]></category>
            <category><![CDATA[sdet-interview]]></category>
            <category><![CDATA[interview-questions]]></category>
            <dc:creator><![CDATA[Melvin Laguren]]></dc:creator>
            <pubDate>Thu, 17 Apr 2025 15:02:25 GMT</pubDate>
            <atom:updated>2025-04-17T15:02:25.934Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Write a function that determines if a given string contains every letter in the alphabet (a-z), in other words determine if the given string is a pangram.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzc5IvdqQLAIwNY75frqKQ.jpeg" /><figcaption>The Quick Red Fox Jumps Over The Lazy Brown Dog. This image was created with the assistance of DALL·E 2</figcaption></figure><p>Over my career, I have been on both the giving and receiving end of the pangram coding question. The first time I encountered it, my immediate instinct was to write a function using a for loop to check every character in the string. My approach was to track each letter of the alphabet in an array and cross off characters as I found them. If any letters remained after processing the string, I determined that it was not a pangram.</p><p>Many QA professionals I’ve asked this question also arrived at a similar solution. While this approach works, it isn’t the most efficient one.</p><p>Luckily, my interviewer followed up with a crucial question:</p><blockquote>Is your solution optimal?</blockquote><p>At that moment, my nerves settled, and everything I had learned in college came “looping” back into my mind. Over the next 30 minutes, I refactored my code, explaining how my function improved from O(n) to O(k).</p><p>Although I didn’t get the job, that interview left a lasting impression. Now, when I interview SDET candidates, I often use the same question. It allows me to evaluate fundamental programming skills in a single challenge.</p><blockquote>Edge Case Handling</blockquote><p>SDETs, QA engineers, and all members of a Scrum team must consider edge cases — empty strings, missing letters, non-alphabetic characters, and varying letter cases. This reinforces the habit of writing robust, defensive code, along with corresponding unit tests that hold up in unpredictable scenarios.</p><blockquote>Efficiency Considerations</blockquote><p>As mentioned at the beginning, writing code that works is one thing, but writing code that scales is another. My initial solution involved multiple loops, but the final refined approach significantly reduced time complexity.</p><blockquote>Algorithmic Thinking</blockquote><p>The pangram question may seem simple at first, but it requires logical problem-solving. SDETs must break the problem down, strategize an efficient solution, and iterate on their approach — just like they would when tackling complex automation challenges in test engineering.</p><blockquote>String Manipulation</blockquote><p>Many automation tasks involve working with raw text — extracting meaningful information and transforming it for validation. The pangram question is a great way to assess how well an SDET can manipulate strings to solve a problem efficiently.</p><blockquote>Language Proficiency</blockquote><p>Since it can be solved in multiple ways (loops, sets, bitwise operations, regex), the pangram question demonstrates an SDET’s proficiency for a language. It would demonstrate familiarity with language-specific features, idiomatic coding styles and implementation of data structures.</p><p>Have you taken the pangram coding question? Visit <a href="https://pangram-checker.com/?utm_source=medium&amp;utm_medium=social_media">pangram-checker.com</a> for other variations that I have used for interviewing SDET/QA candidates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=948b75ad6dab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hosting A Static Website On An AWS S3 Bucket]]></title>
            <link>https://towardsdev.com/hosting-a-static-website-on-an-aws-s3-bucket-1489642f792c?source=rss-5f4bc7631e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/1489642f792c</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[jamstack]]></category>
            <category><![CDATA[static-site]]></category>
            <category><![CDATA[s3-bucket]]></category>
            <dc:creator><![CDATA[Melvin Laguren]]></dc:creator>
            <pubDate>Fri, 10 Mar 2023 06:38:00 GMT</pubDate>
            <atom:updated>2023-03-14T18:03:06.377Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wzntktW3gGgGIbVrOkkhA.png" /><figcaption>Personal Website Hosted On AWS S3 Bucket</figcaption></figure><p>Amazon’s Simple Storage System (S3) is probably one of the most affordable solutions to host a website, especially if you are looking to build one using a <a href="https://jamstack.org/">jamstack</a> solution like myself (https://melvin.laguren.net).</p><p>I’ve outlined the steps below to configure an S3 bucket to host a sample website. If you don’t have an AWS account, you can sign up for an account and follow the instructions below.</p><p>Log into you AWS account and go to your S3 buckets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O3men5pdeh_vdnpNAyGUlg.png" /><figcaption>Click on the Create Bucket button</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*tlw99kkzSFpwPN8I2SvYBQ.png" /><figcaption>Enter a unique bucket name</figcaption></figure><p><em>Tip: Because S3 bucket names need to be globally unique, it may be beneficial to name the bucket after the domain name you own and plan to use.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JFEp0jrBLt1aq_FSMZWzxw.png" /><figcaption>Scroll down the screen and uncheck, Block all public access. You’ll need to check on the “I acknowledge” checkbox.</figcaption></figure><p>Scroll to the bottom of the page and click on “Create Bucket”. If your bucket name is unique, the bucket will be created and you will return to the list of buckets. Once you are back on the list of buckets, click on your new bucket and select permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BIThnGesc5BZcZq8-NW7RA.png" /><figcaption>On the properties page, scroll to the bottom.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RolB-WgybadEqhMj4FRsRg.png" /><figcaption>On the Static website hosting box, click on Edit</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*Exc1c2Cwb4ot3Ym1wavTKA.png" /><figcaption>Static website will be checked on Disable, change it to Enable</figcaption></figure><p>Once enabled, select “Host A Static Website” and enter index.html as the default home page for your site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*ipDgJw0rSOVR2TiNYfCmNQ.png" /><figcaption>Scroll to the bottom and click on Save Changes</figcaption></figure><p>Now, go to the Permissions page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*k8fEYpGPvFWvmE2nwjiZ5A.png" /></figure><p>Scroll to the bottom and stop where it says Bucket policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zwEKDNnk11aGFUaiOaT_gQ.png" /><figcaption>S3 Bucket Policy Field</figcaption></figure><p>Click on the edit button and enter the following permission below. <strong>Replace “YOURBUCKETNAME” with the actual name of the bucket you created. </strong>In my case, it would be www.my-website.demo</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;PublicReadGetObject&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: &quot;*&quot;,<br>            &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>            &quot;Resource&quot;: &quot;arn:aws:s3:::YOURBUCKETNAME/*&quot;<br>        }<br>    ]<br>}</pre><p>Save the permissions and then return to the Objects page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y204DLGyKLCwe_3ik-nS_Q.png" /><figcaption>Now you can upload your html files</figcaption></figure><p>Once the files are uploaded, go to the properties page and scroll to the bottom to get the accessible url.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2oSEi6__xUABehQ413vESg.png" /></figure><p>In my next post, I’ll cover how I set up Cloudfront and register to get a free SSL certificate so that I can have a secure site, https://melvin.laguren.net.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1489642f792c" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/hosting-a-static-website-on-an-aws-s3-bucket-1489642f792c">Hosting A Static Website On An AWS S3 Bucket</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running KIBA as a Github Action]]></title>
            <link>https://mlaguren.medium.com/running-kiba-as-a-github-action-8cea647c4a07?source=rss-5f4bc7631e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cea647c4a07</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[kiba]]></category>
            <category><![CDATA[environment]]></category>
            <dc:creator><![CDATA[Melvin Laguren]]></dc:creator>
            <pubDate>Tue, 28 Feb 2023 17:34:50 GMT</pubDate>
            <atom:updated>2023-02-28T17:34:50.863Z</atom:updated>
            <content:encoded><![CDATA[<p>Now that I have gone over how I built an <a href="https://medium.com/@mlaguren/kiba-loading-data-to-buy-defi-acdadc73dba8">ETL job using KIBA</a>, let’s look at how I leverage Github Actions to run the jobs on a daily basis.</p><h3>Setting Up Environments</h3><p>As I continue to redesign <a href="https://buyanddefi.com/">buyanddefi.com</a>, I want to set up different environments to test my etl code and other future feature. Fortunely, Bit.io’s free plan helps me to set up the 3 basic environments for future CI plans (local, staging, production). For local development, I’ll describe how I used the dotenv gem to manage my environment in a future article.</p><p><strong>STAGING ENVIRONMENT (ETHEREUM)</strong></p><p>For my staging environment, I want to run the etl job every time code gets merged to the develop branch. So, my workflow file starts off like this:</p><pre>name: ETL Workflow On Ethereum<br>on:<br>  pull_request:<br>    branches:<br>      - develop<br>    types: [closed]</pre><p>Now, I need to set up the environment variables for this workflow to connect to the Ethereum environment. On a paid plan of Github, there is an option called environments when you go the repository’s settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MlcSwudULMRQX3jutmdcMQ.png" /></figure><p>After creating the Ethereum environment, you will be provided a section to configure the environment variables. You are provided two options when setting up your environment variables, Environment Secrets and Environment Variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*NdZfniKxQqbv712dHmvk-g.png" /></figure><p>Based on the description provided, I decided to just set up 3 secrets and provide the following set up so that it is accessible from the workflow.</p><pre>jobs:<br>  etl:<br>    runs-on: ubuntu-latest<br>    environment: ethereum<br>    env:<br>      DB: &#39;${{ secrets.DB }}&#39;<br>      DBPASS: &#39;${{ secrets.DBPASS }}&#39;<br>      DBUSER: &#39;${{ secrets.DBUSER }}&#39;<br>      SSLMODE: &#39;require&#39;<br>      HOST: &#39;db.bit.io&#39;<br>    steps:<br>      - uses: actions/checkout@v1<br>      - uses: ruby/setup-ruby@v1<br>        with:<br>          ruby-version: &#39;3.0&#39; # Not needed with a .ruby-version file<br>          bundler-cache: true # runs &#39;bundle install&#39; and caches installed gems automatically<br>      - run: bundle exec ruby etl.rb</pre><p>The etl job will run on the ethereum environment (aka staging) with the environment variables defined from secrets I entered into the Github repository. In addition, two additional environment variables I’ve defined in the yaml file will be included (SSLMODE &amp; HOST).</p><p><strong>PRODUCTION ENVIRONMENT (BITCOIN)</strong></p><p>The only difference in the Bitcoin (production) environment/workflow are two things:</p><ol><li>The workflow is scheduled to run as a daily cron job</li><li>A new environment is set up for the production environment</li></ol><pre>name: ETL Workflow On Ethereum<br>on:<br>  schedule: ## Run job everyday at 1400 UTC<br>    - cron: &quot;0 14 * * *&quot;<br>jobs:<br>  etl:<br>    runs-on: ubuntu-latest<br>    environment: bitcoin<br>    env:<br>      DB: &#39;${{ secrets.DB }}&#39;<br>      DBPASS: &#39;${{ secrets.DBPASS }}&#39;<br>      DBUSER: &#39;${{ secrets.DBUSER }}&#39;<br>      SSLMODE: &#39;require&#39;<br>      HOST: &#39;db.bit.io&#39;<br>    steps:<br>      - uses: actions/checkout@v1<br>      - uses: ruby/setup-ruby@v1<br>        with:<br>          ruby-version: &#39;3.0&#39; # Not needed with a .ruby-version file<br>          bundler-cache: true # runs &#39;bundle install&#39; and caches installed gems automatically<br>      - run: bundle exec ruby etl.rb</pre><h3>Conclusion</h3><p>From my two examples, you can now configure Github actions to run an ETL job when you either merge code to a branch or set it up to run on a daily basis. Feel free to revisit my previous article on how I built the ETL job using <a href="https://medium.com/@mlaguren/kiba-loading-data-to-buy-defi-acdadc73dba8">Kiba</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cea647c4a07" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kiba — Loading Data To Buy & Defi]]></title>
            <link>https://mlaguren.medium.com/kiba-loading-data-to-buy-defi-acdadc73dba8?source=rss-5f4bc7631e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/acdadc73dba8</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[kiba]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Melvin Laguren]]></dc:creator>
            <pubDate>Tue, 21 Feb 2023 05:09:28 GMT</pubDate>
            <atom:updated>2023-02-21T05:09:28.985Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kiba — Loading Data To Buy &amp; Defi</h3><p>In my last <a href="https://medium.com/@mlaguren/building-a-page-scraper-with-ruby-and-mechanize-57f4775027bc">post</a>, I showed how I collected Earn information from Binance US’s website using Mechanize. Now with the data captured, how do I load it to a database that my website, <a href="https://buyanddefi.com/">buyanddefi.com</a>, can use?</p><p><strong>What is KIBA?</strong></p><p><a href="https://www.kiba-etl.org/">Kiba</a> is an ETL framework written in ruby that makes it simple to:</p><ul><li>Extract information from a source, such as a database or file</li><li>Transform that information</li><li>Load the updated information to a new destination (database, file, etc)</li></ul><pre>require &#39;kiba&#39;<br>require_relative &#39;lib/binance&#39;<br>require_relative &#39;lib/load_binance&#39;<br><br># Defining an ETL job to retrieve and load Binance information<br><br>get_binance = Kiba.parse do<br>  source Binance<br>  transform BinanceTransform<br>  destination LoadBinance<br>end<br><br>Kiba.run(get_binance)<br></pre><p><strong>Source (aka Extract)</strong></p><p>My page scraper for Binance retrieved information from their website and stored it in an array. To define a source in Kiba, I created a class called Binance which contains 2 methods, initialize and each.</p><p>My initialize method is basically the entire mechanize code that visits Binance’s website and stores the data in an array. The each method will read each element of the array and pass it downstream to the transform/destination parts of the ETL job defined by Kiba. Ideally, each element of the array should be a hash.</p><pre>class Binance<br><br>  def initialize<br>    a = Mechanize.new { |agent|<br>      agent.user_agent = &#39;Windows Chrome&#39;<br>    }<br>    page = a.get(&#39;https://www.binance.us/staking&#39;)<br>    cards = page.search(&#39;//*[@id=&quot;__APP&quot;]/div/div[1]/div/div[2]/div/div/div/div/child::*&#39;)<br>    @binance = []<br>    cards.each do | card |<br>      coin = {}<br>      coin[:symbol] = card.element_children[0].element_children[0].elements.children.children[0].text<br>      coin[:name] = card.element_children[0].element_children[0].elements.children.children[1].text<br>      coin[:rate] = card.element_children[0].element_children[0].elements.children.children[2].text[/(.*)%/,1]<br>      @binance &lt;&lt; coin<br>    end<br><br>  end<br><br>  def each<br>    @binance.each do | coin |<br>      yield(coin)<br>    end<br>  end<br><br>end</pre><h3>Transform</h3><p>This part of the ETL job will allow us to update each “row” of data so that it can be loaded to the destination. The data we received from the scraper, we want to do 2 things:</p><ol><li>Put the name in all capital letters</li><li>Add a new key called exchange with the value “BINANCE”</li></ol><p>To do this, I created a new class called BinanceTransform.</p><pre>class BinanceTransform<br>  def initialize<br><br>  end<br><br>  def process(row)<br>    row[:name] = row[:name].upcase<br>    row[:exchange] = &#39;BINANCE&#39;<br>    return row<br>  end<br><br>end</pre><p>When I run the ETL job, I can see that my extracted data did indeed get transformed as:</p><pre>{:symbol=&gt;&quot;ETH&quot;, :name=&gt;&quot;ETHEREUM&quot;, :rate=&gt;&quot;5.00&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;BNB&quot;, :name=&gt;&quot;BNB&quot;, :rate=&gt;&quot;2.50&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;ADA&quot;, :name=&gt;&quot;CARDANO&quot;, :rate=&gt;&quot;4.30&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;MATIC&quot;, :name=&gt;&quot;POLYGON&quot;, :rate=&gt;&quot;6.40&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;VET&quot;, :name=&gt;&quot;VECHAIN&quot;, :rate=&gt;&quot;2.00&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;SOL&quot;, :name=&gt;&quot;SOLANA&quot;, :rate=&gt;&quot;7.70&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;ATOM&quot;, :name=&gt;&quot;COSMOS&quot;, :rate=&gt;&quot;15.00&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;ONE&quot;, :name=&gt;&quot;HARMONY&quot;, :rate=&gt;&quot;7.20&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;AVAX&quot;, :name=&gt;&quot;AVALANCHE&quot;, :rate=&gt;&quot;5.40&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;DOT&quot;, :name=&gt;&quot;POLKADOT&quot;, :rate=&gt;&quot;10.30&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;NEAR&quot;, :name=&gt;&quot;NEAR PROTOCOL&quot;, :rate=&gt;&quot;7.00&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;ALGO&quot;, :name=&gt;&quot;ALGORAND&quot;, :rate=&gt;&quot;6.80&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;FTM&quot;, :name=&gt;&quot;FANTOM &quot;, :rate=&gt;&quot;3.40&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;GRT&quot;, :name=&gt;&quot;THE GRAPH&quot;, :rate=&gt;&quot;6.70&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;XTZ&quot;, :name=&gt;&quot;TEZOS &quot;, :rate=&gt;&quot;3.00&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;ROSE&quot;, :name=&gt;&quot;OASIS NETWORK&quot;, :rate=&gt;&quot;4.50&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;FLOW&quot;, :name=&gt;&quot;FLOW&quot;, :rate=&gt;&quot;7.00&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;TRX&quot;, :name=&gt;&quot;TRON&quot;, :rate=&gt;&quot;4.90&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;AUDIO&quot;, :name=&gt;&quot;AUDIUS&quot;, :rate=&gt;&quot;12.80&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;LPT&quot;, :name=&gt;&quot;LIVEPEER&quot;, :rate=&gt;&quot;11.40&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;FET&quot;, :name=&gt;&quot;FETCH.AI&quot;, :rate=&gt;&quot;3.60&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;KSM&quot;, :name=&gt;&quot;KUSAMA&quot;, :rate=&gt;&quot;11.80&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;CELR&quot;, :name=&gt;&quot;CELER&quot;, :rate=&gt;&quot;4.80&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;BAND&quot;, :name=&gt;&quot;BAND PROTOCOL&quot;, :rate=&gt;&quot;12.00&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;SKL&quot;, :name=&gt;&quot;SKALE&quot;, :rate=&gt;&quot;7.00&quot;, :exchange=&gt;&quot;BINANCE&quot;}<br>{:symbol=&gt;&quot;T&quot;, :name=&gt;&quot;THRESHOLD&quot;, :rate=&gt;&quot;5.50&quot;, :exchange=&gt;&quot;BINANCE&quot;}</pre><h3>Destination</h3><p>To load the newly transformed data into the Buy And Defi database, I created a new called LoadBinance which consists of three methods</p><ul><li>initialize — open a connection to the database</li><li>write — insert/update the record in the appropriate table</li><li>close — close the database connection</li></ul><pre>class LoadBinance<br><br>  def initialize<br>    @conn = PG.connect( :host =&gt; ENV[&#39;HOST&#39;], :dbname=&gt; ENV[&#39;DB&#39;], :user =&gt; ENV[&#39;DBUSER&#39;], :password =&gt; ENV[&#39;DBPASS&#39;], :sslmode=&gt; ENV[&#39;SSLMODE&#39;])<br>  end<br><br>  def write(row)<br>    @conn.exec_params(&quot;insert into coins ( symbol, name, rate, exchange ) values ( $1, $2, $3, $4) on conflict (name, exchange) do update set rate = $3, updated_at = NOW()&quot;,<br>                      [ row[:symbol], row[:name], row[:rate], row[:exchange] ])<br>  end<br><br>  def close<br>    @conn.close<br>  end<br><br>end</pre><p><em>Note: Because the my ETL job will run on a daily basis, my insert query in the write method includes an </em><strong><em>on conflict</em></strong><em> condition.</em></p><h3>Kiba.run(get_binance)</h3><p>With all the classes defined, I can simply have Github run the Kiba job(s) and voila! 26 rows have been added to my database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*knhsuT3rg9DZ38C-qBqBOQ.png" /><figcaption>Screenshot of database (interface courtesy bit.io)</figcaption></figure><p>My ETL job, get_binance, can now run on a daily basis and update the Buy And Defi database for any rate changes or new coins added on Binance’s Earn page.</p><p>In my next article, I’ll share how I configured a Github action to run the ETL job on a daily basis.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acdadc73dba8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building A Page Scraper With Ruby and Mechanize]]></title>
            <link>https://mlaguren.medium.com/building-a-page-scraper-with-ruby-and-mechanize-57f4775027bc?source=rss-5f4bc7631e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/57f4775027bc</guid>
            <category><![CDATA[binance]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Melvin Laguren]]></dc:creator>
            <pubDate>Mon, 13 Feb 2023 15:58:31 GMT</pubDate>
            <atom:updated>2023-02-13T15:58:31.720Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yKLRgqNaeKQ5wb8pUX08rw.png" /><figcaption>https://buyanddefi.com</figcaption></figure><p>Just like interest rates, staking/defi rates change periodically. Collecting and entering this information from different crypto exchange websites manually can be a painstaking task. Unfortunately, very few crypto exchanges provide an API to collect that information. So, I decided to write a page scraper to collect the data and then have it upload to a database.</p><h3><strong>Enter Mechanize</strong></h3><p>Years ago, I used a Perl module called Mechanize to “browse” the web and collect data from websites. I was happy to see that there was a ruby gem of the same name and capabilities. Here’s a description from the <a href="https://github.com/sparklemotion/mechanize">Github repo</a>:</p><p><em>The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and submit forms. Form fields can be populated and submitted. Mechanize also keeps track of the sites that you have visited as a history.</em></p><p>So, I decided to try it out on Binance US.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FeZkTzVnan6hVFuCui3Jtg.png" /></figure><p>When you visit <a href="https://binance.us/staking,">https://binance.us/staking,</a> you can see on the page the offers listed in the various cards on the page. In order to get the information, I needed to write a script that did the following:</p><ol><li>Visit the staking page</li><li>Identify all the cards on the page</li><li>Extract the Symbol, Name, and Rate from each card</li><li>Store it in an object (JSON)</li></ol><h3><strong>Visiting the staking page</strong></h3><p>After installing the mechanize gem, the first thing I needed to do was create a Mechanize object and I set the user_agent to ‘Windows Chrome’.</p><pre>require &#39;mechanize&#39;<br><br>a = Mechanize.new { |agent|<br>  agent.user_agent = &#39;Windows Chrome&#39;<br>}</pre><p>Then, I needed to visit the staking page.</p><pre>page = a.get(&#39;https://www.binance.us/staking&#39;)</pre><p>To see what information page received, you can do an inspection and see the following information:</p><p>#&lt;Mechanize::Page<br> {url #&lt;URI::HTTPS <a href="https://www.binance.us/staking">https://www.binance.us/staking</a>&gt;}<br> {meta_refresh}<br> {title “Earn Rewards With Crypto Staking | Binance.US”}<br> {iframes<br> #&lt;Mechanize::Page::Frame<br> nil<br> “<a href="https://www.googletagmanager.com/ns.html?id=GTM-5PWJS9J">https://www.googletagmanager.com/ns.html?id=GTM-5PWJS9J</a>&quot;&gt;}<br> {frames}<br>…</p><h3><strong>Identify all the cards on the page</strong></h3><p>Mechanize provides a method called search. Using <a href="https://www.w3schools.com/xml/xpath_intro.asp">xpath</a> as a parameter, I was able to collect all the elements on the page that represented a card.</p><pre>xpath = &#39;//*[@id=&quot;__APP&quot;]/div/div[1]/div/div[2]/div/div/div/div/child::*&#39;<br>cards = page.search(xpath)</pre><h3><strong>Extract the Symbol, Name, and Rate From Each Card</strong></h3><p>Now comes the fun part. Inspecting the html value of one of the cards collected by Mechanize, I can see that the information can be found in the HTML/XML collected by the search method.</p><pre>&lt;div class=&quot;card-item&quot;&gt;<br>  &lt;div class=&quot;sc-bcXHqe fLkoyl item-intro&quot;&gt;<br>    &lt;div class=&quot;item-icon&quot;&gt;<br>      &lt;img style=&quot;border-radius:100%;overflow:hidden;display:block&quot; width=&quot;40&quot; height=&quot;40&quot; src=&quot;https://static.binance.us/image/admin_mgs_image_upload/20210202/b2a3e592-3659-4e5d-9ef6-474cb9f61963.png&quot;&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;sc-bcXHqe lcVLsA item-info&quot;&gt;<br>      &lt;div&gt;<br>        &lt;h3 class=&quot;sc-bcXHqe gcebil&quot;&gt;ETH&lt;/h3&gt;<br>        &lt;p style=&quot;white-space:nowrap&quot;&gt;Ethereum&lt;/p&gt;<br>      &lt;/div&gt;<br>      &lt;div class=&quot;item-info-rate&quot; style=&quot;color:#828384&quot;&gt;<br>        &lt;span style=&quot;font-size:20px&quot;&gt;5.00&lt;!-- --&gt;%&lt;/span&gt;&lt;span style=&quot;font-size:20px&quot;&gt; APY&lt;/span&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>  &lt;div class=&quot;sc-bcXHqe lcVLsA item-btns&quot;&gt;<br>    &lt;button data-bn-type=&quot;button&quot; class=&quot;sc-bcXHqe ibyizy&quot;&gt;Stake &lt;!-- --&gt;ETH&lt;/button&gt;&lt;button data-bn-type=&quot;button&quot; class=&quot;sc-bcXHqe kqxVKL&quot;&gt;Buy &lt;!-- --&gt;ETH&lt;/button&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>In the html, the values that need to be extracted are there.</p><ul><li>Symbol (ETH)</li><li>Name (Ethereum)</li><li>APY (5.00)</li></ul><p>Playing around with the methods element_children, elements, children and text, I was able to traverse through the html (xml) and find the text that contained the symbol ETH.</p><pre>coin[:symbol] = card.element_children[0].element_children[0].elements.children.children[0].text</pre><p>Repeating the process, I retrieved the name and the APY. Because I’m only interested in the APY rate, I removed the % symbol as part of my extraction process using the following regular expression pattern, /(.*)%/.</p><pre> coin[:name] = card.element_children[0].element_children[0].elements.children.children[1].text<br> coin[:rate] = card.element_children[0].element_children[0].elements.children.children[2].text[/(.*)%/,1]</pre><p>With 1 card down, I added a loop that would iterate through all the cards collected by my search method earlier and store the information in a json/hash.</p><pre># initialize an array<br>binance = []<br>cards.each do | card |<br>  # initialze a hash to store the extracted information<br>  coin = {}<br>  coin[:symbol] = card.element_children[0].element_children[0].elements.children.children[0].text<br>  coin[:name] = card.element_children[0].element_children[0].elements.children.children[1].text<br>  coin[:rate] = card.element_children[0].element_children[0].elements.children.children[2].text[/(.*)%/,1]<br>  # add the coin to the array<br>  binance &lt;&lt; coin<br>end</pre><p>And there you have it. As of this writing, the following rates from Binance US are:</p><pre>[{:symbol=&gt;&quot;ETH&quot;, :name=&gt;&quot;Ethereum&quot;, :rate=&gt;&quot;5.00&quot;},<br> {:symbol=&gt;&quot;BNB&quot;, :name=&gt;&quot;BNB&quot;, :rate=&gt;&quot;2.50&quot;},<br> {:symbol=&gt;&quot;ADA&quot;, :name=&gt;&quot;Cardano&quot;, :rate=&gt;&quot;4.30&quot;},<br> {:symbol=&gt;&quot;MATIC&quot;, :name=&gt;&quot;Polygon&quot;, :rate=&gt;&quot;6.40&quot;},<br> {:symbol=&gt;&quot;VET&quot;, :name=&gt;&quot;VeChain&quot;, :rate=&gt;&quot;2.00&quot;},<br> {:symbol=&gt;&quot;SOL&quot;, :name=&gt;&quot;Solana&quot;, :rate=&gt;&quot;7.70&quot;},<br> {:symbol=&gt;&quot;ATOM&quot;, :name=&gt;&quot;Cosmos&quot;, :rate=&gt;&quot;15.00&quot;},<br> {:symbol=&gt;&quot;ONE&quot;, :name=&gt;&quot;Harmony&quot;, :rate=&gt;&quot;7.20&quot;},<br> {:symbol=&gt;&quot;AVAX&quot;, :name=&gt;&quot;Avalanche&quot;, :rate=&gt;&quot;5.40&quot;},<br> {:symbol=&gt;&quot;DOT&quot;, :name=&gt;&quot;Polkadot&quot;, :rate=&gt;&quot;10.30&quot;},<br> {:symbol=&gt;&quot;NEAR&quot;, :name=&gt;&quot;NEAR Protocol&quot;, :rate=&gt;&quot;7.00&quot;},<br> {:symbol=&gt;&quot;ALGO&quot;, :name=&gt;&quot;Algorand&quot;, :rate=&gt;&quot;6.80&quot;},<br> {:symbol=&gt;&quot;FTM&quot;, :name=&gt;&quot;Fantom &quot;, :rate=&gt;&quot;3.40&quot;},<br> {:symbol=&gt;&quot;GRT&quot;, :name=&gt;&quot;The Graph&quot;, :rate=&gt;&quot;6.70&quot;},<br> {:symbol=&gt;&quot;XTZ&quot;, :name=&gt;&quot;Tezos &quot;, :rate=&gt;&quot;3.00&quot;},<br> {:symbol=&gt;&quot;ROSE&quot;, :name=&gt;&quot;Oasis Network&quot;, :rate=&gt;&quot;4.50&quot;},<br> {:symbol=&gt;&quot;FLOW&quot;, :name=&gt;&quot;FLOW&quot;, :rate=&gt;&quot;7.00&quot;},<br> {:symbol=&gt;&quot;TRX&quot;, :name=&gt;&quot;TRON&quot;, :rate=&gt;&quot;4.90&quot;},<br> {:symbol=&gt;&quot;AUDIO&quot;, :name=&gt;&quot;Audius&quot;, :rate=&gt;&quot;12.80&quot;},<br> {:symbol=&gt;&quot;LPT&quot;, :name=&gt;&quot;Livepeer&quot;, :rate=&gt;&quot;11.40&quot;},<br> {:symbol=&gt;&quot;FET&quot;, :name=&gt;&quot;Fetch.ai&quot;, :rate=&gt;&quot;3.60&quot;},<br> {:symbol=&gt;&quot;KSM&quot;, :name=&gt;&quot;Kusama&quot;, :rate=&gt;&quot;11.80&quot;},<br> {:symbol=&gt;&quot;CELR&quot;, :name=&gt;&quot;Celer&quot;, :rate=&gt;&quot;4.80&quot;},<br> {:symbol=&gt;&quot;BAND&quot;, :name=&gt;&quot;Band Protocol&quot;, :rate=&gt;&quot;12.00&quot;},<br> {:symbol=&gt;&quot;SKL&quot;, :name=&gt;&quot;SKALE&quot;, :rate=&gt;&quot;7.00&quot;},<br> {:symbol=&gt;&quot;T&quot;, :name=&gt;&quot;Threshold&quot;, :rate=&gt;&quot;5.50&quot;}]</pre><p>Stay tuned to how I use an Kiba, an ETL framework, to upload this information to Buy And Defi’s database.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57f4775027bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps or SRE — A Simple API Example]]></title>
            <link>https://mlaguren.medium.com/devops-or-sre-a-simple-api-example-f94f440cf8af?source=rss-5f4bc7631e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/f94f440cf8af</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sinatra-app]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[site-reliability-engineer]]></category>
            <dc:creator><![CDATA[Melvin Laguren]]></dc:creator>
            <pubDate>Wed, 19 Oct 2022 05:42:44 GMT</pubDate>
            <atom:updated>2022-10-21T20:56:55.181Z</atom:updated>
            <content:encoded><![CDATA[<h3>DevOps or SRE — A Simple API Example</h3><p>During the development of a new app environment with terraform, I was reviewing the dev environment and asked a question to my DevOps engineer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*UttEVoNvLdsU7WQEQoxSHQ.png" /><figcaption>Image Courtesy Of <a href="https://www.seobility.net/en/wiki/REST_API">Seobility</a></figcaption></figure><p><strong><em>How Do I Know That This Environment Is Functional?</em></strong></p><p>The first answer I received was to call the “alive” endpoint and check for a status code of 200.</p><p>For many, that would be acceptable. Unfortunately, my colleague learned that the answer was not good enough for me. For the next 10 minutes, we debated on what the right answer was.</p><p>To understand the debate, here is an example piece of code to demonstrate both our point of views.</p><pre><em>require </em><strong>&quot;sinatra/base&quot;<br></strong><em>require </em><strong>&#39;sinatra/activerecord&#39;<br><br>class <em>App </em></strong>&lt; <strong><em>Sinatra</em></strong>::<strong><em>Base<br>  </em></strong><em>get </em><strong>&#39;/alive&#39; do<br>    </strong>status 200<br>  <strong>end<br><br>  </strong><em>get </em><strong>&#39;/healthcheck&#39; do<br>    </strong><em>ruby_version </em>= <strong>`ruby -v`<br>    </strong><em>sinatra_version </em>= <strong>`gem list sinatra`<br>    </strong><em>app </em>= <strong><em>AppVersion</em></strong>.last<br><br>    status 200<br>    <strong>return </strong>{<br>      <strong>&#39;ruby version&#39;</strong>:<strong>&quot;</strong>#{ <em>ruby_version</em>.strip }<strong>&quot;</strong>,<br>      <strong>&#39;sinatra version&#39;</strong>:<strong>&quot;</strong>#{ <em>sinatra_version</em>.strip }<strong>&quot;</strong>,<br>      <strong>&#39;app version&#39;</strong>:&quot;<em>#{ app[&#39;version&#39;] }</em>&quot;<br>    }.to_json<br>  <strong>end<br><br>  </strong>run!<br><strong>end</strong></pre><p>From my colleague’s point of view, if I make a GET request to /alive and receive a 200 status code, then my environment is up. However, if you look at the /healthcheck endpoint, I get more information about whether or not my environment is functional.</p><p>Making a GET request to /healthcheck, the api will return me 3 pieces of information:</p><ul><li>What version of ruby is configured?</li><li>What version is the sinatra gem?</li><li>What application version is currently stored in the database?</li></ul><p>For this simple API, an SRE would leverage the information returned to validate that the site is up and reliable. As the application becomes more complex, the SRE will need to think of how to create monitoring scripts to determine the functionality and availability of the application and environment. This allows the DevOps engineer to continue the bridge between development and operations.</p><p>For smaller companies, DevOps could play both roles. However, as a company grows, an SRE will need to be added to ensure a company’s success.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f94f440cf8af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Investing In Disneyland]]></title>
            <link>https://mlaguren.medium.com/investing-in-disneyland-4f28c5533164?source=rss-5f4bc7631e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f28c5533164</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[disney-stock]]></category>
            <category><![CDATA[disneyland-tickets]]></category>
            <category><![CDATA[dogecoin]]></category>
            <category><![CDATA[disneyland]]></category>
            <dc:creator><![CDATA[Melvin Laguren]]></dc:creator>
            <pubDate>Wed, 05 May 2021 05:13:56 GMT</pubDate>
            <atom:updated>2021-05-05T05:13:56.726Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1iuEVabXdyRRIMTGgBc4ng.jpeg" /><figcaption>Image by Aline Dassel from Pixabay</figcaption></figure><p>Over a year ago, Disneyland closed its gates because of the pandemic. Not only did the park close, but it put an end to the Disneyland Annual Pass. After reopening on April 30, details of the new annual pass program have not been made publicly available as of this post.</p><p>While everyone is waiting for the new pricing, I wondered what would have happened if I took the price of annual pass and invested it. During the course of the pandemic, stocks were not the only thing that made the news. Cryptocurrency became popular, with Bitcoin (and Doge) making news.</p><p>So, I looked up the historical price of each of these coins, along with Disney Stock and calculated what it would worth had I purchased when the park closed and sold my “investment” when tickets went back on sale.</p><p>The day after the park closed, here is the closing value of each of these investments:</p><ul><li>Disney Stock — $95.80</li><li>Bitcoin — $5002.58</li><li>Doge — $.0016</li></ul><p>Check out the Visme Charts below. Each chart shows the value of each Disneyland annual pass’s value had you invested in either Disney stock, Bitcoin or Dogecoin while waiting for the park tickets to go back on sale again on April 15, 2021.</p><ul><li><a href="https://my.visme.co/view/ojnng184-investing-in-disney-stock-during-the-pandemic">Investing In Disney Stock During The Pandemic</a></li><li><a href="https://my.visme.co/view/z4pp3dkx-investing-in-bitcoin-during-the-pandemic">Investing In Bitcoin During The Pandemic</a></li><li><a href="https://my.visme.co/view/epdd7wvm-investing-in-doge-during-the-pandemic">Investing In Doge During The Pandemic</a></li></ul><p>Wow! These are some impressive gains.</p><p><strong>Good</strong>: Disney went from $95.80 to $188.09 (196% gain)<br><strong>Better:</strong> Bitcoin went from $5,002.58 to $63,075.20 (1261% gain)<br><strong>Best:</strong> Doge went from $.0016 to $0.12 (7575% gain)</p><p>Wish a fairy godmother can send me back in time so that I can invest in at least one of these investments. Correction, I wish I took the amount for the Premier UP ($2199) pass and put it in Doge. I would be going to both Disneyland and Walt Disney World ($166,574.25).</p><p>​So, here’s the takeaway. Besides having a savings account, you should probably look at adding stocks and cryptocurrency as part of your savings portfolio for the long run. Making money quick is nice, but had I made these investments and just chilled during the pandemic, I’d have a bit of fun when things reopen.</p><p>Since I am in no rush at the moment to head out to the Happiest Place on earth, I am going to do a little exploring with <a href="https://www.okcoin.com/join?channelId=600009913">okcoin</a> who recently announced that of Doge is now available on their platform. Feel free to click on my personal referral link, <a href="https://www.okcoin.com/join?channelId=600009913,">https://www.okcoin.com/join?channelId=600009913,</a> and when you deposit or trade $100, okcoin will provide another $10 in Bitcoin. Who knows, that $110 investment at $.3238 price for Doge (as of this writing) , will end up being worth $335.06 when Doge hits $1.</p><p>​</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f28c5533164" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>