Skip to content

Instantly share code, notes, and snippets.

Avatar

Carl Hörberg carlhoerberg

View GitHub Profile
@carlhoerberg
carlhoerberg / README.md
Last active Feb 19, 2018 — forked from lukebakken/README.md
Restart RabbitMQ TLS acceptors with new settings
View README.md

Restarting RabbitMQ TLS Listeners with new TLS options

Edit your /etc/rabbitmq/rabbitmq.config and then reload the settings from there with:

sudo rabbitmqctl eval '{ok, [C]} = file:consult("/etc/rabbitmq/rabbitmq.config"), {rabbit, R} = proplists:lookup(rabbit, C), {ssl_options, O} = proplists:lookup(ssl_options, R), application:set_env(rabbit, ssl_options, O).'

Restart the TLS Listener on port 5671

View rpc_benchmark.rb
#!/usr/bin/env ruby
require 'securerandom'
require 'json'
require 'benchmark'
require 'bunny'
conn = Bunny.new
conn.start
ch = conn.create_channel
x = ch.default_exchange
View oauth_signature.rb
require 'cgi'
require 'base64'
require 'openssl'
def oauth_url(url)
parameters = ["oauth_consumer_key=#{ENV.fetch 'OAUTH_KEY'}",
"oauth_nonce=#{Random.rand(100000000).to_s}",
"oauth_signature_method=#{'HMAC-SHA1'}",
"oauth_timestamp=#{Time.now.to_i.to_s}",
"oauth_version=1.0"].join('&')
You can’t perform that action at this time.