Skip to content

Instantly share code, notes, and snippets.

View lukebakken's full-sized avatar

Luke Bakken lukebakken

View GitHub Profile
@lukebakken
lukebakken / rmq-centos-7.md
Last active June 7, 2017 17:47
RabbitMQ download, install and start on CentOS 7

Download

Docs for this can be found here:

curl -LO https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10-1.el7.noarch.rpm
curl -LO https://github.com/rabbitmq/erlang-rpm/releases/download/v19.3.5/erlang-19.3.5-1.el7.centos.x86_64.rpm

Install

@lukebakken
lukebakken / erlang-in-ps-output.md
Last active June 20, 2017 22:34
Erlang arguments in ps output

erl started with +K true:

$ erl +K true
Erlang/OTP 19 [erts-8.3.5] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:true]                                                                                                                                                                             
                                                                                                                                                                                                                                                                                
Eshell V8.3.5  (abort with ^G)
1> erlang:system_info(kernel_poll).
true
2> os:getpid().
@lukebakken
lukebakken / commands.txt
Last active August 3, 2017 20:51
rabbitmq-cli-214
-define(COMMANDS_NOT_REQUIRING_APP,
[stop, shutdown, stop_app, start_app, wait, reset, force_reset, rotate_logs,
join_cluster, change_cluster_node_type, update_cluster_nodes,
forget_cluster_node, rename_cluster_node, cluster_status, status,
environment, eval, force_boot, help, hipe_compile, encode, decode,
list_ciphers, list_hashes]).
stop
shutdown
stop_app
@lukebakken
lukebakken / kill-vhost.erl
Last active August 4, 2017 17:25
Kill a RabbitMQ vhost
f(), {ok, Pid} = rabbit_vhost_sup_sup:get_vhost_sup(<<"/">>), [MPid] = [Pid || {Name, Pid, _, _} <- supervisor:which_children(Pid), Name == msg_store_persistent], erlang:exit(MPid, force_vhost_failure).
@lukebakken
lukebakken / clear-queues.sh
Last active September 20, 2017 22:34
VESC-842
#!/usr/bin/env bash
set -o errexit
set -o nounset
declare -r node='rabbit@shostakovich'
declare -r user='guest'
declare -r pass='guest'
declare -ir queue_count=9
#!/usr/bin/env ruby
# encoding: utf-8
require 'bunny'
require 'glutton_ratelimit'
require 'pp'
conn = Bunny.new
conn.start
ch = conn.create_channel
#!/usr/bin/env python
import pika
import sys
def callback(ch, method, properties, body):
pass
# print(" [x] Received %r" % body)
queue_name = sys.argv[1]
cp = pika.ConnectionParameters('shostakovich')
@lukebakken
lukebakken / .gitignore
Last active October 10, 2017 15:13
Erlang RSS Memory
*.beam
*.csv
@lukebakken
lukebakken / echo-client.go
Created November 19, 2017 14:36 — forked from paulsmith/echo.go
A simple echo server testing a few interesting Go language features, goroutines and channels.
package main
import (
"fmt"
"net"
"os"
"time"
)
func main() {