HTTP request debugging in Go with httputil

29 July 2014

Many tools and libraries which deal with HTTP requests provide means to dump full request and response data for debug purposes. http package in Go, by itself, does not provide this capability – but it can be easily extended with httputil to do so.

Let’s see how both packages work together.

GZipped JSON files and Logstash

13 January 2014

Working on moving a large part of data from our database into the offline storage, I and my team have faced a problem of keeping it gzipped in the filesystem, but at the same time making it easy to send it for processing to Elastic Search. The obvious solution was to use Logstash as the middleman, but it doesn’t really handle archived data from the box.

Let’s see how we can write an input plugin for Logstash to make this process easy.

Automatic system backups with backup gem and some shell scripting - part 3, large file structures

12 January 2014

In part 1 and part 2 of this series we set up a remote image file as the backup storage, and learned how to use Backup gem to back up a database and small data directories.

In the final part, let’s see how we can handle a backup of file directories with a large number of files in them (as it is the case for many web sites), and wrap it all up.

Automatic system backups with backup gem and some shell scripting - part 2, using backup gem

20 May 2013

In part 1 of this series we set up a remote image file as the backup storage, with some extra scripts for easier operations.

Now, let’s move on to actually backing up our data, using ruby backup gem. I’ll show you today how you can quickly and easily back up your database, and essential small-to-medium-sized file directories.

Automatic system backups with backup gem and some shell scripting - part 1, the preparation

13 May 2013

One of the most important things when setting up a new application server, especially for a greenfield project on untested hardware, is to make sure you have a solid backup setup to ensure the safety of your data.

Ruby makes it really easy with backup gem, and with some shell scripting we can supplement it to build a really robust and effective backup solution.

vim - Craftsman's Precision Tool

11 May 2013

Slides from my lightning talk about the origins of vim editor, and explaining some basic ideas behind it.

Processes, Threads and Ruby - Presentation Slides

22 April 2013

Presentation from the talk that I gave at JN Solutions office on April, 2013. Gives an introduction into working with processes and threads in Ruby, together with a deeper look at some underlying differences between various Ruby versions and implementations.

Concurrent Programming and Threads in Ruby - a reading list

02 April 2013

Many rubyists consider threads in Ruby as somewhat of an arcane knowledge, though in reality they’re a very well researched and understood concept. Of course, writing effective multithreaded concurrent programs requires certain amount of knowledge and discipline from the programmer, but there’s nothing that a smart one can’t learn if he wants to.

To help with the task, awesome @brainopia compiled a list of recommended reading on the topic of concurrency and threads, traslation of which into English you can find in this post.

Simple configuration for Ruby applications

29 May 2011

Sometimes we don’t really need a full-blown gem with a lot of bells and whistles, when a simple hand-made class worth a dozen of lines will do the job just as well, and even better – due to the cut off of extra external dependencies. And I believe that the task of keeping a set of configuration options or settings for the application can be implemented in such “lean” class quite often. Let’s see in this post how it can be done.

Running LigHTTPd 1.5 under Mac OS X

22 February 2010

Recently we’ve started playing with implementing progress-bar-style upload functionality in our of our applications. After certain consideration and discussions it’s been decided that Flash-based uploads are so last century and tried a simple proof-of-concept of flashless uploader widget on one of our servers running LigHTTPd 1.5, and that turned out to be a huge success. So the next logical step was to upgrade LigHTTPd on my own machine to be able to play with it first-hand.

And that gave me a problem – Mac OS X 10.5.7 is my work horse, and apparently 1.5 branch has a whole bunch of issues on OS X. To save you some time and frustration (and probably me, if I’ll ever need to repeat it in the future) here is the full package of things you’ll need to run 1.5 under OS X.