<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mimijidi &#187; Mac</title>
	<atom:link href="http://otherside.mimijidi.com/entries/tag/mac/feed/" rel="self" type="application/rss+xml" />
	<link>http://otherside.mimijidi.com</link>
	<description></description>
	<lastBuildDate>Wed, 09 Jun 2010 11:50:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>ssh-askpass on Mac OS X</title>
		<link>http://otherside.mimijidi.com/entries/ssh-askpass-on-mac-os-x/</link>
		<comments>http://otherside.mimijidi.com/entries/ssh-askpass-on-mac-os-x/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 16:37:29 +0000</pubDate>
		<dc:creator>Zhen Sun</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[bbedit]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[ssh-askpass]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://otherside.mimijidi.com/entries/ssh-askpass-on-mac-os-x/</guid>
		<description><![CDATA[Got a lot of errors like: ssh_askpass: exec(/usr/local/libexec/ssh-askpass): No such file or directory while I was using subversion in BBEdit trying to update my working copy. Well, actually I don&#8217;t have ssh-askpass in that path, and I don&#8217;t know here I can get it. But lately I found I successfully update my working copy using [...]]]></description>
			<content:encoded><![CDATA[<p>Got a lot of errors like:</p>

<blockquote>
  <p><code>ssh_askpass:  exec(/usr/local/libexec/ssh-askpass):  No such file or directory</code></p>
</blockquote>

<p>while I was using subversion in BBEdit trying to update my working copy.</p>

<p>Well, actually I don&#8217;t have ssh-askpass in that path, and I don&#8217;t know here I can get it. But lately I found I successfully update my working copy using <a href="http://versionsapp.com/">Versions</a> or <a href="http://www.zennaware.com/cornerstone/">Cornerstone</a>. BTW they are all good applications with great UI. So I digged into Cornerstone&#8217;s content folder and found that it has a helper application inside called &#8220;SSHAskPass&#8221;. How wonderful~! Immedially I created a symbolic link using <code>ln -s /Applications/Cornerstone.app/Contents/Helpers/SSHAskPass.app/Contents/MacOS/ssh-askpass ssh-askpass</code> in /usr/libexec.</p>

<p>Works perfect in BBEdit now.</p>
]]></content:encoded>
			<wfw:commentRss>http://otherside.mimijidi.com/entries/ssh-askpass-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Safari 3 Beta: Mac + Win</title>
		<link>http://otherside.mimijidi.com/entries/safari-3-beta-mac-win/</link>
		<comments>http://otherside.mimijidi.com/entries/safari-3-beta-mac-win/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 00:50:32 +0000</pubDate>
		<dc:creator>Zhen Sun</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[win]]></category>

		<guid isPermaLink="false">http://otherside.mimijidi.com/entries/safari-3-beta-mac-win/</guid>
		<description><![CDATA[昨天的 WWDC 2007 内容除了众所周知的 Mac OS X Leopard 之外，Apple 还提供了 Safari 3 Public Beta —— Mac、Win 两种版本。 从 Safari 2 来看，Safari 3 除了 WebKit 版本的更新之外，并没有太多重大的功能改变，而更多的是对现有功能的增强。而一些新功能，比如制作 Web Clip Widget，增强的 PDF 阅读器则可能要到 Leopard 中的 Safari 3 才能看到。 Safari 3 宣传最多的还是它的速度：根据 Apple 的说法，Safari 3 的速度是其他浏览器的 2 倍之多。而且根据 Jeff 的测试报告来看，Apple 也没有吹牛。 Overall Speed: Safari 3.0 (Win): 398.6 ms Safari [...]]]></description>
			<content:encoded><![CDATA[<p>昨天的 WWDC 2007 内容除了众所周知的 Mac OS X Leopard 之外，Apple 还提供了 Safari 3 Public Beta —— <a href="http://www.apple.com/safari/">Mac、Win 两种版本</a>。</p>

<p>从 Safari 2 来看，Safari 3 除了 WebKit 版本的更新之外，并没有太多重大的功能改变，而更多的是对现有功能的增强。而一些新功能，比如制作 Web Clip Widget，增强的 PDF 阅读器则可能要到 Leopard 中的 Safari 3 才能看到。</p>

<p>Safari 3 宣传最多的还是它的速度：根据 Apple 的说法，Safari 3 的速度是其他浏览器的 2 倍之多。而且根据 <a href="http://www.dealminded.com/user/jeff/45/">Jeff 的测试报告</a>来看，Apple 也没有吹牛。</p>

<blockquote>
  <p>Overall Speed:<br />
  Safari 3.0 (Win): 398.6 ms<br />
  Safari 3.0 (Mac): 412.4 ms<br />
  OmniWeb 5.5.4 (Mac): 814 ms<br />
  Opera (Mac): 829 ms<br />
  Camino 1.5 (Mac): 1415.6 ms<br />
  Firefox 2.0 (Mac): 1755.8 ms<br />
  Firefox 2.0 (Win): 1768.6 ms<br />
  IE 7 (Win): 2101 ms<br />
  IE 6 (Win): 2109.2 ms<br />
  Safari 2.0 (Mac): 2727 ms</p>
</blockquote>

<p>在 Web 应用日益丰富网络连接速度也越来越快的今天，页面渲染速度以及 Javascript 的执行速度对 Web Browser 的影响也越来越大。而许多第三方编译的 Firefox 优化版本也是以优化 JavaScript 执行速度为优化手段之一，让 Firefox 来更从容的面对越来越重型的 Web Aplications。可以说 Safari 3 在这些测试中表现出来的结果还是相当不错的。</p>

<h4 id="new_features">Safari 3 Beta 新特性</h4>

<p>Beta 版本中的新特性在 Mac 和 Windows 版本中 <strong>没有差别</strong>，如果 Windows 中的 bug 不算新特性的话。如果一直有在用 Webkit Nightly，可能这些功能并不陌生，但是对于 Safari 2 来说这些小的改变还是能让操作更便捷，比如我期盼已久的标签拖拽功能<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>。</p>

<dl>
<dt>标签拖拽</dt>
<dd>这是一个我期盼已久的功能，标签可以用拖拽的方式来排列顺序（就像在 MyIE、Firefox 中）。不仅仅是如此，还可以用把标签“拖出”标签栏的方法，将标签页放到一个独立的窗口中。而在 Window 菜单中，也有相对应的“Merge All Windows”选项来把所有独立的窗口放到同一个窗口中以标签形式浏览。</dd>
<dt>文字搜索框</dt>
<dd>Safari 3 不再使用 Mac OS X 系统的文字搜索框，而是自立门户内建了另一个。看起来好像是 Firefox 中的文字搜索框，不过 Safari 将它放在了页面上边。键入搜索内容后 Safari 会将搜索到的文本高亮显示（页面其他部分变暗，关键字以橘色底白色字显示），在点 Next, Prev 的时候还会缩放一下文字来提醒你。</dd>
<dt>多标签退出提示</dt>
<dd>简单的小功能，在多标签浏览的时候，关闭窗口或者按 Command + Q 退出时会提示你还有其他标签。似乎也有人不喜欢这样的功能，可以在 Perferences 里关掉。</dd>
<dt>拖动改变文本输入框大小</dt>
<dd>HTML 中的文本框都会像窗口一样，可以在右下脚拖动缩放。说实在的，我没觉得有很大用处。╮(▔▽▔&#8221;)╭</dd>
<dt>为标签组添加书签</dt>
<dd>窗口中有多个标签时，Bookmarks 菜单中会有 Add bookmarks for these x tabs&#8230;。还算时蛮实用的一个功能，不过用到的机会似乎不多。新的 bookmarks 组默认是在当前窗口打开所有书签的（Auto-Click），在 Manage Bookmarks 中可以改。</dd>
<dt>设置图片为桌面背景</dt>
<dd>图片的关联菜单中有了 Use Image as Desktop Picture。刚刚从 Firefox 跳船到 Safari 时我很想念这个功能。现在？不太确定。因为已经习惯了把壁纸放到 Wallpapers 文件夹里再设置为壁纸。也许现在我可以先设置为壁纸看看效果，之后再决定是否要保存起来。</dd>
</dl>

<h4 id="WebKit_Changes">WebKit 渲染的改变</h4>

<p>其实 WebKit Nightly 总是变来变去，就先说几个和 Safari 2 相比起来显而易见的吧。</p>

<ul>
<li>中文字体可以显示“粗体”、“斜体”等风格</li>
<li>HTML 元素（按钮、下拉选框、文字框等等）会以 CSS 定义的样式显示，而不是全都套用系统样式（Aqua 按钮，或者是 ShapeShifter 定义的样式）</li>
</ul>

<p>关于第一点，心里有一些又爱又恨。能够显示文字风格固然很好，但是华文黑体变粗以后看起来真的是很&#8230;&#8230;<strong>健壮</strong>。尤其是在粗体用得很多的论坛上，一向清秀的页面突然如此五大三粗让我有些不适应。</p>

<p>值得一提的是安装了 Safari 3 Public Beta 之后其他的程序也将使用新版本的 WebKit。</p>

<h4 id="Windows">Other side: Win</h4>

<p>早起的鸟儿有虫（Bugs）吃。何况是早晨的苹果，bugs 更是在所难免。早上 King 和我交流了一下，发现的 Bug 差不多都一样，不知道是不是和使用系统有关<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>：</p>

<ol>
<li>无法正常显示 <abbr title="中、日、韩文">CJK</abbr> 字符，经常会出现掉字的现象。这个问题有点像 Firefox 早起版本在 Mac OS X 中运行的情况。</li>
<li>点“书签”按钮之后程序会当掉。</li>
<li>渲染页面的时候可能会有破损。</li>
</ol>

<p>如果你发现了其他 Bug 也欢迎留言告诉我们。</p>

<p>仅凭第一点，Safari 3 Beta 目前对东亚用户来说就是无用的。(ー_ー )ノ&#8221; 在文字渲染方面 Safari 没有使用 Windows 自己的 Clear type，而是在选项中设置了 3 个等级（Light, Medium, Strong）。而（可以显示出来的）文字的字体也像极了 Mac OS X 中的日文字体。</p>

<p>相较 Mac 版本来说，这个 Windows 版本的 Safari 3 Beta 还是很 buggy 的一个程序——就像 iTunes 刚刚移植到 Windows 的时候。不过这么大的 Bug 相信在 Mac OS X Leopard <abbr title="2007 年 10 月">正式发售</abbr>之前一定会有修正。╮(▔▽▔&#8221;)╭</p>

<h4 id="whats_next">Apple 想干什么</h4>

<p>Safari 要移植到 Windows 在几年前就有传闻，但是一直到 WWDC 2007 之前都没有真正的动作。Google CEO <a href="http://www.apple.com/pr/library/2006/aug/29bod.html">Eric Schmidt 加入了 Apple 的董事会</a>，iPhone <a href="http://www.iphonealley.com/news/briefly-iphone-open-to-developers-no-sdk-necessary">使用 Web 2.0/Ajax 的方式提供第三方支持</a>，iChat 在 Leopard 的截图中表示<a href="http://i69.photobucket.com/albums/i60/phatmancam/Picture1.png">可能会直接支持 Google Talk</a>（不同于 Jabber）服务，AppleTV 将支持 YouTube，好像 Apple 正在用这种多媒体＋网络＋服务的方式来占领服务市场。将 iTunes 移植到 Windows 是在为 iPod 和 AppleTV 铺路，那么将 Safari 移植到 Windows 是不是在为即将发售的 iPhone 铺路呢？如果 iPhone 真的是用 Web2.0/Ajax 实现第三方程序的支持，无疑移植 Safari 到 Windows 会便于更多的 Developer 能够针对 iPhone 中包含的 Safari 开发第三方程序。</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>我很喜欢将标签页放到一个新的独立窗口中这个功能。因为总要打开许多网页，而我并不喜欢把所有的页面都放在一个窗口中——我只在同一个窗口里放内容相关的网页。这样在收集资料的时候我就不必在眼花缭乱的标签中拣出到底哪个标签是和当前页面相关的。&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>我和 King 用的都是简体中文 Windows XP Professional + SP2&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://otherside.mimijidi.com/entries/safari-3-beta-mac-win/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TextMate 内的中文字符显示与输入</title>
		<link>http://otherside.mimijidi.com/entries/cjk-in-textmate/</link>
		<comments>http://otherside.mimijidi.com/entries/cjk-in-textmate/#comments</comments>
		<pubDate>Mon, 25 Dec 2006 21:37:36 +0000</pubDate>
		<dc:creator>Zhen Sun</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Chinese]]></category>
		<category><![CDATA[cjk]]></category>
		<category><![CDATA[Japanese]]></category>
		<category><![CDATA[Korean]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://otherside.mimijidi.com/entries/cjk-in-textmate/</guid>
		<description><![CDATA[TextMate 是 Mac OS X 下著名的编辑器，相信很多看过 Ruby on Rails Screencast 的开发者都对它有深刻的印象 —— 流畅的生成固定格式代码(Snipper)，方便的 Project 管理，以及像老牌编辑器 BBEdit 一样使用 unix 命令来过滤文本内容。但是 TextMate 对于在开发过程中使用中、日、韩文字的开发着来说却有一些麻烦。 无法正确显示 CJK 字符 无法正确输入 CJK 字符 好在 Hetima 提供了两种可以间接解决问题的办法： 显示 CJK 字符 大多数 CJK 字体都是 2 字宽，在 TextMate 下会和后边的 CJK 字符重叠在一起。（没有使用标准的 NSView？）对于这个问题 Hetima 提出了用 缩小日文字体宽度 的办法来解决，不过实际上最后的效果有点见仁见智。我照猫画虎的用中文字体做了一些实践，下面把大致的步骤写一下。 字体变形有许多选择：从超贵的 FontGrapher 到开放原始码的 FontForge，按照 Hetima 的介绍我们用 FontForge 就可以。用 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://macromates.com/">TextMate</a> 是 Mac OS X 下著名的编辑器，相信很多看过 Ruby on Rails Screencast 的开发者都对它有深刻的印象 —— 流畅的生成固定格式代码(Snipper)，方便的 Project 管理，以及像老牌编辑器 <a href="http://www.barebones.com/products/bbedit/">BBEdit</a>
 一样使用 unix 命令来过滤文本内容。但是 TextMate 对于在开发过程中使用中、日、韩文字的开发着来说却有一些麻烦。</p>

<ul>
<li>无法正确显示 CJK 字符</li>
<li>无法正确输入 CJK 字符</li>
</ul>

<p>好在 Hetima 提供了两种可以间接解决问题的办法：</p>

<h4 id="display">显示 CJK 字符</h4>

<p>大多数 CJK 字体都是 2 字宽，在 TextMate 下会和后边的 CJK 字符重叠在一起。（没有使用标准的 NSView？）对于这个问题 <a href="http://d.hatena.ne.jp/hetima/">Hetima</a> 提出了用 <a href="http://d.hatena.ne.jp/hetima/20061102">缩小日文字体宽度</a> 的办法来解决，不过实际上最后的效果有点见仁见智。我照猫画虎的用中文字体做了一些实践，下面把大致的步骤写一下。</p>

<p>字体变形有许多选择：从超贵的 <a href="http://www.adobe.com/support/fontographer/downloads.html">FontGrapher</a> 到开放原始码的 <a href="http://fontforge.souceforge.org/">FontForge</a>，按照 Hetima 的介绍我们用 FontForge 就可以。用 FontForge 读取 .dfont 或者 .ttf 文件，然后用 <a href="http://fontforge.sourceforge.net/scripting-alpha.html#Scale">Scale()</a> 和 <a href="http://fontforge.sourceforge.net/scripting-alpha.html#MergeFonts">MergeFonts()</a>
方法来变形、合并字体。要注意的是 FontForge 需要 X11 环境的支持，如果你在安装 Mac OS X 的时候没有安装过，可以在第一张安装盘中的 Optional Install 中安装。脚本中使用了 2 款字体，都是可以在 Mac OS X 中找到的（/System/Library/Fonts/）。如果你想要“华文黑体”（STHei.ttf）而不是“黑体”（Hei.dfont），那你需要 <a href="http://www.everything2.com/index.pl?node_id=1256000">动一点小手脚</a> —— STHei.ttf 受 FSType/2 保护，FontForge 在脚本中是动不到它的。当然你也可以用任意两种免费的中英文字体进行组合。</p>

<p>把 Hei.dfont 和 Monaco.dfont 两款字体复制到同一文件夹中，（比如 ~/tmfont/）然后建立文本文件 tmfont.pe：</p>

<blockquote><p><code>#!/usr/local/bin/fontforge -script<br />
<br />
#中文字体处理<br />
Open("Hei.dfont"); #中文字体<br />
SelectAll()<br />
foreach<br />
  Scale(60, 100, 0, 0) #横0.6，纵1.0  <br />
endloop  <br />
Generate("temp.ttf", "", 0x14)  <br />
Close()  <br />
  <br />
#Monaco 字体合并  <br />
Open("Monaco.dfont"); #英文字体  <br />
MergeFonts("temp.ttf");  <br />
SetFontNames("TextMate-Regular", "TextMate", "TextMate Regular", "Regular", "")  <br />
Generate("TextMate.ttf", "", 0x14)  <br />
Close()</code></p></blockquote>

<p>这样就差不多了。开启 X11 环境（/Applications/Utilities/），在 term 中赋予 tmfont.pe 执行权限并执行：</p>

<blockquote>
  <p><code>chmod +x tmfont.pe  
  ./tmfont.pe</code></p>
</blockquote>

<p>之后，你应该能在目录下找到 TextMate.ttf，安装这个字体就可以啦。</p>

<p class="cr">
<img src="http://myskitch.com/otherside/cjk-in-textmate-20070805-114638.jpg" alt="CJK in TextMate" /><br />
使用了自定义字体的 TextMate
</p>

<h4 id="input">输入 CJK 字符</h4>

<p>相比显示 CJK 字符来说简单多了：下载安装 <a href="http://hetima.com/textmate/index-e.html">Hetima 的 CJK-Input.tmplugin</a>。(Kudos to Hetima again.)</p>

<h4 id="links">Links</h4>

<ul>
<li><a href="http://d.hatena.ne.jp/hetima/20061102/1162435711">TextMate で日本語をわりとまともに表示する</a></li>
<li><a href="http://hetima.com/textmate/index-e.html">CJK-Input.tmplugin</a></li>
</ul>

<p>TextMate 的主页上称 TextMate 2.0 将使用 Leopard 中的 CoreText（也就是说想用 2.0 就必须要买 10.5 :-|），作者承诺届时 CJK 支持问题将得到彻底解决。
我在写代码的时候不常用到中文，也许写注释给别人看的时候会用到。虽然这个方法显示的文字略显小，不过聊胜于无，希望对同样使用 TextMate 的朋友有所帮助。</p>
]]></content:encoded>
			<wfw:commentRss>http://otherside.mimijidi.com/entries/cjk-in-textmate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>在 Automator 合并 PDF</title>
		<link>http://otherside.mimijidi.com/entries/combine-pdf-pages/</link>
		<comments>http://otherside.mimijidi.com/entries/combine-pdf-pages/#comments</comments>
		<pubDate>Mon, 20 Nov 2006 16:00:42 +0000</pubDate>
		<dc:creator>Zhen Sun</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[automator]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[utility]]></category>

		<guid isPermaLink="false">http://otherside.mimijidi.com/entries/combine-pdf-pages/</guid>
		<description><![CDATA[不是高科技，但是我今天才用到。因为想要把几个零散的《地海巫师》PDF 合并成一个以后慢慢看，所以想到了 Automator 中有 Combine PDF Files 的脚本。最后完成的 Workflow 可以在桌面生成一个新的合并过的 PDF，并且用默认程序打开。 首先，在 Automator 中选择 Library 中的 Finder，把 Get Selected Finder Items 拖到右边。 然后，把 Sort Finder Items 也拖过来，对选择的文档进行一下排序。 之后在 Library 中选择 PDF，拖 Combine PDF Pages 进来。 顺便也把 Compress Images in PDF Document 也拖进来压缩文档中的图像。 Combine PDF Pages 有点诡异不会问你生成的 PDF 的保存路径，所以这个 action 不会显示任何结果。我们要自己 Copy 出来。选 Finder 中的 Copy [...]]]></description>
			<content:encoded><![CDATA[<p>不是高科技，但是我今天才用到。因为想要把几个零散的《地海巫师》PDF 合并成一个以后慢慢看，所以想到了 Automator 中有 Combine PDF Files 的脚本。最后完成的 Workflow 可以在桌面生成一个新的合并过的 PDF，并且用默认程序打开。</p>

<ul>
<li>首先，在 Automator 中选择 Library 中的 Finder，把 Get Selected Finder Items 拖到右边。</li>
<li>然后，把 Sort Finder Items 也拖过来，对选择的文档进行一下排序。</li>
<li>之后在 Library 中选择 PDF，拖 Combine PDF Pages 进来。</li>
<li>顺便也把 Compress Images in PDF Document 也拖进来压缩文档中的图像。</li>
<li>Combine PDF Pages 有点诡异不会问你生成的 PDF 的保存路径，所以这个 action 不会显示任何结果。我们要自己 Copy 出来。选 Finder 中的 Copy Finder Items。如果你需要还可以加点改名之类的操作⋯⋯</li>
<li>把 Finder 中的 Open Finder Items 拖到最后。</li>
<li>Done!</li>
</ul>

<p>最后大概是这个样子的：</p>

<p class="cr"><img src="http://otherside.mimijidi.com/images/combinepdf.png" alt="Combine PDF Pages in Automator" /></p>

<p>最后把这个 workflow 存为 Finder 的 Plug-in。这样在 Finder 中选中多个文件以后，就可以选择 Automator 菜单中的 Combine PDF Pages，然后 Boom! 一个完整的 PDF 文档就在你的面前打开了。</p>

<p>之后我在 MacOSXHints 也看到 <a href="http://www.macosxhints.com/article.php?story=20060327192826493">不用 Automator 的办法</a>。因为 Automator 中的 Combine PDF Pages 说白了也就是一个名字叫做 join.py 的 python 脚本（并且还有参数的用法：<code>join [--output &lt;file&gt;] [--append] [--shuffle] [--preview] [--verbose]</code>），所以可以这样：</p>

<blockquote>
  <p><code>$ python '/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py' -o '/path/to/output.pdf' '/path/to/input1.pdf' '/path/to/input2.pdf'</code></p>
</blockquote>

<p>不过我不是时刻都开着 terminal 的人，还是用 Automator 比较适合我。</p>

<p>其他可以合并 PDF 文档的软件：</p>

<ul>
<li><a href="http://www.monkeybreadsoftware.de/Freeware/CombinePDFs.shtml">Combine PDFs 2.1</a><br />
一个开放原始码的用 REALBasic 写成的合并 PDF 软件</li>
<li><a href="http://www.iconus.ch/fabien/pdflab/">PDFLab</a><br />
用 Java 写成的合并 PDF 的软件</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://otherside.mimijidi.com/entries/combine-pdf-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install WordPress on a Mac</title>
		<link>http://otherside.mimijidi.com/entries/install-wordpress-on-a-mac/</link>
		<comments>http://otherside.mimijidi.com/entries/install-wordpress-on-a-mac/#comments</comments>
		<pubDate>Fri, 07 Apr 2006 19:25:05 +0000</pubDate>
		<dc:creator>Zhen Sun</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://otherside.mimijidi.com/entries/install-wordpress-on-a-mac/</guid>
		<description><![CDATA[为了在 Mac OSX 上安装 WordPress，我们需要什么呢？ Personal Web Sharing（Apache，系统内建） MySQL 当然还有亲爱的 WordPress 下载、安放 WordPress 首先我们要到 WordPress 的官方网站下载一个 最新版本的 WordPress，.zip 格式或者 .tar 格式都可以。将解压缩之后的文件放在 /Library/WebServer/Documents 目录下。/Library/WebServer/Documents 是 Web 服务器的根目录，你可以把它清空，然后把 WordPress 的文件直接放在里边，也可以在其中新建一个目录放置 WordPress（比如 /blog/）。在这里我们新建一个目录吧，就叫 wordpress，这样以后就可以通过 http://localhost/wordpress/ 来访问啦。 安放好了 WordPress 之后，我们就可以开启内建的 Apache 服务器了。 开启 Personal Web Sharing 所谓 Personal Web Sharing 就是 Mac OSX 下的 Apache（为什么不直接注明呢⋯⋯）。 开启这项服务很简单，在 System Performances -> [...]]]></description>
			<content:encoded><![CDATA[<p>为了在 Mac OSX 上安装 WordPress，我们需要什么呢？</p>

<ul>
<li>Personal Web Sharing（Apache，系统内建）</li>
<li><a href="http://www.mysql.com/" title="MySQL 数据库">MySQL</a></li>
<li>当然还有亲爱的 <a href="http://www.wordpress.org/" title="WordPress 首页">WordPress</a></li>
</ul>

<h4>下载、安放 WordPress</h4>

<p>首先我们要到 WordPress 的官方网站下载一个 <a href="http://wordpress.org/download" title="WordPress 下载页">最新版本的 WordPress</a>，.zip 格式或者 .tar 格式都可以。将解压缩之后的文件放在 <code>/Library/WebServer/Documents</code> 目录下。<code>/Library/WebServer/Documents</code> 是 Web 服务器的根目录，你可以把它清空，然后把 WordPress 的文件直接放在里边，也可以在其中新建一个目录放置 WordPress（比如 /blog/）。在这里我们新建一个目录吧，就叫 wordpress，这样以后就可以通过 http://localhost/wordpress/ 来访问啦。</p>

<p>安放好了 WordPress 之后，我们就可以开启内建的 Apache 服务器了。</p>

<h4>开启 Personal Web Sharing</h4>

<p>所谓 Personal Web Sharing 就是 Mac OSX 下的 Apache（为什么不直接注明呢⋯⋯）。</p>

<p>开启这项服务很简单，在 System Performances -> Sharing 中，选中Personal Web Sharing，搞定。打开了Web Server，下一步就是安装MySQL了。</p>

<h4>下载安装 MySQL</h4>

<p>MySQL 数据库用于存储 WordPress 的各种信息（文章，评论，用户，等等），并且他对个人使用是免费的。最新的 MySQL 版本是5.0，并且 WordPress 2.0 也能很好的支持。</p>

<p>首先到 <a href="http://dev.mysql.com/downloads/mysql/5.0.html">MySQL 5.0 的下载页</a>，选择适合自己系统的版本下载。现在 5.0 有 PPC 和 x86 两种版本提供下载，下载完成以后 Mac OSX 会自动将 .dmg 文件 mount 到桌面。在 5.0 的安装包内会有4个文件：MySQL 安装文件，MySQLStartupItem（开机自动运行），MySQL.prefPane（System Performance 中的控制 MySQL 的面板），以及一个 ReadMe。首先运行安装文件，再运行 MySQStartupItem 配置自动运行，以及 MySQL.PrefPane。安装完成之后，我们就要开始设置 MySQL，设定用户密码，建立 Table。</p>

<h4>设置 MySQL</h4>

<p>终于到了最烦琐的步骤。打开终端(<code>/Applications/Utilities/Terminal.app</code>)，依次输入以下命令。</p>

<blockquote>
  <p><code>cd /usr/local/mysql
  sudo chown -R mysql data/
  sudo echo
  sudo ./bin/mysqld_safe &amp;</code></p>
</blockquote>

<p>接下来我们用 test 数据库来试探一下 MySQL 是否在正常运行。同样是在终端。</p>

<blockquote>
  <p><code>/usr/local/mysql/bin/mysql test</code></p>
</blockquote>

<p>如果 MySQL 吐给你下面的信息，就说明 MySQL 已经成功运行了。`</p>

<blockquote>
  <p>Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 1 to server version 4.0.24-standard</p>
  
  <p>Type &#8216;help;&#8217; or &#8216;\h&#8217; for help.  Type &#8216;\c&#8217; to clear the buffer.</p>
  
  <p>mysql></p>
</blockquote>

<p>之后，输入 quit 退出 MySQL。</p>

<p>只让 MySQL 跑起来当然不够啦，我们还要为它重新设定 root 密码，并且创建 wordpress 用的数据库。</p>

<p>在终端中。</p>

<blockquote>
  <p><code>/usr/local/mysql/bin/mysqladmin -u root password yourpasswordhere</code></p>
</blockquote>

<p>将其中的“yourpasswordhere”换为您的密码。</p>

<p>创建数据库，终端中。</p>

<blockquote>
  <p><code>/usr/local/mysql/bin/mysql -u root -p
  CREATE DATABASE wordpress;
  quit</code></p>
</blockquote>

<p>这样，MySQL 也设置好了。</p>

<h4>开启对 PHP 的支持</h4>

<p>Mac OSX 虽然安装了 PHP，但是在默认设置下是未被启用的。为了唤醒沉睡的 PHP，我们需要编辑 <code>/etc/httpd/httpd.conf</code> 这个文件。</p>

<p>我比较喜欢用 Textmate，如果你不习惯也可以用 Vi，Pico 这些系统自带的编辑器。</p>

<blockquote>
  <p><code>sudo pico /etc/httpd/httpd.conf</code></p>
</blockquote>

<p>哇～～好大的文件呀。没关系我们要修改的只有2行而已。;-) 让我们把目光投向&#8221;Dynamic Shared Object Support&#8221;段，在这里你会找到好多好多以“LoadModule”开头的列表，其中有一些被“＃”号封印（注释掉了⋯⋯）着。现在我们就要解开php4的封印，删除 <code>#LoadModule php4_module</code> 前的 <code>#</code> 号，最后应该是这个样子。</p>

<blockquote>
  <p><code>LoadModule php4_module</code></p>
</blockquote>

<p>接下来我们还要去掉 AddModule 中关于 PHP 4 的注释，最后会是这个样子。</p>

<blockquote>
  <p><code>AddModule mod_php4.c</code></p>
</blockquote>

<p>将这两处的注释改掉之后，我们就可以保存文件退出了。为了让这些设置生效我们还需要重新启动一下 Apache 服务器。</p>

<blockquote>
  <p><code>sudo apachectl graceful</code></p>
</blockquote>

<h4>如果您在运行 Mac OS X 10.4.4 以上！</h4>

<p>如果您的系统是 Mac OS X10.4.4 以上，那么还需要另外一个步骤。</p>

<p>在终端中执行。</p>

<blockquote>
  <p><code>sudo cp /etc/php.ini.default /etc/php.ini</code></p>
</blockquote>

<p>之后编辑 <code>/etc/php.ini</code>，将</p>

<blockquote>
  <p><code>mysql.default_socket =</code></p>
</blockquote>

<p>改为</p>

<blockquote>
  <p><code>mysql.default_socket = /tmp/mysql.sock</code></p>
</blockquote>

<p>之后重新启动 Apache (<code>sudo apachectl graceful</code>)。否则您在安装 WordPress 的时候它会很不友好的告诉您：</p>

<blockquote>
  <p>Error establishing a database connection! This probably means that the connection information in your wp-config.php file is incorrect. Double check it and try again. Are you sure you have the correct user/password? Are you sure that you have typed the correct hostname? Are you sure that the database server is running?</p>
</blockquote>

<p>关于这个错误的更多信息您可以参考 <a href="http://docs.info.apple.com/article.html?artnum=301457">Mac OS X Server 10.4: Issues connecting PHP to MySQL</a>。</p>

<h4>安装配置 WordPress</h4>

<p>最恼人的部分终于结束了。安装 WordPress 的部分和您在远程服务器安装它的步骤应该是一样的。</p>

<p>打开 wp-config-sample.php，编辑基本系统信息。</p>

<p>define(&#8216;DB_NAME&#8217;, &#8216;wordpress&#8217;); &#8211; Change &#8216;wordpress&#8217; to the name of the database you created in MySQL (我们已经创建了数据库wordpress，所以这一项应该可以不改)。</p>

<p>define(&#8216;DB_USER&#8217;, &#8216;username&#8217;); &#8211; 将 username 改为 root。</p>

<p>define(&#8216;DB_PASSWORD&#8217;, &#8216;password&#8217;); &#8211; 将 password 改为刚才所设置的密码。</p>

<p>完成篡改之后，就可以把它另存为 wp-config.php 啦。</p>

<h4>最后一步</h4>

<p>在浏览器中运行 WordPress 的安装文件，按照我们的配置她应该是在 <a href="http://localhost/wordpress/wp-admin/install.php">http://localhost/wordpress/wp-admin/install.php</a>，如果您将 WordPress 放置在不同的目录请自行更改。整个的安装过程非常简单，WordPress 在询问你一些基本的 Blog 信息（比如 blog 的名字啦邮箱啦月光宝盒什么的）之后会随机生成一个 Admin 的密码，由于是随机生成的，所以现在请务必记好它，登陆以后立即更改。同时 WordPress 也会在 wordpress 数据库中自动创建所需要的表，这些就不需要我们去操心了。</p>

<h4>最后的最后一步</h4>

<p>那个随机密码实在是太不好记了，赶快到 User 页去改一个密码，或者新建一个用户吧～</p>

<p>大功告成！现在您可以在自己的 Mac 上试做插件、Theme 啦。如果带宽、资源足够，您甚至可以把它当作自己的 blog 服务器。</p>
]]></content:encoded>
			<wfw:commentRss>http://otherside.mimijidi.com/entries/install-wordpress-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

