Skip to content

Instantly share code, notes, and snippets.

@lamw
lamw / gist:a9ab09834a806505fd02415ed2b85131
Created Jun 23, 2020
VMC Terraform Provider for deploying 1 & 2 Node SDDC
View gist:a9ab09834a806505fd02415ed2b85131
# 1-Node SDDC
provider "vmc" {
refresh_token = var.refresh_token
org_id = var.org_id
}
resource "vmc_sddc" "sddc_1" {
sddc_name = "1-Node-SDDC"
num_host = 1
@lamw
lamw / gist:27818554a29a1f4db164d432a691bf77
Last active Jun 23, 2020
VMC REST API for deploying 1 & 2 Node SDDC
View gist:27818554a29a1f4db164d432a691bf77
# 1-Node SDDC
POST /orgs/{orgs}/sddcs
{
"name": "1-Node-SDDC",
"num_hosts": 1,
"deployment_type": "SingleAZ",
"sddc_type": "1NODE",
"provider": "AWS",
View gist:4769a59dabaa41f789950aaa1c7fab2b
2020/05/08 08:43:05 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2020/05/08 08:43:05 [INFO] Terraform version: 0.12.24
2020/05/08 08:43:05 [INFO] Go runtime version: go1.12.13
2020/05/08 08:43:05 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply", "-auto-approve"}
2020/05/08 08:43:05 [DEBUG] Attempting to open CLI config file: /Users/lamw/.terraformrc
2020/05/08 08:43:05 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/05/08 08:43:05 [INFO] CLI command args: []string{"apply", "-auto-approve"}
2020/05/08 08:43:05 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
View gist:1682db3c1460f4c3838d6a11fe98584b
2020/05/08 08:30:04 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2020/05/08 08:30:04 [INFO] Terraform version: 0.12.24
2020/05/08 08:30:04 [INFO] Go runtime version: go1.12.13
2020/05/08 08:30:04 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply", "-auto-approve"}
2020/05/08 08:30:04 [DEBUG] Attempting to open CLI config file: /Users/lamw/.terraformrc
2020/05/08 08:30:04 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/05/08 08:30:04 [INFO] CLI command args: []string{"apply", "-auto-approve"}
2020/05/08 08:30:04 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
View vsphere-iso-packer-build.json
{
"variables": {
"photon_ovf_template": "photon.xml.template",
"ovftool_deploy_vcenter": "192.168.30.200",
"ovftool_deploy_vcenter_username": "administrator@vsphere.local",
"ovftool_deploy_vcenter_password": "VMware1!"
},
"builders": [
{
"type": "vsphere-iso",
@lamw
lamw / gist:bc191cbb60b9136638e6d1b3f302864f
Created Jan 2, 2020
Example Blog Post DMCA Takedown Notice
View gist:bc191cbb60b9136638e6d1b3f302864f
My name is [YOUR NAME] and I am the owner of the [YOUR BLOG NAME AND URL] blog. A website that your company hosts (according to this WHOIS information) is infringing on at least one of my blog posts.
Here is my original blog post which was published on [PUBLISH DATE/TIME TO YOUR BLOG POST] which I am the owner and creator of.
[LINK TO YOUR ORIGINAL BLOG POST]
The stolen content was slightly altered at the beginning and end to prevent search engines from identifying the stolen content. The unauthorized and infringing copy can be found at:
[LINK TO OFFENDING BLOG POST]
Per the Registry WHOIS information, the individual looks to be named:
[OFFENDER NAME] ([OFFENDER EMAIL]) which hopefully should match the owner of the blog site that is being hosted on [OFFENDER HOSTING PROVIDER NAME].
View gist:7709710864dacc107c69659a8da73377
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 2 columns, instead of 1. in line 1.
letter frequency
Nested_ESXi6.0u3 57
Nested_ESXi6.5u1 22
Nested_ESXi6.7 188
Nested_ESXi6.7u1 171
Nested_ESXi6.5 13
Nested_ESXi6.5u2 116
Nested_ESXi6.5d 110
@lamw
lamw / gist:2a10d4941baf140f94d15f68d951c4c9
Last active Nov 1, 2019
List all Unassociated/Orphaned vSAN Objects using PowerCLI
View gist:2a10d4941baf140f94d15f68d951c4c9
$ClusterName = "Cluster-01"
$clusterView = Get-Cluster $ClusterName
$vmhost = ($clusterView | Get-VMHost) | select -First 1
$vsanClusterObjectSys = Get-VsanView -Id VsanObjectSystem-vsan-cluster-object-system
$results = (($vsanClusterObjectSys.VsanQueryObjectIdentities($clusterMoRef,$null,$null,$true,$true,$false)).Identities | where {$_.Vm -eq $null})
foreach ($result in $results) {
$jsonResult = ($vsanIntSys.GetVsanObjExtAttrs($result.Uuid)) | ConvertFrom-JSON
@lamw
lamw / gist:a744df89a5b8aab18c2b69af9399565b
Last active Jul 10, 2019
Add custom color to vSphere HTML5 UI Header/Footer in vSphere 6.7 Update 1
View gist:a744df89a5b8aab18c2b69af9399565b
NEW_HEX_COLOR=632771
cp /usr/lib/vmware-vsphere-ui/plugin-packages/root-app/plugins/h5ngc.war /usr/lib/vmware-vsphere-ui/plugin-packages/root-app/plugins/h5ngc.war.bak
mkdir -p /root/TEST
cd /root/TEST
cp /usr/lib/vmware-vsphere-ui/plugin-packages/root-app/plugins/h5ngc.war .
unzip h5ngc.war
rm -f h5ngc.war
cat << EOF >> resources/css/vghetto-custom.css
.main-nav HEADER{
background-color:#${NEW_HEX_COLOR} !important; }
View gist:faee1284b0f998e8973a31547103d45e
#!/usr/bin/env python
# VMware vSphere Python SDK
# Copyright (c) 2008-2013 VMware, Inc. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
You can’t perform that action at this time.