Wednesday, May 14, 2014

CakePHP database connection gone while executing a Cron job [solved]

I was working on a CakePHP website that had a script constantly running in background. This script is launched every 10 minutes using Cron and it has a loop that keeps going infinitely until the next launch. It attempts to read some IDs from a Redis key-value store, and then fetches the associated data from the MySQL database.

The problem I got into was that sometimes the script wasn't able to fetch the records from the database, even though they were there. I was confused, because the script worked fine when run using the command line, but not as a Cron task.

Sunday, February 3, 2013

Friday, February 1, 2013

Dumb Blonde Joke For Geeks

- How do you put a blonde into an infinite loop?
- You give her a sheet of paper with both its sides saying 'Look on the other side'.

Friday, January 25, 2013

Tuesday, January 22, 2013

Saturday, January 19, 2013

Running A Blog On Tumblr - Pros and Cons

A list of pros and cons of Tumblr, based on my experience from running a few blogs there.

Tuesday, November 6, 2012

How to set New Tab page with thumbnails as Firefox home page

The page with clickable thumbnails that shows up when you open a new tab in Firefox is quite cool, so why not set it as the home page as well?

Saturday, November 3, 2012

How to disable Flash plugin for specific websites in Chrome

Some websites have this stupid feature of an audio player, which starts playing automatically upon loading the page. First, the unexpected noise from your speakers sometimes makes you jump on your chair, and that sucks. Second, if you open multiple pages of the same website in different tabs, you also get several players playing simultaneously, also slowing down your computer, and that sucks even more. What are the options for solving this?

Sunday, August 26, 2012

uTorrent Easter Egg: Play Tetris While Downloading Torrents

A couple of days ago I found out about this little feature hidden in uTorrent: you can have some fun (or at least kill some time) piling up Tetris bricks while waiting for your downloads to complete. How do you do that?

Friday, August 24, 2012

Sunday, April 15, 2012

Saturday, April 14, 2012

Sunday, April 8, 2012

Saturday, March 31, 2012

Friday, March 30, 2012

Thursday, November 17, 2011

Sunday, November 13, 2011

CakePHP saveField() not working (solved)

Today I ran into a situation where CakePHP's method Model::saveField() didn't work.

Saturday, October 22, 2011

Friday, October 21, 2011

Saturday, October 15, 2011

Saturday, October 8, 2011

MySQL strlen

What is the string length function in MySQL?

There are two MySQL functions for string length:

Thursday, August 25, 2011

DNS lookup command

The quickest way to check what IP a domain or a subdomain resolves to is using this command:

Wednesday, August 24, 2011

Excel change sheets shortcut

The other day I was analyzing some website data using Microsoft Excel. The data was spread across multiple worksheets and I had to jump back and forth quite often.

Saturday, August 20, 2011

CakePHP trailing slash

Fancy trailing slashes?

Me too! That's why I desperately wanted to have them in my CakePHP applications as well.