Skip to content

Instantly share code, notes, and snippets.

View patrickmslatteryvt's full-sized avatar

Patrick M. Slattery patrickmslatteryvt

  • South Burlington, VT
View GitHub Profile
@patrickmslatteryvt
patrickmslatteryvt / vmnix.sh
Last active December 22, 2015 03:19
vmnic debug
[root@08-00-27-a3-a2-ed ~]# dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
e1000g0 Ethernet up 1000 full e1000g0
e1000g1 Ethernet up 1000 full e1000g1
[root@08-00-27-a3-a2-ed ~]# dladm show-phys -m
LINK SLOT ADDRESS INUSE CLIENT
e1000g0 primary 8:0:27:a:5:63 yes e1000g0
e1000g1 primary 8:0:27:a3:a2:ed yes e1000g1
@patrickmslatteryvt
patrickmslatteryvt / nginx_jira.conf
Last active December 22, 2015 07:48
nginx conf for JIRA
Config # 1
server {
listen 80;
server_name xxx.devdmz.xxx.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 300;
location / {
@patrickmslatteryvt
patrickmslatteryvt / ZFS on Linux (CentOS v6.5)
Last active August 29, 2015 14:00
ZFS on Linux (CentOS v6.5)
ZFS on Linux
FAQ
http://zfsonlinux.org/faq.html
A not so short guide to ZFS on Linux
http://unicolet.blogspot.com/2013/03/a-not-so-short-guide-to-zfs-on-linux.html
ZFS Cheatsheet
http://www.datadisk.co.uk/html_docs/sun/sun_zfs_cs.htm
@patrickmslatteryvt
patrickmslatteryvt / create_zol_vm.ps1
Last active September 7, 2017 21:35
PowerShell script to create a vSphere VM with 8 HDDs and 2 SSDs suitable for testing ZFS on Linux
# Stops the client whining about certs
Set-PowerCLIConfiguration -InvalidCertificateAction ignore
# Edit these values to suit your environment
Connect-VIServer -server vcenter.dev.acme.com -User root -Password *******************
# VM host we will create the VM on
$VS5_Host = "10.10.10.2"
# Name of VM we want to create
$vmName1 = "ZOL_CentOS"
@patrickmslatteryvt
patrickmslatteryvt / buildHAProxy.sh
Last active September 18, 2016 17:32 — forked from codingtony/buildHAProxy.sh
Compile of Haproxy using LibreSSL static. See https://github.com/codingtony/docker-build-haproxy for how to use with a Docker Image
#!/bin/bash -e
DIR=$PWD
yum groupinstall -y "Development Tools"
yum install -y make gcc perl wget zlib-devel
#Compile static version of libressl
export STATICLIBSSL=/tmp/staticlibssl
LIBRESSL=libressl-2.4.2
@patrickmslatteryvt
patrickmslatteryvt / ansible_uri.yaml
Last active September 21, 2016 18:32
Ansible URI module issue with multiple data objects
# This works
- name: "Set the Couchbase cluster security settings"
shell: "curl -v -X POST http://{{ couchbase_host }}:{{ couchbase_cluster_port }}/settings/web \
-d port={{ couchbase_cluster_port }} \
-d username={{ couchbase_cluster_username }} \
-d password={{ couchbase_cluster_password }}"
# This does not:
- name: "Set the Couchbase cluster security settings"
uri:
# This works:
- include_role:
name: mwg.svn
tasks_from: create-repo
vars:
svn_instance: svn
svn_repo: subversion
# This does not:
- include_role:

Sample of how to use lists to select from multiple predefined choices in Ansible

playbooks/rackspace.yaml

---
- name: "Provision system(s) in Rackspace"
  hosts: localhost
  connection: local
  gather_facts: yes
# Pull the necessary images:
docker pull nathanleclaire/curl:latest
docker pull openjdk:8u111-jre-alpine

# Start the controller container, note that it has RW access to the Docker API socket:
docker run \
  -ti \
  --rm \
@patrickmslatteryvt
patrickmslatteryvt / gist:97c8140d79f0161be53fc65b872f23c6
Last active February 23, 2017 22:55
docker_login until failures
# Task
- name: "Log into hub.docker.com"
become: yes
become_user: automation
docker_login:
username: "{{ docker_hub_username }}"
password: "{{ docker_hub_password }}"
email: "{{ docker_hub_email }}"
register: docker_login_result
# until: docker_login_result.login_result.Status == "Login Succeeded"