![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Liunx
yylの博客
这个作者很懒,什么都没留下…
展开
-
修改sudo过期时间
修改sudo过期时间# 修改配置文件sudo vim /etc/sudoers# 文件末尾增加,单位为分钟,设置为0则每次都需要密码Defaults env_reset, timestamp_timeout=1000000原创 2022-04-29 17:35:44 · 474 阅读 · 0 评论 -
Ubuntu 18.04 配置root登录
Ubuntu 18.04 配置root登录1. 添加root密码# 设置密码sudo passwd root2. 修改配置文件# 添加两行代码到文件尾部# greeter-show-manual-login=true# all-guest=falsevim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf# 授权文件chmond 777 /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf原创 2021-09-26 11:18:18 · 723 阅读 · 1 评论 -
ubuntu18.04安装zsh+oh-my-zsh
ubuntu18.04安装zsh+oh-my-zsh1. 安装zsh,并修改默认shell为zsh# 安装curl, zshapt install curl zsh -y# 修改默认shell为zshchsh -s /bin/zsh2. 修改密码配置文件搜索bash, 替换为zshvim /etc/passwd3. 安装git和oh-my-zsh# 安装gitapt-get install git -y# 下载oh-my-zsh(码云)sh -c "$(curl -fsS原创 2022-01-05 17:39:31 · 408 阅读 · 0 评论 -
常用压缩解压缩命令
zip# 压缩# 压缩整个目录zip -r xxx.zip xxx/# 指定文件压缩zip -r xxx.zip 1.txt 2.txt 3.txt# 解压缩unzip xxx.ziptar# 压缩# 压缩整个目录tar -cvf xxx.tar xxx/tar -cvf xxx.tar 1.txt 2.txt 3.txt# 解压缩tar -xvf xxx.tar...原创 2021-12-24 15:29:49 · 292 阅读 · 0 评论 -
alpine镜像修改下载源
echo "<http://mirrors.aliyun.com/alpine/latest-stable/main/>" > /etc/apk/repositoriesapk update原创 2021-12-15 18:42:14 · 1524 阅读 · 0 评论 -
shell脚本, 检测cpu异常程序,自动杀死该程序
shell脚本, 检测cpu异常程序,自动杀死该程序自定义间隔时间自定义统计次数自定义exclude_pid列表#!/bin/bashmax_usage=90 # cpu超过当前值后开始根据pid计数, 连续超过30秒则杀死进程pid=0count=0exclude_pid=(7263)while [ 0 == 0 ]dobase_data=`top -c -b | head -10`now_pid=`top -c -b | head -10 |awk -F ' '原创 2021-11-20 15:38:09 · 689 阅读 · 0 评论 -
Shell 使用if 判断 string float 与 int
Shell 使用if 判断 string float 与 int# 判断intmax_usage=90# 获取当前程序cpu最高的值now_cpu_usage=`top -c -b | head -10 |awk '{print $9}' |awk 'NR==8'`# 判断当前最高cpu值(字符串float)是否大于判断值(int)if [ `echo "$now_cpu_usage > $max_usage" |bc` -eq 1 ]then echo "1111111111"原创 2021-11-20 15:34:08 · 752 阅读 · 0 评论 -
Shell for in数组
Shell for in 数组exclude_pid=(7263 123 333)for i in ${exclude_pid[@]};do echo $i;done原创 2021-11-20 15:28:38 · 3670 阅读 · 0 评论 -
root 无法删除文件问题
root 无法删除文件问题# 查看无法删除文件属性,是否包含ia,如果包含则表示不可以被删除lsattr filename# 删除文件属性chattr -ia filename# 也可以添加属性chattr +ia filename原创 2021-11-19 10:29:19 · 392 阅读 · 0 评论 -
ssh 配置免密码登录
ssh 配置免密码登录1.生成公钥ssh-keygen -t rsa2.发送公钥# 用户@ipssh-copy-id ubuntu@10.51.4.3原创 2021-07-23 18:07:14 · 139 阅读 · 0 评论 -
Docker中alipne系统镜像操作
Docker中alipne系统镜像操作1-查询系统版本# 查询是否属于alipne系统cat /proc/versionuname -a2-修改下载源,并更新安装基础套件# 修改为阿里的源sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories# 更新apk update# sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /原创 2021-03-09 11:35:53 · 227 阅读 · 0 评论 -
根据端口获取程序pid
文章目录Liunx 根据端口获取应用pidLiunx 根据端口获取应用pid# 此处可以同时查出多个应用pidnetstat -plntu |grep "5001\|5101\|5102\|5103\|5201"原创 2021-02-22 08:26:11 · 120 阅读 · 0 评论 -
Centos7 openssl过期问题,升级openssl
Centos7 openssl过期问题1-官网下载安装包https://www.openssl.org/source/# 通过wget下载稳定版cd /usr/local/wget https://www.openssl.org/source/openssl-1.1.1h.tar.gztar zxvf openssl-1.1.1h.tar.gzcd openssl-1.1.1h./config --prefix=/usr/local/openssl #检查环境./config –tma原创 2020-12-02 14:57:27 · 497 阅读 · 0 评论 -
VMware 扩充硬盘空间
VMware Centos7 扩充硬盘空间首先在VMvare中将虚拟机文件的硬盘扩展到指定数,然后进去Centos系统中配置1.查看磁盘情况并创建新分区fdisk -l /dev/sdafdisk /dev/sda# 依次输入:np3回车回车t3L8ewreboot # 重启一下2.查看卷组名vgdisplay3.新建物理卷pvcreate /dev/sda34.使用新的物理卷来扩展 LVM 的 VolGroupvgextend centos /dev原创 2020-09-07 12:21:04 · 99 阅读 · 0 评论 -
Centos7 修改硬盘分区大小
Centos7 修改硬盘分区大小扩充root分区大小1.查看磁盘空间大小df -h此处可以看到home分区还要66G,我们需要分配50G到root分区2.备份home目录文件cp -r /home/ homebak/3.卸载home分区,并查看是否成功umount /homedf -hx...原创 2020-04-10 08:39:17 · 4902 阅读 · 0 评论 -
supervisor安装与使用详解
supervisor安装与使用详解supervisor是使用Python编写的一个开源管理框架,可以通过简单的配置来控制管理程序1-安装supervisor(需要有python环境)pip install supervisor2-创建配置目录,获取配置文件mkdir /etc/supervisorecho_supervisord_conf > /etc/supervisor/s...原创 2019-10-29 09:14:52 · 740 阅读 · 0 评论 -
Liunx Centos 远程连接key错误问题
Liunx Centos 远程连接key错误问题ssh远程连接key错误,原因可能是之前连接成功过,后来多次修改过IP导致本地保存key和服务器key对应不上1-删除服务器key文件rm -f /etc/ssh/ssh_host_rsa_key2-找到本地key记录并删除(macOS)vim ~/.ssh/known_hosts3-Windows中key所在位置# 88686:...原创 2019-10-25 15:44:28 · 200 阅读 · 0 评论