唉, 心情还是这么的纠结…
虽然我送了蛋糕, 但这并不表示我认为我是错的. 只是衷心的祝你生日快乐.
就这样!
C on UNIX, 那本书已经买了, 不能不看, 不得不学…
Yii, 虽然用着Kohana, 但就是想学Yii. 属于 JUST WANTED TO 那种.
还有, http://www.cherokee-project.com/ 据说是比nginx还要轻量级的web服务器. 刚才找了好半天, 终于找到了.
(忘了关键词, 一直以为叫monkey什么的. 不过还真有个叫monkey的web server)
HTML5, 主要是js操作canvas, WebGL(web干礼- -, 2OC笑而不语), 能做出个像样的动画, 或者带有交互的动画就行.
哦, 2OC今晚就回SH了…这次聚不成了. 可惜可惜
离英语考试还有7天时间. 该看一看相关的内容了.
总觉得时间好紧, 还想学Qt, 这个书是同UNIX环境高级编程一起买的. 同样不能不去学.
韩寒在sina的blog被屏蔽了. 而且这次居然连Google HK也参与进来. 令我意想不到.
好, 今天就到这儿.
文笔太烂, 思维太活跃. 上下文根本没啥联系的, 哈哈…
I LOVE U
DWIT
DNR
Source: http://royal.pingdom.com/2010/06/18/the-software-behind-facebook/
简单翻译
Memcached, http://memcached.org/
Memcached可以被称作当今互联网上最著名的一个软件了. 作为一款分布式的缓存系统, Facebook以及其他成千上万的站点将其放到Web服务器同MySQL服务器的中间层. 近几年, Facebook也对Memcached做了诸多的改进, 也发布了一些Memcached的周边软件.
Facebook运行着上千台的Memcached服务器, 同时里面缓存着10几TB的数据. 看上去这应该是全世界最庞大的Memcached集群了~
HipHop for PHP, http://wiki.github.com/facebook/hiphop-php/
作为一种脚本型语言, PHP相对于本地应用来说实在不够快. 而HipHop可以将PHP代码转换至C++的代码, 这样在编译后就可以取得更好的性能. 这为Facebook – 这种对PHP有着很强依赖性的网站 – 来说提供了比一般Web服务器更好的性能输出.
一小撮(准确说三个)Facebook工程师花了18个月开发HipHop, 现在它已经可以被使用到生产环境中了…………
Haystack, http://www.facebook.com/note.php?note_id=76191543919
Haystack是Facebook的高性能图片存取系统(严格的说, Haystack是一款对象存储系统, 所以它并不是只能存取图片). 它可以做许多工作: 在Facebook上至少有200亿张用户上传的图片, 而每一张都被存储为4中不同的分辨率, 算下来, 这有超过800亿的图片.
这不仅仅是能够存取百亿级别的图片这么简单, 性能才是关键. 正如我们前面提到的, Facebook每秒钟需要响应大约120万次的图片请求, 这还没包括那些放在Facebook CDN服务器上的图片. 真是个令人吃惊的数字.
BigPipe, http://www.facebook.com/notes/facebook-engineering/bigpipe-pipelining-web-pages-for-high-performance/389414033919
BigPipe是一个由Facebook开发的动态Web页面服务系统. 在它的帮助下, Facebook将分区域的响应每一次的Web页面请求(被称作”pagelets, 页面小应用”), 以达到更加优良的性能.
例如, 聊天框是被拆分开进行处理的, 新闻Feed和其他也是一样. 这种页面小应用可以被平行的处理, 这样又可以获得一些性能, 而且即便是某些部分不活动或者干脆罢工了, 在这种工作方式下, 用户还是可以访问到网站的其他功能.
Cassandra, http://cassandra.apache.org/
Cassandra是一个单点服务器不会坏掉的分布式存储系统, 它是NoSQL运动带来的产物, 并且它已经是开源界的一份子了. Facebook用他来做收件箱的搜索功能.
除了Facebook, 还有很多的网站使用Cassandra, 比如Digg.
尚未完工…
26号的天气好赞啊.
25的也很好, 那天顺便脱宅, 终于去了趟好又多. 买了些生活上的用品.
同时期待下周末的天气也这样, 因为, the party is coming on 30th July, 2010.
又能看到这帮人了…很开心
出自: http://user.qzone.qq.com/138177171/blog/1279730163
PS, WordPress这个主题的默认表格样式太差劲了…
|
运营商 |
游戏名 |
近期最高在线 |
大区数量 |
5173游戏币一天交易量 |
|
腾讯 |
地下城与勇士 |
170-175万 |
120区 |
65万 |
|
QQ自由幻想 |
5-6万 |
29组 |
2万 |
|
|
QQ华夏 |
13-15万 |
32区132组 |
5万 |
|
|
QQ三国 |
23-25万 |
18区49组 |
18万 |
|
|
寻仙 |
9-12万 |
46组 |
4万 |
|
|
大明龙权 |
11-13万 |
27组 |
8万 |
|
|
盛大 |
热血传奇 |
13-15万 |
153区 |
游戏内置 |
|
永恒之塔 |
6-8万 |
14区170组 |
18万 |
|
|
传奇外传 |
3-5万 |
26组 |
游戏内置 |
|
|
传奇世界 |
12-14万 |
137区 |
传奇世界元宝的交易量在260万一天,传奇系列作为盛大的主要营收产品,的确有其特色所在 |
|
|
网易 |
梦幻西游 |
85-89万(去掉了多开用户) |
430组 |
12万(网易有自己的交易平台) |
|
魔兽世界 |
55-58万 |
363组 |
70万;台服22万 |
|
|
大话西游II |
31-36万 |
207组 |
2万(网易有自己的交易平台) |
|
|
天下贰 |
9-12万 |
18区74组 |
7万 |
|
|
大唐无双 |
5-7万 |
16区46组 |
14万 |
|
|
完美时空 |
诛仙2 |
38-43万 |
15区101组 |
25万 |
|
梦幻诛仙 |
32-36万 |
13区52组 |
10万 |
|
|
神鬼传奇 |
8-11万 |
11区67组 |
6万 |
|
|
新武林外传 |
12-16万 |
8区40组 |
7万 |
|
|
完美世界前传 |
20-23万 |
10区80组 |
11万 |
|
|
巨人 |
征途 |
15-18万 |
60组 |
7万 |
|
征途怀旧版 |
5-6万 |
17组 |
4.5万 |
|
|
绿色征途 |
9-11万 |
38组 |
11万 |
|
|
巨人 |
3-4万 |
23组 |
3万 |
|
|
万网之王3 |
2-3万 |
27组 |
8000 |
|
|
畅游 |
天龙八部 |
69-72万 |
337组 |
50万 |
|
刀剑英雄 |
12-14万 |
17区64组 |
7万 |
|
|
刀剑英雄2 |
3-4万 |
5区18组 |
1万 |
|
|
大话水浒 |
6-7万 |
41组 |
1.5万 |
|
|
中华英雄 |
2-3万 |
27组 |
2000 |
|
|
久游 |
勇士OL |
3-4万 |
4区13组 |
3000 |
|
金山 |
剑网叁 |
8-11万 |
53组 |
6万 |
|
剑侠世界 |
9-13万 |
77组 |
9.5万 |
|
|
网龙 |
魔域 |
25-28万 |
454组 |
自带平台交易 |
|
光宇华夏 |
问道 |
30-36万(去掉了多开用户) |
119组 |
21万 |
|
世纪天成 |
跑跑卡丁车 |
14-16万 |
5区 |
3000 |
|
反恐精英OL |
17-21万 |
5区 |
约等于0 |
|
|
中华网 |
热血江湖 |
16-18万 |
43组 |
7万 |
|
麒麟网 |
成吉思汗 |
17-20万 |
108组 |
5万 |
|
绿岸 |
蜀门 |
7-9万 |
61组 |
8万 |
|
大承网络 |
龙 |
3-5万 |
27组 |
5000 |
|
恶魔法则 |
3-4万 |
63组 |
约等于0 |
|
|
武神网络 |
武神 |
6-7万 |
89组 |
1.8万 |
|
蓝港在线 |
西游记 |
4-5万 |
19组 |
4.5万 |
|
九城 |
名将三国 |
1-2万 |
14组 |
4000 |
几天前在电话里听妈妈说发水了. 我家住的比较高, 也没怎么太担心.
今天看了视频, 我靠都上了上海东方的新闻了.
绝对比98年的洪水要大, 绝对…
XDebug是一个很好用的PHP调试工具. 内含的var_dump可以改变PHP默认的var_dump的行为, 主要是给变量加上不同的HTML颜色, 还有层级, 这样就可以直接在页面状态下, 清楚地查看var_dump输出的内容.
由此一来, 最近稍稍有些依赖这个功能, 并且在开发中很少将临时添加上的var_dump函数去掉. 虽然可以在代码中写入var_dump之前敲入类似 //TODO:: 的字样(这是个好习惯!!!)
但我还是懒了…导致目前我有N多处的var_dump, 根本不知道放在哪里了 T-T
so, 除了用grep搜索, 另一种办法就是修改XDebug的默认行为了~
目标是, 给XDebug的var_dump增加 显示 当前文件以及所在行号 的行为. 效果如下图
查了下PHP手册, 发现两个函数:
zend_get_executed_lineno() 和 zend_get_executed_filename()
两个都是Zend提供的API函数, 前者获取当前执行文件的行号, 后者就是脚本的文件名了.
然后就是 下载, 修改源代码, 重新编译, 安装, 重启PHP-FPM.
由于我用的是FreeBSD, 而且我也没什么配置可改的, 下载可以用 make configure 去完成. (在 /usr/ports/devel/php-xdebug 下执行)
如果前面用ports 安装过php-xdebug, 需要 先 make deinstall clean 一下.
在 make configure 之后, 可以直接编辑 vi work/xdebug-2.0.5/xdebug_var.c
Ver.2.0.5的XDebug 的这个文件, 需要修改的函数在第 #1031 行开始, 名字叫 xdebug_get_zval_value_fancy
函数的最前面是变量定义区, 为了适应微软的VS系列, 强烈建议把变量定义在函数内容的最开始部分. 增加下面两行
================Start of Block==================
char temp[4096] = {0}; //用来保存行号, 以及文件名的缓存. 4096Byte, 应该足够了.
int temp_strlen = 0; //等下用这个保存所需内容的字符串长度
================End of Block===================
然后, 在下面的 if (!options) {...} 区块后面加上下面的内容
================Start of Block==================
xdebug_str_addl(&str, "<div style='border:#000 dashed 2px; margin:10px; padding: 10px;'>", 65, 0);//在这里我定义了外层DIV, 也就是轮廓的样式.
temp_strlen = sprintf(temp, "<div style='color:#999;'><b>Line:</b> <span>%u</span> <b>@</b> <b>File:</b> <span>%s</span>;</div>", zend_get_executed_lineno(), zend_get_executed_filename());//在这里我定义了行号, 文件名的样式, 同时输出行号 以及 文件名 到缓冲变量 temp 中, 并将 temp 的字符串长度, 保存到 temp_strlen 中.
xdebug_str_addl(&str, temp, temp_strlen, 0);//输出相应的信息
================End of Block===================
注意, WordPress可能会对英文状态的单/双引号进行转义, 复制粘贴的时候自行转过来即可.
再来就是 xdebug_str_addl(&str, "</pre>", 6, 0); 部分的后面, 另起一行, 结束上面的 <div>
================Start of Block==================
xdebug_str_addl(&str, "</div>", 6, 0);//结束外层DIV, 也就是轮廓的定义
================End of Block===================
OK, 改的差不多了;
xdebug_str_addl函数的功能不太了解, 应该就是输出内容. 具体怎么用, 我会附加到评论中. 想自己定义样式的请先看这个函数的用法吧.
既然改的差不多了, 就 :wq 吧, pwd 确定一下自己现在的位置, 没问题之后, make install
如果没出什么 Error, 就表示编译安装完毕咯.
然后去 /usr/local/etc/rc.d/php-fpm restart 一下, 如果没有提示说xdebug的载入出现问题, 那就马上写一段var_dump() 来检查一下生效后的效果吧. ^-^
NAME
ports – contributed applications
DESCRIPTION
The FreeBSD Ports Collection offers a simple way for users and adminis-
trators to install applications. Each port contains any patches neces-
sary to make the original application source code compile and run on BSD.
Compiling an application is as simple as typing make build in the port
directory! The Makefile automatically fetches the application source
code, either from a local disk or via FTP, unpacks it on your system,
applies the patches, and compiles it. If all goes well, simply type make
install to install the application.
It is possible to download and use ports from the FreeBSD repository that
are newer than the installed system; however it is important to install
the appropriate “Upgrade Kit” from http://www.FreeBSD.org/ports/ first!
The portcheckout(1) (ports/ports-mgmt/portcheckout) script (also a port,
of course!) will help to download new ports.
For more information about using ports, see “Packages and Ports” in The
FreeBSD Handbook,
(file:/usr/share/doc/en_US.ISO8859-1/books/handbook/ports.html or
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ports.html).
For information about creating new ports, see The Porter’s Handbook
(file:/usr/share/doc/en_US.ISO8859-1/books/porters-handbook/index.html or
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/porters-handbook/).
TARGETS
Some of the targets work recursively through subdirectories. This lets
you, for example, install all of the “biology” ports. The targets that
do this are build, checksum, clean, configure, depends, extract, fetch,
install, and package.
The following targets will be run automatically by each proceeding target
in order. That is, build will be run (if necessary) by install, and so
on all the way to fetch. Usually, you will only use the install target.
config Configure OPTIONS for this port using dialog(1).
fetch Fetch all of the files needed to build this port from the
sites listed in MASTER_SITES and PATCH_SITES. See FETCH_CMD,
MASTER_SITE_OVERRIDE and MASTER_SITE_BACKUP.
checksum Verify that the fetched distfile’s checksum matches the one
the port was tested against. Defining NO_CHECKSUM will skip
this step.
depends Install (or compile if only compilation is necessary) any
dependencies of the current port. When called by the extract
or fetch targets, this is run in piecemeal as fetch-depends,
build-depends, etc. Defining NO_DEPENDS will skip this step.
extract Expand the distfile into a work directory.
patch Apply any patches that are necessary for the port.
configure Configure the port. Some ports will ask you questions during
this stage. See INTERACTIVE and BATCH.
build Build the port. This is the same as calling the all target.
install Install the port and register it with the package system.
This is all you really need to do.
The following targets are not run during the normal install process.
showconfig Display OPTIONS config for this port.
showconfig-recursive
Display OPTIONS config for this port and all its depen-
dencies.
rmconfig Remove OPTIONS config for this port.
rmconfig-recursive
Remove OPTIONS config for this port and all its depen-
dencies.
config-conditional
Skip the ports which have already had their OPTIONS con-
figured.
config-recursive
Configure OPTIONS for this port and all its dependencies
using dialog(1).
fetch-list Show list of files to be fetched in order to build the
port.
fetch-recursive Fetch the distfiles of the port and all its dependen-
cies.
fetch-recursive-list
Show list of files that would be retrieved by
fetch-recursive.
run-depends-list, build-depends-list
Print a list of all the compile and run dependencies,
and dependencies of those dependencies, by port direc-
tory.
all-depends-list
Print a list of all dependencies for the port.
pretty-print-run-depends-list, pretty-print-build-depends-list
Print a list of all the compile and run dependencies,
and dependencies of those dependencies, by port name and
version.
missing Print a list of missing dependencies to be installed for
the port.
clean Remove the expanded source code. This recurses to
dependencies unless NOCLEANDEPENDS is defined.
distclean Remove the port’s distfiles and perform the clean tar-
get. The clean portion recurses to dependencies unless
NOCLEANDEPENDS is defined, but the distclean portion
never recurses (this is perhaps a bug).
reinstall Use this to restore a port after using pkg_delete(1)
when you should have used deinstall.
deinstall Remove an installed port from the system, similar to
pkg_delete(1).
deinstall-all Remove all installed ports with the same PKGORIGIN from
the system.
package Make a binary package for the port. The port will be
installed if it has not already been. The package is a
.tbz file that you can use to install the port on other
machines with pkg_add(1). If the directory specified by
PACKAGES does not exist, the package will be put into
the current directory. See PKGREPOSITORY and PKGFILE.
package-recursive
Like package, but makes a package for each depending
port as well.
package-name Prints the name with version of the port.
readmes Create a port’s README.html. This can be used from
/usr/ports to create a browsable web of all ports on
your system!
search Search the INDEX file for the pattern specified by the
key (searches the port name, comment, and dependencies),
name (searches the port name only), path (searches the
port path), info (searches the port info), maint
(searches the port maintainer), cat (searches the port
category), bdeps (searches the port build-time depen-
dency), rdeps (searches the port run-time dependency),
www (searches the port web site) make(1) variables, and
their exclusion counterparts: xname, xkey etc. For
example, one would type:
cd /usr/ports && make search name=query
to find all ports whose name matches “query”. Results
include the matching ports’ path, comment, maintainer,
build dependencies, and run dependencies.
cd /usr/ports && make search name=pear- \
xbdeps=apache
To find all ports whose names contain “pear-” and
which do not have apache listed in build-time dependen-
cies.
cd /usr/ports && make search name=pear- \
xname=’ht(tp|ml)’
To find all ports whose names contain “pear-”, but not
“html” or “http”.
make search key=apache display=name,path,info keylim=1
To find ports that contain “apache” in either of the
name, path, info fields, ignore the rest of the record.
By default the search is not case-sensitive. In order
to make it case-sensitive you can use the icase vari-
able:
make search name=p5-R icase=0
quicksearch Reduced search output. Only display name, path and
info.
describe Generate a one-line description of each port for use in
the INDEX file.
maintainer Display the port maintainer’s email address.
index Create /usr/ports/INDEX, which is used by the
pretty-print-* and search targets. Running the index
target will ensure your INDEX file is up to date with
your ports tree.
fetchindex Fetch the INDEX file from the FreeBSD cluster.
ENVIRONMENT
You can change all of these.
PORTSDIR Location of the ports tree. This is /usr/ports on FreeBSD
and OpenBSD, and /usr/pkgsrc on NetBSD.
WRKDIRPREFIX Where to create any temporary files. Useful if PORTSDIR is
read-only (perhaps mounted from a CD-ROM).
DISTDIR Where to find/put distfiles, normally distfiles/ in
PORTSDIR.
PACKAGES Used only for the package target; the base directory for
the packages tree, normally packages/ in PORTSDIR. If this
directory exists, the package tree will be (partially) con-
structed. This directory does not have to exist; if it
does not, packages will be placed into the current direc-
tory, or you can define one of
PKGREPOSITORY Directory to put the package in.
PKGFILE The full path to the package.
PREFIX Where to install things in general (usually /usr/local).
MASTER_SITES Primary sites for distribution files if not found locally.
PATCH_SITES Primary locations for distribution patch files if not found
locally.
MASTER_SITE_FREEBSD
If set, go to the master FreeBSD site for all files.
MASTER_SITE_OVERRIDE
Try going to these sites for all files and patches, first.
MASTER_SITE_BACKUP
Try going to these sites for all files and patches, last.
RANDOMIZE_MASTER_SITES
Try the download locations in a random order.
MASTER_SORT Sort the download locations according to user supplied pat-
tern. Example:
.dk .sunet.se .se dk.php.net .no .de
heanet.dl.sourceforge.net
MASTER_SITE_INDEX
Where to get INDEX source built on FreeBSD cluster (for
fetchindex target). Defaults to
http://www.FreeBSD.org/ports/.
FETCHINDEX Command to get INDEX (for fetchindex target). Defaults to
“fetch -am”.
NOCLEANDEPENDS
If defined, do not let clean recurse to dependencies.
FETCH_CMD Command to use to fetch files. Normally fetch(1).
FORCE_PKG_REGISTER
If set, overwrite any existing package registration on the
system.
MOTIFLIB Location of libXm.{a,so}.
INTERACTIVE If defined, only operate on a port if it requires interac-
tion.
BATCH If defined, only operate on a port if it can be installed
100% automatically.
DISABLE_VULNERABILITIES
If defined, disable check for security vulnerabilities
using portaudit(1) (ports/ports-mgmt/portaudit) when
installing new ports.
NO_IGNORE If defined, allow installation of ports marked as
<FORBIDDEN>. The default behavior of the Ports framework
is to abort when the installation of a forbidden port is
attempted. Of course, these ports may not work as
expected, but if you really know what you are doing and are
sure about installing a forbidden port, then NO_IGNORE lets
you do it.
PORT_DBDIR Directory where the results of configuring OPTIONS are
stored. Defaults to /var/db/ports. Each port where
OPTIONS have been configured will have a uniquely named
sub-directory, containing a single file options.
FILES
/usr/ports The default ports directory (FreeBSD and
OpenBSD).
/usr/pkgsrc The default ports directory (NetBSD).
/usr/ports/Mk/bsd.port.mk The big Kahuna.
SEE ALSO
make(1), pkg_add(1), pkg_create(1), pkg_delete(1), pkg_info(1),
pkg_version(1)
The following are part of the ports collection:
portaudit(1), portcheckout(1), portlint(1)
The FreeBSD Handbook.
http://www.FreeBSD.org/ports (searchable index of all ports)
HISTORY
The Ports Collection appeared in FreeBSD 1.0. It has since spread to
NetBSD and OpenBSD.
AUTHORS
This manual page was originated by David O’Brien.
BUGS
Ports documentation is split over four places –
/usr/ports/Mk/bsd.port.mk, The Porter’s Handbook, the “Packages and
Ports” chapter of The FreeBSD Handbook, and this manual page.
FreeBSD 8.0 January 21, 2009 FreeBSD 8.0
我不打算写一系列的”教学”, 因为我深知自己对于Unix/Linux世界的了解基本没有, 也没有资格去教别人如何如何.
写下这些, 只能算是我对FreeBSD的学习笔记, 或者, 探险日志(我估计现在写下的内容, 搞不好日后的某一天会引起什么重大的问题…)
所以如果作为读着的您, 发现了什么错误的话, 还劳请指出. 我会感谢您一百零八辈祖宗的.
还是先说一说我为什么选择FreeBSD吧.
Linux有着如此众多的发行版: Ubuntu, RedHat, CentOS…除了RH我没有尝试过之外, Ubuntu给我的感觉是太简单, 过于简单, 一个apt-get install可以走遍世界, 丝毫没有从源代码编译过来的快感. CentOS的东西则是太陈旧了…我不追PHP5.3, 但怎么也要给我个5.0吧.
还有就是Linux套件一般会安装不少的实用程序, 而我又是个有洁癖的人(包括FreeBSD, 我发现装了没用的内容, 采用的不是pkg_delete, 而是直接插U盘, 重新格式化, 安装.), 对于我根本用不到的”实用程序”, 根本不想去安装…
当然, 这缩小了我对服务器操作系统的选择范围, gentoo 或者 FreeBSD. 这两个只是在我知识涉猎范围内的…
gentoo, 据说安装之前就得需要另外一个操作系统, 来编译它的内核…这对从没编译过内核的我来说, 难度系数太大(虽然后来在FreeBSD上编译过一次, 才需要20分钟…). 而且安装gentoo之前还需要安装一个系统, 去编译它. 这不禁让我想起了周星驰的那个手电筒…
而且, 还一个比较重要的原因. 在我选择系统的时候, FreeBSD 8.1 RC的新闻出现在了CB(http://www.cnbeta.com).
恰巧的是, 我基本上不怎么阅读新闻内容, 而直接看评论. 从评论上看, 大众对FreeBSD的评价超高. 这时候, 思想里的一个我(我也不知道是拿叉子的, 还是带光环的)说, “就它了!!!”
另外, 根据近几天的接触, 我发现FreeBSD的官方中文文档做的蛮好. Ubuntu的文档/wiki 很多, 但都是英文. 虽然我看英文不算太吃力, 但毕竟不习惯, 一边看还要一边思考着什么意思, 累.
===================================
FreeBSD的安装, 网络上有很多. 我采用最小化安装, 并选择 man, src-all, ports. 就这些.
安装完的配置:
回到主界面, 选择Configure – Networking, 第一项网卡, 配置并激活, 不知道自己网络配置可以尝试DHCP. 然后如果前面没开sshd的话, 向下翻页, 这里也可以开启.
安装方面就这些了.
Exit Install, 退光盘/U盘, 就可以重启进入新系统.
如果不知道DHCP获得的IP地址, 可以ifconfig看一下, 并且记住. 以后基本靠putty了.