Skip to content

Instantly share code, notes, and snippets.

Avatar

Dobes Vandermeer dobesv

View GitHub Profile
@dobesv
dobesv / boorkmarklet.md
Last active Nov 8, 2021 — forked from 71/boorkmarklet.md
Lists all participants in a Google Meet meeting.
View boorkmarklet.md

The following bookmarket shows a popup with the name of the participants separated by newlines.

javascript:-function(maxStrLength = 2000) { try { function findParticipants(current, depth = 0) { if (depth > 7) return; if (typeof current !== "object" || current === null || current === window) return; const descriptors = Object.getOwnPropertyDescriptors(current); for (const prop in descriptors) { if (prop.startsWith('["spaces/')) return Object.values(current); const item = findParticipants(descriptors[prop].value, depth + 1); if (item !== undefined) return item; } } const rootState = Object.entries(window).find(x => x[0].startsWith("closure_lm_"))[1], participants = findParticipants(rootState), names = []; function findName(obj) { for (const prop in obj) { const value = obj[prop]; if (typeof value === "object" && value !== null && typeof value[1] === "string") return value[1]; } } for (let i = 0; i < participants.length; i++) { const name = findName(participants[i]); if (names.indexOf(name) === -1) names.
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View renovate.json
{
"compatibility": {
"yarn": "2.x"
},
"extends": ["config:base", ":prHourlyLimit1", "docker:enableMajor"],
"packageFiles": ["package.json"],
"packageRules": [
{
"packageNames": ["aws-sdk"],
"prPriority": 0,
View kubedb-catalog.yaml
---
# Source: kubedb-catalog/templates/elasticsearch/elasticsearch-psp.yaml
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: elasticsearch-db
labels:
helm.sh/chart: kubedb-catalog-v0.15.1
app.kubernetes.io/name: kubedb-catalog
app.kubernetes.io/instance: kubedb-catalog
@dobesv
dobesv / custom-metrics-apiserver-tls-keys.certificate.yaml
Created Nov 3, 2020
prometheus custom metrics server kubernetes resource yamls
View custom-metrics-apiserver-tls-keys.certificate.yaml
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: custom-metrics-apiserver-tls-keys
labels:
app: prometheus-custom-metrics
namespace: prometheus
spec:
secretName: custom-metrics-apiserver-tls-keys
commonName: custom-metrics-apiserver.prometheus.svc
View Dockerfile
FROM zookeeper:3.5.6
# Disable Java's built-in DNS cache
RUN sed -i 's/#networkaddress\.cache\.ttl=-1$/networkaddress.cache.ttl=0/' "${JAVA_HOME}/lib/security/java.security"
# Enable prometheus stats export
COPY zookeeper-jmx-exporter-rules.yaml /opt/jmx-exporter/zookeeper-jmx-exporter-rules.yaml
RUN mkdir -p /opt/jmx-exporter && wget -O /opt/jmx-exporter/jmx-exporter.jar "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.12.0/jmx_prometheus_javaagent-0.12.0.jar"
ENV SERVER_JVMFLAGS -javaagent:/opt/jmx-exporter/jmx-exporter.jar=9101:/opt/jmx-exporter/zookeeper-jmx-exporter-rules.yaml
@dobesv
dobesv / Dockerfile
Last active Mar 24, 2020
Example kustomize configs for deploying apache drill on kubernetes
View Dockerfile
FROM apache/drill:1.17.0
# Disable Java's built-in DNS cache
RUN sed -i 's/#networkaddress\.cache\.ttl=-1$/networkaddress.cache.ttl=0/' "/usr/lib/jvm/jre/lib/security/java.security"
# Install JMX Prometheus Exporter
RUN mkdir -p /opt/jmx-exporter && \
curl -o "/opt/jmx-exporter/jmx-exporter.jar" "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.12.0/jmx_prometheus_javaagent-0.12.0.jar"
COPY drill-jmx-exporter-rules.yaml /opt/jmx-exporter/drill-jmx-exporter-rules.yaml
View gist:69bdb0f255a892b077f29c1cc8df4c5a
$ curl -v "https://api.xero.com/api.xro/2.0/Accounts"
> GET /api.xro/2.0/Accounts HTTP/1.1
> Host: api.xero.com
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Content-Type: text/html; charset=utf-8
< Strict-Transport-Security: max-age=31536000
< WWW-Authenticate: OAuth Realm="api.xero.com"
View gist:5b422c3deb749449df621a014ea35cfe
$ curl -vH "Authorization: Bearer eyJhbGc" "https://api.xero.com/api.xro/2.0/Accounts"
> GET /api.xro/2.0/Accounts HTTP/1.1
> Authorization: Bearer eyJhbGc
>
< HTTP/1.1 401 Unauthorized
< Server: Kestrel
< WWW-Authenticate: Bearer error=invalid_token
< Xero-Correlation-Id: e3ec736b-3932-4630-a701-89098e09d5c9
< Content-Length: 125
< Expires: Wed, 22 Jan 2020 05:53:57 GMT
@dobesv
dobesv / gist:4f76a2095a3aa8bc20eda6b3a8e455b3
Created Dec 20, 2019
Example of a kubernetes cron job that dumps a postgres database and copies it to s3
View gist:4f76a2095a3aa8bc20eda6b3a8e455b3
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: postgres-backup
spec:
schedule: "0 12 * * *"
jobTemplate:
spec:
backoffLimit: 0
template: