Skip to content

Instantly share code, notes, and snippets.

View dlinsley's full-sized avatar

Daniel Linsley dlinsley

  • Broadcom - Tanzu
  • SMF
View GitHub Profile
@dlinsley
dlinsley / kapp_pvc_owned.yaml
Last active November 30, 2021 21:35
ytt overlays for kapp annotations
#@ load("@ytt:overlay","overlay")
#@overlay/match by=overlay.subset({"kind":"StatefulSet"})
---
spec:
volumeClaimTemplates:
#@overlay/match by=overlay.all, expects="1+"
-
metadata:
#@overlay/match missing_ok=True
annotations:
@dlinsley
dlinsley / _Delete certain Kubernetes objects across all namespaces with parallel.md
Last active January 22, 2021 20:40
Delete certain Kubernetes objects across all namespaces with parallel

Samples to cleanup multiple configs across multiple namespaces in Kubernetes using kubectl and GNU parallel

@dlinsley
dlinsley / vRO_package_signing_cert_generation.md
Last active April 8, 2022 05:41
vRO package signing cert generation

Package Signing Certificate Generation

Package signing certificate keystores can be created using the keytool command provided by the JDK.

To Create a self signed certificate for package signing that is good for 10 years:

keytool -genkeypair \
-alias _dunesrsa_alias_ \
-keyalg RSA \
-keysize 2048 \
@dlinsley
dlinsley / ffmpegCommands.md
Last active February 9, 2024 20:12
ffmpeg commands I've used more than once

Simple timelapse from video:

  • A png for every every 4th frame:

    ffmpeg -i input_vid.mp4 -r 0.25 folder/video%06d.png

  • Folder of png file to .mp4:

    ffmpeg -f image2 -i folder/video%06d.png -pix_fmt yuv420p output_vid.mp4

@dlinsley
dlinsley / getDatastoreByName.js
Created October 26, 2018 22:31
Get vSphere Datastore by name
// VMware vRealize Orchestrator action sample
// Searches a vCenter or all known vCenters for a Datastore
//
// ensures the search only matches one Datastore
//
//Action Inputs:
// vCenter - VC:SdkConnection (Optional)
// datastoreName - String
//
@dlinsley
dlinsley / getStoragePodByName.js
Created October 25, 2018 15:22
Get vSphere StoragePod by name
// VMware vRealize Orchestrator action sample
// Searches a vCenter or all known vCenters for a StoragePod (Datastore Cluster)
//
// ensures the search only matches one StoragePod
//
//Action Inputs:
// vCenter - VC:SdkConnection (Optional)
// storagePodName - String
//
@dlinsley
dlinsley / parseVroConfigElement.py
Last active March 28, 2022 07:35
Parse strings from an exported vRO Configuration Element with Python
#!/usr/bin/env python3
import argparse
import json
import sys
import xml.etree.ElementTree as ET
parser = argparse.ArgumentParser('Parse strings from exported vRO Configuration Element XML')
parser.add_argument('FILE',help='ConfigElement XML file path')
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('-n','--name',dest='vroAttribute',help='Attribute Name to parse')
@dlinsley
dlinsley / getKubeNodeIPs.sh
Last active May 9, 2018 04:48
Get Kubernetes Node IPs as JSON array with kubectl and jq
kubectl get nodes -o json | jq '.items[] | .status .addresses[] | select(.type=="ExternalIP") | .["address"]' | jq . -s -c
@dlinsley
dlinsley / moveVmRootResourcePoolCluster.js
Created April 20, 2018 17:39
Move VM to root ResourcePool of Cluster
// VMware vRealize Orchestrator action sample
// Determines the ComputeResource or ClusterComputeResource of the VM.
// Assumes the VM is part of a DRS Cluster and a member of a child resoure pool in the cluster.
//
// Moves / Migrates the VM to the root ResourcePool of the Cluster.
//
//Action Inputs:
// vm - VC:VirtualMachine
//
@dlinsley
dlinsley / upgrade_vmtools_if_needed.js
Created January 5, 2018 04:59
Upgrade VMtools if needed
// VMware vRealize Orchestrator action sample
// Upgrades VMtool on a Virtual Machine if needed.
// Assumes vm tools .vib is part of ESXi host image profile
//
//
//Action Inputs:
// vm - VC:VirtualMachine
//
//Return type: void