<?xml version="1.0" ?>
  <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">
    <channel>
        <title>Vincent Aceto's Blog RSS Feed</title>
        <link>https://www.vincentaceto.com</link>
        <atom:link href="https://www.vincentaceto.com/rss.xml" rel="self" type="application/rss+xml" />
        <description>Personal Blog by Vincent Aceto.  I like to write sometimes.</description>
        <language>en</language>
        <lastBuildDate>Sun, 31 Oct 2021 00:00:00 GMT</lastBuildDate>
        
    <item>
        <title>A Hacktoberfest Composition: Redis and Docker</title>
        <link>https://www.vincentaceto.com/posts/hacktoberfest-composition-redis-and-docker</link>
        <guid isPermaLink="false">https://www.vincentaceto.com/posts/hacktoberfest-composition-redis-and-docker</guid>
        <pubDate>Sun, 31 Oct 2021 00:00:00 GMT</pubDate>
        <description>
        <![CDATA[<blockquote>
<p>The following is a guest post that I got to write for Redis!  You can check
out the original version <a href="https://developer.redis.com/hacktoberfest/stories/vincent-aceto">here</a>.
Thanks for reading!</p>
</blockquote>
<p>Hello!  My name's <a href="https://www.vincentaceto.com/">Vincent Aceto</a> and I am a
Software Engineer based in New York City.  Throughout the week, you can find me
hacking away on mobile and TV applications over at Equinox Media.  On the
weekends, when I'm not getting lost somewhere on my skateboard, I'll be nose
deep in some open source or personal projects.</p>
<p>October is a special month for those who enjoy working on exciting software
projects.  In fact, there couldn’t be a more perfect month to get into software
exploration and contribution; it's collectively known as Hacktoberfest!
Hacktoberfest is a community-led effort to encourae open source contributing and
foster learning.  I am a huge advocate for open source, so getting involved in
Hacktoberfest is such a joy; if I have the chance to learn something new or
brush up on some skills, then definitely count me in.</p>
<p>Now, rewind the clock a bit, and you'd find me perusing Github's
Hacktoberfest-tagged issues.  I wanted to find the best first contribution for
the month's coding festivities.  While searching, I had one very important
criterion that the introductory issue needed to satisfy: to work with a
technology that I do not use on a daily basis.  I wanted to make sure that I
walked away with a newfound knowledge that would benefit my career.  After some
time, my eyes landed on a Redis Developer Community issue - I knew it
immediately, this was perfect!  The checkbox was ticked, for I do not regularly
work with Redis.  I was now ready to kick off the Hacktoberfest celebration.</p>
<p>The project I worked on is entitled <a href="https://github.com/redis-developer/introducing-the-geosearch-command">Introducing The Geosearch
Command</a>.
The goal of the project is to demonstrate the use of the GEOSEARCH command,
which was added to Redis in the recent 6.2 release.  Working as a software
engineer, you are almost always going to be working with some cached data and,
more often than not, it's Redis that is sitting nicely somewhere in that cache
layer.  That said, my first-hand experience (at the time) with the caching
technology resonated somewhere between “landing page” and “getting started”.
The project had turned out to be developer sale, a two-for-one: I would get to
learn more about the Redis technology, how to set up an instance, familiarize
myself with the API, and I would get the opportunity to work with Docker - which
I'm not regularly hacking with during my day-to-day.</p>
<p>Now, onto the
<a href="https://github.com/redis-developer/introducing-the-geosearch-command/issues/5">issue</a>.
The issue's aim was to extend an existing Docker Compose integration.  The
<code>docker-compose.yml</code> file was to include a schema, which was to run the
repository's Python Flask application in a Docker container.  Additionally, the
main application was to connect to the project's existing Redis container - this
Redis build step was already included in the Docker Compose file.  With the
features and constraints clearly defined, the next step was to pull out the
documentation.  To make sure I was familiar with the tech at hand, and to ensure
I got the most out of working on the issue, I started with the Redis
installation docs - becoming aware that things like the default Redis port
<code>6379</code> would come to serve me well when debugging.  After installation, I took
some time to explore the Redis API and read about Redis' internal hash
implementation at a high level.  The final reconnaissance was to review Docker.
I had briefly used Docker at a previous position, and have worked on some
personal projects using the container technology; however, a quick Dockerfile
and <code>docker-compose.yml</code> refresher was necessary.</p>
<p>With the pre-work done, it was time to start the Flask application's Docker
Compose implementation.  Here is a step-by-step guide, expressed in the present
tense, to the process:</p>
<p>First, let's start with the Docker Compose <code>YAML</code> file:
</p>
<p>As you can see, we have some Redis provisioning steps.  We assign a name to the
container, define the version of Redis we wish to spin up, and the port mapping
(<code>6379:6379</code> states we'd like to expose port <code>6379</code> from inside the container to
a port on your local machine).</p>
<p>Now, let's start with composing the project's application.  Unlike the Redis
container, which uses an official Docker image to build from, we don't have a
blueprint to scaffold the project's application.  This blueprint, or schema, is
called a Dockerfile.  A Dockerfile lists steps on how to build our image.  It's
this very image that tells Docker's engine how to build the container.  Let's
create a Dockerfile, which will assemble the application image for us:
</p>
<p>In short, this file serves as the foundation for the construction of the
project's application environment.  Additionally, the file tells Docker which
files we want to include in our container, how to install the contained app's
dependencies and what command should be used to run the app. Most of the file's
instructions are better explained in the <a href="https://docs.docker.com/engine/reference/builder/">official
documentation</a>, so please
take a look there if you're curious as to what the file's instructions have to
offer.</p>
<p>Great, before we move on to the compose file, let's make sure we test that
Docker is able to build and run the container from our image.</p>
<p>Let's build the image:
</p>
<p>Get our newly created image's hash identifier by listing our local images:
</p>
<p>Now let’s run the container using the image id, while making sure we bind a port
on our machine to the exposed port defined in the Dockerfile:
</p>
<p>Great!  The logs indicate the container is running.  Let's ensure our port
mapping is working.  A quick <code>cURL</code> command verifies that we can talk to the
application:
</p>
<p>With the Flask application Docker-fiedTM, let's compose it with Redis!
</p>
<p>Let us quickly dissect what was added to the <code>docker-compose.yml</code>:</p>
<ul>
<li>Define a service for the application (namespaced under 'app')</li>
<li>Define a name for the container</li>
<li>Set a build context/entry point (this is the relative location for our service's Dockerfile)</li>
<li>Map the service's port to the host machine</li>
<li>Ensure that Redis is initialized before the Flask app starts (since the Flask application requires a Redis connection on <code>init</code>)</li>
<li>Define the necessary environment variables.</li>
</ul>
<p>With the scaffolding in order, it's now time to run both the Flask application
and Redis with Docker Compose.  To do so, we'll run the command <code>docker-compose up</code>:
</p>
<p>Finally, let's navigate to <code>localhost:5000</code> in our browser to see the
application in action:
</p>
<p>Excellent, the Flask application is running and is composed with the
pre-existing Redis integration!</p>
<p>Now, before I conclude, I'd be remiss if I said that things worked as smoothly
as portrayed; however, we welcome such hiccups and challenges.  The main problem
I faced was an empty response from the contained application server.  What could
be the issue?  The Dockerfile, for the Flask app, is working.  The compose file
seemingly provisions our services successfully.  What could be the problem here?
Welp, turns out I forgot a very important factoid: Docker Compose will set up a
single default network, one of which will house the services defined in the yaml
file.  Containers and their services can communicate within this network, but
what about our browser - which is not on that Docker network?</p>
<p>To resolve this issue, we need to tell our contained application server that it
should listen on all networks, not just localhost; which, in the context of our
running Docker network, is local only to that micro-network, if you will.  To
tell the Flask server to listen on all accessible networks, we can define our
host in the Dockerfile's <code>CMD</code> command:
</p>
<p>All good!</p>
<p>Working through this issue, I definitely picked up some newfound Redis
knowledge!  While not 100% necessary for the task at hand, starting with the
official documentation and exploring the API provided me with the confidence
needed to tackle this issue.  Additionally, the project allowed me to solidify
some pre-existing Docker knowledge; and, very politely, pointed out which
knowledge gaps needed to be filled.</p>
<p>Working through this Hacktoberfest-inspired issue was very rewarding, and I can
say that I have walked away a better developer.  Not only was I exposed to more
technology, and got to flex some problem-solving muscles, but my passion for
open-source software collaboration has grown evermore.</p>
<p>Thank you for reading!  I hope my story inspires you to start with (or continue)
working with open source.</p>
<hr>
<p>You can find Vincent online at <a href="https://www.vincentaceto.com/">his website</a> and
at <a href="https://www.linkedin.com/in/vinaceto">LinkedIn</a>.</p>
]]>
        </description>
    </item>
    <item>
        <title>Getting Started with Dotfiles</title>
        <link>https://www.vincentaceto.com/posts/introduction-to-dotfiles</link>
        <guid isPermaLink="false">https://www.vincentaceto.com/posts/introduction-to-dotfiles</guid>
        <pubDate>Thu, 03 Dec 2020 00:00:00 GMT</pubDate>
        <description>
        <![CDATA[<h2>What Are Dotfiles?</h2>
<p>Dotfiles are configuration files that are used to customize and personalize your system. For all you history buffs, the dotfiles name comes from the UNIX convention of prefixing config files with a dot.  You can checkout some of the dotfiles by opening up terminal, navigate to your home directory, and listing all contents:</p>
<pre><code>cd ~ &#x26;&#x26; ls -la
</code></pre>
<p>Some typical dots include: <code>.bash_profile</code>, <code>.bashrc</code>, and <code>.lesshst</code>.  <code>.bashrc</code>, in particular, is a script used to initialize and configure an interactive bash shell session. Many programs that you use, in your day-to-day development / nix life, can be configured with specific dotfiles.  Git, for example, utilizes a <code>.gitconfig</code> file that allows you set preferences such as your user email, handle, and default editor.</p>
<h2>Saving and Sharing Dotfiles with Git</h2>
<p>Well, fear not. Git to the rescue!  Of course, you can always archive and save your
files to a portable drive, but if you're familiar with git, saving + sharing
your dotfiles quick and easy.</p>
<p>To do this, make sure you:</p>
<ol>
<li>Have a github account</li>
<li>Set up SSH</li>
<li>Create a dotfiles repository</li>
</ol>
<p>When you're ready: <code>git add &#x26;&#x26; git commit &#x26;&#x26; git push</code></p>
<p>You can now rest assured that your files are safe and sound!</p>
<p>In the event that you get a new machine, whether that be for work or personal use, all
you need to do is pull down your dotfiles repo and take the day off.</p>
<h2>Conclusion</h2>
<p>Dotfiles are configuration files for your environment.  Modifying these files to
your liking takes time, so make sure that you back them somewhere.  If you're
tech savvy, Git version control is perfect for saving your
dots--quickly share and sync your configs across multiple devices.</p>
<p>I hope you're ready to start managing and configuring your dots!  For some
inspiration and more dotfile related information, check out my personal files on GitHub: <a href="https://github.com/vinnyA3/dotfiles">https://github.com/vinnyA3/dotfiles</a></p>
<h2>Resources</h2>
<ul>
<li>Get started with your own dotfiles: <a href="https://medium.com/@webprolific/getting-started-with-dotfiles-43c3602fd789">https://medium.com/@webprolific/getting-started-with-dotfiles-43c3602fd789</a></li>
</ul>
]]>
        </description>
    </item>
    </channel>
  </rss>