随笔分类 -  linux

摘要:[root@xxx tmp]# man ssh-keygen NAME ssh-keygen - authentication key generation, management and conversion SYNOPSIS ssh-keygen [-q] [-b bits] -t type [ 阅读全文
posted @ 2017-11-14 23:24 hufangrui 阅读(1613) 评论(0) 推荐(0)
摘要:1、生成账户 [hufangrui@xxx ~]$ openssl passwd -1Password: Verifying - Password: $1$szzkROBZ$GYxffRLp8K5vWKAf33acl/ 2、添加用户并修改密码 useradd -s /bin/bash -m -G a 阅读全文
posted @ 2017-11-14 23:15 hufangrui 阅读(553) 评论(0) 推荐(0)
摘要:1、连接mysql数据库mysql -uroot -p -h127.0.0.1 -P3306 2、列出所有sessionshow full processlist; 3、查看20条执行时间最长的SQLselect * from information_schema.PROCESSLIST ORDER 阅读全文
posted @ 2017-08-19 09:09 hufangrui 阅读(903) 评论(0) 推荐(0)
摘要:由于网络安全的原因,服务器不允许上公网,有2种方案,解决这个问题 1.搭建yum服务器2.使用yum下载缓存进行封装,然后使用缓存安装 这里讲讲使用yum缓存封装 一、下载指定包及相关依赖 二、查看下载的缓存文件,默认存/var/cache/yum 三、yum使用缓存安装指定包 阅读全文
posted @ 2017-04-12 23:09 hufangrui 阅读(17942) 评论(0) 推荐(0)
摘要:linux:Centos 6.6 dstat:0.7.0 注意,有这个提醒:Color support is disabled, python-curses is not installed good了下这个问题,说是bug。。。 但是我仔细对比了服务器,发现dstat用的是python2.7并不是 阅读全文
posted @ 2017-03-09 00:18 hufangrui 阅读(626) 评论(0) 推荐(0)
摘要:#查看你的硬件是否支持虚拟化。命令: #安装基础包 #启动依赖服务及加载模块 #网桥管理命令查看 #创建软链接,并创建虚拟机存放目录 #创建虚拟机磁盘文件 #创建xml模板文件 #创建虚拟机,不建议使用virsh create,停机后,virsh list --all查看不到虚拟机信息,推荐使用vi 阅读全文
posted @ 2017-02-21 20:31 hufangrui 阅读(1736) 评论(0) 推荐(0)
摘要:问题描述: 执行yum命令时,报错[Errno 14] problem making ssl connection 问题分析: ssl证书问题 问题解决: sed -i 's/^#baseurl/baseurl/g;s/^mirrorlist/#mirrorlist/g' /etc/yum.repo 阅读全文
posted @ 2017-02-14 13:44 hufangrui 阅读(725) 评论(0) 推荐(0)
摘要:1、安装rsyncyum -y install rsync.x86_64 2、同步epel至本地#http://mirrors.ustc.edu.cn/status/ 获取镜像库rsync路径mkdir -p /data/yum/epel/#将这个同步命令定时执行,可以同步epel库信息至本地/us 阅读全文
posted @ 2017-01-25 18:23 hufangrui 阅读(1630) 评论(0) 推荐(0)
摘要:Cobbler服务器系统: CentOS 6.6 64位Cobbler版本: cobbler-2.6.11IP地址:192.168.166.136 1、安装epel库 2、安装依赖包 3、配置http 4、配置tftp和rsync 5、配置cobbler相关参数 6、配置dhcp服务器 #检查cob 阅读全文
posted @ 2017-01-24 21:07 hufangrui 阅读(557) 评论(0) 推荐(0)
摘要:[root@VM166136 ~]# cat copy_vmware.sh #!/bin/bash if [ $(id -u) -ne 0 ];then echo "Please use the root user to perform!!!" exit 1 fi #Modify the network card configuration and empty MAC informat... 阅读全文
posted @ 2017-01-23 16:55 hufangrui 阅读(1614) 评论(0) 推荐(0)
摘要:1、当前session执行的命令,放置缓存中,执行exit时,把缓存信息写入~/.bash_history 2、当session直接被kill时,缓存中的历史命令不会写入~/.bash_history 3、正确清空当前用户的history的方法 阅读全文
posted @ 2017-01-23 16:33 hufangrui 阅读(39588) 评论(1) 推荐(0)
摘要:1、查看rpm包里的文件 [root@VM_166_132 ~]# rpm -qlp mysql5.6.29-1-3.x86_64.rpm |more/etc/ld.so.conf.d/mysql-5.6.23_compiled_x86_64.conf/usr/local/lib/libjemall 阅读全文
posted @ 2016-12-02 18:24 hufangrui 阅读(607) 评论(0) 推荐(0)
摘要:参数说明 -i, --interactive prompt before overwrite (overrides a previous -n option) #文件存在是,交互式提示是否覆盖 -n, --no-clobber do not overwrite an existing file (o 阅读全文
posted @ 2016-12-02 15:40 hufangrui 阅读(71680) 评论(1) 推荐(2)
摘要:一、mutt命令 1、安装 yum -y install mutt 2、使用 echo "mail content"|mutt -s "mail title" test@test.com -a /tmp/test1.txt /tmp/test2.txt 二、uuencode命令 1、安装 uuenc 阅读全文
posted @ 2016-10-31 14:01 hufangrui 阅读(3192) 评论(0) 推荐(0)
摘要:1、小写字母转换大写字母 echo "aBcD"|tr 'a-z' 'A-Z' 2、大写字母转换小写字母 echo "aBcD"|tr 'A-Z' 'a-z' 3、当前脚本路径 basepath=$(cd `dirname $0`; pwd) 具体详细解释,请看http://www.cnblogs. 阅读全文
posted @ 2016-10-27 09:25 hufangrui 阅读(195) 评论(0) 推荐(0)
摘要:第一种:命令使用方法 例子1: cat test.txt 1 2 3 for i in $(cat test.txt) do echo $i done 例子2: for i in 1 2 3 4 do echo $i done 例子3: for i in $(seq 1 100) do echo $ 阅读全文
posted @ 2016-10-26 19:35 hufangrui 阅读(379) 评论(0) 推荐(0)