Skip to content

Instantly share code, notes, and snippets.

@jayjanssen
jayjanssen / gist:bcdc33f8ae52f4ecfa69
Created July 10, 2015 12:49
MaxScale + PXC with RW splitting
[maxscale]
threads=4
[PXC Monitor]
type=monitor
module=galeramon
servers=node1,node2,node3
user=maxscale
passwd=maxscale
monitor_interval=1000
@jayjanssen
jayjanssen / gist:1d1edde1541864a5e9c4
Created August 5, 2014 13:36
Find Non Innodb Tables
select engine, table_schema, table_name from information_schema.TABLES
WHERE table_schema NOT IN ('performance_schema','information_schema','mysql')
and engine != 'Innodb';
select table_schema, engine, count(*) as non_innodb_tables from information_schema.TABLES where table_schema NOT IN ('performance_schema','information_schema','mysql')
and engine != 'Innodb' group by table_schema, engine with rollup;
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
@jayjanssen
jayjanssen / gist:41bcf7a6cd358afb655d
Created June 25, 2014 17:55
test windows vagrant-aws file
Vagrant.configure("2") do |config|
config.vm.box = "perconajayj/centos-x86_64"
config.vm.provider :aws do |aws, override|
aws.instance_type = 'm1.small'
aws.region = 'us-east-1'
aws.access_key_id = "YOUR KEY"
aws.secret_access_key = "YOUR SECRET KEY"
aws.keypair_name = "KEYPAIR NAME"
@jayjanssen
jayjanssen / gist:394c18e64fdd31e6cab7
Last active August 29, 2015 14:01
Percona Training scoreboard -- node.js
// To Install: (requires EPEL)
// yum install nodejs nodejs-async -y
// To start:
// export NODE_PATH=/usr/lib/node_modules/
// screen node scoreboard.js
var http = require('http');
var async = require('async');
@jayjanssen
jayjanssen / keepalived.conf
Created March 19, 2014 17:16
Basic Keepalived and PXC setup
vrrp_script chk_pxc {
script "/usr/bin/clustercheck"
interval 1
}
vrrp_instance PXC {
state MASTER
interface eth1
virtual_router_id 51
priority 100
nopreempt
@jayjanssen
jayjanssen / gist:9487973
Created March 11, 2014 15:18
PXC config
[mysqld]
datadir = /var/lib/mysql
query_cache_size=0
query_cache_type=0
binlog_format = ROW
innodb_buffer_pool_size = 128M
#^^ or however much you can allocate to MySQL on this machien
tell application "System Events"
tell current location of network preferences
set VPNservice to service "My VPN" -- name of the VPN service
if exists VPNservice then connect VPNservice
repeat until (connected of current configuration of VPNservice)
delay 1
end repeat
end tell
@jayjanssen
jayjanssen / gist:7945311
Last active December 31, 2015 06:09
Munin plugin for Bitcasa Linux client
#!/usr/bin/perl
my $stats = "/var/lib/bitcasa/stats";
my %patterns = (
'max_cache' => qr/Maximum Cache Size Setting: (.*)$/,
'current_cache' => qr/Current Cache Size: (.*)$/,
'available_cache' => qr/Available Cache Space: (.*)$/,
'used_cache' => qr/Used Cache Space: (.*)$/,
@jayjanssen
jayjanssen / parse_bamboo_contacts.pl
Created September 18, 2013 13:41
Parse CSV download from BambooHR to make it useful to import into OSX Contacts
#!/usr/bin/perl
use Text::CSV;
use Data::Dumper;
my $headers = <STDIN>;
my $csv = new Text::CSV;
print "Last, First, Mobile, \"Phone (work)\", \"Email (work)\", \"Skype (work)\"\n";