查看CPU占用前10
ps aux | head -1;ps aux |grep -v PID |sort -rn -k +3 | head -10
or
ps aux --sort -pcpu | head -n 11
查看内存占用前10
ps aux | head -1;ps aux |grep -v PID |sort -rn -k +4 | head -10
or
ps aux --sort -rss | head -n 11
IT技术笔记
查看CPU占用前10
ps aux | head -1;ps aux |grep -v PID |sort -rn -k +3 | head -10
or
ps aux --sort -pcpu | head -n 11
查看内存占用前10
ps aux | head -1;ps aux |grep -v PID |sort -rn -k +4 | head -10
or
ps aux --sort -rss | head -n 11
1.安装vncserver
yum install tigervnc tigervnc-server
2.配置
在 /etc/tigervnc/vncserver.users 文件中添加用户映射,:1=root,指的是5901端口,root用户
vim /etc/tigervnc/vncserver.users
# TigerVNC User assignment # # This file assigns users to specific VNC display numbers. # The syntax is <display>=<username>. E.g.: # # :2=andrew # :3=lisa :1=root
安装certbot
yum install -y certbot python3-certbot-nginx
获取证书
通过nginx获取证书
certbot certonly --nginx -d www.xxx.com
通过静态目录获取证书
certbot certonly --webroot -w /根目录地址 -d www.xxx.com
注:不加certonly会使certbot自动修改配置文件
引言
从RHEL8/CentOS8开始,dnf取代yum作为rpm 包管理工具。与之而来的还有模块(module)这个东西。 有了它们的加持,让在同一个OS上安装不同版本的软件或者开发语言的工作比之前容易多了。
简介
Modules are special package groups usually representing an application, a language runtime, or a set of tools. They are available in one or multiple streams which usually represent a major version of a piece of software, giving you an option to choose what versions of packages you want to consume.
To simplify installation, modules usually define one or more installation profiles that represent a specific use case. For example a server or a client profile in a database module.
也就是说:
一个软件可以有多个版本,每个版本对应一个stream. 在每个stream内部,又分为proile对应到安装场景(比如开发, server, client)。
使用chmod修改文件权限时报如下错误:
chmod: changing permissions of 'xxx': Read-only file system
解决方法:
1.系统文件
如果是系统文件出现这个问题,重新挂载根目录即可:
mount -rw -o remount /
2.移动硬盘或者U盘
mount -o remount,rw /dev/sdc
问题:
由于安装系统时没有仔细看,/boot目录默认设置只有100M,这样编译几个版本的内核/boot空间就不够用了。mount一下,看到/boot目录被挂在到/dev/sda1上,空间只有100M。
(推荐教程:centos使用教程)
解决办法如下:
1、umount /boot 2、mkdir /boot_old 3、mount /dev/sda1 /boot_old 4、到/boot_old目录下: cp -rp * /boot 5、删除/etc/fstab表中含有 /boot项
该方法是取消将/boot挂在到sda1上,而是直接使用/boot目录,但是需要将原来在/dev/sda1上的文件拷贝到/boot下。
打开文件smb.conf在[global]部分末尾增加以下配置
[global] ... follow symlinks = yes wide links = yes unix extensions = no
我找到问题所在了,是因为ss5的pid文件导致的
默认路径位于/var/run/ss5/ss5.pid。但某些vps在重启后这个目录无缘无故消失了。每次重启系统都需要重建这个目录:mkdir /var/run/ss5。
解决方法就是:修改pid路径。
修改方法:在文件/etc/sysconfig/ss5修改参数,指定pid路径。修改配置后文件内容如下:
# Add startup option here #SS5_OPTS=" -u root" SS5_OPTS=" -p /var/run/ss5.pid"
原文链接:http://blog.95shouyou.com/?id=3
1.开启动态转发
在本地服务器执行以下命令:
ssh -D 7001 username@remote-host
username: 代理服务器账号
remote-host: 代理服务器IP
注:该窗口不可关闭或退出
一、查看系统防火墙状态(如果返回 running 代表防火墙启动正常)
firewall-cmd --state
二、开启端口外网访问
1、添加端口 返回 success 代表成功(--permanent永久生效,没有此参数重启后失效)
firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --zone=public --add-port=443/tcp --permanent
开放多个端口
firewall-cmd --zone=public --add-port=80-85/tcp --permanent
2、重新载入 返回 success 代表成功
firewall-cmd --reload
3、查看 返回 yes 代表开启成功
firewall-cmd --zone=public --query-port=80/tcp