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.

NTLM authentication for Ruby with Typhoeus and libcurl

19 January 2010

A couple of times I’ve faced a problem of performing NTLM authentication from Ruby code. The issue here is that it’s a proprietary Microsoft’s authentication scheme, so it is a certain challenge for the developers to implement. After using different workarounds and proxies, I’ve moved on and implemented a proper solution that extends Typhoeus – networking library build upon libcurl.

The Rebirth

18 January 2010

So I’ve decided to scrap the old WordPress installation and moved everything to Jekyll, using Disqus to power the comments. Design is based on Simplr theme from plaintxt.org. Let’s see how it goes this way. Some old and not-so-relevant posts were killed on the way as I dislike them now.

Use binding methods of prototype.js to keep your code DRY

05 March 2009

There’re two awesome methods in prototype.js library those are often overlooked by newcomers – Function.bind() and Function.bindAsEventListener. These methods are so damn nice that their absense from another awsomeness called Ruby is just driving me crazy every time I stumble upon it.

But let’s take a closer look at why these methods are so useful. First of all, you should familiarize yourself with a concept of binding. The core of it is simple – it allows you to define a function in one context and scope and run it in completely different context. Let me show you almost a real app example.