Skip to content

Instantly share code, notes, and snippets.

@vmwarecode
vmwarecode / snippet.py
Created July 8, 2016 07:50
vCenter Server SSL and TLS Security Protocol Configuration Command line Tool
#!/usr/bin/env python
# Copyright (c) 2015
# Author : Ajay Ahire, Mohan Bollu
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
@vmwarecode
vmwarecode / snippet.py
Created July 8, 2016 07:27
VMDIR Constraint Violation and Consistency Checks
#!/usr/bin/python
import sys
import getopt
import ldap
import re
issueFound = False
def Usage(name):
print "Usage: " + name + '''
@vmwarecode
vmwarecode / snippet.py
Created July 8, 2016 00:43
Python Script to filter all needed files for a feature or change
#!/usr/bin/python
'''
Used to extrac the source files which Developer has updated/created/modified
The branch and the related grep command determined what you are looking for
@Baoyin Qiao
Note: this script verified using python2.7.
@vmwarecode
vmwarecode / snippet.java
Created July 7, 2016 05:56
TestNG Exceptionlistener
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import org.testng.IInvokedMethod;
import org.testng.IInvokedMethodListener;
import org.testng.ITestResult;
import org.testng.Reporter;
import org.testng.TestListenerAdapter;
import com.vmware.g11n.log.GLogger;
@vmwarecode
vmwarecode / snippet.py
Created July 7, 2016 03:49
pyRacetrack Logger
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import sys
import inspect
import logging
import requests
@vmwarecode
vmwarecode / snippet.java
Last active July 6, 2016 07:29
Racetrack Web Service Java Implement
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.List;
@vmwarecode
vmwarecode / snippet.sh
Last active July 7, 2016 03:23
Extract schema and data from racetrack to your local mysql
#/**
# Used to extract schema and data from racetrack to your local mysql.
#
#Created by [email protected] on 4/3/16/3/16
#/
# connection of Racetrack
racetrack_database_server_name==<racetrack server name>
racetrack_database_name==<racetrack database name>
@vmwarecode
vmwarecode / snippet.java
Last active July 17, 2018 06:56
Deploy virtual machines of ova by ovftool
package com.vmware.g11n;
/**
* Used to deploy a virtual machine of ova by ovftool.
*
* Created by [email protected] on 5/8/15
*/
import java.io.BufferedReader;
import java.io.IOException;
@vmwarecode
vmwarecode / snippet.txt
Created July 4, 2016 01:37
Predict is upgrade tools would cause reboot
Set Args = wscript.Arguments
If Args.Count() < 2 Then
wscript.echo "Usage: RebootPredict_mainfest.vbs <Abs path to installed manifest> <Abs path to new manifest>"
Wscript.Quit 1
End If
'Compare two values in format of x.x.x.x#x
'True if pre < pro
@vmwarecode
vmwarecode / snippet.py
Created July 4, 2016 00:59
Bulk upgrade VMTools
#!/usr/bin/python -u
import sys
import time
from pyVim.connect import GetSi, SmartConnect, Disconnect
from pyVim.task import WaitForTasks, WaitForTask
from pyVmomi import Vim
from vmware import vsi
from threading import Thread