PostgreSQL Query Logging

Sometimes you want to see the queries that are executing on your PostgreSQL database. This is mostly useful during development. I wouldn’t recommend doing this in produciton unless you’re aware of the impacts. Logging Enable or disable query logging by running the appropriate statement in psql or however you’re connecting the database. Replace your_db with the name of your database. Enable Logging # ALTER DATABASE your_db SET log_statement = 'all; Disable Logging # ALTER DATABASE your_db SET log_statement = 'none'; See The Queries Your log file may be in a differet location depending on the OS or distribution that you’re running and the version of Postgres that you’re using.
Read more →

Leaving Twitter

It’s official. I’m making my Twitter account inactive. The account will still be under my control, but I will no longer login or check for responses. TLDR; The level of censorship has become unacceptable to me. Why Stop Using Twitter? I stopped using Twitter about a month ago and it’s been very refreshing. I used to use Twitter as a news source. Once I notced my news sources being censored, I was forced me look for alternatives.
Read more →

Moving SQS Messages To Another Queue

Recently we ran into a situation at work where we needed to move all messages from one of our dead letter queues, back onto the “live” queue for the service. AWS doesn’t expose a way to move messages out of the box, so I wrote a small utility, which I creatively named sqsmv. I wrote the project in Go because it is a great fit for command line programs, and I’ve also worked with the Go AWS SDK before.
Read more →

Processing Sidekiq jobs with Go Workers

I have a personal project where a Sidekiq worker (written in Ruby) was using between 150-200MB of RAM with 20 workers. These workers take images that have been uploaded to a Rails application, and upload them to an Amazon S3 bucket in the background. Most of the time these workers are idle. This project generates exactly $0.00 income, and I’m paying for that RAM, which even in the amazing days of cloud computing, is still too expensive to waste on a personal budget.
Read more →

Multiple Go Versions

Running multiple versions of Go is simple. I see and hear chatter about it, and there are a few tools around to handle it for you, but it is so simple to do yourself that I’m surprised people reach for a tool to do this for them. Mostly I run the latest stable version of Go, but for whatever reason (maybe I want to test out a release candidate), I do have multiple versions installed, and I don’t want multiple installations to clobber each other.
Read more →