Skip to content

Instantly share code, notes, and snippets.

@mgoodness
mgoodness / helm-rbac.md
Last active October 30, 2021 17:04
Helm RBAC setup for K8s v1.6+ (tested on minikube)
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
@jesselucas
jesselucas / protogen.md
Last active January 29, 2019 01:23
Tips for generating gRPC protocol buffers

Tips for generating gRPC protocol buffers

You can use the flag -I or -proto_path to specify the path to your protobuffer. The next flag specifies the language to compile to. The Go command is fairly well documented but the Node.js documents seem to only show how to dynamically load a proto file. This is how you generate a compiled file for use in your Node.js project.

GO

protoc --proto_path=$SRC_PATH --go_out=plugins=grpc:$DEST_PATH $SRC_PATH/service.proto

Node.js

protoc --proto_path=$SRC_PATH --js_out=import_style=commonjs,binary:$DEST_PATH --grpc_out=./ --plugin=protoc-gen-grpc=node_modules/grpc-tools/bin/grpc_node_plugin $SRC_PATH/service.proto

@everpeace
everpeace / docker-compose.yml
Last active March 16, 2025 10:27
kafka cluster in docker-compose.
# WARNING: This docker-compose.yml is only for testing purpose.
# Parameters:
# - name: CONFLUENT_PLATFORM_VERSION
# default: 3.0.0
# reference: https://hub.docker.com/u/confluentinc/
# Ports:
# - description: Major ports are exposed to host computer
# - zookeeper: 2181
# kafka1: 9091
# kafka2: 9092
@barnybug
barnybug / docker-compose.yml
Created November 21, 2017 11:14
Docker compose for a Docker-in-docker gitlab runners setup
# Docker-in-Docker Gitlab runners setup taken from:
# https://medium.com/@tonywooster/docker-in-docker-in-gitlab-runners-220caeb708ca
dind:
restart: always
privileged: true
volumes:
- /var/lib/docker
image: docker:17.09.0-ce-dind
command:
- --storage-driver=overlay2
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 4, 2025 11:53
set -e, -u, -o, -x pipefail explanation

Istio Auth Policy and Mesh Policy Results

Test the behavior of various implementations of mTLS for Auth Policies AND Mesh Policies so that we have the right logic implemented when we determine the config mTLS state for the Details API

Set Up

For testing these scenarios, I installed AspenMesh in a bare cluster without enabling mTls by default (use install/kubernetes/aspenmesh.yaml) but otherwise set it up normally according to the Aspen Mesh and Istio Docs.

I used the Istio setup described here

Follow the setup steps in this doc

@disintegrator
disintegrator / https-during-dev.macos.sh
Last active October 23, 2024 08:32
Use Caddy, mkcert and dnsmasq to expose your development server over HTTPS
brew install caddy mkcert nss dnsmasq
mkcert -install
mkcert '*.app.test' '*.cdn.test'
# rename the certs and move them under /usr/local/etc/caddy/certs
cat <<EOF > /usr/local/etc/caddy/Caddyfile
*.app.test:443, *.cdn.test:443 {
@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active April 25, 2025 19:23
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@Sarath18
Sarath18 / video.py
Last active November 30, 2024 15:10
Publish images (sensor_msgs/msg/Image) from webcam or video on ROS2 topic(s)
#!/usr/bin/python3
import rclpy
from rclpy.node import Node
import cv2
import os
import sys
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class ImagePublisher(Node):