Skip to content

Instantly share code, notes, and snippets.

View mrhillsman's full-sized avatar
🎓
Learning

Melvin Hillsman mrhillsman

🎓
Learning
View GitHub Profile
@mrhillsman
mrhillsman / sftpcloudfs-quicksetup.sh
Created March 14, 2014 16:01
Quickly setup sftpcloudfs.
# Install required Python packages
pip install python-keystoneclient sftp-cloudfs ftp-cloudfs py-sendfile pysendfile paramiko python-swiftclient python-daemon python-memcached
# Setup sftpcloudfs user
useradd -r -s /sbin/nologin -M -c 'sftpcloudfs System User' -d /var/run/sftpcloudfs sftpcloudfs;
# Setup some Linux conventions for sftpcloudfs
mkdir /etc/sftpcloudfs;
mkdir /var/log/sftpcloudfs;
mkdir /var/run/sftpcloudfs;
#!/usr/bin/perl -w
# mysqltuner.pl - Version 1.3.0
# High Performance MySQL Tuning Script
# Copyright (C) 2006-2014 Major Hayden - major@mhtx.net
#
# 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
@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)"
@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 / 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
#!/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 / 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)

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:

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}"
---
- name: Setup across all nodes
remote_user: root
hosts: all
become: yes
vars:
packages:
- stress-ng