Skip to content

Instantly share code, notes, and snippets.

View zmx's full-sized avatar

Zhong, Ming-Xun zmx

View GitHub Profile
@zmx
zmx / burn_rate_game_rules.md
Created October 28, 2025 13:36
The Game Rules of Burn Rate (Board Game)

介紹

「燒錢計畫( Burn Rate)」遊戲為2002年由Rich Koehler所設計,為一趣味十足的策略遊戲。 遊戲中玩家們扮演著網路公司的執行長,募集了龐大的資金,希望能讓公司在產業界繼續生存下去。 網路公司包含人力資源、研發、財務及業務四個部門,玩家們除了要網羅具有專業技能的人才努力 經營外,還要想盡辦法拖垮其他競爭對手,包括挖角對手部門主管、強迫對手雇用員工及 提供對手爛點子方案等。遊戲在玩家間的明爭暗鬥中進行,若過程中有玩家的資金燒光,則將宣告倒閉 退出市場。當最後只剩下一家網路公司時,遊戲即告結束,這家網路泡沫下的倖存公司則成為遊戲贏家。

參考資訊 https://mj9981168.pixnet.net/blog/post/141899759

@zmx
zmx / restart_firefox.txt
Last active October 28, 2025 14:55
restart Firefox while preserving your open tabs
# Type about:restartrequired in the address bar and press Enter. This may prompt a restart while preserving tabs, especially after updates.
about:restartrequired
@zmx
zmx / ping_redis_in_k8s.sh
Created May 28, 2025 05:32
ping redis in k8s
exec 3<>/dev/tcp/redis-stack-service.tenant-redis-stack-service.svc.cluster.local/6379 && echo -e "PING\r\n" >&3 && head -c 12 <&3
# +PONG
@zmx
zmx / vault-cp.sh
Created May 7, 2024 07:55
vault cp
vault kv put kv/destination/path @<(vault kv get -format=json kv/origin/path | jq .data.data)
# via https://gist.github.com/elasticdog/e82f0b8e63407cbb6af69341cb9d0336?permalink_comment_id=3278492#gistcomment-3278492
@zmx
zmx / gist:ce91750bcc4c80cb34bc24de7c426f19
Created March 4, 2024 06:33
Prometheus Operator Blackbox Exporter Auto Discover Ingress
apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
name: tls-probe
namespace: monitoring
spec:
interval: 60s
module: http_2xx
prober:
path: /probe
@zmx
zmx / k8s_sync_secret.sh
Created January 16, 2024 17:11
K8s Sync Secrets from Template Job
# Origin: https://colocatedeventsna2023.sched.com/event/1Rj2e
kubectl -n preview-apps get secret db-secret -o yaml | \
yq 'del(.metadata.creationTimestamp, .metadata.uid, .metadata.resourceVersion, .metadata.namespace,
.metadata.annotations, .metadata.ownerReferences)' | \
kubectl apply --namespace $PR_NUMBER -f -
@zmx
zmx / helm_ignore_double_curly.yaml
Created January 16, 2024 06:40
Helm template ignore {{expr}}
# A viable hack is to let Helm render the template as a raw string.
# Note the opening and closing curly bracket with a backtick:
#
# Origin: https://github.com/helm/helm/issues/2798#issuecomment-470435015
#
# Excerpt from a Prometheus Alertmanager yaml
receivers:
- name: slack-receiver
slack_configs:
- text: |-
@zmx
zmx / kwok-macos.sh
Last active December 26, 2023 09:45
kwok on macOS
# https://kwok.sigs.k8s.io/docs/user/kwokctl-platform-specific-binaries/#use-unofficial-binaries
KUBE_VERSION="v1.29.0"
cat <<EOF >> ~/.kwok/kwok.yaml
---
kind: KwokctlConfiguration
apiVersion: config.kwok.x-k8s.io/v1alpha1
options:
kubeBinaryPrefix: https://github.com/kwok-ci/k8s/releases/download/${KUBE_VERSION}-kwok.0-darwin-arm64
---
EOF
@zmx
zmx / mkdocs-hugo-uri.py
Last active October 20, 2023 06:13
mkdocs with hugo "_index.md"
import os
import posixpath
from urllib.parse import quote as urlquote
# Hugo rule https://gohugo.io/functions/urls/urlize/
#
# We use a small subset
HTML_TEMPLATE = """
@zmx
zmx / kill-kube-ns.sh
Created April 28, 2022 03:24
Kill Terminating Kubernetes Namespace
#!/bin/bash
###############################################################################
# Copyright (c) 2018 Red Hat Inc
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at