From 7f5ffc3c9f52dfa448652a1831c155e5734dc541 Mon Sep 17 00:00:00 2001 From: wtifs Date: Wed, 31 Jan 2024 11:34:35 +0800 Subject: [PATCH] update --- Work/docker.md | 34 +++++++++++++++++++++++++++---- Work/git.md | 47 +++++++++++++++++++++++++++++++++++++++++++ Work/gitlab-runner.md | 4 ++-- Work/golang.md | 6 ++++++ Work/ssh.md | 29 ++++++++++++++++++++++++++ 5 files changed, 114 insertions(+), 6 deletions(-) diff --git a/Work/docker.md b/Work/docker.md index 7704fdb..5b4643c 100644 --- a/Work/docker.md +++ b/Work/docker.md @@ -11,9 +11,9 @@ docker run -it --name 容器名称 -v 容器外目录:容器内目录 镜像名 ``` docker run -it --name golang -v /Users/chris/Projects/go/src:/workspace -v /Users/chris:/root golang:latest /bin/bash -docker run -it --name golang1.17-amd64 -v /Users/chris/Projects/go/src:/workspace -v /Users/chris:/root --platform linux/amd64 golang:1.17 /bin/bash +docker run -it --name golang1.17-amd64 -v /Users/chris/Projects/go/src:/workspace -v /Users/chris:/root -v /usr/local/include:/usr/local/include --platform linux/amd64 golang:1.17 /bin/bash -docker run -it --name golang1.21-amd64 -v /Users/chris/Projects/go/src:/workspace -v /Users/chris:/root --platform linux/amd64 golang:1.21 /bin/bash +docker run -it --name golang1.21-amd64 -v /Users/chris/Projects/go/src:/workspace -v /Users/chris:/root -v /usr/local/include:/usr/local/include --platform linux/amd64 golang:1.21 /bin/bash docker run -it --name gcc -v /Users/chris/Projects/go/src:/workspace -v /Users/chris:/root gcc /bin/bash @@ -62,7 +62,9 @@ docker restart {containerID} ##### 启动北极星 ```bash docker run -d --name polaris-server -p 8190:8090 -p 8191:8091 polarismesh/polaris-server -docker run -d --name polaris-console -p 8180:8080 --link polaris-server +docker run -d --name polaris-console -p 8180:8080 --link polaris-server polarismesh/polaris-console + +docker run -d --name polaris-console --net=host polarismesh/polaris-console docker run -d --name polaris-server -p 8090:8090 -p 8091:8091 polarismesh/polaris-server ``` @@ -72,5 +74,29 @@ docker run -d --name polaris-server -p 8090:8090 -p 8091:8091 polarismesh/polari # 16686: jaeger UI 端口 # 14268: jaeger API 端口 # 6831 jaeger agent 端口 -docker run -d -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 -p 16686:16686 -p 14268:14268 -p 14269:14269 -p 9411:9411 -p 6831:6831/udp jaegertracing/all-in-one:latest +docker run -d -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 --net=host jaegertracing/all-in-one:latest + +docker run -d -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 -p 16686:16686 -p 14268:14268 -p 14269:14269 -p 9411:9411 -p 6831:6831/udp jaegertracing/all-in-one:latest ``` + +**启动 apollo** + +```bash +git clone apollo-quick-start +docker-compose up +``` + +**启动mongo** + +```bash +docker run -d --name mongo -p 27017:27017 mongo +``` + + + +编译 + +``` +docker build -t harbor-v2.mobvista.com/dsp/mongo_checker:t0.0.7 -f docker/Dockerfile . +``` + diff --git a/Work/git.md b/Work/git.md index 6be74b4..7686e81 100644 --- a/Work/git.md +++ b/Work/git.md @@ -50,6 +50,9 @@ git config --global --get user.email insteadOf = https://gitlab.xxx.com/ [url "git@gitlab.xxx.com:"] insteadOf = http://gitlab.xxx.com + +// 或者执行 +git config --global url."git@gitlab.xxx.com:".insteadOf http://gitlab.xxx.com/ ``` @@ -116,3 +119,47 @@ git rebase -i hash git config --global credential.helper 'cache –timeout=3600' #保存一小时 ``` + + +##### centOS升级git版本 + +```go +1. 卸载旧版git +yum remove git + +2.安装必要的依赖 +yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker + +3.切换到路径 +mkdir -p /data/lib +cd /data/lib + +4.下载源码 +wget https://www.kernel.org/pub/software/scm/git/git-2.17.1.tar.xz + +5.解包 +tar -vxf git-2.17.1.tar.xz + +6.切换路径 +mv git-2.17.1 git2.17.1 +cd git2.17.1 + +7.编译安装 +./configure --with-openssl=/usr/local/openssl + +8.编译 (如果这一步出错可能是openssl版本太低,1.0版本)这时候需要先升级到1.1.x版本 +make + +9.安装 +make install + +10.检查(有输出证明好了) +./git --version + +11.打开环境变量配置文件,修改环境变量 +vim /etc/profile.d/sh.local + +#在底部加上git相关配置 +export PATH=/data/lib/git2.17.1:$PATH +``` + diff --git a/Work/gitlab-runner.md b/Work/gitlab-runner.md index db05520..d5789c2 100644 --- a/Work/gitlab-runner.md +++ b/Work/gitlab-runner.md @@ -4,7 +4,7 @@ -1. 添加源 +1. 添加源(CentOS) ```bash curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh" | sudo bash @@ -56,7 +56,7 @@ stages: build-job: stage: build tags: - - xxx + - xxx # 使用的 gitlab-runner 的 tag 名称 only: - merge_requests script: diff --git a/Work/golang.md b/Work/golang.md index 42c0a13..08c6ab9 100644 --- a/Work/golang.md +++ b/Work/golang.md @@ -15,3 +15,9 @@ gomonkey 不支持 Mac M2 芯片:使用如下方法运行测试: ##### gomod graph 绘制依赖图 + + + +**安装** + +wget diff --git a/Work/ssh.md b/Work/ssh.md index c13632c..df37dc5 100644 --- a/Work/ssh.md +++ b/Work/ssh.md @@ -26,3 +26,32 @@ ClientAliveInterval 60 ClientAliveCountMax 5 ``` + + +##### 创建用户 + +```bash +useradd 用户名 +``` + + + +##### 清除用户密码 + +```bash +passwd -d 用户名 +``` + + + +##### 授予用户root权限 + +``` +vim /etc/sudoers + +## Allow root to run any commands anywhere +用户名 ALL=(ALL) ALL +``` + + +