Skip to content

Instantly share code, notes, and snippets.

View abg's full-sized avatar

Andrew Garner abg

  • VMware
  • San Antonio
View GitHub Profile
@abg
abg / master_switch.sh
Last active June 18, 2018 13:33
Script to serve as a master_ip_{failover,online_change}_script for MHA
#!/bin/bash
# Source the user config - Mostly useful for setting interface, vip, label as desired
# Example:
# # cat /etc/mha/switch.conf
# vip=172.16.3.1
# interface=eth2
# label=eth2:0
config=/etc/mysql-masterha/vip.conf
[ -e "${config}" ] && . "${config}"
@abg
abg / mysql56u.spec.diff
Created April 15, 2014 04:43
Patch to build INNODB_MEMCACHED in IUS mysql56
--- a/mysql56u.spec 2014-04-09 15:24:17.000000000 -0400
+++ b/mysql56u.spec 2014-04-15 00:42:08.805743802 -0400
@@ -81,6 +81,7 @@
Patch32: community-mysql-covscan-signexpr.patch
Patch33: community-mysql-covscan-stroverflow.patch
Patch34: community-mysql-pluginerrmsg.patch
+Patch99: mysql-5.6.17-libevent.patch
@abg
abg / mysql-libevent-cmake.patch
Created April 15, 2014 04:37
Patch to MySQL 5.6.17 to set LIBEVENT_LIBRARY for use by innodb_memcached
diff --git a/cmake/libevent.cmake b/cmake/libevent.cmake
index c321e93..b127686 100644
--- a/cmake/libevent.cmake
+++ b/cmake/libevent.cmake
@@ -60,15 +60,15 @@ MACRO (MYSQL_CHECK_LIBEVENT)
set(LIBEVENT_LIB_PATHS /usr/local/lib /opt/local/lib)
ENDIF()
- find_library(LIBEVENT_LIB event PATHS ${LIBEVENT_LIB_PATHS})
+ find_library(LIBEVENT_LIBRARY event PATHS ${LIBEVENT_LIB_PATHS})
@abg
abg / gist:9626615
Last active August 29, 2015 13:57 — forked from zastari/gist:9509625
#!/usr/bin/python
import ConfigParser
import logging
import optparse
import sys
import pyrax
error = logging.error
@abg
abg / my-56-terse.diff
Created March 13, 2014 17:07
diff of my.cnf changes
diff --git a/trunk/configs/5.6/my-56-terse.cnf b/trunk/configs/5.6/my-56-terse.cnf
index 092e344..9141704 100644
--- a/trunk/configs/5.6/my-56-terse.cnf
+++ b/trunk/configs/5.6/my-56-terse.cnf
@@ -1,96 +1,104 @@
-## _______________________________________________________________________
-## / Rackspace MySQL 5.6 Terse Configuration File \
-## | |
-## | This is a base configuration file containing the most frequently used |
-## | settings with reasonably defined default values for configuring and |
@abg
abg / my-56-verbose.cnf
Last active August 29, 2015 13:57
IUS 5.6 my.cnf (verbose with extended comments)
### _______________________________________________________________________
### / Rackspace MySQL 5.6 Terse Configuration File \
### | |
### | This is a base configuration file containing the most frequently used |
### | settings with reasonably defined default values for configuring and |
### | tuning MySQL. Note that these settings can likely be further tuned in |
### | order to get optimum performance from MySQL based upon the database |
### | configuration and hardware platform. |
### | |
### | For many deployments, the only variables which need to be modified |
@abg
abg / my-56-terse.cnf
Last active August 29, 2015 13:57
IUS 5.6 default my.cnf (no extended comments)
## _______________________________________________________________________
## / Rackspace MySQL 5.6 Terse Configuration File \
## | |
## | This is a base configuration file containing the most frequently used |
## | settings with reasonably defined default values for configuring and |
## | tuning MySQL. Note that these settings can likely be further tuned in |
## | order to get optimum performance from MySQL based upon the database |
## | configuration and hardware platform. |
## | |
## | For many deployments, the only variables which need to be modified |
#!/usr/bin/python
import pyrax
import ConfigParser
import sys
import getopt
class Config(ConfigParser.ConfigParser):
def __getitems__(self, section):
try:
@abg
abg / cli.py
Last active August 29, 2015 13:56
simple command line helper - inspired by baker.py
"""
cli
~~~
Simple CLI API
@cli.command
def mycommand(required_arg, option='default', *varargs):
...
sys.exit(cli.run())
@abg
abg / filename_to_tablename.py
Last active December 30, 2015 02:39
Decode MySQL filenames to unicode
import binascii
import collections
import re
import struct
CodeRange = collections.namedtuple('CodeRange', 'start end')
class EncodingRule(object):
def __init__(self, coderange, pattern, name, initial_code):
self.coderange = coderange