Posts

Cleaning up Django Persistent Database Connections

For the past year at work we have been utilizing more Kafka infrastructure for what typically would have been handled using celery workers. This has led to some interesting rediscoveries of Django ORM. While this example is used in a Kafka implementation, it is not dependent on it and can be used in any scenario where code is run outside of a typical Django view. We started noticing long running idle connections against MySQL.
Read more

Cellular Data Vietnam

Cellular service in Vietnam is nothing short of incredible. I can be in the remote country side with farmers and still get 3G service. The pricing compared to the American market is incredible too. I believe the total cost for my text, talk and data plan was close to 350,000 Vietnamese Dong or roughly $15 USD. This included ~100,000 Dong charge for the SIM card and the rest for the pay as you go plan.
Read more

Mocking Python Context Managers

Mocking context managers, complex to start and obvious afterwards. Looking back at the example now I am amazed how confused I was. At the time it was a frustrating mess figuring out how to properly mock it, I was constantly mocking the incorrect code at runtime. My google-fu was also failing me as most of the examples were outdated or did not fully dive into what I was attempting to do.
Read more

Ghost, PostgreSQL and Dokku

There are a couple existing tutorials that cover Ghost and Dokku. Unfortunately the two I referenced were outdated and missing important details in setup decisions. Versioning Ghost: 0.4.2 Dokku: 0.2.3 Ubuntu: 14.04 PostgreSQL: latest Dokku Setup This tutorial assumes you already have a Dokku installation running. If you are not familiar with Dokku I highly recommend using Digital Oceans Dokku image to get up and running. If using Digital Ocean, be sure to start off with a 1GB droplet.
Read more