Skip to content

Instantly share code, notes, and snippets.

import (
"bytes"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"io/ioutil"
"net/http"
"strings"
"time"
)
@luoqeng
luoqeng / envoy.md
Last active May 26, 2021 02:53
envoy

数据平面

  • 服务发现:所有可用的上游/后端服务实例是什么?

  • 运行状况检查:服务发现返回的上游服务实例是否健康并准备接受网络流量?这可以包括主动(例如,对/healthcheck端点的带外ping )和被动(例如,使用3个连续的5xx作为不健康状态的指示)健康检查。

  • 路由:给定/foo来自本地服务实例的REST请求,该请求应发送到哪个上游服务集群?

  • 负载平衡:在路由过程中选择了上游服务集群后,应将请求发送到哪个上游服务实例?几点超时?用什么断路设置?如果请求失败,应该重试吗?

{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Chris Swanda",
"label": "DevOps Engineer at SelectQuote Insurance Services",
"picture": "",
"email": "chris.swanda@gmail.com",
"summary": "A consummate, battle-tested technical professional with over 20 years of industry experience, ranging across multiple diverse disciplines - from the laboratory, to the board room. I have the innate ability discover and realize new opportunities for revenue, cost reduction and invention for internal and external stakeholders; by using uncommon knowledge, to bring forth uncommon results.",
@luoqeng
luoqeng / consensus.txt
Created April 21, 2021 03:27
consensus
Designing Data-Intensive Applications
Streaming System
least expressiveness principle
Multi-Paradigm Programming
Domain Driven Design
// Note that this is not the production code
pragma solidity 0.5.6;
import "./IERC20.sol";
contract Wallet {
address internal token = 0x123...<hot_wallet_addr>;
address internal hotWallet = 0x321...<hot_wallet_addr>;
constructor() public {
@luoqeng
luoqeng / bip32.go
Last active November 3, 2020 01:50
package main
import (
"encoding/hex"
"fmt"
"log"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcutil/hdkeychain"

phicomm-k3 compile

官方原版 19.07 + luci-app-ssr-plus, 选 ssr-plus 透明代理简单

编译在全局翻墙环境下进行,或者在海外高配 VPS 上

编译环境配置

sudo apt install build-essential libncursesw5-dev python unzip  #ubuntu 18.04 or later  
@luoqeng
luoqeng / client.c
Created January 8, 2020 04:07 — forked from Chion82/client.c
fake TCP test
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <string.h>
#include "trans_packet.h"
void on_packet_recv(char* from_ip, uint16_t from_port, char* payload, int size, unsigned int seq) {
printf("Packet received from=%s:%d, seq=%d\n", from_ip, from_port, seq);
char* message = (char*)malloc(size);
memcpy(message, payload, size);