Skip to content

Instantly share code, notes, and snippets.

View michaelrice's full-sized avatar

Michael Rice michaelrice

View GitHub Profile
formatter_provider_plugin = __import__(
pigs_config.FORMATTER_PROVIDER_PLUGIN["namespace"],
pigs_config.FORMATTER_PROVIDER_PLUGIN["class"]
)
del klass
klass = getattr(
formatter_provider_plugin,
pigs_config.FORMATTER_PROVIDER_PLUGIN["class"]
)
from abc import ABCMeta, abstractmethod
class BaseABC(object):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self, *args, **kwargs):
pass
@abstractmethod
@michaelrice
michaelrice / deploy_vcsa.sh
Created August 3, 2015 19:42
shell script to deploy a vcenter server app
#!/bin/bash
OVA_SRC=CHANGEME
VCSA_NAME="CHANGEME"
VCSA_GW="10.127.35.1"
VCSA_IP="10.127.35.61"
VCSA_NM="255.255.255.0"
ESXI_USR="root"
ESXI_PASS=""
ESXI_HOST="CHANGEME"
± |james_changes ✗| → tox -e py26
GLOB sdist-make: /Users/errr/programs/python/graphite-api/setup.py
py26 inst-nodeps: /Users/errr/programs/python/graphite-api/.tox/dist/graphite-api-1.0.1.zip
py26 runtests: PYTHONHASHSEED='3404817578'
py26 runtests: commands[0] | python setup.py test
running test
running egg_info
writing pbr to graphite_api.egg-info/pbr.json
writing top-level names to graphite_api.egg-info/top_level.txt
writing graphite_api.egg-info/PKG-INFO

vmxConfigChecksum value in SOAP is:

ox991LwhCGLf2gntXqKkSPdqC+A= 

I do a Base64.decode it and return it to the user as a byte[], and I just feel like I should be able to validate that

ox991LwhCGLf2gntXqKkSPdqC+A= 

Parses into something meaningful. Should I care? Or should I just hand this decoded byte array off to the user and move on?

@michaelrice
michaelrice / TrustAllSSL.java
Created June 19, 2015 03:26
TrustAllSSL.java
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
/**
TASK: [galera_client | Install pip packages] **********************************
failed: [infra3_galera_container-07d97389] => (item=MySQL-python) => {"attempts": 5, "cmd": "/usr/local/bin/pip install MySQL-python", "failed": true, "item"
: "MySQL-python"}
msg: Task failed as maximum retries was encountered
failed: [infra2_galera_container-22db42b4] => (item=MySQL-python) => {"attempts": 5, "cmd": "/usr/local/bin/pip install MySQL-python", "failed": true, "item"
: "MySQL-python"}
msg: Task failed as maximum retries was encountered
failed: [infra1_galera_container-516a6f2d] => (item=MySQL-python) => {"attempts": 5, "cmd": "/usr/local/bin/pip install MySQL-python", "failed": true, "item"
: "MySQL-python"}
msg: Task failed as maximum retries was encountered
## The default networking requires several bridges. These bridges were named to be informative
## however they can be named what ever you like and is adaptable to any network infrastructure
## environment. This file serves as an example of how to setup basic networking and was ONLY
## built for the purpose of being an example.
# EXAMPLE INTERFACE FILE
# 1293 - HOST_NET (Ignore This. It's the native VLAN.)
# 2176 - CONTAINER_NET
# 1998 - OVERLAY_NET
# 2144 - STORAGE_NET
package com.vmware.vim25;
import lombok.Getter;
import lombok.Setter;
import java.util.Calendar;
/**
* Created by Michael Rice on Sun May 24 16:15:35 CDT 2015
*
* Copyright 2015 Michael Rice
package com.vmware.vim25;
/**
* Created by Michael Rice on Wed May 20 12:26:41 CDT 2015
*
* Copyright 2015 Michael Rice
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at