ITeye博客

hedajia的博客

hedajia · 共 10 篇文章

Memcached 命令行常用命令

通过telnet以命令行的方式访问memcached服务器: telnet host port.eg:telnet 127.0.0.1 11211 退出memcached命令行: quit 3.查看memcached实例的状态:.stats 查看slab: stats slabs 查看item:stats items 查看slab中存储的items:stats cachedump . eg:stats cachedump 1 0

2016-04-13 12:11 · memcached · 评论(0)

linux 常用命令收集(持续更新)

记录下工作中常用的linux命令。 查询某个进程的运行时间:ps -o %t -p pid 复制所有文件:(cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xpvf -) 按连接数查看客户端IP:netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr 查找特定日志文件中的关键字。例如:查询service.log中的warning日志:find . -name 'service.log' | xargs grep -i …

2015-05-30 17:52 · linux · 评论(0)

Linux sort 命令(转载)

本周在写ftp数据同步脚本的时候,查找资料,发现一篇写sort的blog写得很赞,收获很大。 地址为: http://roclinux.cn/?p=1472 版权属原作者,也在此表示感谢。

2015-05-30 13:48 · linux · 评论(0)

如何查看linux系统的发行版(distribution)和版本

查看linux的发行版(RedHat、ubuntu、suse...)及版本号的方法: lsb_release -a cat /etc/issue uname -a cat /proc/version

2015-05-16 10:33 · linux · 评论(0)

Junit参数化测试报No tests found Matching Methed

今天在用Junit进行单元测试的时候,遇到一个诡异的问题。测试代码如下: Java类:Calculate.java public class Calculate { public int sum(int var1, int var2) { System.out.println("Adding values " + var1 + " + " + var2); return var1 + var2; } public int subtract(int var1,int var2){ System.out.println("Subtract values "+ var1+" - "+ var2);…

2015-05-04 21:09 · java · junit · 评论(0)

ubuntu安装memcache及基本命令使用

一、Memcache介绍 memcache是一款高性能、分布式的内存对象缓存系统。最初用于通过减轻数据库的负载来提升动态web应用程序的性能。详细介绍可参考官网:http://memcached.org/ 目前工作中使用的memcache是公司的memcache集群,通过xmemcached(memcache客户端的java实现之一)和memcache集群交互。今天在自己的机器上试着安装和使用memcache,记录如下。 二、环境 操作系统:Ubuntu 14.04.1 三、步骤 1、因为memcache依赖于libevent,所以要先安装libevent: apt-get install …

2015-04-11 14:00 · 评论(0)

Python String Operation Basics

First of all,python strings can not be changed,because they are immutable. String escape 'Isn\'t,he said' "Isn\"t,he said" more readable string print("Isn\"t,he said") do not want to escape print(r'C:some\name') String concatenating "py" + "pyon" "py" "pyon" #works prefix="py" prefix "thon" #does't…

2014-07-03 21:37 · python · 评论(0)

Javascript Array (from javascript:the good parts)

Confusion A common error in JavaScript programs is to use an object when an array is required or an array when an object is required. The rule is simple: when the property names are small sequential integers, you should use an array. Otherwise, use an object. how to distinguish between arrays and o…

2014-06-18 22:31 · javascript · 评论(0)

Adapter

Adapter Intent Convert the interface of a class into another interface that clients expect.Adatper let classes work together that couldn't otherwise because of incompatible interfaces. Applicability Use Adapter pattern when 1)you want to use an existing class,and its interface does not match what y…

2013-04-20 09:35 · java · 设计模式 · 评论(0)

策略模式

Strategy pattern Definition: The strategy pattern defines a family of algorithms,encapsulate each one,and makes them interchangeable.Strategy lets the algorithm vary independently from clients that use it.Whereby an algorithm's behaviour can be selected at runtime. Intent Encapsulate what varys,and…

2013-04-05 20:17 · java · 设计模式 · 评论(0)