Skip to content

Instantly share code, notes, and snippets.

View michaelcoburn's full-sized avatar

Michael Coburn michaelcoburn

View GitHub Profile
if sysbench.cmdline.command == nil then
error("Command is required. Supported commands: run")
end
sysbench.cmdline.options = {
point_selects = {"Number of point SELECT queries to run", 5},
skip_trx = {"Do not use BEGIN/COMMIT; Use global auto_commit value", false}
}
local page_types = { "actor", "character", "movie" }
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
@voxxit
voxxit / download-slow-query-log.sh
Last active October 31, 2023 16:13
Downloads RDS slow query logs for the last 24 hours using the AWS CLI
#!/bin/bash
instanceID=$1
date=$(date +%Y%m%d)
function downloadLog () {
local log=$1
aws rds download-db-log-file-portion \
--output text \
@leucos
leucos / do_boot.sh
Last active July 4, 2018 20:46
Bootstrap your DO infrastructure unsing Ansible without dynamic inventory
#!/bin/bash
#
# What is that
# ============
#
# This script will help you setting up your digital ocean
# infrastructure with Ansible
#
# Usually, when working with DO, one is supposed to use digital_ocean.py
# inventory file, and spin up instances in a playbook.
@ocxo
ocxo / gist:ce376fb4ab3298392048
Created December 16, 2014 17:10
temporary hack to address bug with vagrant-vbguest installation on vagrant 1.7.1
# temporary hack to address bug with vagrant-vbguest installation
# https://github.com/mitchellh/vagrant/issues/4962
if awk "BEGIN {exit `vagrant -v` == "1.7.1" ? 0 : 1 }"
then
sudo sed -i .original 's/\*\*opts/opts/g' /opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/machine.rb
fi