Netplan on Ubuntu is a network configuration tool introduced in Ubuntu 17.10 (Artful Aardvark) and widely used in subsequent versions. It simplifies network setup by allowing administrators to define network interfaces and their configurations in YAML files, which are then applied to the system using a backend renderer (such as systemd-networkd or NetworkManager).
以管理员权限运行 CMD,依次输入以下命令。
- 卸载已安装密钥
slmgr.vbs /upk
Create docker-compose.yml
services:
gitlab:
image: gitlab/gitlab-ce:17.7.0-ce.0
container_name: roger-gitlab
restart: always
hostname: "gitlab.luojia.work"
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab.luojia.work:8929'
gitlab_rails['gitlab_shell_ssh_port'] = 2424
ports:
- "8929:8929"
- "2424:22"
volumes:
- "./volumes/config:/etc/gitlab"
- "./volumes/logs:/var/log/gitlab"
- "./volumes/data:/var/opt/gitlab"
shm_size: "256m"
gitlab-runner:
image: gitlab/gitlab-runner:v17.7.0
container_name: roger-gitlab-runner
restart: always
depends_on:
- gitlab
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "./volumes/config/gitlab-runner:/etc/gitlab-runner"
- "./volumes/bin/docker:/usr/bin/docker"
command: ["run", "--user=root", "--working-directory=/home/gitlab-runner"]
privileged: true
Overview
Sometimes docker can not pull images, we need to configure the proxy.
Solution
Create /etc/systemd/system/docker.service.d/http-proxy.conf.
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:7890"
Environment="HTTPS_PROXY=http://127.0.0.1:7890"
Environment="NO_PROXY=localhost,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"
Overview
Sometimes k8s containerd can not pull images, we need to configure the proxy.
Solution
configure proxy using systemctl
sudo systemctl set-environment HTTP_PROXY=127.0.0.1:7890
sudo systemctl set-environment HTTPS_PROXY=127.0.0.1:7890
sudo systemctl set-environment NO_PROXY=localhost,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local,.ewhisper.cn,<nodeCIDR>,<APIServerInternalURL>,<serviceNetworkCIDRs>,<etcdDiscoveryDomain>,<clusterNetworkCIDRs>,<platformSpecific>,<REST_OF_CUSTOM_EXCEPTIONS>
sudo systemctl restart containerd
sudo systemctl unset-environment HTTP_PROXY
sudo systemctl unset-environment HTTPS_PROXY
sudo systemctl unset-environment NO_PROXY
sudo systemctl restart containerd
Overview
MacBook Pro M1 on Monterey system, installed openssl with homebrew previously, but now because this system is old, homebrew can no longer be upgraded, and many software updates depend on it, so I need to install the latest version manually.
Solution
brew uninstall openssl
wget https://www.openssl.org/source/openssl-3.4.0.tar.gz
tar -xvf openssl-3.4.0.tar.gz
cd openssl-3.4.0
./Configure darwin64-arm64-cc
make
sudo make install MANDIR=/opt/homebrew/Cellar/openssl@3/3.4.0/share/man MANSUFFIX=ssl
sudo mkdir /opt/homebrew/Cellar/openssl@3/3.4.0/bin
sudo mv /usr/local/bin/openssl /opt/homebrew/Cellar/openssl@3/3.4.0/bin/openssl
ls -s /opt/homebrew/Cellar/openssl@3/3.4.0/bin/openssl /usr/local/bin/openssl
sudo mv /usr/local/share/doc /opt/homebrew/Cellar/openssl@3/3.4.0/share/doc
sudo mv /usr/local/include /opt/homebrew/Cellar/openssl@3/3.4.0/include
sudo mv /usr/local/lib /opt/homebrew/Cellar/openssl@3/3.4.0/lib
sudo mv /usr/local/ssl /opt/homebrew/Cellar/openssl@3/3.4.0/ssl
brew linke openssl@3
Overview
Generally speaking, turning off the monitor only requires pressing the monitor's power button. However, if the monitor does not have a power button or there are other reasons, you need to use a command to turn off the monitor.
Solution
First solution
On linux, you can turn off the monitor with the following command:
概述
终端输入:vmware-netcfg ,来调用 vmware-netcfg 来初始化 vmware 网络模块,但是报错:
Network configuration is missing. Ensure that /etc/vmware/networking exists.
解决方案
在终端输入:
sudo touch /etc/vmware/x ; sudo vmware-networks --migrate-network-settings /etc/vmware/x ; sudo rm /etc/vmware/x
Commander
这是一个很受欢迎的命令行参数解析库。它可以帮助你轻松定义命令行指令和选项,比如定义一个简单的 “--version” 选项来展示脚本版本号,或者定义如 “init” 这样的命令用于初始化项目。
Inquirer
主要用于实现交互式命令行界面。当你需要用户输入一些信息,如用户名、密码或者从给定的选项中选择一个配置时,它非常有用。例如可以通过它让用户选择要安装的软件包版本。
Chalk
用于在命令行中给文本添加颜色和样式。可以让输出的信息更加醒目,例如把错误信息用红色字体显示,正确的操作提示用绿色字体显示,方便用户区分不同类型的消息。
安装 duti:
brew install duti