yum install --downloadonly --downloaddir=./yum-packages tree
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # get k3s and disable traefik | |
| curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" INSTALL_K3S_EXEC="--disable=traefik" sh - | |
| # install helm | |
| curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
| # install nginx ingress: https://kubernetes.github.io/ingress-nginx/deploy/#quick-start | |
| helm upgrade --install ingress-nginx ingress-nginx \ | |
| --repo https://kubernetes.github.io/ingress-nginx \ | |
| --namespace ingress-nginx --create-namespace |
VsCode 本身对于 Markdown 编写来说是足够的,但是没有办法直接插入图片。在这里分享我最近查找到的一种方式,主要是利用 vs-picgo 这个插件来实现的,图片保存在了腾讯云的 COS 中。
Vscode 设置中插件的配置类似为
{
"picgo.picBed.tcyun.appId": "xxx",
"picgo.picBed.tcyun.secretId": "xxxx",
"picgo.picBed.tcyun.secretKey": "xxxx",
"picgo.picBed.current": "tcyun",
"picgo.picBed.tcyun.area": "ap-guangzhou",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "strconv" | |
| "encoding/hex" | |
| ) | |
| func main() { | |
| // "A" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "os/exec" | |
| ) | |
| func main() { | |
| cmd := exec.Command("aaa", "-za") | |
| output, err := cmd.CombinedOutput() |
upstream apachereadonly {
server 10.10.11.10:8011;
server 10.10.11.11:8011;
server 10.10.11.12:8011;
hash $remote_addr consistent;
}Please note the ip_hash of nginx only cares the first thress parts of client ip, so 10.0.0.1/24 all will go to the same backend server.
- 在制作镜像的目录下新建文件
sources.list。新建过程及内容见阿里云镜像源 - 在 Dockerfile 中
FROM ubuntu:latest之后添加如下内容:COPY sources.list /etc/apt/sources.list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import json | |
| url = 'https://httpbin.org/get' | |
| proxies = { | |
| 'http': 'http://127.0.0.1:7890', | |
| 'https': 'http://127.0.0.1:7890', | |
| } | |
| r = requests.get(url, proxies=proxies) |
NewerOlder