摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->package com.paul.ui;
import java.awt.BorderLayout;
import java.awt.Container;...
阅读全文
http://baike.baidu.com/view/3930.htm公有IP段:
A类IP地址 地址范围1.0.0.1-126.255.255.254
B类IP地址地址范围128.0.0.1-191.255.255.254
C类IP地址范围192.0.0.1-223.255.255.255
私有IP段:
A类 10. 0.0.0 -- 10.255.255.255
B类 172. 16.0.0 -- 172. 31.255.255
C类 192.168.0.0 -- 192.168.255.255
正则表达式(JAVA版):
(^127\\.0\\.0\\.1)|
(^10\\..*)|
(^172\\.1[6-9]\\..*)|
(^172\\.2[0-9]\\..*)|(^172\\.3[0-1]\\..*)|
(^192\\.168\\..*)
扫描程序:
使用技术
1、Services相关
Core Framework:Spring Framework 3.2。
Security Framework:Apache Shiro 1.2。
2、Web相关
MVC Framework:SpringMVC 3.2。
Layout Decoration:SiteMesh 2.4。
JavaScript Library:JQuery 1.9。
CSS Framework:Twitter Bootstrap 2.0.4。
JavaScript/CSS Compressor:YUI Compressor 2.4。
Front Validation:JQuery Validation Plugin 1.11。
3、Database相关
ORM Framework:Spring-Data-JPA 1.3、Hibernate 4.1。
Connection Pool:BoneCP 0.7
Bean Validation:Hibernate Validation 4.3.0。
Cache:Ehcache 2.6。
4、Tools 相关
Commons:Apache Commons
JSON Mapper:Jackson 2.1
Bean Mapper:Dozer 5.3.2
Full-text search:Hibernate Search 4.2(Apache Lucene 3.6)、IK Analyzer 2012_u6中文分词
Log Manager:Log4j 1.2
http://thinkgem.github.com/jeesite/
https://github.com/thinkgem/jeesite
在新节点安装好hadoop
把namenode的有关配置文件复制到该节点
修改masters和slaves文件,增加该节点
设置ssh免密码进出该节点
单独启动该节点上的datanode和tasktracker(hadoop-daemon.sh start datanode/tasktracker)
运行start-balancer.sh进行数据负载均衡
负载均衡:作用:当节点出现故障,或新增加节点时,数据块分布可能不均匀,负载均衡可以重新平衡各个datanode上数据块的分布
If you need 200ms for each of the 65536 ports (in the worst case, a firewall is blocking everything, thus making you hit your timeout for every single port), the maths is pretty simple: you need 13k seconds, or about 3 hours and a half.
You have 2 (non-exclusive) options to make it faster:
- reduce your timeout
- paralellize your code
Since the operation is I/O bound (in contrast to CPU bound -- that is, you spend time waiting for I/O, and not for some huge calculation to complete), you can use many, many threads. Try starting with 20. They would divide the 3 hours and a half among them, so the maximum expected time is about 10 minutes. Just remember that this will put pressure on the other side, ie, the scanned host will see huge network activity with "unreasonable" or "strange" patterns, making the scan extremely easy to detect.
The easiest way (ie, with minimal changes) is to use the ExecutorService and Future APIs:
@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
public static Future<Boolean> portIsOpen(final ExecutorService es, final String ip, final int port, final int timeout) {
return es.submit(new Callable<Boolean>() {
@Override public Boolean call() {
try {
Socket socket = new Socket();
socket.connect(new InetSocketAddress(ip, port), timeout);
socket.close();
return true;
} catch (Exception ex) {
return false;
}
}
});
}
Then, you can do something like:
public static void main(
final String

args) {
final ExecutorService es = Executors.newFixedThreadPool(20);
final String ip = "127.0.0.1";
final int timeout = 200;
final List<Future<Boolean>> futures =
new ArrayList<>();
for (
int port = 1; port <= 65535; port++) {
futures.add(portIsOpen(es, ip, port, timeout));
}
es.shutdown();
int openPorts = 0;
for (
final Future<Boolean> f : futures) {
if (f.get()) {
openPorts++;
}
}
System.out.println("There are " + openPorts + " open ports on host " + ip + " (probed with a timeout of " + timeout + "ms)");
}
If you need to know which ports are open (and not just how many, as in the above example), you'd need to change the return type of the function to Future<SomethingElse>, where SomethingElse would hold the port and the result of the scan, something like:
public final class ScanResult {
private final int port;
private final boolean isOpen;
// constructor
// getters
}
Then, change Boolean to ScanResult in the first snippet, and return new ScanResult(port, true) or new ScanResult(port, false) instead of just true or false
Exercise 1 Web site Development
Using Microsoft Project 2007 (can be downloaded from internet)
A nonprofit organization would like to lead a website development project. The organization has internet access that includes space on a web server, but no experience in developing websites. In addition to creating its website, the organization would like you to train two people on its staff to do simple web page updates. The website should include the following information, as a minimum: description of the organization (mission, history, and recent events), list of services, and contact information. the organization wants the website to include graphics( photographs and other images) and have an attractive, easy way to use layout.
1- Project Scope Management: create a WBS for this project and enter the tasks in project 2007. Create milestones and summary tasks. Assume that some of the project management tasks are similar to tasks from the project tracking database project. some of the specific anaylsis, design, and implementation tasks will do:
a) collect information on the organization in hardcopy and digital form( brochures, reports, organization charts)
b) research web site of similar organization
c) collect detailed information about customer's design preferences
d) develop a template for the customer to review (background color of pages, layout of text)
e) create a site map or hierarchy chart showing the flow of website
2- Project Time Management:
a) enter realistic duration for each task, and then link the tasks
b) do Gantt Chart view and Network Diagram View for the project
c) do schedule table to see key dates and slack times for each task.
3- Project Cost Management
a) assume you have three people working on project and each of them would charge $20 per hour. Enter this information in the Resource Sheet.
b) estimate that each person will spend an average of about five hours per week for the four month period. Assign resources to the tasks, and try to make the final cost in line with this estimate
c) do a budget report for your project
4- Project Human Resource Management
a) assume that one project team member will be unavailable due to vacation for two weeks in the middle of the project. Make adjustments to accommodate this vacation so that the schedule does not slip and the costs do not change. Document the changes from the original plan and the new plan.
b) use the Resource Usage view to see each person's work each month. Print a copy of the Resource Usage view.
5- Project Communications Management
a) do a Gantt chart for this project. use a time scale that enables that chart to fit on one page. and the copy and paste it to PowerPoint
b) do a TO DO LIST report for each team member
c) Create a WHO DOES WHAT REPORT
** Write a two page single spaced paper summarizing what do you think about Microsoft Project. What do you like and What do you dislike about it. Do you think it would be useful for managing all project or just some and which ones.