It seems that a link /usr/sbin/dlm_controld.pcmk should be
established
pointing to the command /usr/sbin/dlm_controld, or else It
may complain
in /var/log/messages:
Dec 12 13:27:54 fedora2 controld[16055]: ERROR: Setup problem:
couldn't find command: dlm_controld.pcmk.
反映到pcs status上,表现为:
Failed actions:
dlm:1_monitor_0/gfs-control:1_monitor_0
... not installed
(2012-09-01 20:32)
node.js新手入门,读的一篇好文:
作者说,读了它,你会From novice to advanced novice。
它示例的程序写的是个简单的Web Server,实现图片上传并显示的功能。
这其中我感兴趣的是它的event based async callback 机制。很新鲜。
以及,看来,我对functional programming的理解还是连个皮毛都没摸到。Go coding
Haskell!
另外,Mac 下的截屏是Command键 + Shift + 3或者4 。
原作者的源代码的位置在GitHub上:
今天在读Beginning Python: From Novice to Professional, 2nd中关于Python
Testing的内容,除讲Python标准库中doctest和unittest模块外,还有讲用PyChecker和PyLint来检查Code
Quality的。在扩展内容里,有提及Automatic Checking的局限性,有点小意思,拎出来遛遛:
THE LIMITS OF AUTOMATIC CHECKING:
WILL IT EVER END?
It should be obvious that there are
limits to the capabilities of an automatic checke
说明:我在学习Unix
signals时对alarm函数诸多困惑,因此参考alarm的man页,并上网搜索相关举例,写成本文。文中不对alarm函数的具体实现作分析,而只是就其用例做点阐发。转载请注明出处,以免受害。
第一例:
$cat alarm_1.c
#include <stdio.h>
#include<unistd.h>
#include<signal.h>
void handler() {
printf('Hello\n');
signal(SIGALRM,handler);
alarm(5);
}
int main()
{
int i;
handler();
for(i=1;i<21;i++){
&
环境:
/usr/bin/od, 源码包为coreutils-8.4-13.el6.src.rpm
内容:
这个所谓的“利用od转储二进制文件”的Hack还是很实用的,
说白了就是讲如何查看二进制文件的内容。
od一词,本是octal dump的缩写,因为默认时是用八进制转存输出二进制文件的。
[story@rhel6:linking]$od ld-2.12.so.cache |head -6
0000000 042577 043114 000402 000001 000000 000000 000000
000000
0000020 000003 000076 000001 000000 005400 115200 000071
000000
0000040 000100 000000 000000 000000 054360 000002 000000
000000
0000060 000000 000000 000100 000070 000007 000100 000035
000034
0000100 000001 000000 000005 000000 000000 000000 000000
000000
0000120 000000 115200 000071 000000 000000 115200 000071
000000
在Linux系统中,file是个很有用的命令。它通过详细阅读文件的内容,找出其中的特征量并与幻数文件(magic
pattern file, or magic file)中保存的幻数模式(magic
pattern)作比较,来确定文件的类型。
在我的RHEL6.1中, file命令对应的源码包为:file-5.04-6.el6.src.rpm, 其幻数文件的路径为:
/usr/share/misc/magic 。
举几个例子:
[story@rhel6:iso]$file
/usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.18,
stripped
[story@rhel6:archive]$file -i
/usr/bin/file
# -i
之前一时起意,想做个牛掰到极点的黑客。 有次偶尔从同事那儿发现了本《Binary Hacks
黑客秘笈100选》,好像很了不起的样子,于是自己也去网上买了本来,而后放在书架上,半年多没有动。
后来终于有一天,在看另一本更牛掰的书CSAPP2e到Linking一章结尾的时候,差点崩了——讲共享库和PIC的时候它的举例跟我实验的结果已有些出入(现在猜来,可能是GCC版本不同的原因)——,于是为了弄个明白,就翻出这本Binary
Hacks来。
这本书是日本人写的,Binary Hacks - ハッカー秘伝のテクニック100選,好像很了不起的样子。翻了翻各项
Hack技,也很不错。
只是只是,由中国电力出版社给出的中文翻译实在太滥了。豆瓣上有人说,
这本书应该把谷歌翻译或者金山词霸作为第一译者,尽管有点太过刻薄,但也点出了实情:翻译水平差得不是一点半点。
后来我想明白了:大约这本书的翻译者,要既懂日文又懂英文还得懂中文,才能翻译得好它。——这是后话。
既然原版的日文看不懂,那就去看看有没有英文的吧,结果却发现没有。只是找到其简介,聊以慰藉。
Binary
Environment:
# uname -a
Linux fedora17 3.3.1-3.fc17.x86_64 #1 SMP Wed Apr 4 18:13:49 UTC
2012 x86_64 x86_64 x86_64 GNU/Linux
VMware Workstation Product
Info:
VMware Workstation 8.0.2
(build-591240) x86_64 bundle
Problem
Description:
When trying to run the 'vmware' command after installing VMware WS
on my fedora 17 system, it failed to compile module vmnet, as can
be seen from the abstract of the modconfig-2407.log
(2012-03-30 12:20)
Putting Theory to Practice: Understanding the SSD Performance
Degradation Problem
Let’s look at the problem in the real world. You, me and our
best friend have decided to start making SSDs. We buy up some
NAND-flash and build a controller. The table below summarizes our
drive’s characteristics:
| |
Our Hypothetical
SSD |
| Page Size |
4KB |
| Block Size |
5 Pages (20KB) |
| Drive Size |
|