Skip to content

Instantly share code, notes, and snippets.

# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@websider
websider / building-static-nginx.txt
Created January 4, 2016 05:35 — forked from rjeczalik/building-static-nginx.txt
Notes on building nginx as a static binary.
# Building static nginx for teh lulz
#
# basic dependencies
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev
# download nginx and openssl
wget http://nginx.org/download/nginx-1.5.6.tar.gz
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6
@websider
websider / gearman-worker-exception.php
Last active August 29, 2015 14:27 — forked from hjr3/gearman-worker-exception.php
pecl/gearman worker exception
<?php
$gmw = new GearmanWorker();
$gmw->addServer();
$gmw->addFunction('test', function(GearmanJob $job) {
throw new Exception('Boom');
});
while(1) $gmw->work();
@websider
websider / gearman-client-exception-callback.php
Last active August 29, 2015 14:27 — forked from hjr3/gearman-client-exception-callback.php
pecl/gearman client exception callback example
<?php
$gmc= new GearmanClient();
$gmc->addServer();
$gmc->setExceptionCallback(function(GearmanTask $task) {
$m = $task->data();
echo "Exception: {$m}\n";
@websider
websider / gearman-client-batch-example.php
Last active August 29, 2015 14:27 — forked from hjr3/gearman-client-batch-example.php
Gearman client batch job example
<?php
$complete = 0;
$fail = 0;
$gmc = new GearmanClient;
$gmc->addServer();
$gmc->setCompleteCallback(function() use (&$complete) {
$complete++;
#!/usr/bin/env python
import sys
import datetime
import time
from datetime import timedelta
sys.path.append('/home/reb/local/azure-sdk-for-python/')
from azure.storage import *