Skip to content

Instantly share code, notes, and snippets.

Avatar

Luke Bakken lukebakken

View GitHub Profile
@lukebakken
lukebakken / riak-2-certificate-notes.md
Last active Jul 5, 2022
Riak 2 / PAM / Certificates
View riak-2-certificate-notes.md

Testing Notes

At this time only the protocol buffers client supports client certificates. HTTP is not supported.

Setup

Setting up a Root CA

It is necessary to set up a Root Certificate authority to be able to create and sign certificates.

@lukebakken
lukebakken / rmq-passwd-gen
Last active Jun 20, 2022
RabbitMQ - Create Hashed User Password
View rmq-passwd-gen
#!/usr/bin/env bash
set -o errexit
set -o nounset
declare -r passwd="${1:-newpassword}"
declare -r tmp0="$(mktemp)"
declare -r tmp1="$(mktemp)"
View code.py
"""Basic message consumer example"""
import functools
import logging
import pika
LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) '
'-35s %(lineno) -5d: %(message)s')
LOGGER = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
@lukebakken
lukebakken / RabbitMQ-Clients.md
Last active Jan 5, 2022
Cllient library overview 2022-01
View RabbitMQ-Clients.md

AMQP

Feature list

  • Low vs high-level
  • TLS support
  • Stats / Metrics / Monitoring (S)
  • Auto-reconnect (R)
  • Topology recovery (TR)
@lukebakken
lukebakken / marblemouse.conf
Last active Nov 11, 2021 — forked from superjamie/marblemouse.conf
xorg.conf for Logitech Trackman Marble Mouse
View marblemouse.conf
# https://help.ubuntu.com/community/Logitech_Marblemouse_USB
# https://wiki.archlinux.org/index.php/Logitech_Marble_Mouse
#
# Xorg Functions
# 1 = Left Click
# 2 = Middle Click
# 3 = Right Click
# 4 = Mouse Cursor Down
# 5 = Mouse Cursor Up
# 6 = Mouse Cursor Left
@lukebakken
lukebakken / Vagrantfile
Last active Nov 19, 2020
Ubuntu 16 + RabbitMQ
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
export DEBIAN_FRONTEND=noninteractive
echo "deb https://dl.bintray.com/rabbitmq/debian xenial main" | sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list
wget -O- https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | sudo apt-key add -
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
dpkg -i erlang-solutions_1.0_all.deb
apt-get -yq update
@lukebakken
lukebakken / pg2table.rb
Last active Nov 10, 2020 — forked from johanrhodin/pg2table.rb
Fill up pg2table in RabbitMQ
View pg2table.rb
#!/usr/bin/env ruby
require 'bunny'
require 'dotenv/load'
connection = Bunny.new ENV['CLOUDAMQP_URL3']
connection.start
channel = connection.create_channel # Declare a channel
for i in 1..1
puts "Creating queue #{i}"
@lukebakken
lukebakken / collectd.conf
Last active Nov 1, 2020
Riak monitoring setup with collectd + Graphite
View collectd.conf
Hostname "ubuntu-12"
FQDNLookup true
BaseDir "/var/lib/collectd"
PIDFile "/var/run/collectd.pid"
PluginDir "/usr/local/lib/collectd"
TypesDB "/usr/local/share/collectd/types.db"
# LoadPlugin syslog
# <Plugin syslog>
# LogLevel info
View repro.py
import logging
from pika import SelectConnection, URLParameters
from threading import Thread
from time import sleep
from argparse import ArgumentParser
class AsyncConnection():
def __init__(self, host):
self.connection_params = URLParameters('amqp://guest:guest@{}:5672/%2F'.format(host))
self.log = logging.getLogger(self.__class__.__name__)