Atitit atiMail atiDns新特性 v2 q39
Atitit atiMail atiDns新特性 v2 q39
V1 实现了基础的功能
V2 重构..使用自然语言的方式
c.According_to_the_domain_name("chinanetcenter.com").query_MX_records().outputAsJson().print();
其他的计划
V3 高的性能重构..lambda框架
作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙, EMAIL:1466519819@qq.com
转载请注明来源: http://www.cnblogs.com/attilax/
package com.attilax.lang.mail;
public class MxScannerGui {
public static void main(String[] args) {
MxScanner c=new MxScanner();
c.According_to_the_domain_name("chinanetcenter.com").query_MX_records().outputAsJson().print();
}
}
package com.attilax.lang.mail;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.attilax.io.filex;
import com.attilax.io.pathx;
import com.attilax.json.AtiJson;
import com.attilax.lang.CmdX;
/**
* com.attilax.lang.mail.MxScanner
* @author Administrator
*
*/
public class MxScanner {
public static void main(String[] args) throws IOException {
String f = pathx.classPathParent()+"\\dom.txt";
//args[0].trim();
String dir =pathx.classPathParent()+"\\result.txt";
//+ " args[1].trim();
List<String> domains = filex.read2list(f);
filex fx = new filex(dir);
for (String dom : domains) {
try {
String cmd = "nslookup -qt=mx 163.com";
cmd = cmd.replaceAll("163.com", dom);
String t = CmdX.exec(cmd);
List<String> mxs = getMxs(t);
for (String mx : mxs) {
String lin_new=dom+"----"+mx;
fx.appendLine_flush_safe(lin_new);
}
System.out.println(t);
} catch (Exception e) {
e.printStackTrace();
}
}
fx.close();
System.out.println("--f");
}
private static List<String> getMxs(String lookupAfterRetTxt) {
List<String> mxs = new ArrayList<String>();
String[] lines = lookupAfterRetTxt.split("\n");
for (String line : lines) {
try {
if (line.contains("MX preference")
&& line.contains("mail exchanger")) {
String[] a = line.split("=");
String mx = a[a.length - 1].trim();
mxs.add(mx);
}
} catch (Exception e) {
e.printStackTrace();
}
}
return mxs;
}
String domain;
public MxScanner According_to_the_domain_name(String string) {
domain=string;
return this;
}
public MxScanner query_MX_records() {
query_MX_records(this.domain);
return this;
}
private MxScanner query_MX_records(String domain2) {
String cmd = "nslookup -qt=mx 163.com";
cmd = cmd.replaceAll("163.com", domain2);
String t = CmdX.exec(cmd);
List<String> mxs = getMxs(t);
rzt=mxs;
return this;
}
Object rzt;
Object final_rzt;
public MxScanner outputAsJson() {
final_rzt= AtiJson.toJson(rzt);
return this;
}
public void print() {
System.out.println(this.final_rzt);
}
}
Atitit atiMail atiDns新特性 v2 q39的更多相关文章
- Atitit.aticmd v4 新特性q39 添加定时器释放功能
Atitit.aticmd v4 新特性q39 添加定时器释放功能 V1 实现兰cmd V2 标准输入,标准输出,标准错误与重新定向 V3 stdout stderr统一重新定向 V4 添加定 ...
- Atitit opencv版本新特性attilax总结
Atitit opencv版本新特性attilax总结 1.1. :OpenCV 3.0 发布,史上功能最全,速度最快的版1 1.2. 应用领域2 1.3. OPENCV2.4.3改进 2.4.2就有 ...
- Atitit s2018 s3 doc list alldvc.docx .docx s2018 s3f doc compc s2018 s3f doc homepc sum doc dvcCompc dtS312 s2018 s3f doc compc\Atitit PathUtil 工具新特性新版本 v8 s312.docx s2018 s3f doc compc\Atitit 操作日
Atitit s2018 s3 doc list alldvc.docx .docx s2018 s3f doc compc s2018 s3f doc homepc sum doc dvcCompc ...
- Atitit.cateService分类管理新特性与设计文档说明v1
Atitit.cateService分类管理新特性与设计文档说明v1 1. V2 新特性规划1 2. 分类管理1 3. 分类增加与修改维护2 4. Js控件分类数据绑定2 1. V2 新特性规划 增加 ...
- Atitit.linux 内核 新特性 新功能
Atitit.linux 内核 新特性 新功能 1. Linux 3.2内核新特性 2012-02-12 22:41:471 1.1. EXT4:支持更大的块2 1.2. BTRFS:更快的数据清理 ...
- Atitit.jquery 版本号新特性attilax总结
Atitit.jquery 版本号新特性attilax总结 1. Jq1.4 1 2. 1.5 1 3. 1.6 3 4. Jq1.7 3 ⒉提升了事件委派时的性能有了大幅度的提升.尤其是在ie7下: ...
- Atitit html5.1 新特性attilax总结
Atitit html5.1 新特性attilax总结 9. 嵌入 header 和 footer1 7. 校验表单1 6. 浏览器的上下文菜单2 1. 响应式图像2 Attilax觉得还不错的心特性 ...
- Atitit.jquery 版本新特性attilax总结
Atitit.jquery 版本新特性attilax总结 1. Jq1.4 1 2. 1.5 1 3. 1.6 3 4. Jq1.7 3 ⒉提升了事件委派时的性能有了大幅度的提升,尤其是在ie7下: ...
- Atitit. c# 语法新特性 c#2.0 3.0 4.0 4.5 5.0 6.0 attilax总结
Atitit. c# 语法新特性 c#2.0 3.0 4.0 4.5 5.0 6.0 attilax总结 1.1. C# 1.0-纯粹的面向对象 1.2. C# 2.0-泛型编程新概念 1.3. ...
随机推荐
- [BZOJ3205][APIO2013]Robot(斯坦纳树)
3205: [Apio2013]机器人 Time Limit: 15 Sec Memory Limit: 128 MBSubmit: 1007 Solved: 240[Submit][Status ...
- [CF460E]Roland and Rose
题意:给定$n$和$r$,要找$n$个整点,使得他们两两距离的平方和最大,并且所有点到原点的距离必须小于$r$ 很容易猜到答案在凸包上然后暴力找,但证明还是挺妙的 首先转化一下距离平方和 令$\vec ...
- 1.4(学习笔记)JSP自定义标签
一.JSP自定义标签 JSP自定义标签,可以通过实现Tag接口.继承TagSupport类来设置标签功能. 后续通过配置文件将标签和具体的实现类关联. 二.自定义第一个标签(实现Tag接口) 自定义标 ...
- [Hybrid App]--Android混合开发,Android、Js的交互
AndroidJs通信 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !imp ...
- 阿里云(ECS)Linux客户端SSH会话连接超时OperationTimedOut
问题描述:使用SecureCRT等SSH客户端连接Linux服务器时,提示Operation timed out. 问题原因:SSH服务未配置或注释掉向SSH客户端连接会话发送频率和时间. 解决方法: ...
- 记录一次Elasticsearch线上部署后出现:org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []的问题解决
说明:ES部署了3个节点,而一般情况只要这三个节点的IP其中一个都可以连接,Web端口使用的是9500,Client连接使用的是9600,调用程序使用了ES原生Client进行连接. 解决方法: 1. ...
- 使用UNetbootin工具制作的CentOS 6.9镜像U盘在启动安装过程中出现:unable to read package metadata.this may be due to a missing repodata directory
1.制作: 2.重命名文件 (前) (后) 这些文件是拷贝另一个得来的,并且后面的命名是根据repomd.xm这个文件来的. 参考: http://blog.csdn.net/maijunjin/ar ...
- 启用多处理器编译--加快VS2013编译
依次打开项目“属性“==>”配置属性“==>”C/C++(或其它语言)“==>”常规“,最后一项,多处理器编译选择是. 官方解释如下: /MP 选项在命令行上以减少总时间编译源文件. ...
- [转] C/C++中printf和C++中cout的输出格式
原文地址 一. Printf 输出格式 C中格式字符串的一般形式为: %[标志][输出最小宽度][.精度][长度]类型,其中方括号[]中的项为可选项.各项的意义介绍如下:1.类型类型字符用以表示输出数 ...
- SVN安装中遇到的问题
新的版本:1.9.5 必须使用Apache Portable Runtime Utility 1.5.4 Released没有安装的话需要先安装 需要安装apr.apr-util sqlite zli ...