Skip to content

Instantly share code, notes, and snippets.

View smitmartijn's full-sized avatar

Martijn Smit smitmartijn

View GitHub Profile
# This small script removes VMware Data Security from ESXi hosts
# via an API call - for after you've upgraded vCNS to NSX and
# forgot to uninstall Data Security
#
# Martijn Smit <martijn@lostdomain.org>
$vCenter_IP = "vcenter.myurl.nl"
$NSX_Manager_IP = "nsxmanager.myurl.nl"
$NSX_Manager_User = "admin"
$NSX_Manager_Password = "mysecretnsxpassword"
#!/usr/bin/perl
#
# This script connects to a MySQL of MariaDB database servers and
# gets information about the Galera Cluster (http://galeracluster.com/)
# to use that information to determine the health of the cluster and then
# return the health status in a format that nagios understands.
#
# This script needs a database user, preferbly one with only USAGE rights. Here's an example:
# GRANT USAGE ON *.* TO 'myuser'@'myhost' IDENTIFIED BY 'mypassword';
#
# This script goes through all backup jobs configured on your Veeam
# Backup & Replication Management server and calculates the amount of
# data (the size of the data in the VMs) and the backup sizes (the size
# of the data on the backup disk).
#
# There is more information in the backup job object for you to use, but this
# script was intended for billing purposes based on GB of backup storage.
#
# Martijn Smit <martijn@lostdomain.org>
#
### Keybase proof
I hereby claim:
* I am smitmartijn on github.
* I am smitmartijn (https://keybase.io/smitmartijn) on keybase.
* I have a public key whose fingerprint is 4C42 8050 45A7 E181 5E7F F60A C95A 62E2 AC44 3AA2
To claim this, I am signing this object:
$Url = "http://www.example.com/path"
$Username="user"
$Password="password"
# Invoke Internet Explorer
$IE = New-Object -com internetexplorer.application;
$IE.visible = $true;
$IE.navigate($Url);
#!/usr/bin/perl
# Check Gluster volume status and number of present bricks
#
# Requires edits to /etc/sudoers:
# Defaults:epops !requiretty
# epops ALL=NOPASSWD: /usr/sbin/gluster volume info*
use strict;
use Getopt::Long qw(GetOptions);
"/2.0/vdn/config/segments": {
"get": {
"description": "Lists all Segment ID Pools",
"tags": [
"2.0"
],
"operationId": "Get_vdnSegmentPoolList_",
"produces": [
"application/json"
],
# This is where we save the cookies!
$global:CookieJar = New-Object System.Net.CookieContainer
$global:LoggedIn = $False
$global:LoggingIn = $False
function ACI-API-Call([string]$method, [string]$encoding, [string]$url, $headers, [string]$postData)
{
$return_value = New-Object PsObject -Property @{httpCode = ""; httpResponse = ""}
## Create the request
param (
[parameter(Mandatory=$true,ValueFromPipeLine=$true,ValueFromPipeLineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[string]$username,
[parameter(Mandatory=$true,ValueFromPipeLine=$true,ValueFromPipeLineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[string]$password,
[parameter(Mandatory=$true,ValueFromPipeLine=$true,ValueFromPipeLineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[string]$apic,
function New-NsxMulticastRange
{
<#
.SYNOPSIS
Adds a new multicast IP address range for use in the VXLAN network
.DESCRIPTION
Specifying a multicast address range helps in spreading traffic across your
network to avoid overloading a single multicast address.A virtualized
network‐ready host is assigned an IP address from this range.