sendmail

Shell脚本日志关键字监控+告警

若如初见. 提交于 2020-04-24 02:07:41
  最近小张的爬虫程序越来越多,可当爬虫程序报错,不能及时的发现,从而造成某些重要信息不能及时获取的问题,更有甚者,遭到领导的批评。于是就在想有没有一种方法,当爬取信息报错的时候,可以通过邮件或者短信的方式及时通知小张呢,于是我进行相关搜索,还真让我找到了^_^。 为了避免大家踩坑,以下为自己亲测,其中出现了一些bug的相关解决方法我已做说明,文章最后有我的源代码。 该程序使用场景说明:主要用于Linux服务器爬虫程序日志监控,如出现关键字异常则触发相应的动作或告警操作,通知到邮件联系人,让你及时了解到爬虫程序是否正常爬取,也可用于服务器重要日志的监控 。 一、安装邮件服务 安装邮件服务之前首先停用系统自带的邮件服务 systemctl stop sendmail systemctl disable sendmail systemctl stop postfix systemctl disbale postfix 然后下载mailx,下载地址: http: // www.linuxfromscratch.org/blfs/view/7.6/basicnet/mailx.html 1、解压 tar -jxf mailx-12.4.tar.bz2 -C /usr/src/ && cd /usr/src/mailx-12.4/ 如果报错 tar (child): lbzip2:

网络安全类别划分——网络信息采集(端口扫描、漏洞扫描、网络窃听)、拒绝服务攻击、漏洞攻击

懵懂的女人 提交于 2020-04-13 17:34:43
【今日推荐】:为什么一到面试就懵逼!>>> 攻击技术是信息安全所面临的主要威胁,是信息安全工作者要应对的主要问题之一。了解攻击的技术路线,攻击的主要原理、手段、方法和途径,对于发现信息安全漏洞、采取安全应对措施、制定安全防护策略有重要的指导意义。 1.网络信息采集 (1)常用的信息采集命令常用的信息采集命令有ping、host、traceroute、nbtstat、net、finger、nslookup等,这些命令被网络安全工作者和攻击者所使用,用来获取目标网络基本信息。 (2)漏洞扫描漏洞扫描是指通过检测目标网络设备和主机系统中存在的安全问题,发现和分析可以被攻击者利用的漏洞。堆栈指纹技术是利用不同操作系统在处理TCP/IP时存在的微小差异来查看网络中主机操作系统的主要手段。 (3)端口扫描攻击者通过扫描众所周知的端口和常用的端口,发现目标网络开放的端口以及相应端口上提供的服务。常用的端口扫描技术有TCP端口扫描、TCPSYN扫描、TCPFIN扫描、NULL扫描、Xmastree扫描、UDP扫描等。 (4)网络窃听以太网的工作机制使得通过将网卡设置成混杂模式,就可以探听并记录下同一网段上所有的数据包。网络窃听具有较好的隐蔽性和较大的危害性。无线网络通信有更多的漏洞。 (5)典型信息采集工具本章列举了典型的信息采集工具:nmap扫描器、AxcetNetRecon扫描器

PHP mail function (2)

血红的双手。 提交于 2020-04-11 11:48:45
问题 Hi I am using php mail function to send mails from my contact section. But the mails are not geting me. If i use gmail id its working but if I use any other email ids like hr@sbnphpjobs.com not geting. 回答1: It's better to use PHPMailer or Swift Mailer in combination with a smtp server (e.g. gmail). Mail send from php (mail()) is often seen as spam by a lot of spamfilters... 回答2: Your smtp server might only send email to a white list of domain name. I had the same issue with a customer smtp.

java生成和识别二维码

雨燕双飞 提交于 2020-04-10 08:15:45
全栈工程师开发手册 (作者:栾鹏) java教程全解 本文使用两种方式生成和识别二维码。 方法1:使用日本公司的qrcode 需要引入的包 qrcode_swetake.jar qrcode.jar 测试代码 public static void main(String[] args){ Mail sendmail = new Mail(); sendmail.setHost("smtp.163.com"); sendmail.setUserName("aaaaaaaaa@163.com"); sendmail.setPassWord("aaaaaaaaa"); sendmail.setTo("aaaaaaaaa@163.com"); sendmail.setFrom("aaaaaaaaa@163.com"); sendmail.setSubject("你好,这是测试!"); sendmail.setContent("你好这是一个带多附件的测试!"); //Mail sendmail = new Mail("aaaaaaaaa@163.com","aaaaaaaaa@163.com","smtp.163.com","aaaaaaaaa","aaaaaaaaa","你好","胃,你好吗?"); sendmail.attachfile("D:\\test.jpg"); sendmail

How do I use MVC model binding to get data from SendGrid Inbound Parse Webhook in Asp.net MVC?

我的未来我决定 提交于 2020-04-10 06:33:11
问题 I am looking at implementing the SendMail Inbound Parse Webhook but have found that the examples they provide seem to fall a long way short of a perfect solution. https://sendgrid.com/docs/Code_Examples/Webhook_Examples/csharp.html#-Parse-Webhook [HttpPost] public async Task<HttpResponseMessage> Post() { var root = HttpContext.Current.Server.MapPath("~/App_Data"); var provider = new MultipartFormDataStreamProvider(root); await Request.Content.ReadAsMultipartAsync(provider); var email = new

How do I use MVC model binding to get data from SendGrid Inbound Parse Webhook in Asp.net MVC?

生来就可爱ヽ(ⅴ<●) 提交于 2020-04-10 06:33:07
问题 I am looking at implementing the SendMail Inbound Parse Webhook but have found that the examples they provide seem to fall a long way short of a perfect solution. https://sendgrid.com/docs/Code_Examples/Webhook_Examples/csharp.html#-Parse-Webhook [HttpPost] public async Task<HttpResponseMessage> Post() { var root = HttpContext.Current.Server.MapPath("~/App_Data"); var provider = new MultipartFormDataStreamProvider(root); await Request.Content.ReadAsMultipartAsync(provider); var email = new

Embedding an image in an email using linux commands

流过昼夜 提交于 2020-04-05 17:58:21
问题 Is there a way to embed images into the body of an email using linux commands like mutt or sendmail ? I used this mutt -e 'set content_type="text/image"' \ u.mohan@6dtech.co.in -s "TEST" \ -i image001.jpg < data.txt but it's not working. 回答1: I have written a shell script to send with mutt an HTML message with embedded images rather than linked ones. Several steps: download all image files linked by <img> tags in the original HTML, prepare the HTML file by changing the src url to a cid ,

mysql主从同步

我怕爱的太早我们不能终老 提交于 2020-03-23 15:55:12
3 月,跳不动了?>>> #!/bin/bash . /etc/rc.d/init.d/functions if [ $# -ne 0 ];then echo "Usage:sh `basename $0`" exit 1 fi #MASTER VARIABLES #binlog-do-db=yiishop 设置复制的数据库 MASTER_USER=root MASTER_PASS="Qwe#663745721" MASTER_PORT=3306 MASTER_IP="172.18.47.44" REP_USER='slave' REP_PWD='Qwe#663745721' #SLAVE VARIABLES SLAVE_USER=root SLAVE_PASS="Qwe#663745721" SLAVE_PORT=3306 SLAVE_IP="172.18.47.43" #启用多线程 WORKERS=0 MASTER_DATA_PATH=/data/backup MASTER_STATUS_FILE=${MASTER_DATA_PATH}/mysqllogs_`date +%F`.log MASTER_DATA_FILE=${MASTER_DATA_PATH}/mysql_backup_`date +%F`.sql.gz MYSQL_DIR=/usr/bin #指定数据库 -

linux就该这么学-部署邮件系统

非 Y 不嫁゛ 提交于 2020-03-22 19:43:55
3 月,跳不动了?>>> 发件服务程序:Postfix服务程序,基于SMTP(simple mail transfer protocol ,简单邮件传输服务),占用25/TCP端口。 收件服务程序:Devecot服务程序,基于POP3(Post Office Protocol 3,邮局协议版本3),占用110/TCP端口。 RHEL5和RHEL6中的发件服务是sendmail,而RHEL 7中为Postfix。 部署POSTFIX 1.配置服务器主机名称 2.关闭防火墙 3.配置DNS服务,将listen-on port 53 和allow-query改为any 4.配置区域配置文件 5.配置数据配置文件 6.将服务器的DNS地址修改为本地IP地址,并重启网络服务。 7.编辑postfix主配置文件 /etc/postfix/main.cf 添加如下内容 myhostname=mail.abc.com mydomain=abc.com myorigin=$mydomain 来源: oschina 链接: https://my.oschina.net/u/4312865/blog/3208361

Sending Emails to unique people from a column

爱⌒轻易说出口 提交于 2020-03-05 04:04:09
问题 I have a TABLE with list of people and their names and a condition(Y/N) column. Column 1 Column 2 Column 3 (Name) (Email) (Condition Y/N) I want to send emails to all people in the TABLE whose name matches with the unique values (name) in one of the columns in Sheet 1. So I want something that looks up the column in Sheet 1 and maybe changes the Condition to Y (in Column 3) in the TABLE, for all unique names found in that Column (Column D) in Sheet 1.(I can FILTER my TABLE in POWER QUERY to