Skip to content

Instantly share code, notes, and snippets.

View tsunejui's full-sized avatar
👋
Your IT Solutions Partner

Rex Wu tsunejui

👋
Your IT Solutions Partner
View GitHub Profile
@cjmatta
cjmatta / README.md
Last active April 12, 2024 11:53
Secure Kafka Connect (SASL_SSL)
@ScriptingSquirrel
ScriptingSquirrel / export-node-stats.md
Last active April 4, 2023 02:18
Setup prometheus-node-exporter and push stats to Pushgateway with cron job

(Assuming a Debian 8-like system)

  • Install prometheus-node-exporter

    $ sudo apt update && sudo apt install prometheus-node-exporter
  • Configure prometheus-node-exporter to expose metrics only to localhost, not on to all networks. Modify file /etc/default/prometheus-node-exporter:

    # Set the command-line arguments to pass to the server.
@kekru
kekru / 01nginx-tls-sni.md
Last active June 19, 2024 17:24
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@monmonja
monmonja / generate-ios.sh
Created July 16, 2019 13:16
generate ios from command line
# download this file to your project folder and excute
# chmod +x generate-ios.sh
# then run using
# ./generate-ios.sh
# flutter build defaults to --release
flutter build ios
# make folder, add .app then zip it and rename it to .ipa
mkdir -p Payload
@slok
slok / pprof.md
Last active July 1, 2024 11:41
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
@waynedovey
waynedovey / scaledown.sh
Last active July 10, 2024 18:23
Scale Down OpenShift Monitoring
oc patch clusterversion/version --type='merge' -p "$(cat <<- EOF
spec:
overrides:
- group: apps/v1
kind: Deployment
name: cluster-monitoring-operator
namespace: openshift-monitoring
unmanaged: true
EOF
)"

为了方便,将所有的用户名密码统一为Abc12345

最后会开放所有用户的所有权限,如果需要实现真正的权限控制,【授权】那一节请根据实际需求修改命令

生成证书

使用jdk的keytool生成,所有参数的含义keytool --help都带有中文文档,此处不再解释

@neoakris
neoakris / prom-gui_and_GMP_on_GKE_autopilot.md
Last active April 26, 2024 04:00
Example of Troubleshoot Prom GUI and GMP on GKE Autopilot