08 2021 档案

摘要:1. 比较运算符 符号 说明 实例 -eq 等于 -ne 不等于 -gt 大于 -ge 大于等于 -lt 小于 -le 小于等于 https://blog.51cto.com/020618/1890587 阅读全文
posted @ 2021-08-31 11:19 LeoShi2020 阅读(64) 评论(0) 推荐(0) 编辑
摘要:1. 字符串长度 $.Length PS /root> "1234567".length 7 2. 字符串包含 if( -not ($storage.Name -match "Local*|NFS")) 阅读全文
posted @ 2021-08-31 11:14 LeoShi2020 阅读(48) 评论(0) 推荐(0) 编辑
摘要:1. 查看samba连接 net use PS C:\Users\Administrator> net use 会记录新的网络连接。 状态 本地 远程 网络 已断开 \\10.1.90.201\shared Microsoft Windows Network OK \\172.16.1.129\IP 阅读全文
posted @ 2021-08-30 11:04 LeoShi2020 阅读(719) 评论(0) 推荐(0) 编辑
摘要:] ntpq -p remote refid st t when poll reach delay offset jitter 10.1.1.1 10.100.5.51 4 u 2 64 1 0.831 -0.011 0.000 10.1.1.2 10.100.5.52 4 u 26 64 1 0. 阅读全文
posted @ 2021-08-29 11:12 LeoShi2020 阅读(584) 评论(0) 推荐(0) 编辑
摘要:1. 系统默认时区UTC ] date Sun Aug 29 01:41:07 UTC 2021 2. 从其他的Linux复制Shanghai时区文件至共享卷 # scp /usr/share/zoneinfo/Asia/Shanghai root@172.15.7.203:/vmfs/volume 阅读全文
posted @ 2021-08-29 10:27 LeoShi2020 阅读(849) 评论(0) 推荐(0) 编辑
摘要:1. 计划任务文件路径 /var/spool/cron/crontabs/root #min hour day mon dow command 1 1 * * * /sbin/tmpwatch.py 1 * * * * /sbin/auto-backup.sh 0 * * * * /usr/lib/ 阅读全文
posted @ 2021-08-29 10:25 LeoShi2020 阅读(289) 评论(0) 推荐(0) 编辑
摘要:1. 查看所有磁盘 oradb1:oracle:/oracle>lsdev -Cc disk hdisk0 Available 00-08-00 SAS Disk Drive hdisk1 Available 00-08-00 SAS Disk Drive hdisk2 Available 00-0 阅读全文
posted @ 2021-08-25 15:45 LeoShi2020 阅读(127) 评论(0) 推荐(0) 编辑
摘要:1. 批量将虚拟机光驱摘除 $vms=get-vm $vms.Name | ForEach-Object{ $cd = Get-CDDrive -VM $_ Set-CDDrive -CD $cd -NoMedia -Confirm:$false } END 阅读全文
posted @ 2021-08-24 00:49 LeoShi2020 阅读(111) 评论(0) 推荐(0) 编辑
摘要:1. 安装rar工具 yum install rar -y 2. 解压缩文件到当前目录 rar e <压缩包.rar> rar e huaweiusg6kv-usg.rar 3. 解压缩带路径 rar x huaweiusg6kv-usg.rar END 阅读全文
posted @ 2021-08-22 22:07 LeoShi2020 阅读(69) 评论(0) 推荐(0) 编辑
摘要:[root@localhost:~] services.sh restart vmware-hostd [root@localhost:~] services.sh restart vmware-vpxa 该问题主要是由于虚拟机的光驱选择了宿主机的光驱,所以导致显示该告警,把虚拟机的光驱改为客户端模 阅读全文
posted @ 2021-08-19 15:07 LeoShi2020 阅读(1164) 评论(0) 推荐(0) 编辑
摘要:1. 条件判断语句 if (<条件>) {<为真执行该语句>} elseif (<条件>) {<为真执行该语句>} else {<为假自行该语句>} 2. 例子 PS /root> $person_li 白雪公主今年10岁了 小猪今年10岁了 灰太狼今年20岁了 哪吒今年5岁了 if ($perso 阅读全文
posted @ 2021-08-19 13:10 LeoShi2020 阅读(1424) 评论(0) 推荐(0) 编辑
摘要:1. 多条件筛选 PS /root> $person_li 白雪公主今年10岁了 小猪今年10岁了 灰太狼今年20岁了 哪吒今年5岁了 # 找到包含5和20的条目 PS /root> $person_li | where {($_ | Select-String 5) -or ($_ | Selec 阅读全文
posted @ 2021-08-19 13:02 LeoShi2020 阅读(444) 评论(0) 推荐(0) 编辑
摘要:1. PowerShell的函数 function <函数名称>(<参数1>,<参数2>...) {<函数体>} 2. 传参 function person_info ($name="小猪",$age="10") { Write-Output $name"今年"$age"岁了" } PS /root 阅读全文
posted @ 2021-08-19 12:33 LeoShi2020 阅读(71) 评论(0) 推荐(0) 编辑
摘要:1. '#' 截取关键字右侧 ]# STR='DISTANCE_ESXi_7SERVER_IP=172.15.7.133' ]# echo ${STR} DISTANCE_ESXi_SERVER_IP=172.15.7.133 # 从左往右找到第一个关键字7匹配,截取关键字右侧所有字符 ]# ech 阅读全文
posted @ 2021-08-18 11:34 LeoShi2020 阅读(78) 评论(0) 推荐(0) 编辑
摘要:1. 下载安装包 pip download -d <包路径> <包名称> pip download -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com -d paramiko paramiko 2. 安装依赖包 pip i 阅读全文
posted @ 2021-08-16 11:09 LeoShi2020 阅读(222) 评论(0) 推荐(0) 编辑
摘要:1. 循环遍历 foreach $a='a','b','c' foreach ($i in $a) { echo $i } a b c 2. 循环遍历 foreach-object $a | ForEach-Object{ echo $_ } a b c 3. for循环 for ($counter 阅读全文
posted @ 2021-08-13 14:04 LeoShi2020 阅读(1039) 评论(0) 推荐(0) 编辑
摘要:1. 查看虚拟机列表 PS /root> Get-VM Name PowerState Num CPUs MemoryGB mysql数据库测试 PoweredOn 8 32.000 中间件测试服务器 PoweredOn 8 16.000 test01 PoweredOn 2 4.000 VMwar 阅读全文
posted @ 2021-08-13 12:58 LeoShi2020 阅读(1023) 评论(0) 推荐(0) 编辑
摘要:1. 连接ESXi服务器 Connect-VIServer -Server <IPAddress> -Protocol <https> -User <root> -Password <pass> PS /root> Connect-VIServer -Server 10.1.1.1 Specify 阅读全文
posted @ 2021-08-13 10:53 LeoShi2020 阅读(316) 评论(0) 推荐(0) 编辑
摘要:1. 查看当前素有的版本 PS /root> Find-Module -Repository PSGallery -Name VMware.PowerCLI -AllVersions | ft -AutoSize Version Name Repository Description 12.3.0. 阅读全文
posted @ 2021-08-13 09:01 LeoShi2020 阅读(761) 评论(0) 推荐(0) 编辑
摘要:1. 下载地址 curl -O https://packages.microsoft.com/rhel/7/prod/powershell-7.1.3-1.rhel.7.x86_64.rpm 2. 安装依赖 yum install -y libicu 3. 安装powercli rpm -ivh p 阅读全文
posted @ 2021-08-12 16:14 LeoShi2020 阅读(413) 评论(0) 推荐(1) 编辑
摘要:1. 修改转发配置文件 echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf 2. 配置文件生效 sysctl -p 3. 配置防火墙 --add-forward-port=port=<portid>[-<portid>]:proto=<protocol> 阅读全文
posted @ 2021-08-10 23:56 LeoShi2020 阅读(425) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示