Skip to content

Instantly share code, notes, and snippets.

@guweigang
guweigang / git_toturial
Last active April 14, 2025 01:43
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "[email protected]" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://[email protected]/VT.git # clone远程仓库
@bojand
bojand / index.md
Last active July 15, 2024 02:51
gRPC and Load Balancing

Just documenting docs, articles, and discussion related to gRPC and load balancing.

https://github.com/grpc/grpc/blob/master/doc/load-balancing.md

Seems gRPC prefers thin client-side load balancing where a client gets a list of connected clients and a load balancing policy from a "load balancer" and then performs client-side load balancing based on the information. However, this could be useful for traditional load banaling approaches in clound deployments.

https://groups.google.com/forum/#!topic/grpc-io/8s7UHY_Q1po

gRPC "works" in AWS. That is, you can run gRPC services on EC2 nodes and have them connect to other nodes, and everything is fine. If you are using AWS for easy access to hardware then all is fine. What doesn't work is ELB (aka CLB), and ALBs. Neither of these support HTTP/2 (h2c) in a way that gRPC needs.

@quxf2012
quxf2012 / squid.md
Last active March 3, 2022 09:11
squid.conf

squid ip 白名单授权 or auth_user 授权

一开始需要定义一个safe_host 将所有有权限使用squid的主机定义到其中,并在自定义规则的前面定义一条 http_access deny !safe_host ,来明确禁止非安全主机访问,因为使用auth_user认证时无法使用ip限制,使用该规则可以先把非法ip排除在外;

auth_ip 通过 src 地址认证,不验证用户密码

指定ip可以连指定域名, 可以代理yum仓库等公共地址 http_access allow localnet ip_auth_domain http_access allow localnet ip_auth_host

@quxf2012
quxf2012 / django_admin_export_to_csv.py
Last active November 22, 2023 10:09
1. django admin export selected data to csv 2. django admin export data to csv without selected item;
"""
from django.contrib import admin
@admin.register(models.XXXX)
class XxxxxAdmin(ExportQueryBaseWithoutSelect, admin.ModelAdmin):
serializer_class = XxxSerializer #
...
"""
from django.contrib import admin