2013年12月4日

摘要: 节选自:http://bash.cumulonim.biz/BashPitfalls.html原文有43个bash pitfall,这里挑了5个我认为比较重要的,和大家分享一下同时建议大家都读一读原文1. for i in $(ls *.mp3)错误:如果文件名包含空格,譬如:01 - Don't Eat the Yellow Snow.mp3,上述语句会将文件名分拆为7个部分:01,-,Don't,Eat,the,Yellow,Snow.mp3ls是多余的正确写法:for i in *.mp3; do [[ -f "$i" ]] || continue s 阅读全文

posted @ 2013-12-04 15:04 justff 阅读(231) 评论(0) 推荐(0) 编辑

2013年12月2日

摘要: hive版本:0.9.0数据存储及解析我们先来看下hive中如何建表,并通过分析建表语句了解hive中数据的存储解析方式create table tutorial ( name string, //string类型字段namenumber int, //int类型字段numberresource array, //string数组类型字段detail map //字典类型(key为字符串... 阅读全文

posted @ 2013-12-02 11:54 justff 阅读(3054) 评论(0) 推荐(1) 编辑

2013年12月1日

摘要: 一点收获:hadoop streaming:ignore map failure: -Dmapred.max.map.failures.percent=10 allows 10 percent of map failurebzip2 check:bzip2 -t filenameshell extended glob:shopt -u extglobshopt -s extglobhdfs glob:from api:org.apache.hadoop.fs.GlobFilterA filter for POSIX glob pattern withbrace expansions 阅读全文

posted @ 2013-12-01 18:49 justff 阅读(154) 评论(0) 推荐(0) 编辑

2013年8月3日

摘要: test.py:import timewhile 1: print 'a' time.sleep(1)执行python脚本,python test.py > output然后用tailf output查看,却没有内容google了下,是因为stdout默认是buffered I/O,所以是print到缓冲区了有几种办法可以解决这个问题:print之后加sys.stdout.flush()或者python -u test.py,-u参数是强制stdin,stdout,stderr无缓冲 阅读全文

posted @ 2013-08-03 17:35 justff 阅读(1940) 评论(0) 推荐(0) 编辑

2013年7月28日

摘要: sudo apt-get update遭遇Hash Sum Mismatch解决办法:在装有goagent的情况下:sudo apt-get -o Acquire::http::proxy="http://127.0.0.1:8087/" update没有goagent的话。。网上有些其他方法,似乎不太靠谱,试试看吧:sudo rm -rf /var/lib/apt/lists/*sudo apt-get cleansudo apt-get update --fix-missing 阅读全文

posted @ 2013-07-28 14:46 justff 阅读(4831) 评论(0) 推荐(0) 编辑