Skip to content

Instantly share code, notes, and snippets.

View sljeff's full-sized avatar
🚩
Flag

Kind Jeff sljeff

🚩
Flag
View GitHub Profile
import sys
import json
def filter(har_file, contains):
with open(har_file) as f:
har = json.load(f)
entries = har['log']['entries']
filtered = [e for e in entries if contains in e['request']['url']]

下面都是说的无状态服务,有状态的类似,除了 1 2 再多一句话就能描述

最开始的状态:不云,但原生

没有好用的隔离方案,通常会在一个机器上部署一个东西:

  1. 我们知道机器的资源(这个进程最多能用多少 CPU 内存)
    • 以便让服务运行在资源足够的地方
  2. 我们知道哪些机器运行着这个服务(服务发现),服务可能直接监听 80 这样的端口
  • 以便做负载均衡
@sljeff
sljeff / phones.md
Last active December 17, 2023 12:04
我用过的手机,纯记录
  • 天语功能机
  • 振华MTK山寨机
  • 多普达 696
  • HTC G1
  • HTC G6
  • iPhone 4
  • HTC G18
  • HTC G23 (One X)
  • iPhone 5s
  • iPhone 6
{
"configurations":{
"Debug GRPC":{
"adapter":"vscode-go",
"configuration":{
"type":"go",
"request":"launch",
"mode":"debug",
"remotePath":"",
"port":2345,
#!/bin/bash
install_ipset() {
yum install -y ipset ipvsadm
}
load_mod() {
echo "#!/bin/bash
modprobe -- ip_vs
modprobe -- ip_vs_rr
🏆 205 Contributions in year 2020
📦 Used 24 MB in GitHub's Storage
📜 7 Public Gists
🔑 5 Public Keys
💼 Opted to Hire
Dart 6 hrs 36 mins ██████████████████▍░░ 87.5%
CocoaPods 25 mins █▏░░░░░░░░░░░░░░░░░░░ 5.7%
XML 24 mins █▏░░░░░░░░░░░░░░░░░░░ 5.4%
sshconfig 2 mins ░░░░░░░░░░░░░░░░░░░░░ 0.6%
YAML 2 mins ░░░░░░░░░░░░░░░░░░░░░ 0.6%
clash
from PIL import Image
img = Image.open("QQwhite.jpg")
width, height = img.size
result = Image.new('RGB', (width, height))
data = list(img.getdata())
for i, t in enumerate(data):
if set(t) == {255}: