Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Gasch embano1

View GitHub Profile
@embano1
embano1 / README.md
Created Apr 6, 2022
Retrieve StorageIOAllocation property of a virtual disk
View README.md
$ ./govc object.collect -json /vcqaDC/vm/vm-with-disk config.hardware.device \
  | jq '.[0].Val.VirtualDevice[]|select(.Key==2000)|.StorageIOAllocation'
{
  "Limit": -1,
  "Shares": {
    "Shares": 1000,
    "Level": "normal"
  },
 "Reservation": 0
@embano1
embano1 / RESULT.md
Last active Apr 22, 2022
go 1.18 assert.Equal benchmark
View RESULT.md
go test -v -bench=. -gcflags '-l -N' -cpu=1,2,4 -benchmem
goos: darwin
goarch: amd64
pkg: github.com/embano1/assertbench
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkEqualGeneric
BenchmarkEqualGeneric           462083778                2.392 ns/op           0 B/op          0 allocs/op
BenchmarkEqualGeneric-2         504194739                2.391 ns/op           0 B/op          0 allocs/op
BenchmarkEqualGeneric-4 513227227 2.470 ns/op 0 B/op 0 allocs/op
@embano1
embano1 / workflow.yaml
Created Mar 11, 2022
Github Actions ko cosign Example
View workflow.yaml
name: image
on:
push:
branches: ['main']
workflow_dispatch:
permissions:
contents: read
packages: write
@embano1
embano1 / create.sh
Last active Sep 9, 2021
HTTP CloudEvents function always returning 500 (for failure tests, retries, etc.)
View create.sh
export KIND_CLUSTER_NAME=knative-0.24
export KO_DOCKER_REPO=kind.local
ko apply -f .
@embano1
embano1 / README.md
Created Jul 26, 2021
VMware Horizon Events API
View README.md

Authenticate

Note: Access token is valid for 8min.

TOKEN=$(echo -n '{"domain":"corp","username":"administrator","password":"VMware1!"}'| curl -s -d@- -H "content-type: application/json" -k https://10.153.252.17:15443/rest/login | jq -r '.access_token')

Filter to URL-encoded

@embano1
embano1 / README.md
Last active Nov 23, 2021
End-to-End Installation of VMware Event Router with kind
View README.md

End-to-End Installation of VMware Event Router with kind

The following steps describe the installation of the VMware Event Router (also part of the VEBA project) in a local Kubernetes and Knative environment.

The steps assume a Mac OSX environment but the links provide resources to install the components for other platforms.

@embano1
embano1 / README.md
Last active Jul 7, 2021
etcd Deep Dive at Golang Leipzig Meetup
View README.md

Setup

Prepare the etcd server:

docker pull bitnami/etcd:latest
docker network create app-tier --driver bridge
docker run -d --name etcd-server \
    --network app-tier \
    --publish 2379:2379 \
View README.md

Manually trigger Github Action Workflow from CLI

Motivation: the Github UI by default won't let you specify tags as input when triggering a workflow enabled with the on: workflow_dispatch event type.

Get Workflow ID

@embano1
embano1 / README.md
Created May 6, 2021
Configure Event Router with custom certs
View README.md

Configure Event Router with Custom (self-signed) Certificates

  1. Convert Cert to PEM
$ openssl x509 -inform der -in ~/Downloads/ca.cer > vc-ca.crt
  1. Create cert as ConfigMap