Script for adding new MySQL database and user easily

October 20th, 2007

At my company we have lots of MySQL databases(usually one for each virtual host) and each database has its unique user. Adding a new database and a user with proper permissions can be quite tedious, that’s why I hacked up the following script which saves some of my precious time ;)

Read the rest of this entry »

A couple of nginx utility scripts

October 20th, 2007

In my previous nginx related post I promised to show a couple of utility scripts we use to simplify managing of multiple virtual hosts both under Apache and nginx. Well, here they come ;)

Read the rest of this entry »

lmbActiveRecord’s late static binding emulation

October 15th, 2007

I was quite inspired on having heard that the late static binding(LSB) patch will make it into PHP-5.3. In short, it should allow to know the name of a class which invoked the parent’s static class method.

Read the rest of this entry »

vim automatic upward search for make and scons build scripts

October 8th, 2007

If you happen to have your vim configured to change the current directory to the one where the edited file is stored(e.g. “autocmd BufEnter * :cd %:p:h”) you might find the following vim script handy.
Read the rest of this entry »

Syncman - projects remote deployment for my grandma

October 7th, 2007

Syncman Logo

If you’re running a company mainly occupied with development of lots of web sites ranging from tiny promo sites to large portals you most probably should face deployment headaches some day.

How do folks usually deploy their remote applications? Some use manual deployment via FTP, others prefer using rsync or unison, some brave souls deploy simply by updating the project’s Subversion working copy on the remote server, Rails fans usually stick with Capistrano, some smart fellows are said to be using complicated cfengine, etc.

At my company we were not happy with any mentioned above methods of remote project deployment due to either lack of functionality or unnecessary complexity. We simply needed a tool which could use non-technical personnel: managers, web-designers, etc. That’s why we hacked our own simple utility - meet Syncman ;)

Read the rest of this entry »

Speeding up Apache static content serving with nginx

September 28th, 2007

If you have not already tried using nginx, one of the fastest http and reverse proxy servers in the world, you definitely should try doing so!

Nginx can save lots of CPU cycles simply by “standing” before the main heavy http server(e.g. Apache) and taking the role of serving effectively all static content. Actually it can be your main and the only http server but that’s a story for another day since it will require quite a lot hassle if you already have many virtual hosts served by another server(Apache again).

Read the rest of this entry »

“Everybody else is doing it, so why can’t we”..er..I?

September 12th, 2007

As Cranberries put this very question as a title of their debut album, similarly I’m asking myself why not starting yet another blog and if it’s really a good idea to post my personal thoughts to the public ;) Probably not and, who knows, I may abandon this blog in a week but right now I feel inspired(oh, at least I’ll have a chance to practice my English).

You may be asking, why choosing such a title for the blog “My personal blah-blah for efficiency”? Well, you see I’m an efficiency fan. I simply admire people who get things done with a few keystrokes in vim, who can deploy the new version of the application(being under highload) to the web cluster with a minimum of fuss, who have some free time(and good sleep) while developing a >500k LOC application at the primary job and releasing it in time, who…ouch, I can keep on but this post is getting bigger than usual for the “hello world”. Anyway, I guess, you get the idea.

Simply put, this is a blog where I’m going to describe my adventures while trying to achieve better efficiency in every aspect of my life(actually, mostly in software development and *nix administration ;) )