linux
yum
marc_chen
这个作者很懒,什么都没留下…
展开
-
taskset使用和说明
taskset使用和说明原创 2022-07-04 18:22:54 · 2973 阅读 · 0 评论 -
GRE简单模拟 Generic Routing Encapsulation
gre Generic Routing Encapsulation原创 2022-06-24 10:11:05 · 395 阅读 · 0 评论 -
bridge veth netns
bridge veth netns1,创建br02,配置br0 网络,并启动3,创建nns1 和nns2 的网络命名空间4,创建veth对(veth10@veth11 veth20@veth21)5,将veth中的veth10 veth20 加入到br0中6,将veth中的veth11移动到nns1中,并配置ip,并启动7,将veth中的veth21移动到nns2中,并配置ip,并启动8,检查网络的连通性(nns1—br0;nns2—br0,nns1–nns2...原创 2022-06-23 20:38:42 · 192 阅读 · 0 评论 -
iscsi_server_client_chap_username_password_targetcli
iscsi targetcli chap server client原创 2022-06-23 10:09:43 · 397 阅读 · 0 评论 -
netns与veth
netns veth 网络命名空间原创 2022-06-23 09:51:05 · 416 阅读 · 0 评论 -
docker修改国内源
修改如下文件内容[root@localhost ~]# vim /etc/docker/daemon.json{“registry-mirrors”: [“https://registry.docker-cn.com”]}[root@localhost ~]# systemctl restart docker可以添加的国内源有如下一下:Docker国内源说明:Docker 官方中国区https://registry.docker-cn.com网易http://hub-mirror.c.1原创 2021-12-14 13:01:17 · 1720 阅读 · 0 评论 -
centos8安装docker-ce
解决的问题,centos8 使用yum默认安装的docker为podman;如何安装docker-ce呢?1,卸载默认安装的podman2, 添加docker源,3,安装docker-ce4,启动docker 查看docker 版本开始系统的信息:[root@localhost ~]# cat /etc/redhat-releaseCentOS Linux release 8.5.2111podman version 3.3.1[root@localhost ~]# yum insta原创 2021-12-14 12:44:58 · 1570 阅读 · 0 评论 -
linux java安装
1,下载Linux版本的jre版本2,上传下载的版本至系统3,解压jre文件4,export JRE_HOME,并将其加入到PATH中5,检查JAVA版本1,下载Linux版本的jre版本https://java.com/en/download/linux_manual.jsp2,上传下载的版本至系统[root@node5 java]# pwd/usr/local/java[root@node5 java]# lsjre-8u311-linux-x64.tar.gz[root@nod原创 2021-10-22 23:15:36 · 105 阅读 · 0 评论 -
history命令中显示命令执行的时间
[root@node5 ~]# history #默认的history显示的命令是不带时间的 1 hostnamectl set-hostname node5 2 exit[root@node5 ~]# echo 'export HISTTIMEFORMAT="%F %T "'>>/etc/profile #添加一行[root@node5 ~]# source /etc/profile #让文件生效[root@node5 ~]# history原创 2021-10-22 21:59:35 · 400 阅读 · 0 评论 -
expect带变量参数实现ssh登录
[root@node5 ~]# cat sshlogin2.exp#!/bin/bashset ip [lrange $argv 0 0] #第一个变量赋值ipset password [lrange KaTeX parse error: Expected 'EOF', got '#' at position 14: argv 1 1] #̲第二个变量赋值给passwor…ip -pKaTeX parse error: Undefined control sequ原创 2021-10-17 09:49:26 · 234 阅读 · 0 评论 -
shell 免秘钥自动创建
使用方法: ./sshlogin IP 密码[root@node5 ~]# cat sshlogin#!/bin/baship=$1passwd=$2port=22autologin(){expect -c "set timeout 5spawn ssh-copy-id -f root@$1 -p$3expect {“yes/no” {send “yes”\n;exp_continue}“password:" {send “$2”\n}}expect eof"}#sh cr原创 2021-10-17 00:31:49 · 67 阅读 · 0 评论 -
shell ssh免秘钥制作
[root@node2 ~]# ssh-keygenGenerating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /root/.ssh/id_rsa.Yo原创 2021-10-16 23:16:42 · 131 阅读 · 0 评论 -
shell脚本+用户名+密码 ssh自动登录(expect spawn)
[root@node5 ~]# cat sshlogin #使用1条命令登录远程主机,并停留在登录交互页面#!/bin/baship=$1password=$2autologin(){expect -c "set timeout 5spawn ssh root@$1 -p22expect {“yes/no” {send “yes”\r;exp_continue}“password” {send $2\r}}interact"}autologin $ip $passwor原创 2021-10-16 22:59:18 · 1710 阅读 · 0 评论 -
shell spawn expect ssh自动登录
#第一次[root@node2 ~]# ssh root@192.168.0.129The authenticity of host ‘192.168.0.129 (192.168.0.129)’ can’t be established.ECDSA key fingerprint is SHA256:843LW+DwjjBNWQjNlv4MNcJ4+jkEA6n/PnuOqrbS5Fo.ECDSA key fingerprint is MD5:ac:1b:e2:f1:7a:a8:e9:6f:37:原创 2021-10-16 22:56:08 · 536 阅读 · 0 评论 -
shell basename dirname readlink使用
[root@localhost home]# ./checkpath.shthis is full file name:checkpath.shthis is file name:checkpaththis is file full path:/home/checkpath.shthis is file path:/home[root@localhost home]# cat checkpath.sh#!/bin/bashfullfile=basename $0file=basename $原创 2021-10-15 14:26:54 · 237 阅读 · 0 评论 -
shell 命令 cat rev tac
[root@localhost home]# cat test.txt #从左到右,从上到下打印hello wordtest file[root@localhost home]# rev test.txt #行级 反向打印drow ollehelif tset[root@localhost home]# tac test.txt #从下到上反向打印test filehello word...原创 2021-10-12 15:19:20 · 72 阅读 · 0 评论 -
Linux random还是生成随机数
#RANDOM在linux下是一个自带的系统变量,取值范围是0-32767#如下方式为取RANDOM值取模60,则可以得到0-60之间的一个随机整数[root@node5 ~]# num=$((RANDOM%60))[root@node5 ~]# echo $num56#如下方式为取RANDOM值取模120,则可以得到0-120之间的一个随机整数[root@node5 ~]# num=$((RANDOM%120))[root@node5 ~]# echo $num115...原创 2021-08-29 22:53:55 · 323 阅读 · 0 评论 -
ntp client ntp server 时区,时间关系
ntp client获取ntp server的UTC时间,然后加上自己的时区时间,得到当前时间原因:同一个操作系统从不同时区的ntp server获取的时间,都是一样的,因为操作系统使用的时区设置是一样的结论:ntp client端同步ntp server是同步ntp server UTC,然后用同步的UTC+timezone ,得到自己服务器时间验证:1,修改操作系统为不同的时区,查看获取的时间,[root@node5 ~]# timedatectl set-timezone Europe/L原创 2021-08-29 09:07:49 · 2138 阅读 · 0 评论 -
ipmctl Intel(R) Optane(TM) Persistent Memory Command Line Interface
Intel® Optane™ Persistent Memory Command Line InterfaceUsage: ipmctl <verb>[<options>][<targets>][<properties>]Commands:Display the CLI help.helpDisplay the CLI version.version Show the topology of all the DDRs and PMem mod原创 2021-08-26 22:27:35 · 324 阅读 · 0 评论 -
Centos8 网关 DNS 临时添加
[root@localhost ~]# ip a1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::原创 2021-08-20 15:50:03 · 432 阅读 · 0 评论 -
linux 内存文件系统 tmpfs
linux 内存文件系统 tmpfs1,挂载tmpfs系统,不指定容量大小,则默认文件系统为总内存容量的一半2,挂载tmpfs系统,指定容量大小1,挂载tmpfs系统,不指定容量大小,则默认文件系统为总内存容量的一半[root@node5 ~]# free #内存容量为2Gtotal used free shared buff/cache availableMem: 1865308 99164 13原创 2021-06-27 22:44:03 · 535 阅读 · 0 评论 -
INTEL AEP内存 memory mode的创建
1,查看机器AEP内存数量和状况2,将AEP全部设置成memeory mode3,重启机器4,查看AEP模式状况和容量1,查看机器AEP内存数量和状况[root@localhost ~]# ipmctl show -dimmDimmID | Capacity | LockState | HealthState | FWVersion0x0001 | 126.742 GiB | Disabled | Healthy | 02.01.00.14260x0011 | 126.742原创 2021-06-13 10:33:59 · 1779 阅读 · 1 评论 -
docker image拷贝加载 docker save docker load
解决问题:在内网下,使用跳板机上下载的docker镜像启动docker1,在跳板机上下载镜像2,打包镜像3,拷贝镜像到对应运行docker的机器上4,加载镜像到机器上1,在跳板机上下载镜像[root@home]# docker pull nginx…[root@home]# docker imagesREPOSITORY TAG IMAGE ID CREATED S原创 2021-06-13 10:27:00 · 344 阅读 · 0 评论 -
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. Error: open /proc/sel
问题描述:在Centos8系统中,使用docker run时,出现如下报错:Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.Error: open /proc/self/uid_map: no such file or directory解决办法:1,卸载podman软件(可以使用rpm -qa|grep docker)yum remove docker2,下载docker-ce源cur原创 2021-06-13 10:16:01 · 19275 阅读 · 3 评论 -
2021-03-04
centos 添加阿里源 yum源#添加步骤##备份本地源cd /etc/yum.repos.d/mkdir bakmv *.repo bak##下载阿里源(按照对应的操作系统版本下载对应的文件)centos6wget http://mirrors.aliyun.com/repo/Centos-6.repocentos7wget http://mirrors.aliyun.com/repo/Centos-7.repocentos8wget http://mirrors.aliyun原创 2021-03-04 12:27:43 · 128 阅读 · 1 评论 -
yum 安装 appache php
1,安装httpd,php,php-fpm //php-fpm实际整合的是mod_php,从配置文件中可以看到2,启动httpd3,验证(增php测试页,测试)1,安装httpd,php,php-fpm[root@node2 ~]# yum install httpd php php-fpm -y..................................Dependencies Resolved==============================...原创 2020-10-20 11:49:49 · 117 阅读 · 0 评论 -
查看配置文件,去掉以“#|空格#|tab #|空行”的行
1,去掉行首的空格或者tab2,去掉行首是“#|空行”1,去掉行首的空格或者tabsed 's/^[ \t]*//g' /etc/httpd/conf/httpd.conf将行首空格|tab去掉2,去掉行首是“#|空行”sed 's/^[ \t]//g' /etc/httpd/conf/httpd.conf | grep ^[^#]...原创 2020-10-20 11:44:34 · 442 阅读 · 0 评论 -
CentOS 7更换阿里或者163 yum源和epel源
#备份默认的yum源#下载国内的yum源–163源–阿里源#清理缓存文件 //可以不用执行#生成新源的元文件 //可以不用执行#安装epel源#查看yum源和epel源#备份默认的yum源[root@localhost ~]# cd /etc/yum.repos.d/ //进入yum文件目录[root@localhost yum.repos.d]# ls //查看目录下文件CentOS-Base.repo CentOS-Debuginfo.repo原创 2020-06-04 13:10:05 · 1799 阅读 · 0 评论 -
CentOS 7 epel yum源
#查看Centos yum源版本#安装Centos epel yum源#查看Centos yum源 enable的模块备注:使用Centos版本如下:[root@localhost ~]# uname -aLinux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux[root@localhost ~]# cat /etc/re原创 2020-06-04 12:14:26 · 696 阅读 · 0 评论