DevOps

Configuring server-side infrastructure, cloud architecture, and sometimes networking. Even automate your DevOps workflow with products from Hashicorp.
Python
12 Sep 2018

So You've Fucked up your Python Path

A timeless hazing ritual for new Python devs, and how to fix it.
So You've Fucked up your Python Path

I remember back to when I first learned Python. It was a strange decision for a happily employed post-graduate to make, especially for a time when many were screaming for the death of the language with Guido's (outrageous?) grand reveal of Python 3.  The Ruby on Rails guys seemed to be doing just fine. Those were the days.

After weeks of sweating over a keyboard in the basement of an illegal BedStuy hostel, I had finally set out what I had hoped to achieve. It was the greatest credential any programmer could possibly strive for: yes ladies and gentlemen, none

Continue Reading
DevOps
05 Sep 2018

My First Experience with Docker

Reboot EC2 instances with Docker.
My First Experience with Docker

We have a .NET application that has been running for years, but once a week, the application fails to recover and needs the server needs to be rebooted.  To preemptively reboot the EC2 instance nightly we decided to use Docker and ECS  scheduled tasks.

Here is what the finished Dockerfile looks like:

FROM amazonlinux:latest

RUN yum -y update
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
RUN python get-pip.py
RUN pip install boto
COPY ./win_reboot.py /root/
RUN chmod +x /root/win_reboot.py

CMD ["/root/win_reboot.py"]

ECS has a

Continue Reading
Google Cloud
05 Sep 2018

Connect to your Google Cloud Compute Engine

Configuring SSH and file transfers in Google Cloud.
Connect to your Google Cloud Compute Engine

So you've taken a leap and decided to host your VPS on Google Cloud: let me be the first to congratulate you on joining the clearly superior cloud platform of our modern era. I would apologize for being so openly opinionated, but so far I've only stated objective facts.

Now that you've joined the club, you may have found yourself asking the inevitable: "how do I connect to my damn instance?" If you're like me, you're probably not the kind of person who enjoys this as their main solution:

Google Cloud's in-browser terminal.

Luckily for us, there are a few

Continue Reading
Google Cloud
10 Aug 2018

Cloud SQL: Relational Databases on Google Cloud

Create a database in Google Cloud using Cloud SQL, compare Cloud SQL to RDS, and learn the admin API.
Cloud SQL: Relational Databases on Google Cloud

I've found that the strength of Google Cloud's services comes from consistently delivering across a few key metrics, namely reliability and performance. When dealing with SQL databases, it's hard to imagine any metrics more important than these two things, and Google's Cloud SQL delivers.

To become familiar with Cloud SQL, we're going to walk through the creation of a SQL database and explore the advantages Google Cloud offers us when compared to other solutions. We'll also be dipping into the Cloud SQL API to see how we might manage our SQL database programmatically.

Cloud SQL Versus Alternatives

There aren't many

Continue Reading
Tableau
03 Aug 2018

Hacking Tableau to Handle ETL Workflows

Weaponizing APIs against tyrannical software.
Hacking Tableau to Handle ETL Workflows

Before we get into the specifics of how to sadistically abuse Tableau, let's clear the air: there's something about inaccessible, expensive, proprietary enterprise software that tends to put me in a touchy mood. As we know, B2B software pricing has nothing to do with code quality or even value-add, but rather the tendency of businesses to create time-based urgencies without warning; the kinds of urgencies which may be solved by, say, a tool of sorts.

My first interaction with Tableau actually took place after I had committed myself to the cult of Python's Pandas library and all that comes with

Continue Reading
Tableau
26 Jul 2018

Hacking Your Tableau Linux Server

Cracking Tableau's master Postgres account.
Hacking Your Tableau Linux Server

Let's say you're a Data Scientist. Well, maybe not a data scientist- I mean, those online data analysis courses were definitely worth it, and you'd made it this far without being quizzed on Bayesian linear regression. So maybe you're an analyst or something, but whatever:  you use Tableau, So you must be a Scientist™.

I've admitted a few times in the past to have purchased a personal Tableau Server license in my more ignorant years (aka a few months ago). While BI tools are great for understanding preexisting data, they don't allow us to go much further. This is is

Continue Reading
Google Cloud
14 Jul 2018

Create a VPS with Google Cloud: Introducing Compute Engine

Spin up a VPS and configure DNS with relative ease.
Create a VPS with Google Cloud: Introducing Compute Engine

I've been enamored with Google's cloud platform (aptly named Google Cloud Platform). GCP contains the things you might expect from a young player in the cloud provider space; a lot of existing AWS services already have an equivalent on GPC, but the comparison isn't always 1-to-1.

A seemingly prevalent philosophy behind GCP is prioritizing reliability and simplicity over features. It's a philosophy I agree with but occasionally comes up short from AWS's offering. GCP is the first contender to package enterprise cloud computing in a simple, satisfying way. Its clear GCP has assigned UI and Product Management resources to their

Continue Reading
DevOps
08 Jul 2018

Weekend Worker #2 - Cert Renewals

Renewing LetsEncrypt Certs with Certbot.
Weekend Worker #2 - Cert Renewals

It's Sunday and you know what that means... time to catch up on work outside of work.

I recently used LetsEncrypt for the awesome temporary free SSL Certs they offer. In the last use I became familiar with and implemented the use of certbot.

I did not go so far as to automate certbot to check for and update near-expiring certs. But this is coming up soon...

However, it's come time to renew so I've had to reteach myself how to do it, grasping for all logs in 'history' over a few different machines, I was able to easily re-do

Continue Reading
DevOps
24 Jun 2018

Weekend Worker #1

Implementing an automatic backup system.
Weekend Worker #1

Hello and Welcome, this is the first installment of "Weekend Worker" series.

Today as a Weekend Worker i'll be implementing an automatic backup system to backup each individual client website.

We'll be using the following technologies:

  • Linux cron job
  • Bash
  • Ansible
  • Docker
  • AWS ECS
  • VNC server

And we'll setup our dev environment on our home Windows desktop with the following tools:

  • Ansible for Windows (to launch dev tests)
  • Visual Studio Code (for editing and pushing updates)
  • Git (so our remote prod server can grab the code updates)
  • VNCviewer (to access prod remotely)
  • Bitbucket (for source control)

Preparing the

Continue Reading
AWS
06 Jun 2018

AWS Adventures: Why Can't I SSH Into My Damn EC2 Instance?

Watch as I struggle with the cloud! My pain, your gain!
AWS Adventures: Why Can't I SSH Into My Damn EC2 Instance?

Sometimes I find myself responsible for setting up and maintaining my own infrastructure for doing data stuff. In light of this, I've taken it upon myself to learn more about AWS in order for this experience to be less terrifying. I've been following a course on Udemy for the AWS Solutions Architect Certification. So far, so good.

Cut to the EC2 section. Has you spin up a little EC2 instance and SSH into it. I would find myself SSHing in, then after a few minutes my connection would be reset and then any further attempts would be met with a

Continue Reading
REST APIs
06 May 2018

Preparing your AWS Project to Build an API

Get your AWS instance configured, and become familiar with the services needed to build APIs.
Preparing your AWS Project to Build an API

There comes a surreal moment in nearly every profession in which perspective violently forces itself into our self-awareness. People with cooler jobs probably have that moment when they save their first patient or launch their first rocket. For me, the idea of building an API was this moment in software development. All those past black boxes which spat out results your life depended on: we can make those now.

Feel free to remain unfazed by this as I'm sure most are... for those of us who can't remember how they became an "engineer" in the first place, API design feels

Continue Reading
MySQL
30 Apr 2018

MySQL on the Cloud with AWS RDS

Spinning up a standalone MySQL Database with Amazon.
MySQL on the Cloud with AWS RDS

Last time we became familiar with the handiwork of setting up MySQL locally, navigating databases via command line, and exposing your database to external access. While badass, it has come to my attention that most people don't bother doing things this way. Unless you're getting deep into some heavy architecture, most people opt to use cloud services such as AWS to set up databases which are intended to be interacted with by multiple services.

A perfect example is one we ran into over the weekend while working on this very blog. We're running a Ghost instance, which is respectably complex

Continue Reading
MySQL
22 Apr 2018

Accessing Self-Hosted MySQL Externally

Connecting to MySQL instances hosted on a VPS.
Accessing Self-Hosted MySQL  Externally

In the previous post, we got familiar with the basics of creating and navigating MySQL databases. This leads us to the next most logical thing to ask: how can I use this in any meaningful way?

MySQL installations default to refusing connections outside of the local machine's IP address, as we should expect. That said, relational databases aren't usually being used by a single person on a single machine forever (but if you do, we should hang out). It goes without saying that our MySQL instance should be focusing on uptime and accessibility, or in other terms, far away from

Continue Reading
MySQL
17 Apr 2018

Setting up a MySQL Database on Ubuntu

Setting up MySQL the old-fashioned way: on a Linux server.
Setting up a MySQL Database on Ubuntu

As frameworks and services evolve to remove us further away from boilerplate code, the first casualty of saved time is the fundamental understanding of what we're actually doing sometimes. This has good reason; one can only learn so much from repetitive command-line interactions with databases, thus making any service's one-click-deploy button all the more sensible.  If I  had to imagine the least sexy title for a post in software development, it would be something along the lines of How to Configure MySQL on a VPS, as opposed to like, a cloud-based solution, or Even a Docker Container, as Though we

Continue Reading