Skip to content

Instantly share code, notes, and snippets.

View kevincantu's full-sized avatar

Kevin Cantú kevincantu

  • Palo Alto Networks
  • Oakland, California
View GitHub Profile
@kevincantu
kevincantu / example.sh
Created January 15, 2022 06:32
Adding a TLS client certificate (PEM + PKCS#12) to your Keychain Access on macOS, from the CLI
# given files
# * kcantu-cert.pem
# * kcantu-key.pem
# * kcantu.p12
# add the identity + certificate
security import kcantu.p12
# trust the certificate (as if in GUI choosing "Always Trust"
sudo security add-trusted-cert -d -r trustAsRoot -k /Library/Keychains/System.keychain kcantu-cert.pem
# specify the URL like usual, but point that DNS entry at a different server either by IP or by alt. domain
# https://daniel.haxx.se/blog/2018/04/05/curl-another-host/
#
curl --resolve example.test:443:127.0.0.1 https://example.test/
curl --connect-to example.test:443:alt.test:443 https://example.test/
curl --connect-to example.test:443:alt.test:443 https://example.test/ --header "Host: alt2.test"
# and for TLS certificate checking:
openssl s_client -servername example.test -connect alt.test:443 2>/dev/null </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -text -noout
@kevincantu
kevincantu / 1-otel-collector.yaml
Last active July 22, 2022 12:31
OpenTelemetry Collector's OTLP gRPC receiver config on Envoy / Contour
---
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-conf
namespace: monitoring
labels:
app: opentelemetry
component: otel-collector-conf
data:
# YAGES: https://github.com/mhausenblas/yages#yet-another-grpc-echo-server
#
# set this up and then call:
# grpcurl --insecure -v yages.staging.test:443 yages.Echo.Ping
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: yages
namespace: monitoring

Keynote usage:

  1. Play -> Play Slideshow in Window
  2. Ctrl+Cmd+F to maximize

Zoom settings, General:

  • [on] Use dual monitors (to open gallery in a separate window)
  • [off] Enter full screen when starting or joining a meeting

Zoom settings, Share Screen:

  • [off] Enter full screen when a participant shares screen
@kevincantu
kevincantu / deserializing-k8s-objects.go
Last active March 17, 2021 02:03 — forked from nownabe/deployment.yaml
Deserialize Kubernetes objects in Go
package main
import (
"fmt"
"io/ioutil"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
@kevincantu
kevincantu / multi-line-grep.bash
Created July 12, 2018 22:44
multi-line grepping
grep -Plrz "Notebook[[]{\n}" *
@kevincantu
kevincantu / steps to do big updates to a .gitattributes file.bash
Last active March 17, 2021 02:03
User experience rebasing a working branch to origin/master after we've merged (currently AKA: origin/kevin-eol-cleanup)
# update the .gitattributes
git add .gitattributes
git commit -am "cleaning up line endings"
# force Git to re-index everything
rm .git/index
git reset
git add -u
# now modify that commit