shell编程实现创建新用户和打包文件 1、shell编程创建新用户 #! /bin/bash `useradd $1` `echo $2 | passwd --stdin $1` 假设这个文件的名称为test.sh,则操作方式为: ./test.sh admin 123456 其中1参为用户名,2 ...
分类:
系统相关 时间:
2021-03-31 12:11:52
阅读次数:
0
dockerSearch命令
Get https://index.docker.io/v1/search?q=redis&n=25: dial tcp: lookup index.docker.io on [::1]:53: read udp [::1]:49555->[::1]:53: read:... ...
分类:
其他好文 时间:
2021-03-31 12:10:21
阅读次数:
0
前言:方案仅供参考,请参考前置条件和问题描述后以实际情况为准; 前置条件:导入centos7后,关闭selinux,关闭防火墙,主机ping通了虚拟机,虚拟机无法ping主机,于是在百度上搜索后一顿操作猛如虎,最后作死了..... 问题描述: 虚拟机导入的centos7默认为nat连接;原本主机能p ...
分类:
其他好文 时间:
2021-03-31 12:02:40
阅读次数:
0
vi readreply.sh #!/bin/bash#第一部分 echo -n "What is your name?"readecho "Your name is $REPLY" #已将变量的值从标准输入读到REPLY #第二部分echo -n "What is the name of your ...
分类:
系统相关 时间:
2021-03-30 13:53:42
阅读次数:
0
. shell逻辑表达式 #!/bin/bash FILE_BASED_ENCRYPTION="true" if [ "$FILE_BASED_ENCRYPTION" == "true" ]then echo "if: first one" || echo "if: second one"else ...
分类:
系统相关 时间:
2021-03-30 13:52:37
阅读次数:
0
背景: Pod处于Terminating 排查: 1、kubectl delete pod pod名 依旧是无法拉为Running状态 2、kubectl get node 输出显示两个Node是NotReady 3、两个节点ip可ping通,登陆到节点上执行 systemctl restart d ...
分类:
其他好文 时间:
2021-03-30 13:49:24
阅读次数:
0
Shell脚本基础 变量 什么是变量? 变量即可以变化的量 变量名称注意事项 只能包含字母、数字、下划线,并且不能以数字开头 不应该跟系统中已有的环境变量重名,尽量不要全部使用大写,尽量不要用“_”下划线开头 最好做到见名知义 不能使用程序中的保留字,例如if、for等 变量类型 字符型 数值型 整 ...
分类:
系统相关 时间:
2021-03-30 13:46:50
阅读次数:
0
Shell函数 linux shell 可以用户定义函数,然后在shell脚本中可以随便调用。 shell中函数的定义格式如下: [ function ] funname [()] { action; [return int;] } 说明: 1、可以带function fun() 定义,也可以直接f ...
分类:
系统相关 时间:
2021-03-30 13:46:15
阅读次数:
0
1 import os 2 3 # 获取手机系统信息 4 phone_sys = os.popen('adb shell "cat /system/build.prop | grep "product""').read() 5 print(phone_sys) 6 7 # 获取手机设备型号 8 de ...
分类:
编程语言 时间:
2021-03-30 13:42:38
阅读次数:
0
Springboot项目Java轻松实现Excel导出 一、需求背景 要求Java后端实现一个Excel导出功能。 二、工程包引入 implementation group: 'org.apache.poi', name: 'poi', version: '4.0.1' implementation ...
分类:
编程语言 时间:
2021-03-30 13:36:58
阅读次数:
0