Skip to content

Instantly share code, notes, and snippets.

View bradfordpythian's full-sized avatar

Ronald Bradford bradfordpythian

  • Pythian
  • Trumbull CT USA
View GitHub Profile
@bradfordpythian
bradfordpythian / linux-desktop-browser.txt
Created December 7, 2016 15:57
Ubuntu desktop browser configuration
$ xdg-settings get default-web-browser
google-chrome.desktop
$ xdg-open http://google.com/
$ xdg-settings set default-web-browser firefox.desktop
$ xdg-open http://google.com/
$ file `which xdg-open`
@bradfordpythian
bradfordpythian / xenial_setup.sh
Last active August 9, 2017 18:48
Ubuntu 16.04 Default Installation
#
# Instructions for Ubuntu 16.04 (Xenial) Desktop
#
# The following primary packages will be installed
# - VirtualBox 5.1
# - Vagrant 1.9.x
# - Ansible 2.x
# - Docker
#
@bradfordpythian
bradfordpythian / xenial_verify.sh
Last active January 25, 2017 18:59
Ubuntu 16.04 Setup Verification Steps
# Verification steps after default xenial_setup.sh
[ -z `which vboxmanage` ] && echo "VirtualBox not installed correctly" && exit 1
[ -z `which vagrant` ] && echo "Vagrant not installed correctly" && exit 1
[ -z `which ansible` ] && echo "Ansible not installed correctly" && exit 1
[ -z `which docker` ] && echo "Docker not installed correctly" && exit 1
vboxmanage --version
vagrant --version
ansible --version
docker --version
@bradfordpythian
bradfordpythian / mysql_sandbox_setup.sh
Last active February 3, 2017 15:20
MySQL Sandbox Setup
#
# Setup of MySQL Sandbox via git repo
#
[ -d mysql-sandbox ] && cd mysql-sandbox && git pull & cd ..
[ ! -d mysql-sandbox ] && git clone https://github.com/datacharmer/mysql-sandbox.git
cd mysql-sandbox
echo "perl Makefile.PL
make
make test
make install" > install.sh
@bradfordpythian
bradfordpythian / docker_setup.sh
Last active December 29, 2016 14:22
Docker setup on Ubuntu 16.04 (xenial)
#
# Setup of docker on Ubuntu 16.04
# SEE: https://docs.docker.com/engine/installation/linux/ubuntulinux/
#
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv \
--keyserver hkp://ha.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo add-apt-repository "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main"
@bradfordpythian
bradfordpythian / cluster_trepctl.sh
Created December 13, 2016 15:39
Tungsten Cluster column trepctl output
#!/bin/sh
#
# NAME: cluster_trepctl.sh
# AUTHOR: Ronald Bradford
# PURPOSE: Simple script to combine trepctl output from 'n' hosts into columns
SCRIPT_NAME=`echo $0 | sed -e "s/\.sh$//"`
[ -z "${TMP_DIR}" ] && TMP_DIR="/tmp"
[ $# -eq 0 ] && echo "USAGE: $0 <host> [<host> ...]" && exit 0
@bradfordpythian
bradfordpythian / strict_trans_table_test.sql
Created December 15, 2016 20:06
Test showing how MySQL sql_mode STRICT_TRANS_TABLE fails
CREATE SCHEMA IF NOT EXISTS test;
USE test;
DROP TABLE IF EXISTS strict_test;
CREATE TABLE strict_test(
i1 INT UNSIGNED NOT NULL AUTO_INCREMENT,
c1 VARCHAR(10) NOT NULL,
i2 TINYINT NOT NULL DEFAULT '1',
PRIMARY KEY (i1)
) ENGINE=InnoDB;
SET GLOBAL sql_mode='NO_ENGINE_SUBSTITUTION';
# https://www.percona.com/doc/percona-xtrabackup/2.3/installation/yum_repo.html
# For CentOS/RHEL/OL
if [ -f "/etc/redhat-release" ]
then
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
yum install -y libev
yum install -y http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm
yum list | grep xtrabackup
yum install -y percona-xtrabackup
fi
@bradfordpythian
bradfordpythian / vagrant_ubuntu_1004.sh
Created December 19, 2016 21:23
Install and update Ubuntu 10.04 via Vagrant
BOX="ubuntu-10.04"
if [ `vagrant box list | grep "^${BOX}" | wc -l` -eq 0 ]
then
vagrant box add ${BOX} http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-10.04_chef-provisionerless.box
fi
echo '# VagrantFile
Vagrant.configure(2) do |config|
@bradfordpythian
bradfordpythian / docker_mysql.sh
Created December 30, 2016 14:43
MySQL Docker Helper functions
wget https://raw.githubusercontent.com/ronaldbradford/mysql-docker-minimal/master/dockerhelper.sh
. ./dockerhelper.sh
# Docker Registered functions are: docker_mysql, docker_percona, docker_mariadb