代码改变世界

随笔分类 -  系统运维

centos7安装使用vagrant

2021-04-15 21:15 by jetwill, 310 阅读, 收藏, 编辑
摘要: https://blog.51cto.com/u_12173069/2312621 #download virtualbox https://www.virtualbox.org/wiki/Linux_Downloads #download vagrant https://www.vagrantup 阅读全文

Centos7 安装 brctl 工具

2021-04-06 21:17 by jetwill, 1914 阅读, 收藏, 编辑
摘要: [root@docker-node1 ~]# brctl show -bash: brctl: command not found [root@docker-node1 ~]# yum -y install bridge-utils ... Installed: bridge-utils.x86_6 阅读全文

教你三步在CentOS 7 中安装或升级最新的内核

2021-04-01 09:07 by jetwill, 521 阅读, 收藏, 编辑
摘要: 转载自:https://www.linuxprobe.com/update-kernel-centos7.html #步骤 1:检查已安装的内核版本 >uname -sr #步骤 2:在 CentOS 7 中升级内核 >rpm --import https://www.elrepo.org/RPM- 阅读全文

在CentOS7 安装 jq

2021-04-01 08:16 by jetwill, 377 阅读, 收藏, 编辑
摘要: root@: 安装EPEL源: yum install epel-release 安装完EPEL源后,可以查看下jq包是否存在: yum list jq 安装jq: yum install jq ##命令参考资料 ###EPEL 企业版 Linux 附加软件包(以下简称 EPEL)是一个 Fedor 阅读全文

Shell中 heredoc 内容转义

2021-03-17 09:01 by jetwill, 172 阅读, 收藏, 编辑
摘要: 1、在$符号前面加反斜杠,如: cat > test.sh <<EOF \$test EOF 如果不加,将转成实际的值。 2、给EOF加个双引号,如: cat > test.sh <<"EOF" $test EOF 阅读全文

Linux下Shell的for循环语句

2021-03-17 08:52 by jetwill, 832 阅读, 收藏, 编辑
摘要: Linux下Shell的for循环语句 第一类:数字性循环 #!/bin/bash for((i=1;i<=10;i++)); do echo $(expr $i \* 3 + 1); done #!/bin/bash for i in $(seq 1 10) do echo $(expr $i \ 阅读全文

去掉所有包含this或is的行

2021-03-16 20:07 by jetwill, 70 阅读, 收藏, 编辑
摘要: 题目描述 写一个 bash脚本以实现一个需求,去掉输入中含有this的语句,把不含this的语句输出 示例: 假设输入如下: that is your bag is this your bag? to the degree or extent indicated. there was a court 阅读全文

打印每一行出现的数字个数

2021-03-16 19:41 by jetwill, 239 阅读, 收藏, 编辑
摘要: 题目描述 写一个 bash脚本以统计一个文本文件 nowcoder.txt中每一行出现的1,2,3,4,5数字个数并且要计算一下整个文档中一共出现了几个1,2,3,4,5数字数字总数。 示例: 假设 nowcoder.txt 内容如下: a12b8 10ccc 2521abc 9asf 你的脚本应当 阅读全文

Shell练习 行列转换

2021-03-16 08:37 by jetwill, 286 阅读, 收藏, 编辑
摘要: 原题:https://leetcode.com/problems/transpose-file/ Given a text file file.txt, transpose its content. You may assume that each row has the same number o 阅读全文

Linux shc 命令手册

2021-01-06 21:45 by jetwill, 993 阅读, 收藏, 编辑
摘要: shc Generic shell script compiler. https://www.linux-man.cn/command/shc/ #Compile a shell script: shc -f {{script}} #Compile a shell script and specif 阅读全文

Oracle查看表空间及大小

2020-12-25 16:43 by jetwill, 3075 阅读, 收藏, 编辑
摘要: --1、查看表空间的名称及大小 SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size FROM dba_tablespaces t, dba_data_files d WHERE t.tablespace_nam 阅读全文

Oracle 五种约束的创建和移除:

2020-12-25 16:42 by jetwill, 343 阅读, 收藏, 编辑
摘要: 1.主键约束: 创建表的时候就添加: create table table_name (categoryId varchar2(10), categoryName varchar2(30), primary key(categoryId)); 创建表后追加: alter table table_na 阅读全文

Oracle的decimal和number的对比

2020-12-25 16:31 by jetwill, 1585 阅读, 收藏, 编辑
摘要: Oracle只是在语法上支持decimal类型,但是在底层实际上它就是number类型,支持decimal类型是为了能把数据从Oracle数据库移到其他数据库中(如DB2等)。 因为decimal在Oracle底层就是number类型,所以就当number类型使用就可以了,如果需要对这种字段类型转为 阅读全文

Python 国内镜像源

2020-12-02 09:00 by jetwill, 99315 阅读, 收藏, 编辑
摘要: 让 python pip 使用国内镜像源 国内镜像源: 清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.ed 阅读全文

怎样在 CentOS/RHEL 7/6 上安装和配置 Sendmail 服务器

2020-10-01 17:50 by jetwill, 767 阅读, 收藏, 编辑
摘要: 在 CentOS 上,可以通过 mailx 命令 或 sendmail 命令来给因特网发送电子邮件。 关于前者的文章比较多,关于后者的文章比较少。 这里记录了我在 CentOS 7 上安装和配置 sendmail 服务器的过程。 1. 安装 Sendmail yum install sendmail 阅读全文

Cannot uninstall 'pyparsing'. It is a distutils installed project

2020-08-31 23:09 by jetwill, 1387 阅读, 收藏, 编辑
摘要: 我的环境: [root@ansible ~]# python -V Python 2.7.5 [root@ansible ~]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [root@ansible ~]# pip -V 阅读全文

Linux下校验SHA1和MD5的方法

2020-08-27 09:25 by jetwill, 2073 阅读, 收藏, 编辑
摘要: 当我们从互联网下载东西或者从U盘拷贝东西的时候,通常是不会和源文件有什么区别的,但是在偶然的情况下会出现下载或者拷贝出错的情况, 尤其是在下载大文件的时候,比如系统光盘......当你装机到一半才发现是坏的怎么办?所以就有了以SHA1和MD5为代表的哈希值校验,数学上的功夫就不多说了, 反正就是SH 阅读全文

Linux查看进程启动时间和运行多长时间

2020-08-26 13:57 by jetwill, 7157 阅读, 收藏, 编辑
摘要: Linux 查看进程启动时间和运行多长时间 启动时间 ps -eo lstart 运行多长时间 ps -eo etime -bash-4.1$ ps -eo pid,lstart,etime | grep 188637 188637 Wed Aug 26 11:37:45 2020 02:16:44 阅读全文

sqlplus -S参数表示什么意思?

2020-08-25 20:39 by jetwill, 3995 阅读, 收藏, 编辑
摘要: sqlplus -S , -S选项是静默模式,是Silent的缩写。在这种模式下将会以最精简的形式完成SQL*Plus的交互过程。 -S模式多用于脚本模式。在命令行sqlplus -S还有可能出现卡住的情况。 C:\Users\chenjo>sqlplus -H SQL*Plus: Release 阅读全文

dnspython模块报错 AttributeError: 'CNAME' object has no attribute 'address'

2020-08-23 14:56 by jetwill, 783 阅读, 收藏, 编辑
摘要: 有时候用到这个模块的时候会报错 AttributeError: 'CNAME' object has no attribute 'address' 如下所示 [root@ansible ch01]# ./dnspython_ex1.py Please input a domain: www.baid 阅读全文