Archive for the '生活小札' Category
周末完了
周一又开始了,上周五公司happy houre 一堆人聚着一起看《画皮》,我照例在lost template上面杀的昏天黑地。 《画皮》貌似不好看,网上有流传说唯一一个亮点是和狐妖的激情戏非常唯美。 但是用了替身,而且张艺谋说为了保护当事人的隐私,演员表里面不会出现替身的名字, 只给经济补偿,虽然从来不看演员表,这替身名利不能双收。 感觉怪怪的,既然用了替身,为什么不给名分?是真的担心替身的隐私? 还是担心人家闲话老谋子为数不多的亮点都是作假搞的? 最终可惜的是这段戏只能导演和审片的人看到,寡味得很。 末尾的那句拔不出那个神器的独白解释,更是牵强,让人作呕。 国产片越看越难看。最近也好像没的啥子好看的电影。 《越狱》算是为数不多的盼头了 昨天下午到处找第四季的第九集,后来说是要4号才有第九集,罢了。 上周末到南京东路上面走了走,满街的”米帅”(越狱里面迈克的扮演者)代言的 ME&CITY品牌广告,后来在美特斯邦威南京东路上面的旗舰店里面发现 居然是邦威旗下的另外一个品牌,似乎是邦威的高端产品。 刚刚google了一下,证实了偶的猜想。 很多媒体这样评价: ME&CITY系列是美特斯邦威企业(以下简称美邦)新推出的一个面对都市职场人群的品牌。 我的理解就是都市白领人群的正式着装。 呵呵。貌似我们蓝领还买不起的。 仔细回忆,貌似国内没有那家电影公司有引进米帅的片子 完全是依靠网络便迅速蹿红的,煞是让人惊奇。 网上黑多论坛专门讨论、研究这部片子的。我虽然没有功夫 去那么深入的把玩,但是看别人琢磨起来也比较过瘾 :D 而且米帅在米国貌似也不特别红火,很有墙内开花墙外香的味道。 这着实让人惊讶网络的另外一种力量。
这周末上海下了两天的雨,哪儿都没有去。 窝在家里,在星际争霸里面尝试着用神族1挑7, 都已惨败告终。
秋天来了,应该有很多地方都有好看的秋景了吧。 北京的香山红叶,南方无名小岛上面的沙滩日光浴。 啊,美啊 可惜都是YY的。 受金融风暴影响,上周听说YangMan准备来上海了,简简单单的介绍我们公司的C职位。 要是他能够过来,那比较好玩的一件事情。 伯乐还是在云南,下午说无线路由器的事情, 我一直认为他在走茶马古道,多么惬意的一件事情,痛并快乐着。 没想到还是在某个城里面过着我等凡夫俗子的日子。
server audit via analyzing the munin database
On Tue, Oct 14, 2008 at 00:08, Moses Moore <moses@mozai.com wrote:
HG wrote:
Hi,Matthias: thanks for your reply . actually, I have dumped these data into XML format using rrdtool before i ask the question. i want to know is there a simple way to get these usefull data.
… I’m a bit boggled as to why you don’t think an XML file of all the numbers you need is not ‘a simple way.’ All the minimums, maximums, and averages are there for you, one per line, with timestamps.
Still, you asked for an explanation of how else you can get the data out of the *.rrd files used by munin. I don’t think the non-XML way is any easier. I hope I can help.
You could use ‘rrdtool fetch ${filename} AVERAGE -r 86400 -s ${start} -e {$end}’ to get the averages for each day over a time period, but you have to have the exact values (accurate to the second) or else it just gives up and ignores the ‘-r’ parameter and gives it to you for each 5 minute period. Kinda sucks if you’re not machine-like perfect.
You could get the number out using rrdtool graph, although this is really inefficient since it has to compute a whole graph every time you get each number, and you can only get numbers one at a time. Example: rrdtool graph /tmp/$$ –start `date +%s -d today-7days`
simple response to the DDOS attacks
周六中午还在家里休息的时候,收到报警,一个韩国的站点web服务没有响应, 检查之后,发现有很多针对search页面的http请求,所谓的很多,从分析看来 高到四五百的IP,这些IP中多则3千多个、少的也有十几个http请求发过来。 这就是传说中的DDOS ,用搬家比方一下: 如同四五百个人一起让你来来回回的让你去六楼给他们同时搬上千样最重的东西。 六楼是没有电梯的最高层了,得要走的,要的东西还是最重的,而且每个人还同时要很多份。 而且一起要的人还有很多个人,只有《The Metrix》中会分身的史密斯才可以应付得来。 可惜我们的httpd不是史密斯。 虽然这个站点不在主盈利站点之列,但是这已经不是第一次碰到这种情况了。 上次发生类似情况的时候,通过识别、然后简单的通过httpd的403给处理掉。 没想到这次来时更加凶猛,httpd已经应付不过来了,只能在tcp里面handle了。 非常高兴这个站点没有通过load balance作负载均衡,要不然还得考虑对其他站点 的影响,而是直接从pix过来的。那就block吧,三下五除二,把那些可疑的IP 都drop掉之后,世界又恢复太平了。发notify,收工。 事后想想,这会是谁干的? 首先:可以支配数百台傀儡机器,不是一般的小玩家 其次:这次的http 请求和前几次有着相同的痕迹,可以理解为同一个或者同一伙人 实施的更加凶猛的一次攻击、而且这也不是最后一次,那下一次会是什么情况呢? SQL injection?SYNC Flood?
how to install Zend Debugger
install Zend Debugger:
1. Locate ZendDebugger.so or ZendDebugger.dll file that is compiled for the correct version of PHP (4.3.x, 4.4.x, 5.0.x, 5.1.x, 5.2.x) in the appropriate directory.
2. Add the following line to the php.ini file: Linux and Mac OS X: zend_extension=/full/path/to/ZendDebugger.so Windows: zend_extension_ts=/full/path/to/ZendDebugger.dll Windows non-tread safe: zend_extension=/full/path/to/ZendDebugger.dll
(*) the windows non-thread safe is used only with Zend Core 2.0
3. Add the following lines to the php.ini file: zend_debugger.allow_hosts= zend_debugger.expose_remotely=always
4. Place dummy.php file in the document root directory.
5. Restart web server.
How to allow Zend Optimizer and Zend Debugger coexistturns out the default suggested configuration was wrong, you must use a hidden arg zend_extension_manager.debug_server_ts and point it to a container directory that names its children directory with a name pattern “php-n.m.x” otherwise you will get:
“PHP Fatal error: [Zend Optimizer] Zend Debugger must be loaded after Zend Optimizer in Unknown on line 0 ”
the following is the steps:
1. cd /full/path/to/ZendDebuger/ 2. ln -s 5_m_n_x_comp php-5.m.n.x 3. In php.ini, replace zend_extension=/full/path/to/ZendDebugger.so with: zend_extension_manager.debug_server=/parrent/path/of/php-5.m.n.x 4. restart httpd
as instance: cd /usr/local/ZendDebugger-5.2.14-linux-glibc23-x86_64/ ln -s 5_2_x_comp php-5.2.x add the following line to php.ini: zend_extension_manager.debug_server=/usr/local/ZendDebugger-5.2.14-linux-glibc23-x86_64/ /usr/local/apache2/bin/apachectl start
finished!
