Of course I have a backup!

Random blobs of wisdom about software engineering

Archive About Me Consulting My toolset

Arrays exist in Bash since version 4.0. However, the capabilities are pretty limited, it is nowhere near other scripting languages like PHP, Ruby, or Python. You can have sequentially indexed arrays, and associative arrays, but, both of them can be only one dimension.

Continue reading ...

There is a picture that circulates around the net, about the high learning curve of Vim. It is true, there is definitely a learning curve, but it isn't that bad. You'll need a week, or maybe two, and you'll be probably more productive than with your current editor. The production gain from using Vim is shocking. I'll tell you where Vim's power comes from, and how you can start using it in a less painful way.

Continue reading ...

We had a site that was expecting 100k+ unique visitors, but only for a single day. The motto of the site is "the day of internet shopping", basically, it is centered around having larger stores of all kinds, signing up, and making discounts, that are only valid for that single day only. I want to show some steps that we took to make sure that the website does not crash under the load.

Continue reading ...

Two years ago, I had the chance of introducing version control to a small development team, which have not used any kind of VCS for their code before. This is going to be a little case study on how it worked out after two years.
The company's primary profile was marketing and media, development was mostly considered a second/third class citizen. Most of the projects were very simple websites, either to advertise a client's new product, or to serve as the backend for a facebook app, or 90% CRUD for summarizing various surveys. Development time for projects was between 2-8 weeks, and without a written specification.

Continue reading ...

There are two kinds of people, those who back up their data, and those who have never had accidents happen to them.

I want to spread the love about rdiff-backup, because it's such a good tool for taking backups of anything text based, and a lot of people don't know about it. It is available in most major distributions (found it in Arch, Debian, and Fedora, stopped looking after that), and it's only dependencies are python2 and librsync. It can preserve permissions, user:groups, ACLs, extended attributes, fifos, pipes, whatnot. It is very very easy to use and automate, requiring almost no manual reading.

Continue reading ...

I see these types of questions a lot on forums:

I have made an ajax based favorites system on my webshop. Users can click on the "add" button next to each product, and it will be added to their favorites list. Everything works fine, except that on freshly favorited elements, the "remove" button does not work, until I refresh the page. What could cause this? Here is the code. I'm using jQuery.

Without even taking a look at the code, I already know what the problem is. The problem usually has nothing to do with jQuery, but given the popularity of it, but it usually gets associated to it. The question can come in various flavors, but the pattern is always the same:

There is a container element, that has elements added to it via DOM manipulation, and the newly added elements behave in unexpected ways, usually some functionality is not working, until a page refresh is made.

Continue reading ...

I'm sure a lot of people can relate, when I say that deploying changes isn't my favorite part of the job. It's error prone, tedious, repetitive, and leads to a lot of shotgun debugging, when for some reason things don't work out on the production server. I'd like to show some snippets how deploying could be made easier, and less error prone. Note that this won't be a tutorial on bash scripting, since there are already a lot of that on the web, it will be more about putting it to some use.

Continue reading ...