windows主機中構建適用于K8S Operator開發環境

基于win 10 打造K8S應用開發環境(wsl & kind)

一、wsl子系統安裝

1.1 確認windows系統版本

cmd/powershell
在這里插入圖片描述
或者win + r 運行winver
在這里插入圖片描述

操作系統要>= 19044
在這里插入圖片描述

1.2 開啟wsl功能

控制面板 -> 程序 -> 啟用或關閉Windows功能
開啟適用于Linux的windows子系統 & 虛擬機平臺
在這里插入圖片描述
確認完成后,電腦會重啟。

1.3 wsl配置

wsl
適用于 Linux 的 Windows 子系統沒有已安裝的分發版。
可以通過訪問 Microsoft Store 來安裝分發版:
https://aka.ms/wslstore#更改新分發的默認安裝版本為2
wsl --set-default-version 2
#WSL 2 內核更新
wsl --update#獲得有效分發列表
wsl --list --online#安裝Ubuntu
wsl --install -d Ubuntu

啟動ubuntu

C:\WINDOWS\system32>wsl
Provisioning the new WSL instance Ubuntu
This might take a while...
Create a default Unix user account: test
New password:
Retype new password:
passwd: password updated successfully
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.Welcome to Ubuntu 24.04.2 LTS (GNU/Linux 5.15.167.4-microsoft-standard-WSL2 x86_64)* Documentation:  https://help.ubuntu.com* Management:     https://landscape.canonical.com* Support:        https://ubuntu.com/proSystem information as of Fri Apr 11 10:27:41 CST 2025System load:  0.57                Processes:             34Usage of /:   0.1% of 1006.85GB   Users logged in:       0Memory usage: 3%                  IPv4 address for eth0: 192.168.137.113Swap usage:   0%This message is shown once a day. To disable it please create the
/home/test/.hushlogin file.

1.4 解決在WSL上虛擬機無法連通外網問題

在 WSL(Windows Subsystem for Linux)上使用 NAT(網絡地址轉換)模式時,虛擬機無法連通外網是一個常見問題

檢查DNS:
DNS 配置問題會導致無法連接外網。可以嘗試以下步驟:
1.備份并刪除自動生成的文件:

sudo cp /etc/wsl.conf /etc/wsl.conf.bk
sudo cp /etc/resolv.conf /etc/resolv.conf.bk
sudo rm /etc/resolv.conf || true
sudo rm /etc/wsl.conf || true

2.重新創建配置文件:

sudo bash -c 'cat <<EOF > /etc/wsl.conf
[network]
generateResolvConf = false
EOF'

3.重新創建 DNS 配置:

sudo bash -c 'cat <<EOF > /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
EOF'

1.5 wsl命令解釋

獲取幫助文檔

wsl --help
版權所有(c) Microsoft Corporation。保留所有權利。用法: wsl.exe [Argument] [Options...] [CommandLine]運行 Linux 二進制文件的參數:如果未提供命令行,wsl.exe 將啟動默認 shell。--exec, -e <CommandLine>在不使用默認 Linux Shell 的情況下執行指定的命令。--按原樣傳遞其余命令行。選項:--cd <Directory>將指定目錄設置為當前工作目錄。如果使用了 ~,則將使用 Linux 用戶的主頁路徑。如果路徑以 / 字符開頭,將被解釋為絕對 Linux 路徑。否則,該值一定是絕對 Windows 路徑。--distribution, -d <Distro>運行指定分發。--user, -u <UserName>以指定用戶身份運行。管理適用于 Linux 的 Windows 子系統的參數:--help顯示用法信息。--install [選項]安裝額外的適用于 Linux 的 Windows 子系統分發。要獲得有效分發列表,請使用“wsl --list --online”。選項:--distribution, -d [參數]按名稱下載并安裝分發。參數:有效分發名稱(不區分大小寫)。示例:wsl --install -d Ubuntuwsl --install --distribution Debian--set-default-version <Version>更改新分發的默認安裝版本。--shutdown立即終止所有運行的分發及 WSL 2輕型實用工具虛擬機。--status顯示適用于 Linux 的 Windows 子系統的狀態。--update [Options]如果未指定任何選項,則將 WSL 2 內核更新為最新版本。選項:--rollback恢復為 WSL 2 內核的先前版本。--inbox僅更新收件箱 WSL 2 內核。不要從 Microsoft Store 下載 WSL。--web-download從 Internet 而不是 Microsoft Store 下載最新版本的 WSL。用于管理適用于 Linux 的 Windows 子系統中的分發的參數:--export <Distro> <FileName>將分發導出到 tar 文件。對于標準輸出,文件名可以是 ---import <Distro> <InstallLocation> <FileName> [Options]將指定的 tar 文件作為新分發導入。對于標準輸入,文件名可以是 -。選項:--version <Version>指定要用于新分發的版本。--list, -l [Options]列出分發。選項:--all列出所有分發,包括當前正在安裝或卸載的分發。--running僅列出當前正在運行的分發。--quiet, -q僅顯示分發名稱。--verbose, -v顯示所有分發的詳細信息。--online, -o顯示使用“wsl --install”進行安裝的可用分發列表。--set-default, -s <分發>將分發設置為默認值。--set-version <分發> <版本>更改指定分發的版本。--terminate, -t <分發>終止指定的分發。--unregister <分發>注銷分發并刪除根文件系統。

更改新分發的默認安裝版本為2

wsl --set-default-version 2

WSL 2 內核更新

wsl --update

獲得有效分發列表

wsl --list --online

安裝額外的適用于 Linux 的 Windows 子系統分發Ubuntu

wsl --install -d Ubuntu

運行指定分發。

wsl -d Ubuntu

運行默認的分發

wsl

列出分發并顯示版本

wsl -l -v

將Ubuntu分發設置為默認值

wsl --set-default Ubuntu

終止指定的分發。將Runing變成Stopped

wsl --terminate Ubuntu

注銷分發并刪除根文件系統。

wsl --unregister Ubuntu

顯示適用于 Linux 的 Windows 子系統的狀態。

wsl --status
默認分發: Ubuntu
默認版本: 2

以指定用戶身份運行

wsl --user root
root@DESKTOP-KCURLDV:/mnt/c/Users/Administrator#

二、安裝Docker Desktop

2.1 下載docker Desktop

https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe?utm_source=docker&utm_medium=webreferral&utm_campaign=dd-smartbutton&utm_location=module&_gl=1*5ht9ce*_gcl_au*MjQwMDkyNDQ0LjE3NDQxMTQzMzg.*_ga*MTM1ODM2MjU5NS4xNzQ0MTE0MzEx*_ga_XJWPQMJYHQ*MTc0NDExNDMxMS4xLjEuMTc0NDExNjM4OC41MC4wLjA.

2.2 安裝以及設置
一步步安裝就行。

docker配置如下圖所示
在這里插入圖片描述
在這里插入圖片描述

三、Golang安裝

功能:可以安裝多個golang版本,可以切換golang版本

root@DESKTOP-KCURLDV:~# bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
Cloning from https://github.com/moovweb/gvm.git to /root/.gvm
No existing Go versions detected
ERROR: Missing requirements.
Installed GVM v1.0.22Please restart your terminal session or to get started right away run`source /root/.gvm/scripts/gvm`# source /root/.gvm/scripts/gvm
ERROR: Missing requirements.

如果不執行source /root/.gvm/scripts/gvm需要退出Ubuntu終端,再登入即可有gvm命令


# gvm versionCould not find bisonlinux: apt-get install bisonCould not find gcclinux: apt-get install gccCould not find makelinux: apt-get install makeERROR: Missing requirements.# apt-get update
# apt-get install bison gcc make
# gvm version
Go Version Manager v1.0.22 installed at /root/.gvm# gvm
Usage: gvm [command]Description:GVM is the Go Version ManagerCommands:version    - print the gvm version numberget        - gets the latest code (for debugging)use        - select a go version to use (--default to set permanently)diff       - view changes to Go roothelp       - display this usage textimplode    - completely remove gvminstall    - install go versionsuninstall  - uninstall go versionscross      - install go cross compilerslinkthis   - link this directory into GOPATHlist       - list installed go versionslistall    - list available versionsalias      - manage go version aliasespkgset     - manage go packages setspkgenv     - edit the environment for a package setapplymod   - apply the go version in go.mod
# gvm listallgvm gos (available)go1go1.0.1go1.0.2go1.0.3go1.1....# gvm install go1.19 -B
Installing go1.19 from binary source
# gvm install go1.20.3 -B
Installing go1.20.3 from binary source# gvm use go1.19
Now using version go1.19# gvm list
gvm gos (installed)=> go1.19go1.20.3
# gvm use go1.20.3
# gvm listgvm gos (installed)go1.19
=> go1.20.3

四、kubectl安裝

啟動Docker 并指定wsl為Ubuntu后,會在Ubuntu安裝docker和kubectl命令。
如果沒有kubectl命令可以手動安裝

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin

Kind 只負責創建集群(會配置好 kubeconfig)

五、Golang安裝下載

5.1 下載安裝地址(傻瓜式)

https://www.jetbrains.com/go/download/#section=windows
在這里插入圖片描述

5.2 創建Project

在這里插入圖片描述

location:     \\wsl$\Ubuntu\root\aiops
GOROOT:       \\wsl$\Ubuntu\root\.gvm\gos\go1.19

在這里插入圖片描述

5.3 無法訪問\wsl$\Ubuntu\root\解決

在這里插入圖片描述
原因分析:
因此,我查找了WSL官方文檔(WSL 的文件權限 | Microsoft Learn),發現其給出如下解釋
在這里插入圖片描述
即Windows訪問Linux的文件的權限是由WSL分發版(如Ubuntu)的默認用戶決定的,安裝WSL分發版時會創建一個用戶,一般會使用該用戶登錄,因此我們需要修改默認用戶。

解決方案:

C:\Users\Administrator>ubuntu config --default-user rootC:\Users\Administrator>wsl -l -vNAME              STATE           VERSION
* Ubuntu            Running         2docker-desktop    Running         2C:\Users\Administrator>wsl
test@DESKTOP-KCURLDV:/mnt/c/Users/Administrator$ cat /etc/wsl.conf
[boot]
systemd=true[user]
default=test
test@DESKTOP-KCURLDV:/mnt/c/Users/Administrator$ vi /etc/wsl.conf
test@DESKTOP-KCURLDV:/mnt/c/Users/Administrator$ sudo vi /etc/wsl.conf
[boot]
systemd=true[user]
#default=test
test@DESKTOP-KCURLDV:/mnt/c/Users/Administrator$

在終端使用如下命令將默認用戶變更為root(注意:ubuntu處需要根據你安裝的Linux版本改變,可用如下命令查看你的Linux發行版名稱),然后使用wsl命令打開Linux終端,正常來說就會以root用戶登錄,同時也可以直接在Windows的資源管理器中以root身份訪問Linux文件。

擁有root權限可能會對虛擬機的安全造成威脅,例如從Windows入侵Linux文件系統。因此建議在執行完相關文件上傳任務后,將默認用戶改為普通用戶(也可以改變需要訪問的文件或文件夾的權限,例如sudo chmod 777 XXX,但會相對麻煩)。


C:\Users\Administrator>wsl -l -vNAME              STATE           VERSION
* Ubuntu            Running         2docker-desktop    Running         2如果執行以上命令后仍未變更默認用戶,則可能是在Linux中使用了配置文件,使用如下命令查看并注釋掉相關配置即可。(有時可能需要重啟wsl)
```bash
C:\Users\Administrator>wsl --terminate Ubuntu
操作成功完成。C:\Users\Administrator>wsl
root@DESKTOP-KCURLDV:/mnt/c/Users/Administrator#

5.4 編寫test.go并運行

在這里插入圖片描述

package mainimport "fmt"func main() {fmt.Println("Hello World")
}

在這里插入圖片描述

在這里插入圖片描述

如果出現報錯
package test is not in GOROOT

解決:GO111MODULE修改為on
命令為go env -w GO111MODULE=on

root@DESKTOP-KCURLDV:~/aiops# go env
GO111MODULE="on" # 修改為on
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/root/.gvm/gos/go1.19"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/root/.gvm/gos/go1.19/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/root/aiops/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3377041513=/tmp/go-build -gno-record-gcc-switches"       

六、kind安裝

Kind是Kubernetes In Docker的縮寫,顧名思義,看起來是把k8s放到docker的意思。
kind創建k8s集群的基本原理就是:提前準備好k8s節點的鏡像,通過docker啟動容器,來模擬k8s的節點,從而組成完整的k8s集群。
需要注意,kind創建的集群僅可用于開發、學習、測試等
不能用于生產環境。

創建、啟動k8s集群非常快速,資源消耗較低。
支持創建多節點的k8s集群,包括高可用模式。
kind 支持Linux,macos and windows
它是CNCF認證的k8s集群安裝方式之一。
在這里插入圖片描述安裝kind:

#通過設置 gvm use 命令的 --default 參數來指定默認的 Go 版本,這樣每次新建終端時就不需要手動指定了
# gvm use go1.19 --default 
Now using version go1.19# go install sigs.k8s.io/kind@latest
go: downloading sigs.k8s.io/kind v0.27.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/spf13/cobra v1.8.0
go: downloading al.essio.dev/pkg/shellescape v1.5.1
go: downloading github.com/pkg/errors v0.9.1
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/pelletier/go-toml v1.9.5
go: downloading github.com/mattn/go-isatty v0.0.20
go: downloading sigs.k8s.io/yaml v1.4.0
go: downloading github.com/BurntSushi/toml v1.4.0
go: downloading github.com/evanphx/json-patch/v5 v5.6.0
go: downloading github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2
go: downloading golang.org/x/sys v0.6.0
# kind version
kind v0.27.0 go1.19 linux/amd64# kind -h
kind creates and manages local Kubernetes clusters using Docker container 'nodes'Usage:kind [command]Available Commands:build       Build one of [node-image]completion  Output shell completion code for the specified shell (bash, zsh or fish)create      Creates one of [cluster]delete      Deletes one of [cluster]export      Exports one of [kubeconfig, logs]get         Gets one of [clusters, nodes, kubeconfig]help        Help about any commandload        Loads images into nodesversion     Prints the kind CLI versionFlags:-h, --help              help for kind-q, --quiet             silence all stderr output-v, --verbosity int32   info log verbosity, higher value produces more output--version           version for kindUse "kind [command] --help" for more information about a command.

注意docker版本和kind版本的兼容問題,如果部署失敗可能是k8s版本過低

七、使用kind實現單節點k8s集群部署

在這里插入圖片描述
kind部署的k8s與docker中的k8s無關.

# kind create cluster --name k8s-1 --image kindest/node:v1.25.16Creating cluster "k8s-1" ...? Ensuring node image (kindest/node:v1.25.16) 🖼? Preparing nodes 📦? Writing configuration 📜? Starting control-plane 🕹?? Installing CNI 🔌? Installing StorageClass 💾
Set kubectl context to "k8s-1-kind"
You can now use your cluster with:kubectl cluster-info --context kind-kindNot sure what to do next? 😅  Check out https://kind.sigs.k8s.io/docs/user/quick-start/# kubectl cluster-info --context kind-kind
Kubernetes control plane is running at https://127.0.0.1:38317
CoreDNS is running at https://127.0.0.1:38317/api/v1/namespaces/kube-system/services/kube-dns:dns/proxyTo further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.# kind get clusters
kind# kubectl get node
NAME                 STATUS   ROLES           AGE     VERSION
kind-control-plane   Ready    control-plane   5m37s   v1.25.16# kubectl get po -n kube-system
NAME                                         READY   STATUS    RESTARTS        AGE
coredns-565d847f94-6kvst                     1/1     Running   0               6m
coredns-565d847f94-d7nt8                     1/1     Running   0               6m
etcd-kind-control-plane                      1/1     Running   0               6m12s
kindnet-cxk26                                1/1     Running   0               6m
kube-apiserver-kind-control-plane            1/1     Running   0               6m15s
kube-controller-manager-kind-control-plane   1/1     Running   1 (5m16s ago)   6m15s
kube-proxy-h8g6p                             1/1     Running   0               6m
kube-scheduler-kind-control-plane            1/1     Running   1 (5m18s ago)   6m12s# kind delete clusters kind 
Deleted nodes: ["kind-control-plane"]
Deleted clusters: ["kind"]

八、使用kind實現多節點k8s集群部署

# cat <<EOF > kind.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
EOF# kind create cluster --image kindest/node:v1.25.16 --name kind --config kind.yaml
Creating cluster "kind" ...? Ensuring node image (kindest/node:v1.25.16) 🖼? Preparing nodes 📦 📦 📦? Writing configuration 📜? Starting control-plane 🕹?? Installing CNI 🔌? Installing StorageClass 💾? Joining worker nodes 🚜
Set kubectl context to "kind-kind"
You can now use your cluster with:kubectl cluster-info --context kind-kindNot sure what to do next? 😅  Check out https://kind.sigs.k8s.io/docs/user/quick-start/# kubectl get node
NAME                 STATUS   ROLES           AGE    VERSION
kind-control-plane   Ready    control-plane   2m1s   v1.25.16
kind-worker          Ready    <none>          86s    v1.25.16
kind-worker2         Ready    <none>          85s    v1.25.16# cat <<EOF > kind1.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
networking:disableDefaultCNI: truekubeProxyMode: "ipvs"
EOF# kind create cluster --image kindest/node:v1.25.16 --name kind1 --config kind1.yaml
Creating cluster "kind1" ...? Ensuring node image (kindest/node:v1.25.16) 🖼? Preparing nodes 📦 📦 📦? Writing configuration 📜? Starting control-plane 🕹?? Installing StorageClass 💾? Joining worker nodes 🚜
Set kubectl context to "kind-kind1"
You can now use your cluster with:kubectl cluster-info --context kind-kind1Not sure what to do next? 😅  Check out https://kind.sigs.k8s.io/docs/user/quick-start/#kubectl config current-context
kind-kind1
#kubectl config use-context kind-kind# kind delete clusters kind1
Deleted nodes: ["kind1-control-plane" "kind1-worker2" "kind1-worker"]
Deleted clusters: ["kind1"]# kind delete clusters kind
Deleted nodes: ["kind-control-plane" "kind-worker2" "kind-worker"]
Deleted clusters: ["kind"]

也可以創建多套K8S集群
使用–name 指定集群名稱
使用kubectl config use-context 集群上下文名稱即可切換集群。

# cat <<EOF > kind2.yaml
# a cluster with 3 control-plane nodes and 3 workers
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: control-plane
- role: control-plane
- role: worker
- role: worker
- role: worker
EOF#kind create cluster --image kindest/node:v1.25.16 --name kind2 --config kind2.yaml
Creating cluster "kind2" ...? Ensuring node image (kindest/node:v1.25.16) 🖼? Preparing nodes 📦 📦 📦 📦 📦 📦? Configuring the external load balancer ??? Writing configuration 📜? Starting control-plane 🕹?? Installing CNI 🔌? Installing StorageClass 💾? Joining more control-plane nodes 🎮? Joining worker nodes 🚜
Set kubectl context to "kind-kind2"
You can now use your cluster with:#kubectl cluster-info --context kind-kind2Not sure what to do next? 😅  Check out https://kind.sigs.k8s.io/docs/user/quick-start/
root@DESKTOP-KCURLDV:~# kubectl cluster-info --context kind-kind2Kubernetes control plane is running at https://127.0.0.1:41983
CoreDNS is running at https://127.0.0.1:41983/api/v1/namespaces/kube-system/services/kube-dns:dns/proxyTo further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.# kubectl get nodes
NAME                   STATUS   ROLES           AGE     VERSION
kind2-control-plane    Ready    control-plane   4m27s   v1.25.16
kind2-control-plane2   Ready    control-plane   3m53s   v1.25.16
kind2-control-plane3   Ready    control-plane   2m17s   v1.25.16
kind2-worker           Ready    <none>          83s     v1.25.16
kind2-worker2          Ready    <none>          83s     v1.25.16
kind2-worker3          Ready    <none>          83s     v1.25.16

九、通過goland開發 部署描述文件,并部署到k8s集群

在這里插入圖片描述

編寫yaml

apiVersion: apps/v1
kind: Deployment
metadata:name: nginx
spec:selector:matchLabels:app: nginxtemplate:metadata:labels:app: nginxspec:containers:- name: nginximage: nginx:latestimagePullPolicy: IfNotPresentrestartPolicy: Always
# kubectl apply -f aiops/nginx.yaml
deployment.apps/nginx configured
# kubectl get po
NAME                    READY   STATUS    RESTARTS   AGE
nginx-d5f959df4-kcqq4   1/1     Running   0          4m12s

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/75463.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/75463.shtml
英文地址,請注明出處:http://en.pswp.cn/web/75463.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

計算機視覺色彩空間全解析:RGB、HSV與Lab的實戰對比

計算機視覺色彩空間全解析&#xff1a;RGB、HSV與Lab的實戰對比 一、前言二、RGB 色彩空間?2.1 RGB 色彩空間原理?2.1.1 基本概念?2.1.2 顏色混合機制? 2.2 RGB 在計算機視覺中的應用?2.2.1 圖像讀取與顯示?2.2.2 顏色識別?2.2.3 RGB 色彩空間的局限性? 三、HSV 色彩空…

PyTorch多GPU訓練實戰:從零實現到ResNet-18模型

本文將介紹如何在PyTorch中實現多GPU訓練&#xff0c;涵蓋從零開始的手動實現和基于ResNet-18的簡潔實現。代碼完整可直接運行。 1. 環境準備與庫導入 import torch from torch import nn from torch.nn import functional as F from d2l import torch as d2l from torchvisio…

micro介紹

micro介紹 Micro 的首要特點是易于安裝&#xff08;它只是一個靜態的二進制文件&#xff0c;沒有任何依賴關系&#xff09;和易于使用Micro 支持完整的插件系統。插件是用 Lua 編寫的&#xff0c;插件管理器可自動為你下載和安裝插件。使用簡單的 json 格式配置選項&#xff0…

Linux內核分頁——線性地址結構

每個進程通過一個指針&#xff08;即進程的mm_struct→pgd&#xff09;指向其專屬的頁全局目錄&#xff08;PGD&#xff09;&#xff0c;該目錄本身存儲在一個物理頁框中。這個頁框包含一個類型為pgd_t的數組&#xff0c;該類型是與架構相關的數據結構&#xff0c;定義在<as…

微信小程序開發:微信小程序上線發布與后續維護

微信小程序上線發布與后續維護研究 摘要 微信小程序作為移動互聯網的重要組成部分,其上線發布與后續維護是確保其穩定運行和持續優化的關鍵環節。本文從研究學者的角度出發,詳細探討了微信小程序的上線發布流程、后續維護策略以及數據分析與用戶反饋處理的方法。通過結合實…

分享一些使用DeepSeek的實際案例

文章目錄 前言職場辦公領域生活領域學習教育領域商業領域技術開發領域 前言 以下是一些使用 DeepSeek 的實際案例&#xff1a; DeepSeek使用手冊資源鏈接&#xff1a;https://pan.quark.cn/s/fa502d9eaee1 職場辦公領域 行業競品分析&#xff1a;剛入職的小李被領導要求一天內…

flink iceberg寫數據到hdfs,hive同步讀取

目錄 1、組件版本 環境變量配置 2、hadoop配置 hadoop-env.sh core-site.xml hdfs-site.xml mapred-site.xml yarn-site.xml 3、hive配置 hive-env.sh hive-site.xml HIVE LIB 原始JAR 4、flink配置集成HDFS和YARN 修改iceberg源碼 編譯iceberg-flink-runtime-1…

qq郵箱群發程序

1.界面設計 1.1 環境配置 在外部工具位置進行配置 1.2 UI界面設計 1.2.1 進入QT的UI設計界面 在pycharm中按順序點擊&#xff0c;進入UI編輯界面&#xff1a; 點擊第三步后進入QT的UI設計界面&#xff0c;通過點擊按鈕進行界面設計&#xff0c;設計后進行保存到當前Pycharm…

【C++游戲引擎開發】第10篇:AABB/OBB碰撞檢測

一、AABB(軸對齊包圍盒) 1.1 定義 ?最小點: m i n = ( x min , y min , z min ) \mathbf{min} = (x_{\text{min}}, y_{\text{min}}, z_{\text{min}}) min=(xmin?,ymin?,zmin?)?最大點: m a x = ( x max , y max , z max ) \mathbf{max} = (x_{\text{max}}, y_{\text{…

大模型是如何把向量解碼成文字輸出的

hidden state 向量 當我們把一句話輸入模型后&#xff0c;例如 “Hello world”&#xff1a; token IDs: [15496, 995]經過 Embedding Transformer 層后&#xff0c;會得到每個 token 的中間表示&#xff0c;形狀為&#xff1a; hidden_states: (batch_size, seq_len, hidd…

C++指針(三)

個人主頁:PingdiGuo_guo 收錄專欄&#xff1a;C干貨專欄 文章目錄 前言 1.字符指針 1.1字符指針的概念 1.2字符指針的用處 1.3字符指針的操作 1.3.1定義 1.3.2初始化 1.4字符指針使用注意事項 2.數組參數&#xff0c;指針參數 2.1數組參數 2.1.1數組參數的概念 2.1…

生命篇---心肺復蘇、AED除顫儀使用、海姆立克急救法、常見情況急救簡介

生命篇—心肺復蘇、AED除顫儀使用、海姆立克急救法、常見情況急救簡介 文章目錄 生命篇---心肺復蘇、AED除顫儀使用、海姆立克急救法、常見情況急救簡介一、前言二、急救1、心肺復蘇&#xff08;CPR&#xff09;&#xff08;1&#xff09;適用情況&#xff08;2&#xff09;操作…

基于神經環路的神經調控可增強遺忘型輕度認知障礙患者的延遲回憶能力

簡要總結 這篇文章提出了一種名為CcSi-MHAHGEL的框架&#xff0c;用于基于多站點、多圖譜fMRI的功能連接網絡&#xff08;FCN&#xff09;分析&#xff0c;以輔助自閉癥譜系障礙&#xff08;ASD&#xff09;的識別。該框架通過多視圖超邊感知的超圖嵌入學習方法&#xff0c;整合…

[WUSTCTF2020]level1

關鍵知識點&#xff1a;for匯編 ida64打開&#xff1a; 00400666 55 push rbp .text:0000000000400667 48 89 E5 mov rbp, rsp .text:000000000040066A 48 83 EC 30 sub rsp, 30h .text:000000…

cpp自學 day20(文件操作)

基本概念 程序運行時產生的數據都屬于臨時數據&#xff0c;程序一旦運行結束都會被釋放 通過文件可以將數據持久化 C中對文件操作需要包含頭文件 <fstream> 文件類型分為兩種&#xff1a; 文本文件 - 文件以文本的ASCII碼形式存儲在計算機中二進制文件 - 文件以文本的…

Gartner發布軟件供應鏈安全市場指南:軟件供應鏈安全工具的8個強制功能、9個通用功能及全球29家供應商

攻擊者的目標是由開源和商業軟件依賴項、第三方 API 和 DevOps 工具鏈組成的軟件供應鏈。軟件工程領導者可以使用軟件供應鏈安全工具來保護他們的軟件免受這些攻擊的連鎖影響。 主要發現 越來越多的軟件工程團隊現在負責解決軟件供應鏈安全 (SSCS) 需求。 軟件工件、開發人員身…

備賽藍橋杯-Python-考前突擊

額&#xff0c;&#xff0c;離藍橋杯開賽還有十個小時&#xff0c;最近因為考研復習節奏的問題&#xff0c;把藍橋杯的優先級后置了&#xff0c;突然才想起來還有一個藍橋杯呢。。 到目前為止python基本語法熟練了&#xff0c;再補充一些常用函數供明天考前再背背&#xff0c;算…

榕壹云外賣跑腿系統:基于Spring Boot+MySQL+UniApp的智慧生活服務平臺

項目背景與需求分析 隨著本地生活服務需求的爆發式增長&#xff0c;外賣、跑腿等即時配送服務成為現代都市的剛性需求。傳統平臺存在開發成本高、功能定制受限等問題&#xff0c;中小企業及創業團隊極需一款輕量級、可快速部署且支持二次開發的外賣跑腿系統。榕壹云外賣跑腿系統…

使用Docker安裝Gogs

1、拉取鏡像 docker pull gogs/gogs 2、運行容器 # 創建/var/gogs目錄 mkdir -p /var/gogs# 運行容器 # -d&#xff0c;后臺運行 # -p&#xff0c;端口映射&#xff1a;(宿主機端口:容器端口)->(10022:22)和(10880:3000) # -v&#xff0c;數據卷映射&#xff1a;(宿主機目…

【antd + vue】Modal 對話框:修改彈窗標題樣式、Modal.confirm自定義使用

一、標題樣式 1、目標樣式&#xff1a;修改彈窗標題樣式 2、問題&#xff1a; 直接在對應css文件中修改樣式不生效。 3、原因分析&#xff1a; 可能原因&#xff1a; 選擇器權重不夠&#xff0c;把在控制臺找到的選擇器直接復制下來&#xff0c;如果還不夠就再加&#xff…