摘要: 1、比较符号解释 $# 表示提供到shell脚本或者函数的参数总数; $1 表示第一个参数。 -ne 表示 不等于 $?是shell变量,表示"最后一次执行命令"的退出状态.0为成功,非0为失败. 2、整数比较 -eq 等于,如:if ["$a" -eq "$b" ] -ne 不等于,如:if [" 阅读全文
posted @ 2018-11-20 21:34 effortsing 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 1、cat向文件覆盖内容 cat > local.repo << EOF [local]name=localbaseurl=file:///mnt/cdromgpgcheck=0enabled=1EOF 2、cat向文件追加内容 cat >> local.repo << EOF[local]name 阅读全文
posted @ 2018-11-20 21:19 effortsing 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 一、centos7.5安装orcale 安装环境 内存最小1G,推荐2G或者更高 内存为1-2g,swap是内存的1.5倍左右 内存大于2G, swap和内存相等 硬盘最小为30G oracle版本 oracle 11g 1、安装图形化界面 (非必须,只安装xmanager也可以) yum chec 阅读全文
posted @ 2018-11-20 15:32 effortsing 阅读(741) 评论(0) 推荐(0) 编辑
摘要: 1、centos7.4安装图形界面 yum check-update && yum install epel-release && yum groupinstall "GNOME Desktop" "Graphical Administration Tools" && yum groups mark 阅读全文
posted @ 2018-11-19 23:19 effortsing 阅读(1612) 评论(0) 推荐(0) 编辑
摘要: import subprocess import sys import os def main(): try: subprocess.call(["yum install wget -y;cd /etc/yum.repos.d/ && mkdir repo_bak && mv *.repo repo_bak/"], shell=True) subproce... 阅读全文
posted @ 2018-11-19 22:48 effortsing 阅读(2144) 评论(0) 推荐(0) 编辑
摘要: 在pycharm中调用shell命令 1、调用普通命令 # -*- coding:UTF-8 -*- import subprocess subprocess.call(["ls /home"], shell=True) #subprocess.call(["cat /root/d.txt | grep hello"], shell=True) 执行结果 ssh://root@192.... 阅读全文
posted @ 2018-11-19 21:58 effortsing 阅读(7598) 评论(0) 推荐(0) 编辑
摘要: 1、第一种 1.1 正确 class People(object): C:\Python34\python.exe C:/Users/Administrator/PycharmProjects/untitled25/file3/file3.py 阅读全文
posted @ 2018-11-19 21:21 effortsing 阅读(1380) 评论(0) 推荐(0) 编辑
摘要: 1、代码格式化: Ctrl + Alt + L 2、设置行号和字体:参照文档 https://jingyan.baidu.com/article/6b182309bfe7abba59e15944.html 3、整体缩进的快捷键:选中多行,按tab进行缩进, 4、按tab+shift去除缩进 阅读全文
posted @ 2018-11-19 21:05 effortsing 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 经过几次面试,发现有的公司没有用过k8s,有的公司正在用,但是都问了共同的问题:k8s的好处在哪里。所以总结了一下几点 1、故障迁移:当某一个node节点关机或挂掉后,node节点上的服务会自动转移到另一个node节点上,这个过程所有服务不中断。这是docker或普通云主机是不能做到的 2、资源调度 阅读全文
posted @ 2018-11-19 15:16 effortsing 阅读(5285) 评论(0) 推荐(1) 编辑
摘要: 程序输入和raw_inoput() 内建函数 字符解释 f% :对应小数 >>> print "%s is number %d" % ("python",1)python is number 1 >>> user = raw_input('enter login name:')enter login 阅读全文
posted @ 2018-11-19 11:40 effortsing 阅读(299) 评论(0) 推荐(0) 编辑