Entries Tagged as ''

招聘

公司:网易北京技术部

工作地点:北京

简历发送到:jqyu at corp.netease.com

任职资格:

1、精通JAVA语言,熟悉面向对象的程序设计方法,一年以上的Java web方面(JSP/SERVLET)的工作经验;

2、基础扎实,精通常用数据结构与算法;

3、熟悉MYSQL、 Oracle

4、熟悉UNIX/LINUX操作系统

5、熟悉TCP/IP、HTTP

6、强烈的责任心和团队协作精神,有良好的沟通能力

7、细致耐心,工作踏实,善于思考和发现问题。

Fedora Core3下的vi(vim)

这两天

有同事反映说

Fedora Core 3的机器上用vi编辑php程序

没有彩色显示(语法高亮)

我上去看了一眼

alias vi=’vim’

OK了

这在以前的redhat版本里都是缺省的

以前大家直接敲vi,就支持语法高亮

所以大家都认为vi就应该支持语法高亮

其实vi是不支持的

vim(Vi IMproved)才支持

只是由于以前的系统自动把vi当成了vim(Vi IMproved)的别名

所以敲的是vi

执行的其实是vim(Vi IMproved)

现在Fedora Core 3没做这个工作(把vi当作vim的别名)

当然就不行了

但是我又仔细看了看

vi –version
vim –version

发现vi(/bin/vi)和vim(/usr/bin/vim)其实都是vim6.3

只不过是他们编译的时候加的参数vim这个程序的多一些

看来"vi"不支持语法高亮不是因为他是vi的原因

而是因为他编译时加的参数较少的原因吧



注:这里提到的vim,有两种意思,一种是指软件Vi IMproved,还一种是指Fedora Core 3下的程序文件/usr/bin/vim

关于resin的license问题

公司有机器跑得有resin

同事讲每2个月需要把license更新一下

否则resin就会罢工

而在我的印象中

resin3的早期版本好像是收费的

但是现在的resin3的版本因该是免费了的呀

为了搞明白这个问题

再次上了resin的官方网站

终于搞明白了:

原来要钱的是Resin Professional版本

官方网站这么写道:

Resin Professional is commercial software. Users must purchase deployment licenses, allowing us to develop and support the highest quality web application software. Caucho Technology is committed to providing the best web tools for all developers, from hobbyists to multinational corporations.



Limited-time evaluation licenses are available at http://www.caucho.com/license.



For information on deployment licenses and pricing, see our sales page.

Resin 3.0是GPL的

官方站点上是这么写的:

Resin 3.0 Open Source is available under the GNU Public License (GPL).

为php提供ssh2的支持

提供了一堆的函数以供调用

用来在php程序里方便的连到远程主机

执行程序

并取回结果

首先,系统需要已经装有openssl和openssl-devel包

rpm -qa | grep openssl

然后,安装libssh2

当下来源代码后

./configure && make all install

再然后,安装PECL/ssh2

可以用命令pear install ssh2(眼前可能只能用pear install ssh2-beta)

或者是去PECL/ssh2当下来源代码

然后

phpize && ./configure –with-ssh2 && make

再然后把生成的ssh2.so文件拷贝到php.ini中申明的extension_dir目录下(这里是/usr/lib/php4)

cp modules/ssh2.so /usr/lib/php4/

再在/etc/php.d目录下新建一个文件ssh2.ini

echo "extension=ssh2.so" > /etc/php.d/ssh2.ini

再重起web server,让其重读php.ini

搞定

令人失望的笔记本:Dell Inspiron 710m

首先

宽屏

这个东东以前总在宣传里看好像是很高档的样子

(电影、高档电视机大多是宽屏的)

戴尔的这款本本(Inspiron 710m)也是宽屏的

用了一下

感觉四个字:

华而不实

用本本上网的话

如今有哪个网站的设计是为宽屏设计的?

一般都是假设用户的分辨率是1024×168设计的

所以宽屏在看网页来讲

纯属鸡肋

然而

最奇怪的是

这款本本居然没有不支持红外!

如今红外都已经是本本的标配了

这款号称最时尚的本本居然都不支持!

虽然红外用得少

但在没有蓝牙的时候

红外还是很有用的

比如:跟手机通讯

综上所述,此笔记本有两点不爽

1,宽屏华而不实,纯属概念炒作

2,不但没有蓝牙,连红外都没有,真是败笔

mrtg2.10.xx下时间显示不对的问题

机器上配了个mrtg

通过snmp去抓打开了snmp的squid的信息

结果发现时间轴显示的时间不对

既不是gmt时间

又不是本地时间

我的mrtg.cfg中设置了Timezone[dss]: GMT+8

以及Language[dss]: chinese

结果发现时间轴上显示的时间正好是本地时间+8

后来

我把Timezone一句去掉了

就好了

搞不懂为什么

squid在linux下的”file descriptors”的问题

跑了squid的linux机器

其"file descriptors"是一个比较重要的调优参数

因为打开一个文件需要一个file descriptor;建立一个socket连接也需要一个

而linux自带的缺省file descriptors比较小,只有1024

所以跑squid的机器上比较容易出“Too many open files ”、“out of file descriptors”这样的错误

用tmpfs做缓存的更容易出这个错误

解决办法也比较容易

首先,调大file descriptors值

ulimit -HSn 8192

然后再编译squid

configure的时候会自动检测"file descriptors"

这样编出来的squid就会支持大于1024的file descriptors(这里的例子里是8192)

这样

跑squid之前,把系统的"file descriptors"调大

这样就能保证squid使用大于linux缺省1024的file descriptors了

Squid data available over SNMP

  • cacheServerRequests the number of requests received. By labeling I would assume that this means HTTP and ICP requests together, but when compared to data obtained from cachemgr, the values are too low.

  • cacheServerErrors mostly 0 on my cache. Not clear what kind of errors it counts, because it doesn’t trigger when a user enters a wrong URL and it doesn’t trigger when the log file system fills up and squid crashes.

  • cacheServerInKb Traffic from origin servers (www/ftp/parent) to squid.

  • cacheServerOutKb The amount of data sent to origin and/or parent servers from squid.

  • cacheClientHttpRequests Number of HTTP requests received from clients.

  • cacheHttpHits Number of hits. (i.e. object count of hits).

  • cacheHttpErrors mostly 0 on my machine.

  • cacheICPpktsSent Number of packets sent to ICP clients.

  • cacheICPpktsRecv Number of packets received from ICP clients.

  • cacheICPkbSent Size of packets sent to clients.

  • cacheICPkbRecv Size of packets received from clients. On my machine, the two are very close…

  • cacheHttpInKbTraffic from squid’s clients to squid. Basically, the aggregate size of the requests.

  • cacheHttpOutKb Traffic from squid to clients. On machine practically the same value as the previous variable. Weird.

  • cacheCurrentSwapSize It moves around too much to be the amount of disk used for stored objects. It moves around too little to be the size of swapped-out part of squid. (not clear what this represents).

  • cacheHttpMedianSvcFiveMin Median time to service an HTTP request in the last 5 minutes. Unit is probably milliseconds.

  • cacheICPQueryMedianSvcFiveMin Median time to process an ICP query in the last 5 minutes.

  • cacheICPReplyMedianSvcFiveMinMedian time to reply to an ICP query in the last 5 minutes.

  • cacheDNSMedianSvcFiveMin median time to get a reply from DNS servers in the last 5 minutes.

  • cacheHttpMedianSvcHour Median HTTP service time in the last hour.

  • cacheICPQueryMedianSvcHour Median ICP query for the last hour.

  • cacheICPReplyMedianSvcHour Median ICP reply time for the last hour.

  • cacheDNSMedianSvcHour Median DNS processing time in the last hour.

  • cacheNumObjCount the MIB simply says "Number of objects". Objects where? In the cache? It jumps around too much for that.

  • cacheCpuUsage Cache usage of CPU in the a recent period. Unit appears to be 0.01 % CPU.

  • cacheMemUsage Amount of memory consumed by cache. Unit is probably bytes.

  • cacheSysPageFaults Number of page faults. Very useful if your cache is slow and you don’t know why.

  • cacheTCPconnections Listed in MRTG, but not in squid MIB. Does not work.

  • cacheUDPconnections Same as the above.

Squid data available over SNMP

  • cacheServerRequests the number of requests received. By labeling I would assume that this means HTTP and ICP requests together, but when compared to data obtained from cachemgr, the values are too low.

  • cacheServerErrors mostly 0 on my cache. Not clear what kind of errors it counts, because it doesn’t trigger when a user enters a wrong URL and it doesn’t trigger when the log file system fills up and squid crashes.

  • cacheServerInKb Traffic from origin servers (www/ftp/parent) to squid.

  • cacheServerOutKb The amount of data sent to origin and/or parent servers from squid.

  • cacheClientHttpRequests Number of HTTP requests received from clients.

  • cacheHttpHits Number of hits. (i.e. object count of hits).

  • cacheHttpErrors mostly 0 on my machine.

  • cacheICPpktsSent Number of packets sent to ICP clients.

  • cacheICPpktsRecv Number of packets received from ICP clients.

  • cacheICPkbSent Size of packets sent to clients.

  • cacheICPkbRecv Size of packets received from clients. On my machine, the two are very close…

  • cacheHttpInKbTraffic from squid’s clients to squid. Basically, the aggregate size of the requests.

  • cacheHttpOutKb Traffic from squid to clients. On machine practically the same value as the previous variable. Weird.

  • cacheCurrentSwapSize It moves around too much to be the amount of disk used for stored objects. It moves around too little to be the size of swapped-out part of squid. (not clear what this represents).

  • cacheHttpMedianSvcFiveMin Median time to service an HTTP request in the last 5 minutes. Unit is probably milliseconds.

  • cacheICPQueryMedianSvcFiveMin Median time to process an ICP query in the last 5 minutes.

  • cacheICPReplyMedianSvcFiveMinMedian time to reply to an ICP query in the last 5 minutes.

  • cacheDNSMedianSvcFiveMin median time to get a reply from DNS servers in the last 5 minutes.

  • cacheHttpMedianSvcHour Median HTTP service time in the last hour.

  • cacheICPQueryMedianSvcHour Median ICP query for the last hour.

  • cacheICPReplyMedianSvcHour Median ICP reply time for the last hour.

  • cacheDNSMedianSvcHour Median DNS processing time in the last hour.

  • cacheNumObjCount the MIB simply says "Number of objects". Objects where? In the cache? It jumps around too much for that.

  • cacheCpuUsage Cache usage of CPU in the a recent period. Unit appears to be 0.01 % CPU.

  • cacheMemUsage Amount of memory consumed by cache. Unit is probably bytes.

  • cacheSysPageFaults Number of page faults. Very useful if your cache is slow and you don’t know why.

  • cacheTCPconnections Listed in MRTG, but not in squid MIB. Does not work.

  • cacheUDPconnections Same as the above.

windows2003下实现名为“屏幕收藏幻灯片”的屏保

windows2003因为是主要做服务器使用

所以很多花哨的功能没有

比如我以前在windows xp下用的“屏幕收藏幻灯片”这个屏保

关于怎么在windows 2003下实现这个功能的文档有一大把

一般都是这么讲的:

  第一步:在Windows Me的“X:\Windows\system”文件夹中,找到“IMAGING.DLL”文件和“图片收藏屏幕保护程序.scr”文件,然后拷贝到闪存上备用(其中X是Windows Me系统所在分区的盘符)。

  第二步:将闪存中的“IMAGING.DLL”文件和“图片收藏屏幕保护程序.scr”文件拷贝到Windows 2003的“X:\Windows\system32”文件夹下。

  第三步:在Windows 2003中打开记事本程序,输入以下内容:

  Windows Registry Editor Version 5.00

  [HKEY_CLASSES_ROOT\CLSID\{327

  abdab-2E5F-11d0-8B85-00AA0044F941}\InProcServer32]

  @="F:\windows\system\imaging.dll"

  "ThreadingModel"="both"

  文尾空一行以上空格或者是回一下车,将此文档另存为“AddScreenSavers.reg”。

  第四步:双击“AddScreenSavers.reg”文件,将它导入到注册表中。

  第五步:回到Windows 2003的桌面,点击右键,选择菜单中的“属性”。在弹出的“显示属性”窗口的“屏幕保护程序”选项卡中就会出现“图片收藏屏幕保护程序”的选项。

但现在的问题是:上哪儿找windows me去呀

我去windows xp下找

却没有这两个文件:imaging.dll图片收藏屏幕保护程序.scr

一个都没有

我贼心不死

继续在windows xp下找.scr的文件(屏幕保护程序)

发现一个叫ssmypics.scr的文件

感觉有点意思

双击一下

果然就是!

.scr文件找到了

按照前面文档的思路

应该还有一个.dll文件才对

跟找.scr文件相反

.dll文件我找遍了也没有找到

连注册表里跟ssmypics.scr相关的我都看了

也没有这个.dll文件的线索

终于

我想

就先把ssmypics.scr文件拿过来到windows 2003上看能不能打开

于是找个同事扔了个ssmypics.scr过来

存到\windows\system32目录下

双击一下

居然也出来了(屏幕保护程序)

能打开!

这下我感觉好像有戏了

再在桌面上点右键–>属性–>屏幕保护程序

然后在“屏幕保护程序”的那个下拉列表框里就看见了

久违的“图片收藏幻灯片”的选项

耶!

搞定