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
@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
@nonamed01
nonamed01 / fuckForticlient.sh
Last active July 9, 2025 08:04
fuckForticlient, a command-line client to connect to SAML fortivpn servers by using openfortivpn and the --cookie-in-stdin parameter
#!/bin/bash
# Uncomment the following line to debug the script:
#set -x
#####################################################################################
# fuckForticlient.sh
#
# Script to authenticate against Fortinet SAML servers using Firefox and
# openfortivpn. This replaces Forticlient for GNU/Linux completely.
# Because openfortivpn does not support SAML login (yet), this script uses Firefox
# to authenticate, grabs SVPNCOOKIE and then calls openfortivpn to setup
@nathanl
nathanl / deadlock_demo.md
Created June 10, 2022 18:41
Demo of deadlocks with PostgreSQL

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

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

生成证书

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

@krisek
krisek / alert.rules.yml
Last active December 5, 2025 12:33
Prometheus alert rules for node exporter
groups:
- name: node_exporter_alerts
rules:
- alert: Node down
expr: up{job="monitoring-pi"} == 0
for: 2m
labels:
severity: warning
annotations:
title: Node {{ $labels.instance }} is down
@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
)"
@slok
slok / pprof.md
Last active November 23, 2025 09:06
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
@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
@kekru
kekru / 01nginx-tls-sni.md
Last active November 27, 2025 08:33
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
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active December 4, 2025 15:03
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##