Linux
Quincy379
坚持、冷静
展开
-
Shell之自动化安装elasticsearch代码实现V2
代码】Shell之自动化安装elasticsearch代码实现V2。原创 2022-07-15 12:33:43 · 511 阅读 · 0 评论 -
kali-linux配置pyenv步骤
git clone https://github.com/pyenv/pyenv.git ~/.pyenvecho 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc echo 'eval "$(pyenv init -)"' >> ~/.b..原创 2022-05-16 11:55:37 · 855 阅读 · 0 评论 -
kali-linux配置支持中文
apt install ttf-wqy-microheiapt install xfonts-intl-chinese原创 2022-05-15 22:22:02 · 217 阅读 · 0 评论 -
Nginx之缓存配置
location / { client_max_body_size 1024m; proxy_redirect off; proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_...原创 2021-08-17 14:35:36 · 309 阅读 · 0 评论 -
Linux之利用lsof恢复部分误删数据文件
lsof | grep deletedjava 5379 elasticsearch 1u CHR 136,0 0t0 3 /app/es/logs/gc.logcat /proc/5379/fd/1 >> /app/es/logs/gc.log原创 2021-02-26 14:03:15 · 152 阅读 · 0 评论 -
Linux之操作处理排除某个目录或文件
Linux中移动,复制,删除,打包排除某个目录或文件移动,复制,删除排除某个文件或目录方式一:cp !(file1|dir2) /data/ 复制文件到/data/,排除file1和dir2mv !(file1|dir2) /data/ 移动文件到/data/,排除file1和dir2rm -rf !(file1|dir2) ./ 删除当前目录下的文件,排除file1和dir2tar打包排除某个目录或文件使用–exclude选项,格式与示例如下格式:tar -zcvf xxx.tar.原创 2021-02-24 08:57:33 · 3412 阅读 · 1 评论 -
Linux之sed在指定字符上下前后添加内容
前:sed -i “/指定字符/要添加的内容&/” 要处理的文件后:sed -i “/指定字符/&要添加的内容/” 要处理的文件上:sed -i “/指定字符/i要添加的内容” 要处理的文件下:sed -i “/指定字符/a要添加的内容” 要处理的文件https://www.cnblogs.com/bulh/articles/11071783.htmlhttps://blog.csdn.net/sinat_31275315/article/details/103885065.原创 2021-02-24 08:07:57 · 1192 阅读 · 0 评论 -
Linux之shell自动安装Python3.6.8
mkdir -p /app/cd /app/wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xzxz -d /app/Python-3.6.8.tar.xztar -xf /app/Python-3.6.8.tarcd /app/Python-3.6.8/./configure --prefix=/app/python368make && make installcd ..rm -rf /app/P原创 2020-12-08 14:19:15 · 338 阅读 · 0 评论 -
Shell之自动安装elasticsearch代码实现V1版本
#!/bin/sh##############################################用法:source auto_deploy_elastic.sh ip node##Author: Quincy379############################################## 创建用户和用户组#set -eUsage(){ echo "Usage: source auto_deploy_elastic.sh ip1 ip2 ip3 node0原创 2020-11-02 15:02:04 · 429 阅读 · 5 评论 -
Linux 指定 configure --prefix=/ 作用
如果配置prefix,如:./configure --prefix=/usr/local/test可以把所有资源文件放在/usr/local/test的路径中,不会杂乱。Configure是一个可执行脚本,它有很多选项,在待安装的源码路径下使用命令./configure–help输出详细的选项列表。其中,prefix选项是配置安装的路径,如果不配置该选项,安装后可执行文件默认放在/usr/local/bin,库文件默认放在/usr/local/lib,配置文件默认放在/usr/local/etc,其它的资原创 2020-07-29 16:17:13 · 523 阅读 · 0 评论 -
Linux之定时自动清理释放内存脚本
#!/bin/bashmem_total=`free -m | awk 'NR==2' | awk '{print $2}'`mem_free=`free -m | awk 'NR==3' | awk '{print $4}'`mem_used=`free -m | grep Mem | awk '{print $3}'`if (($mem_used!=0));then mem_per=0`echo "scale=2; $mem_free/$mem_total" | bc` DATA原创 2020-06-29 13:26:19 · 1812 阅读 · 0 评论 -
Linux之循环查看一个命令的结果,解放双手
eval “while true;do ll |wc -l;echo “[root@sh-ty-app3 export]#”;sleep 2;done”Linux while command not found参考 https://unix.stackexchange.com/questions/193757/while-command-not-found原创 2020-06-29 10:55:14 · 620 阅读 · 0 评论 -
Linux之scp远程上传文件
scp -P 10022 ./要上传的文件 root@172.0.0.1:/optroot@172.0.0.1’s password:输入密码就可以了原创 2019-10-30 14:31:08 · 163 阅读 · 0 评论 -
Centos7 中查找文件、目录、内容
1、查找文件find / -name ‘filename’2、查找目录find / -name ‘path’ -type d3、查找内容find . | xargs grep -ri ‘content’//find . | xargs grep -ril ‘content’ 只显示文件名称参考文档:https://blog.csdn.net/hhhzua/article...原创 2018-10-15 17:20:29 · 35979 阅读 · 2 评论 -
Linux之auto-logout设置
vim /etc/profile,编辑profile文件,在最后面添加如下行:export TMOUT=60timed out waiting for input: auto-logout原创 2019-06-13 11:02:59 · 4197 阅读 · 0 评论 -
Linux 误修改etc/profile后导致所有命令都找不到的解决办法
今天一个指令搞崩了三台服务器,就是修改/etc/profile失败,#号变为>号,解决办法为进入linux单用户模式,重新修改/etc/profile,或者下面的方法:https://blog.csdn.net/superyu1992/article/details/79882092...原创 2019-03-15 17:12:40 · 2288 阅读 · 0 评论 -
Linux查看系统配置常用命令
linux CPU大小cat /proc/cpuinfo |grep “model name” && cat /proc/cpuinfo |grep “physical id”内存大小cat /proc/meminfo |grep MemTotal硬盘大小fdisk -l |grep Diskhttps://www.cnblogs.com/xuchunlin...原创 2018-12-26 15:56:27 · 541 阅读 · 0 评论 -
Shell中的$0、$1、$2的含义
在 shell 中我们会见到 $0、$1、$2这样的符号,这是什么意思呢? 简单来说 $0 就是你写的shell脚本本身的名字,$1 是你给你写的shell脚本传的第一个参数,$2 是你给你写的shell脚本传的第二个参数比如你新建了一个shell脚本 Test.sh, 内容如下:#!/bin/shecho "shell脚本本身的名字: $0"echo "传给shell的第一个参数: $1...原创 2018-11-22 14:16:36 · 1710 阅读 · 0 评论 -
/mnt/hgfs/下不显示共享文件夹的处理办法
root用户下执行:vmhgfs-fuse .host:/ /mnt/hgfs注意点不管你的共享文件夹名字是什么,直接复制上句就可以了,非常完美!以前还有个方法,很简单。比这个还要简单,怎么想都想不起来!笔记还是很重要的…...原创 2018-11-21 17:03:21 · 33825 阅读 · 31 评论 -
Celery之任务处于PENDING处理
1.问题描述:任务一直处于PENDING,重启redis不行!任务:1ead8f07-8f49-4ef2-9c8c-54a49d90d362 当前的 state 为:PENDING127.0.0.1 - - [19/Oct/2018 11:06:19] “GET /status/1ead8f07-8f49-4ef2-9c8c-54a49d90d362 HTTP/1.1” 200 -任务:0...原创 2018-10-19 11:18:34 · 4705 阅读 · 0 评论 -
Docker删除仓库中的镜像问题
很全了:https://segmentfault.com/q/1010000006127473原创 2018-10-16 11:28:06 · 5910 阅读 · 0 评论 -
Linux服务器的部分安全加固措施
chown root:root /etc/passwd /etc/shadow /etc/group /etc/gshadowchmod 0644 /etc/groupchmod 0644 /etc/passwdchmod 0400 /etc/shadowchmod 0400 /etc/gshadow编辑 /etc/ssh/sshd_config 文件以按如下方式设置参数(取消注释):...原创 2019-06-15 10:51:06 · 668 阅读 · 0 评论 -
no crontab for root - using an empty one
[root@xxx www.api.com]# crontab -eno crontab for root - using an empty onecrontab: installing new crontab一切正常,不用担心!原创 2019-06-15 13:23:37 · 8689 阅读 · 0 评论 -
CentOS7之CentOS7安装zabbix3.x(二)
接上篇:https://blog.csdn.net/qq_33733970/article/details/82017457 sudo make && make install更新数据库: updatedb配置zabbix_server文件 locate zabbix_server.conf locate mysql.sock egr...原创 2018-08-27 14:58:30 · 190 阅读 · 0 评论 -
Linux之安装Python3环境及Pip3
我只写步骤,具体的自己摸索:wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgztar -xzvf Python-3.6.0.tgzcd Python-3.6.0./configure --prefix=/usr/local/python3make && make installln -s /usr/...原创 2019-09-23 17:39:22 · 179 阅读 · 0 评论 -
Linux之删除软连接
[root@localhost bin]# ll |grep python3lrwxrwxrwx 1 root root 32 Sep 23 16:33 python3 -> /usr/local/python3.5/bin/python3[root@localhost bin]# ln -s /usr/local/python3.5/bin/python3.5 /us...原创 2019-09-23 16:45:35 · 1507 阅读 · 0 评论 -
Shell之删除某个路径下N前天的文件夹(时间命名)
文件夹以时间命名,比如20190917。具体处理见下:#!/bin/sh#rm -rf /var/spool/postfix/maildrop/*location="/data/tingyun/shared/data/application/export/"dt=`date +%Y%m%d -d "10 days ago"`for subdir in $(ls $location)...原创 2019-09-17 14:53:05 · 2007 阅读 · 2 评论 -
Linux之ROOT CA NOT INSTALLED YET
解决方案:所有的证书都藏在这里:/etc/pki/tls/certs/ca-bundle.crt我们只需要将生成的证书导入就可以了:cat 你生成的证书 >> /etc/pki/tls/certs/ca-bundle.crt注意:有的证书需要转化格式,转化链接见下参考:https://my.oschina.net/lemonzone2010/blog/467213...原创 2019-09-17 09:22:26 · 1182 阅读 · 0 评论 -
日志易之Agent统一IP地址开通多个端口
U盘落公司了,明天补充!原创 2019-09-15 16:35:24 · 426 阅读 · 0 评论 -
Linux之安装nodejs步骤
wget https://npm.taobao.org/mirrors/node/v12.10.0/node-v12.10.0-linux-x64.tar.xztar -xvf node-v12.10.0-linux-x64.tar.xzmv node-v12.10.0-linux-x64 nodejscd nodejs/cd bin/ln -s /root/nodejs/bin/no...原创 2019-09-15 11:32:10 · 616 阅读 · 0 评论 -
Python之检测文件变化并利用QQ邮箱发送消息代码(二)
直接上代码了:#!/usr/bin/env python# -*- coding=utf-8 -*-import smtplibfrom email.mime.text import MIMETextimport threadingimport time, datetimeimport pyinotifymailto_list = [""] # 里面是对方的邮箱# ----...原创 2019-06-21 13:40:03 · 675 阅读 · 0 评论 -
Celery定时任务之简单实现
Project Layout:celerybeat-schedule文件是自动生成的//celeryconfig.pyfrom datetime import timedeltaCELERYBEAT_SCHEDULE = { 'add': { 'task': 'tasks.add', 'schedule': timedelta(seconds...原创 2018-09-28 16:56:53 · 1777 阅读 · 0 评论 -
Rabbitmq和Celery结合使用
1. 正确安装rabbitmq-serverhttps://blog.csdn.net/qq_33733970/article/details/82881858[root@localhost ~]# rabbitmqctl add_user myuser mypasswordCreating user "myuser"[root@localhost ~]# rabbitmqctl add_...原创 2018-09-28 14:16:54 · 1315 阅读 · 0 评论 -
Python之win10 Exception: you need a C compiler to build uWSGI
参考资料: http://www.mamicode.com/info-detail-2294351.html https://blog.csdn.net/chunleixiahe/article/details/55666792 https://blog.csdn.net/pluschang/article/details/78312426?utm_source=debugrun&u...原创 2018-08-21 17:05:01 · 2876 阅读 · 0 评论 -
CentOS7之CentOS7安装zabbix3.x(一)
安装zabbix3.xrpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm yum install zabbix-server-mysql zabbix-web-mysql zabbix-get -y待续~原创 2018-08-24 14:17:52 · 677 阅读 · 0 评论 -
CentOS7之安装VMware tools,以及解决安装后/mnt/hgfs下没有共享文件的方法
1.首先查看设置的共享文件夹: vmware-hgfsclient shared_docs2.如果只使用一次共享文件夹: sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other3.第二步要使用每次都要挂载,那么终极杀器: vi /etc/fstab: 在最后添加一行: .host:/ ...原创 2018-08-24 13:42:15 · 4069 阅读 · 7 评论 -
CentOS7之不能联网解决办法
https://www.linuxidc.com/Linux/2018-04/151999.htm好用奥!原创 2018-08-24 11:18:41 · 515 阅读 · 0 评论 -
Linux安装VMware Tools
参考文档: https://blog.csdn.net/sweeper_freedoman/article/details/73848923最后记得重启生效! reboot原创 2018-08-23 13:16:26 · 658 阅读 · 0 评论 -
Zabbix server is not running:the information displayed may not be current
先看懂https://blog.csdn.net/dai451954706/article/details/16881069可能路径不同,先定位所要编辑的文件在哪个目录下 locate filename都改下就好了!主要原因是数据库建立时没设置密码造成的,解决方案大神已经给出!...原创 2018-08-27 16:40:45 · 782 阅读 · 0 评论 -
Linux命令简写和全称
su:Switch user 切换用户,切换到root用户 cat: Concatenate 串联 uname: Unix name 系统名称 df: Disk free 空余硬盘 du: Disk usage 硬盘使用率 chown: Change owner 改变所有者 chgrp: Change group 改变用户组 ps:Process Status 进程状态 ...原创 2018-08-23 10:09:10 · 2919 阅读 · 0 评论