随笔分类 - centos
摘要:统计IPV6的行数awk -F " " '{print $1}' /var/log/nginx/access.log | grep ':' | wc -l 统计所有的行数awk -F " " '{print $1}' /var/log/nginx/access.log | wc -l
阅读全文
摘要:安装wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2yum install bzip2tar -jxvf phantomjs-2.1.1-linux-x86_64.tar
阅读全文
摘要:find /var/ -size +500M -print0|xargs -0 du -m|sort -nr
阅读全文
摘要:【机器】内网机器A(10.1.125.10):运行python程序。内网机器B(10.1.131.20):内网nginx代理。外网机器C(10.1.148.30):外网nginx代理。 【目标】在机器A上配置pip源,把外网请求mirrors.aliyun.com通过两层nginxB和C转发到外网。
阅读全文
摘要:根据人行要求,金融机构到2020年12月底,关键服务需要支持IPV6,涉及配置Centos服务器的IPV6地址,过程如下: 通过ip addr命令查看网卡名称,这里是ens192:ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueu
阅读全文
摘要:#查看操作系统cat /etc/redhat-release #查看tomcat版本sh /root/tomcat_8080/bin/version.sh | grep 'Server version' #查看nginx版本nginx -v #查看mysql版本mysql --version #查看
阅读全文
摘要:1、关闭DNS反向解析# vi /etc/ssh/sshd_configUseDNS=no 2、重启sshd服务# service sshd restart
阅读全文
摘要:1. 打开编辑limits.conf文件 vi /etc/security/limits.conf 2. 插入以下内容* hard nofile 999999* soft nofile 999999* soft nproc 65535* hard nproc 65535* hard stack 10
阅读全文
摘要:确认新挂载的磁盘 [root@share-redis ~]# fdisk -l Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size
阅读全文
摘要:#查看操作系统 cat /etc/redhat-release #查看CPU的个数、核数、型号grep 'physical id' /proc/cpuinfo | sort -u | wc -lgrep 'core id' /proc/cpuinfo | sort -u | wc -ldmideco
阅读全文
摘要:curl http://ifconfig.me curl http://icanhazip.com
阅读全文
摘要:tcpdump host 10.1.131.75 -i eth0 -w data.cap 其中,10.1.131.75上目标机器的IP,eth0上网卡名称,data.cap上抓包数据写入的文件。
阅读全文
摘要:rm -rf /etc/localtime ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ntpdate cn.pool.ntp.org 修改crontab vi /etc/crontab #每天晚上11点同步时间服务器 0 23 *
阅读全文
摘要:近期遇到一个非常奇怪的问题,也不知道改了什么,tomcat启动非常慢,以前几秒就启动好了,现在要30秒左右。 而且,通过jdbc连接oracle数据库也非常慢,以前建立一个连接只要几十毫秒,现在也要10秒左右。 折腾了好几天,终于解决了,记录下来,帮助大家少走弯路。 遇到这个问题时,最初以为是ran
阅读全文
摘要:写一个sh文件: 保存成ping.sh,赋可执行权限: chmod +x ping.sh 执行: sh ./ping.sh 192.168.1.6 > ./1.log 在后台执行: nohup sh ./ping.sh 192.168.1.6 > ./1.log &
阅读全文
摘要:虚拟机分配磁盘40GB,实际系统分区只用了20GB,需要手工扩展到40GB,操作方法如下: 查看磁盘信息(确认主分区只有17GB):[root@test-web1 ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/cento
阅读全文
摘要:rm -f /etc/yum.repos.d/* wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel-7.repo h
阅读全文
摘要:wget https://dl.grafana.com/oss/release/grafana-6.2.5-1.x86_64.rpm yum localinstall grafana-6.2.5-1.x86_64.rpm service grafana-server start 默认是3000端口,
阅读全文
摘要:yum -y install libreoffice.x86_64 libreoffice --invisible --convert-to html --outdir /root/demo_html /root/demo.docx
阅读全文
摘要:oracle -11g-xe是数据库是免费版本,支持标准版的大部分功能。oracle XE版本也称快捷版本。是个个人学习,熟悉oracle的简化版。 oracle XE做为免费的Oracle数据库版本,主要的限制是: 最大数据库大小是11GB 可使用的最大内存是1G 一个机器只能安装一个XE实例 X
阅读全文