Skip to content

Instantly share code, notes, and snippets.

View mrhillsman's full-sized avatar

Melvin Hillsman mrhillsman

View GitHub Profile
@mrhillsman
mrhillsman / rpcops-host-setup
Created December 15, 2016 20:18
SantaClara Lab Host Setup
#!/bin/bash
# Move to the root directory as starting point
cd /root/rpcops-onmetal-labconfigurator
# Set host bond0.XXX and dummy bond0.222
__HOST_BOND_INT__=( bond0.200 bond0.222 )
# Get host bond0.XXX address [public]
__HOST_IP__=`ip addr show dev "${__HOST_BOND_INT__[0]}"|awk '/inet/ { split($2, ip, "/"); print ip[1]; exit }'`
---
- name: Setup across all nodes
remote_user: root
hosts: all
become: yes
vars:
packages:
- stress-ng
TASK: [repo_build | Run venv process script] **********************************
failed: [infra01_repo_container-6d540626] => {"changed": true, "cmd": "bash /opt/op-venv-script.sh", "delta": "0:00:45.542975", "end": "2016-11-23 22:23:13.470243", "rc": 99, "start": "2016-11-23 22:22:27.927268", "warnings": []}
stderr:
function venv_create {
VENV_PATH="$1"
VENV_FILE="$2"
# If the venv working directory already exists remove it
[[ -d "/tmp/${VENV_PATH}" ]] && rm -rf "/tmp/${VENV_PATH}"

Keybase proof

I hereby claim:

  • I am mrhillsman on github.
  • I am mrhillsman (https://keybase.io/mrhillsman) on keybase.
  • I have a public key ASBtfPc_fAPVjIiOg7yxg8NKHSJu1eZd5MBdJOr7bEXDwgo

To claim this, I am signing this object:

@mrhillsman
mrhillsman / dns-config.sh
Created August 17, 2016 15:50 — forked from odyssey4me/dns-config.sh
DNS resolver config producer
#!/bin/bash
INPUTFILE=${INPUTFILE:-'/etc/resolv.conf'}
DEBUG=${DEBUG:-false}
FALLBACK_NAMESERVERS_IPV4='8.8.8.8 8.8.4.4'
FALLBACK_NAMESERVERS_IPV6='2001:4860:4860::8888 2001:4860:4860::8844'
HOST_ADDRESSES_IPV4=$(ip a | awk '/inet / {print $2}' | grep -v '^127\.' | cut -d/ -f1 | paste -d' ' -s)
HOST_ADDRESSES_IPV6=$(ip a | awk '/inet6 / {print $2}' | grep -v '^::' | cut -d/ -f1 | paste -d' ' -s)
HOST_NAMESERVERS_NOLOCAL_IPV4=$(awk '/^nameserver/ {print $2}' ${INPUTFILE} | grep -v '^127\.\|^::' | grep '\.' | paste -d' ' -s)
#!/bin/bash
mysql -e "SELECT table_schema \"Data Base Name\", \
sum( data_length + index_length ) / 1024 / 1024 \"Data Base Size in MB\", \
sum( data_free )/ 1024 / 1024 \"Free Space in MB\" \
FROM information_schema.TABLES GROUP BY table_schema;"
@mrhillsman
mrhillsman / installHAProxy.sh
Created December 25, 2015 11:04 — forked from emgee3/installHAProxy.sh
Install HAProxy in Ubuntu 14.04 or 12.04
#!/usr/bin/env bash
#
# Install HAProxy
# Script works on Ubuntu 12.04 and 14.04 only
set -e
set -u
set -o pipefail
@mrhillsman
mrhillsman / gist:a38a38ff31660afdeeba
Created November 20, 2015 14:27 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@mrhillsman
mrhillsman / Generate MAC Address
Created September 5, 2015 12:33
Shell one-liner using python to generate a random MAC address.
python -c "import random; mac = [random.choice(range(256)) for i in range(6)]; mac[0] |= 0x02; mac[0] &= 0xfe; print ':'.join('%02x' % m for m in mac)"
#!/usr/bin/perl -w
# mysqltuner.pl - Version 1.3.0
# High Performance MySQL Tuning Script
# Copyright (C) 2006-2014 Major Hayden - [email protected]
#
# For the latest updates, please visit http://mysqltuner.com/
# Git repository available at http://github.com/major/MySQLTuner-perl
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by