Skip to content

Instantly share code, notes, and snippets.

# The following commands will download and compile the latest nginx
# from source with the Pagespeed and Cache Purge modules on CentOS 6.5 i386
# I will make this into an executable script when I have the chance.
# This was on a fresh install of CentOS. You might have problems if you try it with an existing nginx install
# Make directories for building
mkdir -p $HOME/build/nginx-modules
cd $HOME/build
# Download dependencies for this script
<?php
define('TEST_KEY', 'are_we_glued');
$redis = new Redis();
try {
$redis->connect('localhost', 6379);
$redis->set(TEST_KEY, 'yes');
$glueStatus = $redis->get(TEST_KEY);
if ($glueStatus) {
$testKey = TEST_KEY;
echo "Glued with the Redis key value store:" . PHP_EOL;
<?php
/**
* Super-lightweight Redis client
*
* @param resource $sock
* @param string $cmd
* @return bool|int|string
*/
function redis_cmd($sock, $cmd)
<?php
umask(0);
ini_set('memory_limit','512M');
set_time_limit(0);
if(file_exists('app/Mage.php')) require 'app/Mage.php';
else require '../../app/Mage.php';
// Init without cache so we get a fresh version
Mage::app('admin','store', array('global_ban_use_cache' => TRUE));