Always index your tables. Always


This is going to be brief one: iRead.ro, one of the projects I’m working on during my spare time, was giving me major headaches lately – 2 weeks ago, it took like 15 seconds to render a page. In the last couple of days, it was taking somewhere around 100 seconds to render it; obviously too much for the nginx server that was running my two mongrels.

I *had* indexed my tables, by id, url and several other fields. Turns out, they weren’t indexed with the right columns.

Continue reading “Always index your tables. Always”

*nix tip of the day

I keep having the following problem when dealing with svn: I frequently find myself wanting to add to my own SVN repository stuff(javascript libraries, rails plugins) retrieved from some other svn repositories. The inevitable outcome of my bold attempt is that SVN starts complaining that the new folders can’t be submitted, that they already are under code control or something.

The reason is because when copying entire FOLDERS from one svn repository to another, you also copy their associated .svn folders with svn-specific information. These .svn folders are usually hidden, but you can see them (on Unix/Linux/OSX) by running ls -la from the terminal.

So you see my problem: I want to copy files or folders into my code repository, but don’t want to involve svn into this. I want them to be added as new files/folders, regardless of where they came from.

The following command-line command has helped me avoid quite a bit of frustration today:


find . -name "*.svn" -print
find . -name "*.svn" -ok rm -rf {} \;

The first command lists recursively all svn-specific subfolders of the current one.
The second command displays them to me one after the other and patiently awaits I press ‘y’ to remove it.
Extremely useful, right?
For many more uses of the find command, check out this page – where I learned about the useful ‘ok rm’ trick.

Beginner’s blogging guide – How to bring traffic to your blog

I’ve started and (rather) successfully managed around 7 blogs until now. Each attempt has been a bit more successful than the previous one, each building on the shoulders of its predecessors. So, since nothing beats a little bulleted list, here they are – top ways to bring traffic to your freshly launched blog:

Continue reading “Beginner’s blogging guide – How to bring traffic to your blog”