Google国内hosts
六月 11, 2011 by Littlesuper · Leave a Comment
203.208.39.22 webcache.googleusercontent.com
203.208.39.22 mail.google.com
203.208.39.22 www.google.com.hk
203.208.39.22 www.google.com
Mac OS X 安装 nginx + php fcgi + mysql
六月 2, 2011 by Littlesuper · Leave a Comment
mac port
nginx
在Mac上使用macport安装和配置Nginx非常方便,首先安装nginx
sudo port install nginx spawn-fcgi
安装完成后启动nginx会说没有nginx.conf文件,到/opt/local/etc/nginx目录下看到以下几个文件:
fastcgi_params.example koi-utf koi-win mime.types.example nginx.conf.example win-utf
直接复制example文件:
sudo mv mime.types.example mime.types sudo mv nginx.conf.example nginx.conf
启动nginx:
sudo nginx
访问http://127.0.0.1/,就可以看到Nginx的Welcome页面。
如何重启nginx?
# 检测配置文件是否有效 sudo nginx -t # 重启 sudo nginx -s reload # 帮助 sudo nginx -h
默认的nginx配置不是很好用,下面调整一下
cd /opt/local/etc/nginx/ sudo mkdir conf.d sudo mkdir sites-available sudo mkdir sites-enabled
文件nginx.conf的配置http部分:
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
sendfile on;
tcp_nopush on;
keepalive_timeout 10;
# keepalive_timeout 65;
gzip on;
include /opt/local/etc/nginx/conf.d/*.conf;
include /opt/local/etc/nginx/sites-enabled/*;
}
然后站点配置文件放在目录 sites-available 里,在目录 sites-enabled 中做 ln -s ../sites-available/xxx.conf ./ 即可
php5
安装php5,扩展模块根据自己的需要调整
# sudo port install php5 +fastcgi fcgi php5-gd php5-mysql php5-sqlite php5-eaccelerator php5-curl php5-iconv #配置文件 cd /opt/local/etc/php5 sudo cp php.ini-development php.ini
将时区修改为:date.timezone = Asia/Chongqing
错误级别修改为:error_reporting = E_ALL & ~E_NOTICE
php-fcgi
cd /Library/LaunchDaemons/ sudo vim org.macports.phpfcgi.plist
文件org.macports.phpfcgi.plist内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key><string>org.macports.phpfcgi</string>
<key>Debug</key><false />
<key>OnDemand</key><false />
<key>RunAtLoad</key><false />
<key>EnvironmentVariables</key>
<dict>
<key>PHP_FCGI_CHILDREN</key><string>2</string>
<key>PHP_FCGI_MAX_REQUESTS</key><string>5000</string>
</dict>
<key>LaunchOnlyOnce</key><true />
<key>ProgramArguments</key>
<array>
<string>/opt/local/bin/spawn-fcgi</string>
<string>-C 2</string>
<string>-p 9000</string>
<string>-f /opt/local/bin/php-cgi</string>
</array>
</dict>
</plist>
其中:
<key>PHP_FCGI_CHILDREN</key> 表示开启多少个PHP_FCGI_CHILDREN,如果只是开发的话,2个就ok了 -C 2表示spawn-fcgi跑多少个/opt/local/bin/php-cgi进程
运行:
sudo launchctl load -w org.macports.phpfcgi.plist
上述org.macports.phpfcgi.plist等效于直接运行:
sudo /opt/local/bin/spawn-fcgi -C 2 -p 9000 -f /opt/local/bin/php-cgi
如何重启phpfcgi?
# unload sudo launchctl unload -w org.macports.phpfcgi.plist # /opt/local/bin/php-cgi 进程依然存在就手动kill掉 pkill php-cgi # load sudo launchctl load -w org.macports.phpfcgi.plist
mysql
使用macport安装如下(不推荐)
sudo port install mysql5
推荐使用官方的dmg安装,除了安装文件,还有有两个管理工具,非常方便。
海豹突击队给企业家的五条管理启示
五月 26, 2011 by Littlesuper · Leave a Comment
自从奥萨马•本•拉登被击毙以来,全世界对海豹突击队(Navy SEALs)的兴趣与日俱增。我承认,我自己对他们也非常着迷。雷迪金融集团(Ready Financial)是我的投资组合中的一家公司,其CEO 威尔•图穆迪便是一位退役的海豹突击队员(服役期1990 – 1995)。好心的威尔向我介绍了他的一位战友——布兰登•罗杰斯(服役期1990 – 2000)。不久前,布兰登为包括我在内的、来自美国纽约市科技行业的20位CEO及公司创始人讲述了海豹突击队的故事——在他们执行作战任务背后的训练、计划制定和运作情况;并且,他还为企业家们给出了几条相关经验。从海豹突击队退役后,布兰登先后加入了哈佛商学院(HBS)和麦肯锡咨询公司(McKinsey),之后与他人共同创办了自己的对冲基金,丰富的阅历让他的观点不但有趣,而且具有多面性。
Mac下支持ssh tunnel的软件罗列
五月 19, 2011 by Littlesuper · Leave a Comment
网上很多人都推荐使用shimo做tunnel,但不知道为何,添加SSH TUNNEL总是灰色,无法使用,求助无门。最后在网上搜得以下内容,目前使用最轻量级的Secret Socks。
在Mac和linux上可以直接使用系统自带的ssh命令建立隧道,但毕竟是命令行形式,而且还要保持Terminal窗口开着,有些同学可能会感觉不方便,下面来介绍几款软件。 Mac上支持ssh tunnel的软件有很多,基本上支持ssh的客户端软件都会有ssh tunnel的选项,网上可以搜到很多介绍。这里只介绍几款比较轻量级且较专一的软件。
新入小白MacbookPro700抛弃光驱换SSD
五月 8, 2011 by Littlesuper · 1 Comment
最近变了回伪果粉,配上ipad+mbp700,体验一下来自乔帮主的艺术品般3C产品。
配置:
13-inch: 2.3 GHz
2.3GHz dual-core
Intel Core i5
4GB 1333MHz
320GB 5400-rpm1
Intel HD Graphics 3000
Built-in battery (7 hours)
Read more
关于史蒂夫·乔布斯的最好的几本书是什么?
四月 24, 2011 by Littlesuper · 1 Comment
【回答人:黄继新】
黄继新,创新工场资深投资经理
《重返小王国:乔布斯如何改变世界》,作者:迈克尔·莫瑞茨
Return to the Little Kingdom, by Michael Moritz
豆瓣链接: http://book.douban.com/subject/5400552/《史蒂夫·乔布斯复出记》,作者:艾伦·多伊奇曼
The Second Coming of Steve Jobs, by Alan Deutschman
豆瓣链接: http://book.douban.com/subject/1292273/《完美之物》,作者:史蒂文·列维
The Perfect Thing, by Steven Levy
豆瓣链接: http://book.douban.com/subject/2269898/《苹果往事》,作者:安迪·赫茨菲尔德
Revolution in the Valley, by Andy Hertzfeld
豆瓣链接: http://book.douban.com/subject/4214837/《撬开苹果》,作者:利安德·卡尼
Inside Steve’s Brain, by Leander Kahney
豆瓣链接: http://book.douban.com/subject/3309579/Insanely Great, by Steven Levy
无中文版,豆瓣链接: http://book.douban.com/subject/1341633/
学习 HTML5 最好的几个网站
四月 14, 2011 by Littlesuper · Leave a Comment
HTML5 现在很火热,下面是十来个学习HTML5最好的网站,可惜是英文的,红薯说看不懂的要硬着头皮看。
- HTML5 Labs
- HTML5 – Wikipedia
- Apple – HTML5
- Youtube HTML5 Beta
- Dive into HTML5 by Mark Pilgrim
- HTML 5 Cheat Sheet (PDF) – Smashing Magazine
- HTML5 Rocks
- World’s Biggest PacMan
- HTML5 Gallery
- HTML5 Demos
- W3Schools HTML5
- Gury
HTML 5是近十年来Web开发标准最巨大的飞跃。和以前的版本不同,HTML 5并非仅仅用来表示Web内容,它的新使命是将Web带入一个成熟的应用平台,在HTML 5平台上,视频,音频,图象,动画,以及同电脑的交互都被标准化。
iso4.3.1完美越狱
四月 4, 2011 by Littlesuper · Leave a Comment
新版redsn0w_mac_0.9.6rc9(http://blog.iphone-dev.org/)
下载地址:https://sites.google.com/a/iphone-dev.com/files/home/redsn0w_mac_0.9.6rc9.zip?attredirects=0&d=1
新版redsn0w_win_0.9.6rc9
下载地址:https://sites.google.com/a/iphone-dev.com/files/home/redsn0w_win_0.9.6rc9.zip?attredirects=0&d=1
PwnageTool 4.3 (Mac OS X)下载地址:http://torrents.thepiratebay.org/6293151/PwnageTool_4.3.dmg.6293151.TPB.torrent
越狱工具只支持以下设备:
iPhone 4, 3GS
iPod Touch 4G, 3G
iPad 1 (暂不支持iPad 2)
Apple TV 2G.
使用Firefox Stylish插件改变Google Reader的字体和行距
三月 22, 2011 by Littlesuper · 2 Comments
使用Droid Sans + 微软雅黑 字体显示网页之后,发现Google Reader中的行间距太小,以列表方式显示Google Reader的条目时候,会显示一部分下一行的内容,很不好看。于是就用Stylish插件来改变行距。
具体代码如下:
@-moz-document url-prefix(http://www.google.com/reader), url-prefix(https://www.google.com/reader), url-prefix(http://google.com/reader), url-prefix(https://google.com/reader)
{
*{
font-family: “Droid Sans”,”Microsoft YaHei”,sans-serif !important;
line-height: 150%;
}
}
另:微软雅黑和Droid字体还是挺般配的。

