魏长东

weichangdong

正在查看: 2016年03月日志归档(第 1 页 / 共 11 篇)

show proceslist结果过滤

排除mysql问题,离不了show processlist 或者show full processlist。

但是这个返回的数据好多好多,通过下面的方法,可以带where条件过滤你想要的。

SELECT user,host,time,command,time,Info FROM information_schema.processlist WHERE user = 'wcd' 
and state !=''
and  Info like  '%table_name_test%';

CSS颜色代码大全

FFFFFF #DDDDDD #AAAAAA #888888 #666666 #444444 #000000
#FFB7DD #FF88C2 #FF44AA  #FF0088  #C10066  #A20055  #8C0044 
#FFCCCC #FF8888 #FF3333  #FF0000  #CC0000  #AA0000  #880000 
#FFC8B4 #FFA488 #FF7744  #FF5511  #E63F00  #C63300  #A42D00 
#FFDDAA #FFBB66 #FFAA33 #FF8800  #EE7700  #CC6600  #BB5500 
#FFEE99 #FFDD55 #FFCC22 #FFBB00  #DDAA00  #AA7700  #886600 
#FFFFBB #FFFF77 #FFFF33 #FFFF00 #EEEE00 #BBBB00 #888800
#EEFFBB #DDFF77 #CCFF33 #BBFF00 #99DD00 #88AA00 #668800
#CCFF99 #BBFF66 #99FF33 #77FF00 #66DD00 #55AA00 #227700
#99FF99 #66FF66 #33FF33 #00FF00 #00DD00 #00AA00 #008800
#BBFFEE #77FFCC #33FFAA #00FF99 #00DD77 #00AA55 #008844
#AAFFEE #77FFEE #33FFDD #00FFCC #00DDAA #00AA88 #008866
#99FFFF #66FFFF #33FFFF #00FFFF #00DDDD #00AAAA #008888
#CCEEFF #77DDFF #33CCFF #00BBFF #009FCC #0088A8 #007799
#CCDDFF #99BBFF #5599FF #0066FF  #0044BB  #003C9D  #003377 
#CCCCFF #9999FF #5555FF  #0000FF  #0000CC  #0000AA  #000088 
#CCBBFF #9F88FF #7744FF  #5500FF  #4400CC  #2200AA  #220088 
#D1BBFF #B088FF #9955FF  #7700FF  #5500DD  #4400B3  #3A0088 
#E8CCFF #D28EFF #B94FFF  #9900FF  #7700BB  #66009D  #550088 
#F0BBFF #E38EFF #E93EFF  #CC00FF  #A500CC  #7A0099  #660077 
#FFB3FF #FF77FF #FF3EFF  #FF0 0FF  #CC00CC  #990099  #770077 

 

»»阅读全文

Redis命令和调优

 吞吐量

Redis提供的INFO命令不仅能够查看实时的吞吐量(ops/sec),还能看到一些有用的运行时信息。下面用grep过滤出一些比较重要的实时信息,比如已连接的和在阻塞的客户端、已用内存、拒绝连接、实时的tps和数据流量等:

[root@vm redis-3.0.3]# src/redis-cli -h 127.0.0.1 info |
 grep -e "connected_clients" -e "blocked_clients" -e "used_memory_human"
 -e "used_memory_peak_human" 
-e "rejected_connections" -e "evicted_keys" -e "instantaneous"

connected_clients:1
blocked_clients:0
used_memory_human:799.66K
used_memory_peak_human:852.35K
instantaneous_ops_per_sec:0
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
evicted_keys:0

»»阅读全文

hive中的一些不常见函数的用法

常见的函数就不废话了,和标准sql类似,下面我们要聊到的基本是HQL里面专有的函数,

hive里面的函数大致分为如下几种:Built-in、Misc.、UDF、UDTF、UDAF

我们就挑几个标准SQL里没有,但是在HIVE SQL在做统计分析常用到的来说吧。

1、array_contains (Collection Functions)

这是内置的对集合进行操作的函数,用法举例:

create EXTERNAL table IF NOT EXISTS userInfo (id int,sex string, age int, name string, email string,sd string, ed string)  ROW FORMAT DELIMITED FIELDS 
TERMINATED BY '\t' location '/hive/dw';
 
select * from userinfo where sex='male' and (id!=1 and id !=2 and id!=3 and id!=4 and id!=5) and age < 30;
select * from (select * from userinfo where sex='male' and !array_contains(split('1,2,3,4,5',','),cast(id as string))) tb1 where tb1.age < 30;

»»阅读全文

php获取apk包信息的方法

/*解析安卓apk包中的压缩XML文件,还原和读取XML内容 依赖功能:需要PHP的ZIP包函数支持。*/
 
include('./Apkparser.php');
$appObj  = new Apkparser();
 $targetFile = a.apk;
//apk所在的路径地址
$res = $appObj->open($targetFile);
$appObj->getAppName();     // 应用名称
$appObj->getPackage();    // 应用包名
$appObj->getVersionName();  // 版本名称
 $appObj->getVersionCode();  // 版本代码
Apkparser.php 文件


下载地址 http://cdn.weichangdong.com/ApkParser.class.php

»»阅读全文

perl解析json

[root@swordman perl]# cat  json_t
{"root_path":"pictures\/bbm","count":"15704340","country":"ID","data_type":"1"}
{"root_path":"dcim\/facebook","count":"10421769","country":"ID","data_type":"1"}
{"root_path":"dcim\/100andro","count":"8437408","country":"ID","data_type":"1"}
{"root_path":"android\/data\/com.qihoo.security","count":"8370765","country":"ID","data_type":"1"}
{"root_path":"backucup","count":"7734925","country":"ID","data_type":"1"}
{"root_path":"pictures\/b612","count":"7432353","country":"ID","data_type":"1"}
{"root_path":"pictures\/instagram","count":"6518579","country":"ID","data_type":"1"}
{"root_path":"backucup","count":"6046648","country":"IN","data_type":"1"}
{"root_path":"dcim\/facebook","count":"5875220","country":"IN","data_type":"1"}
{"root_path":"android\/data\/com.qihoo.security","count":"5705046","country":"IN","data_type":"1"}
{"root_path":"android\/data\/com.qihoo.security","count":"4948008","country":"US","data_type":"1"}
{"root_path":"dcim\/100andro","count":"4767237","country":"IN","data_type":"1"}

»»阅读全文

perl命令行学习

网上遇见这样一个问题:

perl解析报文,每3行输出到1行,怎么实现
例如
a1
a2
a3
b1
b2
b3
c1
c2
c3
结果
a1a2a3
b1b2b3
c1c2c3

»»阅读全文

phantomjs使用说明

phantomjs实现了一个无界面的webkit浏览器。虽然没有界面,但dom渲染、js运行、网络访问、canvas/svg绘制等功能都很完备,在页面抓取、页面输出、自动化测试等方面有广泛的应用。

安装

下载phantomjs(官方下载,下载失败请访问另一个下载点)。解压到任意目录,并将包含phantomjs.exe的目录添加到系统路径。

如果要借助phantomjs进行无头测试,请参考各个测试框架的说明,或者参考phantomjs的官方文档:http://phantomjs.org/headless-testing.html

使用说明

»»阅读全文

linux find 的mtime用法

先上命令

find /data/export  -mtime +20 -a  -size +100M -exec rm -f {} \;
find /data/export  -mtime +40 -exec rm -f {} \;

常用的就是mtime的三种格式:-n n +n

»»阅读全文