#
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\\..*)
扫描程序:
相同点:
都是使用到QUEUE。
不同点:
JMS的QUEUE中放的是数据,也即是当数据来的时候还要去调用其他代码去执行
使用技术
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.
标志一、只会踏踏实实地做具体的工作
踏踏实实地做具体工作,这没有错。但只会这样那错就大了,因为这永远只是新手的方式,仅靠这个,永远也成不了高手。甘心一辈子本本分分只当个菜鸟,到头来,肯定连菜鸟也做不成,现在的职场,逆水行舟,原地不动,早晚被浪打翻。
标志二、不会踏踏实实地工作
年轻人喜欢幻想,本身也没错。但若是一天到晚光幻想,那就麻烦了。脱离了现实,好高骛远,白日做梦,眼高手低……漫步云端的感觉是不错,但梦醒时分,从云上跌落粉身碎骨的时候,就追悔莫及了。
标志三、瞧不起上司
受过高等教育的人都清高,别人不如自己的地方很容易放在眼里,并嗤之以鼻,尤其是对领导。让不如自己的人来领导自己,实在不公平。但是,领导之所以是领导,就有原因,不管合理不合理都存在了。也许他学识不行,也许能力不行,但他赢可能就赢在关系上了,可能就赢在心机上了,好的也好,坏的也罢,都是实实在在存在的现象。
标志四、崇拜上司
相比起刚才的这种行为,对上司盲目崇拜,则更显得幼稚。对上司的话全盘接受,无条件服从,缺乏了起码的分析能力,最终会让你在职场中迷失自我。
标志五、容易被激发、被感动、被忽悠
有些人比较感性,我本人也是这样。对于领导一些比较有煽动性东西,难以抵制,很容易用头脑发热。但无论如何,事后一定要冷静思索思索,站在不同的角度来考虑考虑问题,切莫一时意气用事。
标志六、甘当云梯默默无闻
甘当云梯,默默无闻,这本是一种很高尚的情怀。在如今更是难得。但难得归难得,天不佑此类人,生活不助此类人,时代更是难容此类人。对这种人,只能说,老兄,别那么单纯了。
标志七、习惯忍让
喜欢争斗的人让人厌恶,但现在的职场上,也只是这种人才得势。人善被人欺,习惯忍让,别人会觉得你好欺负,这已经成为现在职场上的一种思维定势了。谁也打不破它。
标志八、锋芒毕露
有人则相反,不忍不让,锋芒毕露。这也不好,这样会树敌太多,而且太容易让人看透,很容易中了别人的招儿。适当的时候露露锋芒,展示一下自己的立场就可以了,大多数的情况,还是应该韬光养晦的。
标志九、排斥关系
近几年来,新兴起一门学问,叫做关系学。这里面学问可大了,大到关系职场中的方方面面。可有人就是排斥它,认为靠自己的打拚就已经足够了。其实,职场不比学术,不是把自己关在实验室里就能出成果的,闭门造车,最终自食苦果。
标志十、知无不言言无不真
对别人什么都说,而且什么话都说真的,这很诚实,但太不成熟了。职场上混,就跟下棋一样,尽可能地对方的心理,而不是尽可能地让别人了解自己的心理。道理很浅显。