Skip to content

Instantly share code, notes, and snippets.

View schkovich's full-sized avatar

Goran Miskovic schkovich

View GitHub Profile
@tkuchiki
tkuchiki / install.sh
Last active May 2, 2018 12:27
nutcracker(twemproxy) for systemd
curl -L "https://drive.google.com/uc?id=0B6pVMMV5F5dfb1YwcThnaVZXbjg" -o nutcracker-0.4.1.tar.gz
tar zxf nutcracker-0.4.1.tar.gz
cd nutcracker-0.4.1
./configure --prefix=/usr
make
make install
mkdir /etc/nutcracker
cp conf/nutcracker.yml /etc/nutcracker
cat << 'EOC' > /lib/systemd/system/nutcracker.service
@dimzon
dimzon / example.php
Last active July 30, 2016 08:30
Persisting PHP sessions into mongodb (allows NLB without affinity)
<?php
// all default values
MongoSessionPersistence::create()
->connect()
->register();
// connect to concrete server/db
MongoSessionPersistence::create()
->connect('mongodb://mongo_server:27017', 'databaseName')
->useLifeTime(60*60) // lifetime=1 hour
@philfreo
philfreo / swap.pp
Last active December 23, 2015 03:49 — forked from Yggdrasil/swap.pp
# Manages swapspace on a node.
#
# Based on https://gist.github.com/Yggdrasil/3918632
#
# Parameters:
# - $ensure Allows creation or removal of swapspace and the corresponding file.
# - $swapfile Defaults to /mnt which is a fast ephemeral filesystem on EC2 instances.
# This keeps performance reasonable while avoiding I/O charges on EBS.
# - $swapsize Size of the swapfile in MB. Defaults to memory size.
#