Main image
27th October
2011
written by simplelight

Great post on how to install Memcached from source and monitor its performance.

For a good tutorial on getting started with Memcached in a Ruby on Rails environment, checkout the Scaling Rails series, particularly episode 8

The Memcached wiki also has a page listing the various tools for monitoring Memcached.

 

27th October
2011
written by simplelight

As unstructured file data increasingly resides in cloud file systems, there is a large component that is still missing: Drag & Drop.

Currently, it is not possible to drag a file from Box.net to Salesforce.com or any other cloud service, without first downloading the file to my desktop and then re-uploading it. This problem is compounded on mobile devices such as the iPad because there is no easily accessible local storage or ‘Desktop’ equivalent.

Solving this problem will be more of an engineering challenge than meets the eye. Every cloud service has implemented their own storage protocol and folder system. Second, there is the even larger problem of authentication. Hopefully it will soon be possible to easily tile two browser windows and drag from one cloud service to another. Until then, we will keep on downloading and re-uploading.

Postscript: I have concluded that a single online repository for all my files is a pipe-dream. As the Microsoft monopoly is broken apart, there is going to be increasing fragmentation of cloud services.

19th September
2011
written by simplelight

I used Ubuntu 10.04 so that I know I don’t need to upgrade for the next four years.

1. Follow Linode’s excellent ‘Getting Started‘ instructions.

2. Add a new user and add them to the sudoers file.

3. Use Josh’s ‘Railsready‘ script to install Ruby etc.

Rather than using RVM to create gemsets, I prefer to ‘Vendor Everything‘, so I didn’t use RVM to install Ruby.

4. Install Passenger (this will also install nginx)

19th July
2011
written by simplelight

In this way you can obtain the list of the ten oldest processes:

ps -elf | sort -r -k12 | head -n 10

To sort processes by memory usage use “Shift M” when running.

Use ‘c’ to show full path for command.

For other useful ‘top’ configurations.

Tags: ,
25th April
2011
written by simplelight
22nd April
2011
written by simplelight

Probably one of the first topics covered when you get started learning about jQuery events is the concept of canceling the browser’s default behavior. For instance, a beginner click tutorial may include this:

$(“a.toggle”).click(function () {
$(“#mydiv”).toggle();
return false; // Prevent browser from visiting `#`
});
This function toggles the hiding and displaying of #mydiv, then cancels the browser’s default behavior of visiting the href of the anchor tag.

It is in these very first examples that bad habits are formed as users continue to use return false; whenever they want to cancel the default browser action.

[...]

Tags:
13th April
2011
written by simplelight

If you’re getting 502 Bad Gateways from your WordPress site when using Nginx then the following cron job might help:

Add a .sh script with this content and set it to trigger every ten minutes:

#!/bin/bash
PHPCOUNT=`ps aux | grep ‘.php.sock’ | grep ‘php5.cgi’ | wc -l`
echo $PHPCOUNT
while [ "$PHPCOUNT" -eq 0 ]
do
/etc/init.d/nginx startphp
PHPCOUNT=`ps aux | grep ‘.php.sock’ | grep ‘php5.cgi’ | wc -l`
done

That should check the number of processes, and if it’s not correct restart them.

The script is /root/nginx_php.sh

The cronjob is installed under root, and this is the content:

ps19952:/var/spool/cron/crontabs# crontab -l
MAILTO=”"
*/10     *       *       *       *       /bin/sh /root/nginx_php.shps19952:/var/spool/cron/crontabs#

15th February
2011
written by simplelight

The sea is calm to-night.
The tide is full, the moon lies fair
Upon the straits; on the French coast the light
Gleams and is gone; the cliffs of England stand;
Glimmering and vast, out in the tranquil bay.
Come to the window, sweet is the night-air!
Only, from the long line of spray
Where the sea meets the moon-blanched land,
Listen! you hear the grating roar
Of pebbles which the waves draw back, and fling,
At their return, up the high strand,
Begin, and cease, and then again begin,
With tremulous cadence slow, and bring
The eternal note of sadness in.

Sophocles long ago
Heard it on the Agaean, and it brought
Into his mind the turbid ebb and flow
Of human misery; we
Find also in the sound a thought,
Hearing it by this distant northern sea.

The Sea of Faith
Was once, too, at the full, and round earth’s shore
Lay like the folds of a bright girdle furled.
But now I only hear
Its melancholy, long, withdrawing roar,
Retreating, to the breath
Of the night-wind, down the vast edges drear
And naked shingles of the world.
Ah, love, let us be true
To one another! for the world, which seems
To lie before us like a land of dreams,
So various, so beautiful, so new,
Hath really neither joy, nor love, nor light,
Nor certitude, nor peace, nor help for pain;
And we are here as on a darkling plain
Swept with confused alarms of struggle and flight,
Where ignorant armies clash by night.

15th February
2011
written by simplelight

Stacy Smith, Intel’s CFO, has some interesting data on the tipping point for PC market penetration. As the cost of a PC in a region moves from multiple years to 8 weeks of income, the penetration changes from zero to about 15%. Once the cost drops below 8 weeks of income, the penetration rises very rapidly to 50%.

According to Smith, the cost of a PC in both India and China is now below 8 weeks of income in those countries.

Previous
Next