paulwong

#

MAC软件与游戏

软件大全-1段:
http://pan.baidu.com/s/1pJNUp9h 提取密码:jgag
软件大全-2段:
http://pan.baidu.com/s/1c0vk14O 提取密码:nfy2
Adobe CC合集:
http://pan.baidu.com/s/1eQgToDs 提取密码:esrb
苹果字体大全:
http://pan.baidu.com/s/1kTytVKV 提取密码:6urk
苹果入门教程:
http://pan.baidu.com/s/1o6ukhxo 提取密码:k75v
苹果游戏大全:
http://pan.baidu.com/s/1o6r2sT8 提取密码:vycn

posted @ 2014-10-02 11:31 paulwong 阅读(995) | 评论 (0)编辑 收藏

用Kibana和logstash快速搭建实时日志查询、收集与分析系统

     摘要:   Logstash是一个完全开源的工具,他可以对你的日志进行收集、分析,并将其存储供以后使用(如,搜索),您可以使用它。说到搜索,logstash带有一个web界面,搜索和展示所有日志。kibana 也是一个开源和免费的工具,他可以帮助您汇总、分析和搜索重要数据日志并提供友好的web界面。他可以为 Logstash 和 ElasticSearch 提供的日志分析的 Web 界面说到这里...  阅读全文

posted @ 2014-09-30 13:14 paulwong 阅读(8577) | 评论 (0)编辑 收藏

linux系统:"ping: unknown host www.baidu.com"

"ping: unknown host www.baidu.com"
解决方案:

如果某台Linux服务器ping不通域名, 如下提示:

# ping www.baidu.com
ping: unknown host www.baidu.com

如果确定网络没问题的情况下, 可以通过如下步骤寻找解决办法:

1) 确定设置了域名服务器, 没有的话, 建议设置Google的公共DNS服务, 它应该不会出问题的

# cat /etc/resolv.conf
-------------------------------------------------------------------
nameserver 8.8.8.8
nameserver 8.8.4.4
-------------------------------------------------------------------

2) 确保网关已设置

# grep GATEWAY /etc/sysconfig/network-scripts/ifcfg*
-------------------------------------------------------------------
/etc/sysconfig/network-scripts/ifcfg-eth0:GATEWAY=192.168.40.1
-------------------------------------------------------------------

如果未设置, 则通过如下方式增加网关:

# route add default gw 192.168.40.1

或者手工编写/etc/sysconfig/network-scripts/ifcfg*文件后, 重启network服务:

# service network restart

3) 确保可用dns解析

# grep hosts /etc/nsswitch.conf
-------------------------------------------------------------------
hosts: files dns
-------------------------------------------------------------------

如果以上哪个有问题, 修正后, 再测试, 应该就没问题了:

#ping -c 3 www.baidu.com
PING www.a.shifen.com (220.181.6.175) 56(84) bytes of data.
64 bytes from 220.181.6.175: icmp_seq=0 ttl=50 time=9.51 ms
64 bytes from 220.181.6.175: icmp_seq=1 ttl=50 time=8.45 ms
64 bytes from 220.181.6.175: icmp_seq=2 ttl=50 time=8.97 ms
--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 8.450/8.977/9.511/0.446 ms, pipe 2 

posted @ 2014-09-30 13:01 paulwong 阅读(757) | 评论 (0)编辑 收藏

logstash最佳实践

0. 简介


1. 基础知识
1.1. 介绍
1.2. 安装
1.3. Hello World
1.4. 配置语法


2. 输入插件(Input)
2.1. 标准输入(Stdin)
2.2. 读取文件(File)
2.3. 读取网络数据(TCP)
2.4. 读取 Syslog 数据
2.5. 读取 Redis 数据


3. 编码插件(Codec)
3.1. 采用 JSON 编码
3.2. 合并多行数据(Multiline)


4. 过滤器插件(Filter)
4.1. Grok 正则捕获
4.2. 时间处理(Date)
4.3. 数据修改(Mutate)
4.4. GeoIP 查询归类
4.5. UserAgent 匹配归类
4.6. Key-Value 切分
4.7. 随心所欲的 Ruby 处理
4.8. 数值统计(Metrics)


5. 输出插件(Output)
5.1. 标准输出(Stdout)
5.2. 保存成文件(File)
5.3. 保存进 Elasticsearch
5.4. 输出到 Redis
5.5. 输出到 Statsd
5.6. 报警到 Nagios
5.7. 发送邮件(Email)
5.8. 调用命令执行(Exec)


6. 尚未进入官方库的常用插件
6.1. Kafka
6.2. HDFS
6.3. Scribe


7. 深入了解
7.1. 自己写一个插件
7.2. 为什么用 JRuby? 能用 MRI 运
7.3. 其他类似项目

posted @ 2014-09-30 11:24 paulwong 阅读(3726) | 评论 (0)编辑 收藏

50道外企软件测试面试题

  1. What types of documents would you need for QA, QC, and Testing?
  2. What did you include in a test plan?
  3. Describe any bug you remember.
  4. What is the purpose of the testing?
  5. What do you like (not like) in this job?
  6. What is quality assurance?
  7. What is the difference between QA and testing?
  8. How do you scope, organize, and execute a test project?
  9. What is the role of QA in a development project?
  10. What is the role of QA in a company that produces software?
  11. Define quality for me as you understand it
  12. Describe to me the difference between validation and verification.
  13. Describe to me what you see as a process. Not a particular process, just the basics of having a process.
  14. Describe to me when you would consider employing a failure mode and effect analysis.
  15. Describe to me the Software Development Life Cycle as you would define it.
  16. What are the properties of a good requirement?
  17. How do you differentiate the roles of Quality Assurance Manager and Project Manager?
  18. Tell me about any quality efforts you have overseen or implemented. Describe some of the challenges you faced and how you overcame them.
  19. How do you deal with environments that are hostile to quality change efforts?
  20. In general, how do you see automation fitting into the overall process of testing?
    How do you promote the concept of phase containment and defect prevention?
  21. If you come onboard, give me a general idea of what your first overall tasks will be as far as starting a quality effort.
  22. What kinds of testing have you done?
  23. Have you ever created a test plan?
  24. Have you ever written test cases or did you just execute those written by others?
  25. What did your base your test cases?
  26. How do you determine what to test?
  27. How do you decide when you have ‘tested enough?’
  28. How do you test if you have minimal or no documentation about the product?
  29. Describe me to the basic elements you put in a defect report?
  30. How do you perform regression testing?
  31. At what stage of the life cycle does testing begin in your opinion?
  32. How do you analyze your test results? What metrics do you try to provide?
  33. Realising you won’t be able to test everything – how do you decide what to test first?
  34. Where do you get your expected results?
  35. If automating – what is your process for determining what to automate and in what order?
  36. In the past, I have been asked to verbally start mapping out a test plan for a common situation, such as an ATM. The 36 interviewer might say, “Just thinking out loud, if you were tasked to test an ATM, what items might you test plan 37 include?” These type questions are not meant to be answered conclusively, but it is a good way for the interviewer to see 38 how you approach the task.
  37. If you’re given a program that will average student grades, what kinds of inputs would you use?
  38. Tell me about the best bug you ever found.
  39. What made you pick testing over another career?
  40. What is the exact difference between Integration & System testing, give me examples with your project.
  41. How did you go about testing a project?
  42. When should testing start in a project? Why?
  43. How do you go about testing a web application?
  44. Difference between Black & White box testing
  45. What is Configuration management? Tools used?
  46. What do you plan to become after say 2-5yrs (Ex: QA Manager, Why?)
  47. Would you like to work in a team or alone, why?
  48. Give me 5 strong & weak points of yours.

posted @ 2014-09-23 10:37 paulwong 阅读(301) | 评论 (0)编辑 收藏

如何原价预订IPHONE6

http://bbs.feng.com/read-htm-tid-8317256.html

posted @ 2014-09-22 22:32 paulwong 阅读(540) | 评论 (0)编辑 收藏

ElasticSearch 管理和监控 Elastic HQ

ElasticHQ 是一个具有良好体验、直观和功能强大的 ElasticSearch 的管理和监控工具。提供实时监控、全集群管理、搜索和查询,无需额外软件安装。

posted @ 2014-09-14 18:31 paulwong 阅读(981) | 评论 (0)编辑 收藏

Redis的Java客户端Jedis的八种调用方式(事务、管道、分布式)介绍

在这里对jedis关于事务、管道和分布式的调用方式做一个简单的介绍和对比:

一、普通同步方式

最简单和基础的调用方式,

@Test public void test1Normal() {     Jedis jedis = new Jedis("localhost");     long start = System.currentTimeMillis();     for (int i = 0; i < 100000; i++) {         String result = jedis.set("n" + i, "n" + i);     }     long end = System.currentTimeMillis();     System.out.println("Simple SET: " + ((end - start)/1000.0) + " seconds");     jedis.disconnect(); }

很简单吧,每次set之后都可以返回结果,标记是否成功。

二、事务方式(Transactions)

redis的事务很简单,他主要目的是保障,一个client发起的事务中的命令可以连续的执行,而中间不会插入其他client的命令。

看下面例子:

@Test public void test2Trans() {     Jedis jedis = new Jedis("localhost");     long start = System.currentTimeMillis();     Transaction tx = jedis.multi();     for (int i = 0; i < 100000; i++) {         tx.set("t" + i, "t" + i);     }     List<Object> results = tx.exec();     long end = System.currentTimeMillis();     System.out.println("Transaction SET: " + ((end - start)/1000.0) + " seconds");     jedis.disconnect(); }

我们调用jedis.watch(…)方法来监控key,如果调用后key值发生变化,则整个事务会执行失败。另外,事务中某个操作失败,并不会回滚其他操作。这一点需要注意。还有,我们可以使用discard()方法来取消事务。

三、管道(Pipelining)

有时,我们需要采用异步方式,一次发送多个指令,不同步等待其返回结果。这样可以取得非常好的执行效率。这就是管道,调用方法如下:

@Test public void test3Pipelined() {     Jedis jedis = new Jedis("localhost");     Pipeline pipeline = jedis.pipelined();     long start = System.currentTimeMillis();     for (int i = 0; i < 100000; i++) {         pipeline.set("p" + i, "p" + i);     }     List<Object> results = pipeline.syncAndReturnAll();     long end = System.currentTimeMillis();     System.out.println("Pipelined SET: " + ((end - start)/1000.0) + " seconds");     jedis.disconnect(); }

四、管道中调用事务

就Jedis提供的方法而言,是可以做到在管道中使用事务,其代码如下:

@Test public void test4combPipelineTrans() {     jedis = new Jedis("localhost");      long start = System.currentTimeMillis();     Pipeline pipeline = jedis.pipelined();     pipeline.multi();     for (int i = 0; i < 100000; i++) {         pipeline.set("" + i, "" + i);     }     pipeline.exec();     List<Object> results = pipeline.syncAndReturnAll();     long end = System.currentTimeMillis();     System.out.println("Pipelined transaction: " + ((end - start)/1000.0) + " seconds");     jedis.disconnect(); }

但是经测试(见本文后续部分),发现其效率和单独使用事务差不多,甚至还略微差点。

五、分布式直连同步调用

@Test public void test5shardNormal() {     List<JedisShardInfo> shards = Arrays.asList(             new JedisShardInfo("localhost",6379),             new JedisShardInfo("localhost",6380));      ShardedJedis sharding = new ShardedJedis(shards);      long start = System.currentTimeMillis();     for (int i = 0; i < 100000; i++) {         String result = sharding.set("sn" + i, "n" + i);     }     long end = System.currentTimeMillis();     System.out.println("Simple@Sharing SET: " + ((end - start)/1000.0) + " seconds");      sharding.disconnect(); }

这个是分布式直接连接,并且是同步调用,每步执行都返回执行结果。类似地,还有异步管道调用。

六、分布式直连异步调用

@Test public void test6shardpipelined() {     List<JedisShardInfo> shards = Arrays.asList(             new JedisShardInfo("localhost",6379),             new JedisShardInfo("localhost",6380));      ShardedJedis sharding = new ShardedJedis(shards);      ShardedJedisPipeline pipeline = sharding.pipelined();     long start = System.currentTimeMillis();     for (int i = 0; i < 100000; i++) {         pipeline.set("sp" + i, "p" + i);     }     List<Object> results = pipeline.syncAndReturnAll();     long end = System.currentTimeMillis();     System.out.println("Pipelined@Sharing SET: " + ((end - start)/1000.0) + " seconds");      sharding.disconnect(); }

七、分布式连接池同步调用

如果,你的分布式调用代码是运行在线程中,那么上面两个直连调用方式就不合适了,因为直连方式是非线程安全的,这个时候,你就必须选择连接池调用。

@Test public void test7shardSimplePool() {     List<JedisShardInfo> shards = Arrays.asList(             new JedisShardInfo("localhost",6379),             new JedisShardInfo("localhost",6380));      ShardedJedisPool pool = new ShardedJedisPool(new JedisPoolConfig(), shards);      ShardedJedis one = pool.getResource();      long start = System.currentTimeMillis();     for (int i = 0; i < 100000; i++) {         String result = one.set("spn" + i, "n" + i);     }     long end = System.currentTimeMillis();     pool.returnResource(one);     System.out.println("Simple@Pool SET: " + ((end - start)/1000.0) + " seconds");      pool.destroy(); }

上面是同步方式,当然还有异步方式。

八、分布式连接池异步调用

@Test public void test8shardPipelinedPool() {     List<JedisShardInfo> shards = Arrays.asList(             new JedisShardInfo("localhost",6379),             new JedisShardInfo("localhost",6380));      ShardedJedisPool pool = new ShardedJedisPool(new JedisPoolConfig(), shards);      ShardedJedis one = pool.getResource();      ShardedJedisPipeline pipeline = one.pipelined();      long start = System.currentTimeMillis();     for (int i = 0; i < 100000; i++) {         pipeline.set("sppn" + i, "n" + i);     }     List<Object> results = pipeline.syncAndReturnAll();     long end = System.currentTimeMillis();     pool.returnResource(one);     System.out.println("Pipelined@Pool SET: " + ((end - start)/1000.0) + " seconds");     pool.destroy(); }

九、需要注意的地方

  1. 事务和管道都是异步模式。在事务和管道中不能同步查询结果。比如下面两个调用,都是不允许的:

     Transaction tx = jedis.multi();  for (int i = 0; i < 100000; i++) {      tx.set("t" + i, "t" + i);  }  System.out.println(tx.get("t1000").get());  //不允许   List<Object> results = tx.exec();   …  …   Pipeline pipeline = jedis.pipelined();  long start = System.currentTimeMillis();  for (int i = 0; i < 100000; i++) {      pipeline.set("p" + i, "p" + i);  }  System.out.println(pipeline.get("p1000").get()); //不允许   List<Object> results = pipeline.syncAndReturnAll();
  2. 事务和管道都是异步的,个人感觉,在管道中再进行事务调用,没有必要,不如直接进行事务模式。

  3. 分布式中,连接池的性能比直连的性能略好(见后续测试部分)。

  4. 分布式调用中不支持事务。

    因为事务是在服务器端实现,而在分布式中,每批次的调用对象都可能访问不同的机器,所以,没法进行事务。

十、测试

运行上面的代码,进行测试,其结果如下:

Simple SET: 5.227 seconds  Transaction SET: 0.5 seconds Pipelined SET: 0.353 seconds Pipelined transaction: 0.509 seconds  Simple@Sharing SET: 5.289 seconds Pipelined@Sharing SET: 0.348 seconds  Simple@Pool SET: 5.039 seconds Pipelined@Pool SET: 0.401 seconds

另外,经测试分布式中用到的机器越多,调用会越慢。上面是2片,下面是5片:

Simple@Sharing SET: 5.494 seconds Pipelined@Sharing SET: 0.51 seconds Simple@Pool SET: 5.223 seconds Pipelined@Pool SET: 0.518 seconds

下面是10片:

Simple@Sharing SET: 5.9 seconds Pipelined@Sharing SET: 0.794 seconds Simple@Pool SET: 5.624 seconds Pipelined@Pool SET: 0.762 seconds

下面是100片:

Simple@Sharing SET: 14.055 seconds Pipelined@Sharing SET: 8.185 seconds Simple@Pool SET: 13.29 seconds Pipelined@Pool SET: 7.767 seconds

分布式中,连接池方式调用不但线程安全外,根据上面的测试数据,也可以看出连接池比直连的效率更好。

十一、完整的测试代码

package com.example.nosqlclient;  import java.util.Arrays; import java.util.List;  import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test;  import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.JedisShardInfo; import redis.clients.jedis.Pipeline; import redis.clients.jedis.ShardedJedis; import redis.clients.jedis.ShardedJedisPipeline; import redis.clients.jedis.ShardedJedisPool; import redis.clients.jedis.Transaction;  import org.junit.FixMethodOrder; import org.junit.runners.MethodSorters;  @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestJedis {      private static Jedis jedis;     private static ShardedJedis sharding;     private static ShardedJedisPool pool;      @BeforeClass     public static void setUpBeforeClass() throws Exception {         List<JedisShardInfo> shards = Arrays.asList(                 new JedisShardInfo("localhost",6379),                 new JedisShardInfo("localhost",6379)); //使用相同的ip:port,仅作测试           jedis = new Jedis("localhost");          sharding = new ShardedJedis(shards);          pool = new ShardedJedisPool(new JedisPoolConfig(), shards);     }      @AfterClass     public static void tearDownAfterClass() throws Exception {         jedis.disconnect();         sharding.disconnect();         pool.destroy();     }      @Test     public void test1Normal() {         long start = System.currentTimeMillis();         for (int i = 0; i < 100000; i++) {             String result = jedis.set("n" + i, "n" + i);         }         long end = System.currentTimeMillis();         System.out.println("Simple SET: " + ((end - start)/1000.0) + " seconds");     }      @Test     public void test2Trans() {         long start = System.currentTimeMillis();         Transaction tx = jedis.multi();         for (int i = 0; i < 100000; i++) {             tx.set("t" + i, "t" + i);         }         //System.out.println(tx.get("t1000").get());          List<Object> results = tx.exec();         long end = System.currentTimeMillis();         System.out.println("Transaction SET: " + ((end - start)/1000.0) + " seconds");     }      @Test     public void test3Pipelined() {         Pipeline pipeline = jedis.pipelined();         long start = System.currentTimeMillis();         for (int i = 0; i < 100000; i++) {             pipeline.set("p" + i, "p" + i);         }         //System.out.println(pipeline.get("p1000").get());         List<Object> results = pipeline.syncAndReturnAll();         long end = System.currentTimeMillis();         System.out.println("Pipelined SET: " + ((end - start)/1000.0) + " seconds");     }      @Test     public void test4combPipelineTrans() {         long start = System.currentTimeMillis();         Pipeline pipeline = jedis.pipelined();         pipeline.multi();         for (int i = 0; i < 100000; i++) {             pipeline.set("" + i, "" + i);         }         pipeline.exec();         List<Object> results = pipeline.syncAndReturnAll();         long end = System.currentTimeMillis();         System.out.println("Pipelined transaction: " + ((end - start)/1000.0) + " seconds");     }      @Test     public void test5shardNormal() {         long start = System.currentTimeMillis();         for (int i = 0; i < 100000; i++) {             String result = sharding.set("sn" + i, "n" + i);         }         long end = System.currentTimeMillis();         System.out.println("Simple@Sharing SET: " + ((end - start)/1000.0) + " seconds");     }      @Test     public void test6shardpipelined() {         ShardedJedisPipeline pipeline = sharding.pipelined();         long start = System.currentTimeMillis();         for (int i = 0; i < 100000; i++) {             pipeline.set("sp" + i, "p" + i);         }         List<Object> results = pipeline.syncAndReturnAll();         long end = System.currentTimeMillis();         System.out.println("Pipelined@Sharing SET: " + ((end - start)/1000.0) + " seconds");     }      @Test     public void test7shardSimplePool() {         ShardedJedis one = pool.getResource();          long start = System.currentTimeMillis();         for (int i = 0; i < 100000; i++) {             String result = one.set("spn" + i, "n" + i);         }         long end = System.currentTimeMillis();         pool.returnResource(one);         System.out.println("Simple@Pool SET: " + ((end - start)/1000.0) + " seconds");     }      @Test     public void test8shardPipelinedPool() {         ShardedJedis one = pool.getResource();          ShardedJedisPipeline pipeline = one.pipelined();          long start = System.currentTimeMillis();         for (int i = 0; i < 100000; i++) {             pipeline.set("sppn" + i, "n" + i);         }         List<Object> results = pipeline.syncAndReturnAll();         long end = System.currentTimeMillis();         pool.returnResource(one);         System.out.println("Pipelined@Pool SET: " + ((end - start)/1000.0) + " seconds");     } }

posted @ 2014-09-11 20:33 paulwong 阅读(461) | 评论 (0)编辑 收藏

logback logback.xml 常用配置详解

     摘要: 阅读背景: 您可能需要对log4j,sl4j 有一些初步的了解。阅读目的:深刻的理解logback的常用配置<Configuration> AND <logger>1 : 根节点<Configuration>包含的属性    一:<Configuration >包含的属性scan:当此属性设置为true时,配置...  阅读全文

posted @ 2014-09-11 08:53 paulwong 阅读(3478) | 评论 (0)编辑 收藏

为应用程序设计的 10 个超酷的图标集

1. Dryicons

Dryicons 提供总数 500 个图标和 1700 个向量图标。

 dryicons

2. Raindropmemory

这组图标是由 Raindropmemory 设计

raindropmemory

3. Glyphish

Glyphish 用于 iOS 应用的 Tab 条、导航条、表格等图标,也适用于其他手机平台。

glyphish

4. Application Icon Set

Application Icon Set 有 10 个蓝色图标设计,特别使用 Web 应用,使用 3D 的设计效果

Application-Icon-Set

5. Smashingmagazine

Smashingmagazine 是由 Smashing 杂志设计的图标集

smashingmagazine

6. Monofactor

Monofactor 包含 25 个可缩放的 Illustrator 格式的图标

monofactor

7. Sekkyumu

包含 105 个 32 x 32 的图标,主要用于工具栏

sekkyumu

8. Mini

Mini 包含 144 个 GIF 小图标

famfamfam

9. Androidicons

Androidicons 主要用于安卓的应用。

androidicons

10. Cute Blogging Icon Set

Cute Blogging Icon Set 是非常可爱的博客图标,可以让你的博客看起来很棒、专业而且有创意。

cute-blogging

via developerslane

posted @ 2014-09-09 10:22 paulwong 阅读(266) | 评论 (0)编辑 收藏

仅列出标题
共115页: First 上一页 45 46 47 48 49 50 51 52 53 下一页 Last