Skip to content

Instantly share code, notes, and snippets.

View celldee's full-sized avatar

Chris Duncan celldee

View GitHub Profile
@celldee
celldee / docker-compose.yml
Created May 28, 2018 07:16
Example Docker Compose .yml File for Apache Guacamole
version: "3"
services:
guac-postgres:
container_name: guac-postgres
image: postgres
environment:
- POSTGRES_PASSWORD=blahblahblah
volumes:
- home/fred/Projects/Guacamole/init-scripts:/docker-entrypoint-initdb.d
@celldee
celldee / gist:4241084
Created December 8, 2012 17:19
Example RabbitMQ configuration file - rabbitmq.config
# /etc/rabbitmq/rabbitmq.config
#
# Follow the instructions on RabbitMQ website to create certificate authority and certificates -
#
# http://www.rabbitmq.com/ssl.html
#
[
{rabbit, [
{tcp_listeners,[{"127.0.0.1",5672}]},
@celldee
celldee / gist:4550692
Last active December 11, 2015 05:09
Play with RabbitMQ via Erlang REPL
If you want to connect to your rabbit node via the Erlang REPL then you can start another node in the REPL like this -
erl -sname test -setcookie "ERLANGCOOKIE"
then try -
net_adm:ping('rabbit@hostname').
If it returns 'pong' then you're in business, but if you see 'pang' returned then you have not managed to reach your rabbit node.
@celldee
celldee / gist:4512337
Created January 11, 2013 17:04
Publisher confirms publisher for testing
require 'bunny'
conn = Bunny.new
conn.start
ch = conn.create_channel
x = ch.direct('hello-exchange', :durable => true)
q = ch.queue('hello-queue', :durable => true).bind(x, :routing_key => 'hola')
@celldee
celldee / gist:4500579
Last active December 10, 2015 22:18
Bunny 0.9.0 consumer and publisher to test publisher confirms
Publisher
---------
require 'bunny'
conn = Bunny.new
conn.start
ch = conn.channel
ch.confirm_select
@celldee
celldee / gist:4253037
Created December 10, 2012 20:13
Bunny - specify heartbeat in secs
conn = Bunny.new(:heartbeat => 30)
# or
conn = Bunny.new(:heartbeat_interval => 30)
# or
conn = Bunny.new(:requested_heartbeat => 30)
@celldee
celldee / gist:4253043
Created December 10, 2012 20:14
Bunny - explicitly set socket keepalive
conn = Bunny.new(:keepalive => true)
@celldee
celldee / gist:4247233
Created December 9, 2012 22:07
Bunny - declare queue with per-queue message ttl
q = b.queue('testq', :arguments => {"x-message-ttl" => 60000}) # messages are deemed dead after 60 secs
@celldee
celldee / gist:4247204
Created December 9, 2012 21:58
Bunny - publish message with per-message TTL
q.publish('test message', :expiration => "60000") # message will reside in queue maximum 1 minute
@celldee
celldee / gist:4247130
Created December 9, 2012 21:33
Bunny - declare queue with queue TTL
q = b.queue('testq', :arguments => {"x-expires" => 120000}) # idle queue expires after 2 mins