6145

Centos终端下显示图片

安装caca-utils

yum install caca-utils -y

查看图片

cacaview 1.jpg
1864

docker访问宿主机

host模式,容器内共享宿主机的网络

--network host
5752

Centos用Certbot安装ssl证书

安装certbot

yum install certbot python2-certbot-nginx

1. 使用nginx插件自动配置

certbot --nginx
5842

Centos常用操作命令

只修改文件夹的权限,代码:

chmod 755 `find ./ -type d `

只修改文件的权限,代码:

chmod 644 `find ./ -type f`

修改主机名

vi /etc/sysconfig/network

#添加
HOSTNAME=your-name

vi /etc/hosts

#修改
192.168.x.x your-name your-name

#终端执行
hostname your-name
23343

Win10子系统Alpine服务管理工具openrc

场景

win10安装alpine作为linux子系统

注意

安装完成子系统后,提示输入用户名时,如果只想使用root账号,直接按Ctrl+C终止

可选初始配置

#!/bin/bash

sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
apk update
apk add git nginx tzdata openssh-client openssl curl zsh
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo "Asia/Shanghai" > /etc/timezone
sed -i 's/ash/zsh/g' /etc/passwd
sh -c "$(curl -fsSL https://dotatong.cn/tools/oh_my_zsh.sh)"
sed -i -e 's/ZSH_THEME=.*/ZSH_THEME="ys"/g' /root/.zshrc

服务管理工具

类似于centos的systemd,alpine使用openrc来管理服务