Skip to content

Instantly share code, notes, and snippets.

@winse
Last active August 29, 2015 14:02
Show Gist options
  • Save winse/86e473a1bbde58ec351b to your computer and use it in GitHub Desktop.
Save winse/86e473a1bbde58ec351b to your computer and use it in GitHub Desktop.
记录工作过程中使用的shell,以及相关。部分以图片形式保存到flickr。
  • 批量处理

以回帖的形式进行记录。

@winse
Copy link
Author

winse commented Jun 23, 2014

shell中获取到秒的时间

[hadoop@umcc97-44 pack]$ date '+%s' 
1403511963

@winse
Copy link
Author

winse commented Jun 23, 2014

less显示行号

 -N or --LINE-NUMBERS

@winse
Copy link
Author

winse commented Jun 24, 2014

查看hbase的状态

 echo status | hbase shell 2>/dev/null

@winse
Copy link
Author

winse commented Jul 1, 2014

查看集群运行任务的内存使用情况

for h in `cat hadoop-2.2.0/etc/hadoop/slaves | grep -v '#' ` ; do ssh $h "/usr/local/jdk1.7.0_17/bin/jps -m | grep YarnChild | awk '{print \$1}' | xargs -I{} /usr/local/jdk1.7.0_17/bin/jstat -gcutil {} "; done

@winse
Copy link
Author

winse commented Jul 2, 2014

log4j日志附带线程信息

%t

@winse
Copy link
Author

winse commented Jul 5, 2014

取表格的第二行

$("#list tr:eq(1)")

@winse
Copy link
Author

winse commented Jul 5, 2014

选择第一行,用 $('tr:fisrt')
选择第N行用 $('tr:eq(n-1)')
$("tr td:nth-child(2)")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment