Skip to content

Instantly share code, notes, and snippets.

[custom]
;不要随意改变关键字,否则会导致出错
;acl4SSR规则
;去广告:支持
;自动测速:支持
;微软分流:支持
;苹果分流:支持
;增强中国IP段:支持
;增强国外GFW:支持
@beebird
beebird / direct.list
Last active March 24, 2024 13:40
global direct
# 直连规则
DOMAIN-SUFFIX,zuoyebang.com
DOMAIN-SUFFIX,steampy.com
DOMAIN-SUFFIX,qq.com
DOMAIN-SUFFIX,gushiwen.cn
DOMAIN-SUFFIX,cloudflareclient.com
DOMAIN,cloudflareportal.com
DOMAIN,cloudflareok.com
{
"request": [
{
"enable": true,
"name": "cn bing to www bing",
"ruleType": "redirect",
"matchType": "prefix",
"pattern": "https://cn.bing.com",
"exclude": "",
"group": "bing",
@beebird
beebird / git-pushing-multiple.rst
Created July 25, 2022 03:40 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@beebird
beebird / prom-k8s-request-limits.md
Created March 15, 2022 10:56 — forked from max-rocket-internet/prom-k8s-request-limits.md
How to display Kubernetes request and limit in Grafana / Prometheus properly

CPU: percentage of limit

A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.

This is specific to k8s and containers that have CPU limits set.

To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:

sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
sshuttle:
pkg.installed: []
group.present:
- gid: 2024
user.present:
- fullname: sshuttle
- uid: 2024
- gid: 2024
- allow_uid_change: True
@beebird
beebird / 01nginx-tls-sni.md
Created December 29, 2021 15:24 — forked from kekru/01nginx-tls-sni.md
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
@beebird
beebird / main.go
Created December 9, 2019 07:47 — forked from julz/main.go
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@beebird
beebird / generate_openvpn_config.sh
Created August 1, 2019 07:48 — forked from dmytro/generate_openvpn_config.sh
Script for OpenVPN generate client config file.
#!/bin/bash
# Easy script to create OpenVPN client configuration with the user, pre-generating user's
# RSA key and certificate.
#
# Configuration template must exist in the same directory, with only missing part: certificates.
#
# (c) Dmytro Kovalov, 2015
#
cd $(dirname ${BASH_SOURCE[0]})
@beebird
beebird / tmux.md
Created August 21, 2018 03:24 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a