Ubuntu cloud-init

cloud-init https://hmli.ustc.edu.cn/doc/linux/ubuntu-autoinstall/ubuntu-autoinstall.html ubuntu 安装后获取当前的user-data: /var/log/installer/autoinstall-user-data 示例: #cloud-config autoinstall: version: 1 apt: disable_components: [] fallback: offline-install geoip: true mirror-selection: primary: - uri: http://mirrors.ustc.edu.cn/ubuntu-ports - country-mirror - arches: &id001 - amd64 - i386 uri: http://mirrors.ustc.edu.cn/ubuntu/ - arches: &id002 - s390x - arm64 - armhf - powerpc - ppc64el - riscv64 uri: http://mirrors.ustc.edu.cn/ubuntu-ports preserve_sources_list:

Go conc

Go conc 参考链接 https://www.liwenzhou.com/posts/Go/conc/ go package main import ( "fmt" "time" ) func main() { for i := 0; i < 5; i++ { go func(num int) { fmt.Println(num) }(i) } time.Sleep(5 * time.Second) } sync.WaitGroup 控制并发 package main import ( "fmt" "sync" ) var wg sync.WaitGroup func hello(i int) { defer wg.Done() fmt.Println("Hello Goroutine!", i) } func main() { for i := 0;

CloudBeaver

CloudBeaver web 版 DBeaver docker-compose 安装 version: "3" services: cloudbeaver: image: dbeaver/cloudbeaver:24 container_name: cloudbeaver restart: always ports: - "8978:8978" volumes: - "/data/cloudbeaver:/opt/cloudbeaver/workspace" networks: - app networks: app: # 使用外部共享等网卡 external: true terraform kubernetes https://github.com/serialt/terraform-module-cloudbeaver

sanic

一、Helloworld sanic 安装 python3 -m venv venv . venv/bin/activate pip3 install sanic helloworld from sanic import Sanic from sanic import text app = Sanic("Myapp") @app.route("/") async def test(request): return response.text('Hello World') if __name__ == '__main__': app.run(host="0.0.0.0", port=7777) vscode debug { "version": "0.2.0", "configurations": [ { "name": "Python Debugger: Current File", "type": "debugpy", "request": "launch", "python": "${workspaceFolder}/venv/bin/python3", "program": "main.py",

Gorm Gen

Gorm Gen 参考链接:https://www.liwenzhou.com/posts/Go/gen/ Gen是一个基于GORM的安全ORM框架,其主要

Debug in VSCode

Debug In VSCode 一、GO 1、安装插件: golang.go r3inbowari.gomodexplorer 安装go debug相关组件 command + shift + p –> go install –> 勾选所有进行安装 2、lanuch.json { // 使用 IntelliSense 了解相关属性