Skip to content

Instantly share code, notes, and snippets.

docker stop upstream1
docker stop upstream2
docker rm upstream1
docker rm upstream2
docker run -d -p 5673:5672 -p 8081:15672 -h upstream1 --name upstream1 -e RABBITMQ_ERLANG_COOKIE='SJBDYCLARUGZFQFCDQQZ' rabbitmq:3-management
docker run -d -p 5674:5672 -p 8082:15672 -h upstream2 --name upstream2 -e RABBITMQ_ERLANG_COOKIE='SJBDYCLARUGZFQFCDQQZ' rabbitmq:3-management
docker exec upstream2 rabbitmqctl stop_app
docker exec upstream2 rabbitmqctl join_cluster rabbit@upstream1
@damonsk
damonsk / gist:aa30e8b9980d100fcf78
Last active April 4, 2017 07:36
docker rabbitmq clustered with haproxy
docker run -d -p 5673:5672 -p 15673:15672 -h upstream1 --name upstream1 bijukunjummen/rabbitmq-server
docker run -d -p 5674:5672 -p 15674:15672 -h upstream2 --name upstream2 --link upstream1:upstream2 bijukunjummen/rabbitmq-server
docker exec upstream2 rabbitmqctl stop_app
docker exec upstream2 rabbitmqctl join_cluster rabbit@upstream1
docker exec upstream2 rabbitmqctl start_app
# See other gist for haproxy config. ssh to docker and create ~/haproxy.cfg with content of gist.
@damonsk
damonsk / gist:f5d20dfdd62c2eb47ab9
Last active April 4, 2017 07:39
haproxy for rabbitmq docker
global
log 127.0.0.1 local1
maxconn 4096
#chroot /usr/share/haproxy
uid 99
gid 99
#debug
#quiet
defaults
// bah.js
module.exports.bah = function(){
function ponies(){
return "hai";
}
};
@damonsk
damonsk / gist:4130398
Created November 22, 2012 10:16
coffeelocator generateHtaccess
public static function generateHtaccess($path, $rewrite_settings, $cache_control, $specific = '', $disableMultiviews = false)
{
$tab = array('ErrorDocument' => array(), 'RewriteEngine' => array(), 'RewriteRule' => array());
$multilang = (Language::countActiveLanguages() > 1);
// ErrorDocument
$tab['ErrorDocument']['comment'] = '# Catch 404 errors';
$tab['ErrorDocument']['content'] = '404 '.__PS_BASE_URI__.'404.php';
@damonsk
damonsk / gist:3955099
Created October 25, 2012 20:08
Installing Gammu on Raspberry Pi, Huawei E220
# Send SMS messages using Raspberry Pi.
# Using gammu and Huawei E220
# Prepare SD card with wheezy.
# Login / complete rasp-config / reboot / login
# Set vimrc to prevent annoying ADBC arrow keys
cp /etc/vim/vimrc ~/.vimrc
@damonsk
damonsk / style.css.less
Created September 12, 2012 10:13 — forked from almonk/style.css.scss
Less retina background images mixin
.background-image-retina(@file, @type, @width, @height) {
background-image: url("@{file}.@{type}");
@media (-webkit-min-device-pixel-ratio: 2), (-moz-min-device-pixel-ratio: 2) {
& {
background-image: url("@{file}@2x.@{type}");
-webkit-background-size: @width @height;
}
}
}
@damonsk
damonsk / prestashopinstall
Created May 21, 2012 09:09
New Prestashop Install CHMOD & CHOWN
wget http://prestashop.googlecode.com/files/prestashop_1.4.8.2.zip
unzip prestashop_1.4.8.2.zip
rm -rf css/
rm -rf favicon.ico
rm -rf img/
rm -rf index.html
rm -rf picture_library/
rm -rf prestashop_1.4.8.2.zip
rm -rf test/
@damonsk
damonsk / ClassController.php
Created April 26, 2012 14:51
ClassController
<?php
/**
* --------------------------------------------------------------------
* @authour: Damon Skelhorn <[email protected]> Twitter: @damonsk;
* @date: 26/04/2012
* --------------------------------------------------------------------
*
* Usage:
*
* ClassController::includeClass('MyClass');