Skip to content

Instantly share code, notes, and snippets.

View qclaogui's full-sized avatar

Weifeng Wang qclaogui

  • 06:28 (UTC +08:00)
View GitHub Profile
@qclaogui
qclaogui / multipass-on-bridged-network.md
Created December 29, 2024 03:29 — forked from ynott/multipass-on-bridged-network.md
Instructions for running multipass on a bridge network

1. Environmental information

  • OS: Ubuntu 20.04.2 LTS (GNU/Linux 5.8.0-59-generic x86_64)
  • Network: 192.168.xxx.0/24
  • Ubuntu multipass host machine IP: 192.168.xxx.yyy(static IP)
  • NIC: enp2s0(bridge host NIC)
  • Bridge NIC:br0

2. Prerequisites

@qclaogui
qclaogui / Queries.md
Last active January 28, 2022 08:20 — forked from fortuna/Queries.md
Grafana dashboard for Outline Servers

Example Queries

1h active keys by location:

sum(max(increase(shadowsocks_data_bytes{access_key!=""} [1h])) by (access_key, location) > bool 0) by (location)

1h usage by location:

sum(increase(shadowsocks_data_bytes{dir=~"c<p|p>t"} [1h])) by (location)
@qclaogui
qclaogui / README.md
Created January 17, 2022 13:16 — forked from superseb/README.md
Retrieve kubeconfig from RKE or Rancher 2 custom cluster controlplane node for RKE v0.2.x and Rancher v2.2.x

Retrieve kubeconfig from RKE v0.2.x or Rancher v2.2.x custom cluster controlplane node

For RKE v0.1.x and Rancher v2.0.x/v2.1.x, see https://gist.github.com/superseb/3d8de6092ebc4b1581185197583f472a

This needs to be run on a node with the controlplane role, as it rewrites the server endpoint to https://127.0.0.1:6443, you can of course manually change this if necessary.

Applicable for:

  • RKE v0.2.x
  • Rancher v2.2.x
@qclaogui
qclaogui / rancher_aws_ecr_secret.md
Created August 11, 2021 10:17 — forked from flybd5/rancher_aws_ecr_secret.md
Creating and updating AWS ECR docker-registry secrets in Rancher

The easiest way to create and update a docker-registry secret in Rancher 2.x for an AWS ECR repo is to set up a CRON job that uses the AWS CLI and Kubectl.

  • Log into the host machine where the cluster is running
  • Install AWS CLI and configure it to use an IAM role that can read the ECR credentials.
  • Test the CLI config using this command: aws ecr --region <your_ecr's_region> get-login-password
  • Install kubectl and configure it with the yaml for the cluster in which you want to define the secret
  • Create a shell script like this:
# Delete the secret if it already exists (there is no way to update it)
@qclaogui
qclaogui / north-south-traffic.yaml
Created February 22, 2020 10:50 — forked from phanama/north-south-traffic.yaml
Istio Headless Service North-South Traffic
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: prometheus-server-0
namespace: monitoring
spec:
selector:
istio: ingressgateway
servers:
@qclaogui
qclaogui / README-Template.md
Created June 13, 2019 06:45 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@qclaogui
qclaogui / .travis.yml
Created May 9, 2019 11:01 — forked from ryboe/.travis.yml
Example .travis.yml for Golang
# use the latest ubuntu environment (18.04) available on travis
dist: xenial
language: go
# Force-enable Go modules. Also force go to use the code in vendor/
# These will both be unnecessary when Go 1.13 lands.
env:
- GO111MODULE=on
- GOFLAGS='-mod vendor'
@qclaogui
qclaogui / main_test.go
Created February 7, 2018 06:02 — forked from alexedwards/main_test.go
MaxOpenConns benchmark
package main
import (
"database/sql"
"testing"
"time"
_ "github.com/lib/pq"
)
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)