<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.7">Jekyll</generator><link href="http://alanhan.net/feed.xml" rel="self" type="application/atom+xml" /><link href="http://alanhan.net/" rel="alternate" type="text/html" /><updated>2020-07-28T10:30:04+00:00</updated><id>http://alanhan.net/feed.xml</id><title type="html">AH | Blog</title><subtitle></subtitle><entry><title type="html">从Wordpress到Jekyll</title><link href="http://alanhan.net/2016/12/26/moving-to-jekyll.html" rel="alternate" type="text/html" title="从Wordpress到Jekyll" /><published>2016-12-26T00:00:00+00:00</published><updated>2016-12-26T00:00:00+00:00</updated><id>http://alanhan.net/2016/12/26/moving-to-jekyll</id><content type="html" xml:base="http://alanhan.net/2016/12/26/moving-to-jekyll.html">&lt;p&gt;翻看我过去的文章，发现每到年底，我都会闲着没事把这个博客搬来搬去，从dreamhost到mediatemple，再到AWS EC2，最后是DigitalOcean，唯一没变的就是Wordpress。从版本1.x到4.5，从Nginx到Apache，从当初爱不释手又不厌其烦改来改去的k2到如今懒得只会用每年默认的twenty fourteen/fifteen/sixteen主题，从当初峰值一天两三篇文章到后来全年一篇，始终都没有放弃过Wordpress。然而今年底，在仔细考虑之后我终于下定决心和它说再见了。下一个博客环境将会使用Jekyll，搭建在Github pages上。做出这个选择的原因如下：&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;当初使用的Wordpress的时候还处在不折腾不舒服的年纪，为了SEO装了各种插件做优化，和落伍者上的站长做各种友情链接，为了得到更多搜索引擎的索引，几乎80%的文章都是直接从别的网站直接复制粘贴，我的域名alanhan.net最高峰的时候曾经做到过Alexa十万名左右。但当时我完全忽略了内容质量的重要性，毕竟这是我个人的博客，我也从来没有想过要做一个IT新闻媒体，这个博客所有的内容应该都是我所原创的。在Jekyll上用Markdown语法写文章，再通过Git的形式发布，能让我静下心来写好文章，整个体验是非常舒服的。&lt;/li&gt;
  &lt;li&gt;Wordpress当初最让人诟病的几点就是”性能差“，”不安全“，”代码臃肿”。经过这么多年的发展，我们还是着实见到了Wordpress开发团队的努力去改变这些缺点。但是，随着Jekyll和Ghost这类博客应用的出现，Wordpress庞大的体态对于我个人小小的博客来说，还是显得有些多余。轻量级的Jekyll搭建在Github pages上，省下来的维护时间是非常多的。&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;唯一美中不足的是，从Wordpress到Jekyll几种完整迁移方法都不能完全满足我的要求，没有选择的情况下，我只好手动把过去这些年值得保留的原创文章手动转到Markdown格式。原来的博客上的所有内容我会保存在mysql的备份文件中，如果有一个更好的迁移工具，我再把它们转移过来。没有的话，就让他们安静的成为我的回忆吧。&lt;/p&gt;</content><author><name></name></author><summary type="html">翻看我过去的文章，发现每到年底，我都会闲着没事把这个博客搬来搬去，从dreamhost到mediatemple，再到AWS EC2，最后是DigitalOcean，唯一没变的就是Wordpress。从版本1.x到4.5，从Nginx到Apache，从当初爱不释手又不厌其烦改来改去的k2到如今懒得只会用每年默认的twenty fourteen/fifteen/sixteen主题，从当初峰值一天两三篇文章到后来全年一篇，始终都没有放弃过Wordpress。然而今年底，在仔细考虑之后我终于下定决心和它说再见了。下一个博客环境将会使用Jekyll，搭建在Github pages上。做出这个选择的原因如下： 当初使用的Wordpress的时候还处在不折腾不舒服的年纪，为了SEO装了各种插件做优化，和落伍者上的站长做各种友情链接，为了得到更多搜索引擎的索引，几乎80%的文章都是直接从别的网站直接复制粘贴，我的域名alanhan.net最高峰的时候曾经做到过Alexa十万名左右。但当时我完全忽略了内容质量的重要性，毕竟这是我个人的博客，我也从来没有想过要做一个IT新闻媒体，这个博客所有的内容应该都是我所原创的。在Jekyll上用Markdown语法写文章，再通过Git的形式发布，能让我静下心来写好文章，整个体验是非常舒服的。 Wordpress当初最让人诟病的几点就是”性能差“，”不安全“，”代码臃肿”。经过这么多年的发展，我们还是着实见到了Wordpress开发团队的努力去改变这些缺点。但是，随着Jekyll和Ghost这类博客应用的出现，Wordpress庞大的体态对于我个人小小的博客来说，还是显得有些多余。轻量级的Jekyll搭建在Github pages上，省下来的维护时间是非常多的。 唯一美中不足的是，从Wordpress到Jekyll几种完整迁移方法都不能完全满足我的要求，没有选择的情况下，我只好手动把过去这些年值得保留的原创文章手动转到Markdown格式。原来的博客上的所有内容我会保存在mysql的备份文件中，如果有一个更好的迁移工具，我再把它们转移过来。没有的话，就让他们安静的成为我的回忆吧。</summary></entry><entry><title type="html">Macbook Pro Retina外接显示器小记</title><link href="http://alanhan.net/2016/03/21/macbook-pro-retina-with-external-monitor.html" rel="alternate" type="text/html" title="Macbook Pro Retina外接显示器小记" /><published>2016-03-21T00:00:00+00:00</published><updated>2016-03-21T00:00:00+00:00</updated><id>http://alanhan.net/2016/03/21/macbook-pro-retina-with-external-monitor</id><content type="html" xml:base="http://alanhan.net/2016/03/21/macbook-pro-retina-with-external-monitor.html">&lt;p&gt;上星期趁着Dell的12 Days of Deals，入手了一台&lt;a href=&quot;http://accessories.us.dell.com/sna/productdetail.aspx?c=ca&amp;amp;cs=cadhs1&amp;amp;l=en&amp;amp;sku=210-ADKB&quot;&gt;U2715H&lt;/a&gt;显示器。&lt;br /&gt;
由于是第一次给我2012年的Macbook Pro Retina配显示器，好多东西事先都没有想到。在这里记录一下:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;习惯视网膜屏幕显示效果的人群第一次看到外接显示器的文字显示可能会觉得发虚。这是由于OS X字体渲染的算法导致，基本没有办法解决。网上有些&lt;a href=&quot;http://www.ireckon.net/2013/03/force-rgb-mode-in-mac-os-x-to-fix-the-picture-quality-of-an-external-monitor&quot;&gt;方法&lt;/a&gt;可以尝试，但效果不大：
    &lt;ol&gt;
      &lt;li&gt;确保显示器的Color Profile是RGB（在Preferences -&amp;gt; Display中查看）&lt;/li&gt;
      &lt;li&gt;确保OS X不要将显示器认作电视（在About This Mac -&amp;gt; System Report -&amp;gt; Graphics/Display查看）&lt;/li&gt;
      &lt;li&gt;可以尝试在Preferences -&amp;gt; General中关闭”Use LCD font smoothing when available”&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;U2715H支持的接口有DisplayPort, MiniDP, HDMI。从显示效果上排名应该是DisplayPort &amp;gt; DVI &amp;gt; HDMI &amp;gt; VGA。如果可能尽量使用rMBP上的雷电（Thunderbolt）接口。&lt;/li&gt;
  &lt;li&gt;如果连接rMBP到U2715H并在显示器设置中打开DP 1.2，会导致黑屏，需要特殊方法把DP 1.2关闭：
    &lt;ol&gt;
      &lt;li&gt;将显示器关机&lt;/li&gt;
      &lt;li&gt;拔下所有显示输入线&lt;/li&gt;
      &lt;li&gt;显示器开机，并呼出Input Source菜单，高亮选中DP但不要点确认退出菜单&lt;/li&gt;
      &lt;li&gt;长按确认按钮15秒（绿色勾）&lt;/li&gt;
      &lt;li&gt;DP 1.2重设菜单会出现。转至disabled，然后重启显示器即可&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;由于rMBP设计关系，不建议外接显示器的时候将电脑关盖，会影响散热。&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><summary type="html">上星期趁着Dell的12 Days of Deals，入手了一台U2715H显示器。 由于是第一次给我2012年的Macbook Pro Retina配显示器，好多东西事先都没有想到。在这里记录一下: 习惯视网膜屏幕显示效果的人群第一次看到外接显示器的文字显示可能会觉得发虚。这是由于OS X字体渲染的算法导致，基本没有办法解决。网上有些方法可以尝试，但效果不大： 确保显示器的Color Profile是RGB（在Preferences -&amp;gt; Display中查看） 确保OS X不要将显示器认作电视（在About This Mac -&amp;gt; System Report -&amp;gt; Graphics/Display查看） 可以尝试在Preferences -&amp;gt; General中关闭”Use LCD font smoothing when available” U2715H支持的接口有DisplayPort, MiniDP, HDMI。从显示效果上排名应该是DisplayPort &amp;gt; DVI &amp;gt; HDMI &amp;gt; VGA。如果可能尽量使用rMBP上的雷电（Thunderbolt）接口。 如果连接rMBP到U2715H并在显示器设置中打开DP 1.2，会导致黑屏，需要特殊方法把DP 1.2关闭： 将显示器关机 拔下所有显示输入线 显示器开机，并呼出Input Source菜单，高亮选中DP但不要点确认退出菜单 长按确认按钮15秒（绿色勾） DP 1.2重设菜单会出现。转至disabled，然后重启显示器即可 由于rMBP设计关系，不建议外接显示器的时候将电脑关盖，会影响散热。</summary></entry><entry><title type="html">在Photos中整合iPhoto及Aperture图片库</title><link href="http://alanhan.net/2015/04/13/merge-iphoto-aperture-libraries-in-photos-app.html" rel="alternate" type="text/html" title="在Photos中整合iPhoto及Aperture图片库" /><published>2015-04-13T00:00:00+00:00</published><updated>2015-04-13T00:00:00+00:00</updated><id>http://alanhan.net/2015/04/13/merge-iphoto-aperture-libraries-in-photos-app</id><content type="html" xml:base="http://alanhan.net/2015/04/13/merge-iphoto-aperture-libraries-in-photos-app.html">&lt;p&gt;最近苹果发布了OS X 10.10.3，里面最让我兴奋的就是取代了iPhoto的Photos app。官方介绍&lt;a href=&quot;https://www.apple.com/osx/photos/&quot;&gt;在此&lt;/a&gt;。&lt;/p&gt;

&lt;p&gt;在这次更新之前，我的图片库设置为：&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;iPhoto: 储存iPhone, iPad拍摄的照片，随机存储的图片和墙纸等&lt;/li&gt;
  &lt;li&gt;Aperture：储存以前单反/单电拍摄的照片&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;由于这次更新之后，&lt;a href=&quot;http://www.macrumors.com/2015/04/10/iphoto-aperture-removed-mac-app-store/&quot;&gt;Aperture也从Mac App Store上下架了&lt;/a&gt;，加上我已经很久没用Nex-5n拍照了，绝大部分出游拍照的需求iPhone 6 Plus都可以满足，所以考虑将两个图片库合并到Photos app里。&lt;/p&gt;

&lt;p&gt;当10.10.3更新安装完成后，首次打开Photos用户可以选择任何一个图片库导入，但是无法多选。 所以问题来了，如果要合并多个图片库，应该怎么办？&lt;/p&gt;

&lt;p&gt;经过一番研究之后，发现以下的方法更加方便和安全，具体步骤为：&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;使用Photos导入iPhoto的图片库。官方提供了详细的&lt;a href=&quot;https://support.apple.com/en-us/HT204478&quot;&gt;文档&lt;/a&gt;介绍Photos是如何处理图片及其元数据的导入&lt;/li&gt;
  &lt;li&gt;打开Aperture，选中所有的Projects，选择File菜单下的Relocate Originals&lt;/li&gt;
  &lt;li&gt;选择导出目的地，文件夹及文件的命名规则，然后导出&lt;/li&gt;
  &lt;li&gt;Aperture会将所有Projects中的照片从图片库中导出为普通文件格式&lt;/li&gt;
  &lt;li&gt;在Photos里，选择File菜单下的Import，导入所有Aperture的图片文件即可&lt;/li&gt;
&lt;/ol&gt;</content><author><name></name></author><summary type="html">最近苹果发布了OS X 10.10.3，里面最让我兴奋的就是取代了iPhoto的Photos app。官方介绍在此。 在这次更新之前，我的图片库设置为： iPhoto: 储存iPhone, iPad拍摄的照片，随机存储的图片和墙纸等 Aperture：储存以前单反/单电拍摄的照片 由于这次更新之后，Aperture也从Mac App Store上下架了，加上我已经很久没用Nex-5n拍照了，绝大部分出游拍照的需求iPhone 6 Plus都可以满足，所以考虑将两个图片库合并到Photos app里。 当10.10.3更新安装完成后，首次打开Photos用户可以选择任何一个图片库导入，但是无法多选。 所以问题来了，如果要合并多个图片库，应该怎么办？ 经过一番研究之后，发现以下的方法更加方便和安全，具体步骤为： 使用Photos导入iPhoto的图片库。官方提供了详细的文档介绍Photos是如何处理图片及其元数据的导入 打开Aperture，选中所有的Projects，选择File菜单下的Relocate Originals 选择导出目的地，文件夹及文件的命名规则，然后导出 Aperture会将所有Projects中的照片从图片库中导出为普通文件格式 在Photos里，选择File菜单下的Import，导入所有Aperture的图片文件即可</summary></entry><entry><title type="html">再次搬家</title><link href="http://alanhan.net/2013/12/17/moving-again.html" rel="alternate" type="text/html" title="再次搬家" /><published>2013-12-17T00:00:00+00:00</published><updated>2013-12-17T00:00:00+00:00</updated><id>http://alanhan.net/2013/12/17/moving-again</id><content type="html" xml:base="http://alanhan.net/2013/12/17/moving-again.html">&lt;p&gt;真的很久没有写blog了…&lt;/p&gt;

&lt;p&gt;周末看到livid大牛推荐DigitalOcean，于是去看了一下他们家提供的服务：&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;主打SSD存储&lt;/li&gt;
  &lt;li&gt;内存够用，512MB 起&lt;/li&gt;
  &lt;li&gt;价格不错，$5/月 起&lt;/li&gt;
  &lt;li&gt;网上很容易找到promo code，等值$10&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;在用了一年EC2免费的micro instance后开始付费，过去3个月的账单基本稳定在$15上下，和DO一比较，发现同样价钱下，DO提供的内存更多，于是决定搬家。&lt;/p&gt;

&lt;p&gt;不得不说，DO网站的界面比EC2的后台简洁太多了，从注册到创建主机（DO称之为droplets)的过程非常直观，55秒内CentOS系统就搭建完毕了。有了前几次搬家的经验，剩下的LAMP和wordpress，以及系统的设置和导入也很快就搞定了。&lt;/p&gt;

&lt;p&gt;现在DO的弱势在于机房的稳定性，在推上不时看到有人报告机房无法访问。另一个问题就是现在DO只提供美国（三藩市和纽约）以及欧洲（阿姆斯特丹）的机房，不知道亚洲访问的速度如何。&lt;/p&gt;

&lt;p&gt;还要表扬DO的一点就是他们的社区非常友好，提供了各种各样的&lt;a href=&quot;https://www.digitalocean.com/community&quot;&gt;文档&lt;/a&gt;，非常适合新手建站。&lt;/p&gt;

&lt;p&gt;整个搬家的过程下来，我对于DO非常满意。等用过几个月后再写写心得和感受。&lt;/p&gt;</content><author><name></name></author><summary type="html">真的很久没有写blog了… 周末看到livid大牛推荐DigitalOcean，于是去看了一下他们家提供的服务： 主打SSD存储 内存够用，512MB 起 价格不错，$5/月 起 网上很容易找到promo code，等值$10 在用了一年EC2免费的micro instance后开始付费，过去3个月的账单基本稳定在$15上下，和DO一比较，发现同样价钱下，DO提供的内存更多，于是决定搬家。 不得不说，DO网站的界面比EC2的后台简洁太多了，从注册到创建主机（DO称之为droplets)的过程非常直观，55秒内CentOS系统就搭建完毕了。有了前几次搬家的经验，剩下的LAMP和wordpress，以及系统的设置和导入也很快就搞定了。 现在DO的弱势在于机房的稳定性，在推上不时看到有人报告机房无法访问。另一个问题就是现在DO只提供美国（三藩市和纽约）以及欧洲（阿姆斯特丹）的机房，不知道亚洲访问的速度如何。 还要表扬DO的一点就是他们的社区非常友好，提供了各种各样的文档，非常适合新手建站。 整个搬家的过程下来，我对于DO非常满意。等用过几个月后再写写心得和感受。</summary></entry><entry><title type="html">Hands-on Sybase SQLAnywhere 12.0.1 Installation on Linux</title><link href="http://alanhan.net/hands-on-sybase-sqlanywhere-12-0-1-installation-on-linux/" rel="alternate" type="text/html" title="Hands-on Sybase SQLAnywhere 12.0.1 Installation on Linux" /><published>2013-03-27T00:00:00+00:00</published><updated>2013-03-27T00:00:00+00:00</updated><id>http://alanhan.net/sybase-sqlanywhere-installation-linux</id><content type="html" xml:base="http://alanhan.net/hands-on-sybase-sqlanywhere-12-0-1-installation-on-linux/">&lt;p&gt;Environment: Red Hat or SUSE Linux&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installation Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;On your linux machine, create a new user ‘sybase’&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Switch to this new user, create the database installation directory (e.g. /databases/sybase)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Create another folder for the installer (e.g. /databases/installation)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Upload and unzip the installer&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;unzip sqla1201linux3264_advanced.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Folder structure after unzip&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-al&lt;/span&gt;
total 421004
drwxr-xr-x 4 root root 4096 Jan 25 11:00 &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
drwxr-xr-x 6 sybase dba 4096 Jan 25 10:59 ..
&lt;span class=&quot;nt&quot;&gt;-r--r--r--&lt;/span&gt; 1 root root 0 Feb 1 2011 linux-x86-x64
dr-xr-xr-x 8 root root 4096 Feb 1 2011 monitor
&lt;span class=&quot;nt&quot;&gt;-r--r--r--&lt;/span&gt; 1 root root 387 Feb 1 2011 readme.txt
&lt;span class=&quot;nt&quot;&gt;-rw-r--r--&lt;/span&gt; 1 root root 431087213 Jan 25 11:00 sqla1201linux3264_advanced.zip
dr-xr-xr-x 8 root root 4096 Feb 1 2011 sqlanywhere
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Under the ‘Sybase’ user, start the installer&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./sqlanywhere/setup
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Follow the on-screen instruction
    &lt;ol&gt;
      &lt;li&gt;Press ENTER&lt;/li&gt;
      &lt;li&gt;Select the country you are in&lt;/li&gt;
      &lt;li&gt;In the terms of license screen, click q to skip, then type Y to agree&lt;/li&gt;
      &lt;li&gt;Type 1 for new installation&lt;/li&gt;
      &lt;li&gt;Enter license key&lt;/li&gt;
      &lt;li&gt;Select the components you’d like to install&lt;/li&gt;
      &lt;li&gt;Once everything is selected, type S to continue&lt;/li&gt;
      &lt;li&gt;Enter your desired installation directory (the one you created in step 2)&lt;/li&gt;
      &lt;li&gt;Finally, confirm and start the installation&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;After the installation is completed, go to the installation directory, you should see the following files and folders:&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;ls
&lt;/span&gt;bin32     demo.db                    java      readme_de.txt  res           selinux          tix
bin32s    demo.log                   lib32     readme_en.txt  samonitor.db  sun              ultralite
bin64     deployment                 lib64     readme_ja.txt  samples       support          uninstall.sh
bin64s    install_20130125-1107.log  mobilink  readme_zh.txt  scripts       vcsagent
charsets  installed.ini              readme    relayserver    sdk           thirdpartylegal
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;New Database Configuration Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Under the new ‘sybase’ user, edit .bash_profile&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vim ~/.bash_profile
&lt;span class=&quot;c&quot;&gt;# add the following lines:&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;LD_LIBRARY_PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/databases/sybase/SQLAnywhere/12.01/lib64 &lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;LD_LIBRARY_PATH
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;LANG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;en_US.utf8
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Logout from Sybase user and log in again to apply new profile&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Check that the new environment variables are added&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;env&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;LANG
&lt;span class=&quot;nv&quot;&gt;LANG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;en_US.utf8
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;env&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;LD
&lt;span class=&quot;nv&quot;&gt;LD_LIBRARY_PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/databases/sybase/SQLAnywhere/12.01/lib64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In your SQL Anywhere installation directory, create a new folder for your new database&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &amp;lt;database_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Create temp folder in database directory&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &amp;lt;dir_from_step_4&amp;gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mkdir &lt;/span&gt;tmp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Source SQLAnywhere environment&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; &amp;lt;installation_dir&amp;gt;/bin64/sa_config.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Learn dbinit options&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&amp;lt;/installation_dir&amp;gt;&amp;lt;installation_dir&amp;gt;/bin64/dbinit &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Go to your new database folder, create startup script&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vim init.conf
&lt;span class=&quot;c&quot;&gt;# copy and paste the following lines:&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 8192
    &lt;span class=&quot;nt&quot;&gt;-ze&lt;/span&gt; utf8
    &lt;span class=&quot;nt&quot;&gt;-dba&lt;/span&gt; &amp;lt;admin_username&amp;gt;,&amp;lt;password&amp;gt;
    &lt;span class=&quot;nt&quot;&gt;-dbs&lt;/span&gt; 2G
    &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &amp;lt;dir_from_step_4&amp;gt;/output_msg.trc
    &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; &amp;lt;/dir_from_step_4&amp;gt;&amp;lt;dir_from_step_4&amp;gt;/transaction.log
    &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &amp;lt;/dir_from_step_4&amp;gt;&amp;lt;dir_from_step_4&amp;gt;/transaction_mirror.log
    &amp;lt;/dir_from_step_4&amp;gt;&amp;lt;dir_from_step_4&amp;gt;/data.db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Initialize new database&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&amp;lt;installation_dir&amp;gt;/bin64/dbinit @&amp;lt;dir_from_step_4&amp;gt;/init.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Learn dbsrv12 options&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&amp;lt;installation_dir&amp;gt;/bin64/dbsrv12 &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Create new database configuration parameters file&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vim &amp;lt;dir_from_step_4&amp;gt;/db.conf
&lt;span class=&quot;c&quot;&gt;# copy and paste the following lines:&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-ud&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &amp;lt;new_db_name&amp;gt;
    &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;tcpip (PORT=65000)&quot;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-gm&lt;/span&gt; 64
    &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; 128M
    &lt;span class=&quot;nt&quot;&gt;-ch&lt;/span&gt; 512M
    &lt;span class=&quot;nt&quot;&gt;-dt&lt;/span&gt; &amp;lt;dir_from_step_5&amp;gt;
    &lt;span class=&quot;nt&quot;&gt;-gn&lt;/span&gt; 10
    &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &amp;lt;dir_from_step_4&amp;gt;/sysa12d01.trc
    &lt;span class=&quot;nt&quot;&gt;-os&lt;/span&gt; 10M
    &lt;span class=&quot;nt&quot;&gt;-ze&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-zl&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-zp&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-zt&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-cs&lt;/span&gt;
    &amp;lt;/dir_from_step_4&amp;gt;&amp;lt;dir_from_step_4&amp;gt;/data.db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Start db server&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&amp;lt;installation_dir&amp;gt;/bin64/dbsrv12 @&amp;lt;dir_from_step_4&amp;gt;/db.conf &amp;amp;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Stop db server&lt;/p&gt;

    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&amp;lt;installation_dir&amp;gt;/bin64/dbstop –y –c “eng&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;new_db_name&amp;gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;uid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;admin_username&amp;gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pwd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;password&amp;gt;”
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;</content><author><name></name></author><summary type="html">Environment: Red Hat or SUSE Linux Installation Steps: On your linux machine, create a new user ‘sybase’ Switch to this new user, create the database installation directory (e.g. /databases/sybase) Create another folder for the installer (e.g. /databases/installation) Upload and unzip the installer $ unzip sqla1201linux3264_advanced.zip Folder structure after unzip $ ls -al total 421004 drwxr-xr-x 4 root root 4096 Jan 25 11:00 . drwxr-xr-x 6 sybase dba 4096 Jan 25 10:59 .. -r--r--r-- 1 root root 0 Feb 1 2011 linux-x86-x64 dr-xr-xr-x 8 root root 4096 Feb 1 2011 monitor -r--r--r-- 1 root root 387 Feb 1 2011 readme.txt -rw-r--r-- 1 root root 431087213 Jan 25 11:00 sqla1201linux3264_advanced.zip dr-xr-xr-x 8 root root 4096 Feb 1 2011 sqlanywhere Under the ‘Sybase’ user, start the installer $ ./sqlanywhere/setup Follow the on-screen instruction Press ENTER Select the country you are in In the terms of license screen, click q to skip, then type Y to agree Type 1 for new installation Enter license key Select the components you’d like to install Once everything is selected, type S to continue Enter your desired installation directory (the one you created in step 2) Finally, confirm and start the installation After the installation is completed, go to the installation directory, you should see the following files and folders: $ ls bin32 demo.db java readme_de.txt res selinux tix bin32s demo.log lib32 readme_en.txt samonitor.db sun ultralite bin64 deployment lib64 readme_ja.txt samples support uninstall.sh bin64s install_20130125-1107.log mobilink readme_zh.txt scripts vcsagent charsets installed.ini readme relayserver sdk thirdpartylegal New Database Configuration Steps: Under the new ‘sybase’ user, edit .bash_profile $ vim ~/.bash_profile # add the following lines: LD_LIBRARY_PATH=/databases/sybase/SQLAnywhere/12.01/lib64 export LD_LIBRARY_PATH export LANG=en_US.utf8 Logout from Sybase user and log in again to apply new profile Check that the new environment variables are added $ env | grep LANG LANG=en_US.utf8 $ env | grep LD LD_LIBRARY_PATH=/databases/sybase/SQLAnywhere/12.01/lib64 In your SQL Anywhere installation directory, create a new folder for your new database $ mkdir &amp;lt;database_name&amp;gt; Create temp folder in database directory $ cd &amp;lt;dir_from_step_4&amp;gt; $ mkdir tmp Source SQLAnywhere environment $ source &amp;lt;installation_dir&amp;gt;/bin64/sa_config.sh Learn dbinit options $ &amp;lt;/installation_dir&amp;gt;&amp;lt;installation_dir&amp;gt;/bin64/dbinit -h Go to your new database folder, create startup script $ vim init.conf # copy and paste the following lines: -p 8192 -ze utf8 -dba &amp;lt;admin_username&amp;gt;,&amp;lt;password&amp;gt; -dbs 2G -o &amp;lt;dir_from_step_4&amp;gt;/output_msg.trc -t &amp;lt;/dir_from_step_4&amp;gt;&amp;lt;dir_from_step_4&amp;gt;/transaction.log -m &amp;lt;/dir_from_step_4&amp;gt;&amp;lt;dir_from_step_4&amp;gt;/transaction_mirror.log &amp;lt;/dir_from_step_4&amp;gt;&amp;lt;dir_from_step_4&amp;gt;/data.db Initialize new database $ &amp;lt;installation_dir&amp;gt;/bin64/dbinit @&amp;lt;dir_from_step_4&amp;gt;/init.conf Learn dbsrv12 options $ &amp;lt;installation_dir&amp;gt;/bin64/dbsrv12 -h Create new database configuration parameters file $ vim &amp;lt;dir_from_step_4&amp;gt;/db.conf # copy and paste the following lines: -ud -n &amp;lt;new_db_name&amp;gt; -x &quot;tcpip (PORT=65000)&quot; -gm 64 -c 128M -ch 512M -dt &amp;lt;dir_from_step_5&amp;gt; -gn 10 -o &amp;lt;dir_from_step_4&amp;gt;/sysa12d01.trc -os 10M -ze -zl -zp -zt -cs &amp;lt;/dir_from_step_4&amp;gt;&amp;lt;dir_from_step_4&amp;gt;/data.db Start db server $ &amp;lt;installation_dir&amp;gt;/bin64/dbsrv12 @&amp;lt;dir_from_step_4&amp;gt;/db.conf &amp;amp; Stop db server $ &amp;lt;installation_dir&amp;gt;/bin64/dbstop –y –c “eng=&amp;lt;new_db_name&amp;gt;;uid=&amp;lt;admin_username&amp;gt;;pwd=&amp;lt;password&amp;gt;”</summary></entry><entry><title type="html">How to fix “volume bitmap needs minor repair for orphaned blocks” on OS X 10.8</title><link href="http://alanhan.net/how-to-fix-volume-bitmap-needs-minor-repair-for-orphaned-blocks-on-os-x-10-8/" rel="alternate" type="text/html" title="How to fix “volume bitmap needs minor repair for orphaned blocks” on OS X 10.8" /><published>2013-01-14T00:00:00+00:00</published><updated>2013-01-14T00:00:00+00:00</updated><id>http://alanhan.net/mac-ox-x-volume-bitmap-needs-minor-repair-for-orphaned-blocks-fix</id><content type="html" xml:base="http://alanhan.net/how-to-fix-volume-bitmap-needs-minor-repair-for-orphaned-blocks-on-os-x-10-8/">&lt;p&gt;Recently I noticed something strange on my Retina Macbook Pro with OS X 10.8.2 (Mountain Lion):&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;the available disk space stats gives wrong information (less free space than expected)&lt;/li&gt;
  &lt;li&gt;cannot use Boot Camp to create windows partition (says disk needs to be repaired using Disk Utility)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As instructed by Boot Camp, I went to Disk Utility, select the “Macintosh HD” partition and clicked on “Verify Disk”, then I got a whole bunch of logs and it ended with these error messages:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Checking volume bitmap.
Volume bitmap needs minor repair for orphaned blocks
Checking volume information.
Invalid volume free block count
(It should be ######## instead of ########)
The volume Macintosh HD was found corrupt and needs to be repaired.
Error: This disk needs to be repaired using the Recovery HD. Restart your computer, holding down the Command key and the R key until you see the Apple logo. When the Mac OS X Utilities window appears, choose Disk Utility.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Okay, that’s strange right? I then followed the instruction, restarted my macbook while holding down command+R, went to recovery mode and opened Disk Utility again, clicked on “Verify Disk” and bam, the whole process finished in less than a second, no error found! “That’s great”, i thought. To verify, I restarted OS X once again, went back to Disk Utility and verified the partition once more. Guess what, I got the same error message again! I googled around for the past day, people have been suggesting to use 3rd party software to repair disk, re-install OS X or even replace the hard drive. But to me, this doesn’t seem to be that big of a deal, there must be something very simple that I’ve missed somewhere…&lt;/p&gt;

&lt;p&gt;Just to save you from reading more of my ramblings, &lt;strong&gt;here’s what I did to solve this problem:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Go to “System Preferences” – “Security and Privacy”, click on “FileVault” tab, click the lock icon on the bottom left to unlock, and then click on “Turn Off FileVault”. The decryption process will take a while (around 1 hour).&lt;/li&gt;
  &lt;li&gt;When the decryption is done, reboot into Recovery HD&lt;/li&gt;
  &lt;li&gt;Use Disk Utility to verify OS X Partition, this time the process will take much longer and it will give you the same error message&lt;/li&gt;
  &lt;li&gt;Click on “Repair Disk”&lt;/li&gt;
  &lt;li&gt;DONE!&lt;/li&gt;
  &lt;li&gt;(optional) re-enable FileVault&lt;/li&gt;
&lt;/ol&gt;</content><author><name></name></author><summary type="html">Recently I noticed something strange on my Retina Macbook Pro with OS X 10.8.2 (Mountain Lion): the available disk space stats gives wrong information (less free space than expected) cannot use Boot Camp to create windows partition (says disk needs to be repaired using Disk Utility) As instructed by Boot Camp, I went to Disk Utility, select the “Macintosh HD” partition and clicked on “Verify Disk”, then I got a whole bunch of logs and it ended with these error messages: Checking volume bitmap. Volume bitmap needs minor repair for orphaned blocks Checking volume information. Invalid volume free block count (It should be ######## instead of ########) The volume Macintosh HD was found corrupt and needs to be repaired. Error: This disk needs to be repaired using the Recovery HD. Restart your computer, holding down the Command key and the R key until you see the Apple logo. When the Mac OS X Utilities window appears, choose Disk Utility. Okay, that’s strange right? I then followed the instruction, restarted my macbook while holding down command+R, went to recovery mode and opened Disk Utility again, clicked on “Verify Disk” and bam, the whole process finished in less than a second, no error found! “That’s great”, i thought. To verify, I restarted OS X once again, went back to Disk Utility and verified the partition once more. Guess what, I got the same error message again! I googled around for the past day, people have been suggesting to use 3rd party software to repair disk, re-install OS X or even replace the hard drive. But to me, this doesn’t seem to be that big of a deal, there must be something very simple that I’ve missed somewhere… Just to save you from reading more of my ramblings, here’s what I did to solve this problem: Go to “System Preferences” – “Security and Privacy”, click on “FileVault” tab, click the lock icon on the bottom left to unlock, and then click on “Turn Off FileVault”. The decryption process will take a while (around 1 hour). When the decryption is done, reboot into Recovery HD Use Disk Utility to verify OS X Partition, this time the process will take much longer and it will give you the same error message Click on “Repair Disk” DONE! (optional) re-enable FileVault</summary></entry><entry><title type="html">DB2 Catalog远程数据库服务器</title><link href="http://alanhan.net/2012/09/16/db2-catalog-remote-database.html" rel="alternate" type="text/html" title="DB2 Catalog远程数据库服务器" /><published>2012-09-16T00:00:00+00:00</published><updated>2012-09-16T00:00:00+00:00</updated><id>http://alanhan.net/2012/09/16/db2-catalog-remote-database</id><content type="html" xml:base="http://alanhan.net/2012/09/16/db2-catalog-remote-database.html">&lt;p&gt;在服务器上安装好DB2后,如果需要从客户端连接数据库的话,就要在客户端的机器上执行DB2的Catalog(编目)命令,具体的步骤如下(以下基于Windows):&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;打开DB2 Command Line (需要用管理员权限打开)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;在DB2提示符下,输入:&lt;/p&gt;

    &lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;catalog&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tcpip&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;node&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;node_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;remote&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;server_host_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;port_number&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SVCENAME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;remote_instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;db2_instance_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;   

&lt;span class=&quot;c1&quot;&gt;-- &amp;lt;node_name&amp;gt; = 节点名称,可以任意定义&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;-- &amp;lt;server_host_name&amp;gt; = 数据库服务器IP地址或host name&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;-- &amp;lt;port_number or SVCENAME&amp;gt; = DB2数据库监听端口&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;-- &amp;lt;db2_instance_name&amp;gt; = DB2数据库实例名&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;输入TERMINATE退出DB2提示符再重新进入,刷新DB2 Directory Cache&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;在DB2提示符下,输入:&lt;/p&gt;

    &lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;catalog&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;database&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;db_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;k&quot;&gt;at&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;node&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;node_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;   

&lt;span class=&quot;c1&quot;&gt;-- &amp;lt;db_name&amp;gt; = 数据库名&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;-- &amp;lt;node_name&amp;gt; = 在第二步中定义的节点名&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;再次刷新DB2 Directory Cache&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;在DB2提示符下,输入list node directory和list database directory,如果可以看到新的节点和数据库,证明catalog命令已经执行成功.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;输入以下命令连接远程DB2数据库,此处的&lt;db_name&gt;即是第4步定义的&lt;/db_name&gt;&lt;/p&gt;

    &lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;connect&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;db_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;</content><author><name></name></author><summary type="html">在服务器上安装好DB2后,如果需要从客户端连接数据库的话,就要在客户端的机器上执行DB2的Catalog(编目)命令,具体的步骤如下(以下基于Windows): 打开DB2 Command Line (需要用管理员权限打开) 在DB2提示符下,输入: catalog tcpip node &amp;lt;node_name&amp;gt; remote &amp;lt;server_host_name&amp;gt; server &amp;lt;port_number or SVCENAME&amp;gt; remote_instance &amp;lt;db2_instance_name&amp;gt; -- &amp;lt;node_name&amp;gt; = 节点名称,可以任意定义 -- &amp;lt;server_host_name&amp;gt; = 数据库服务器IP地址或host name -- &amp;lt;port_number or SVCENAME&amp;gt; = DB2数据库监听端口 -- &amp;lt;db2_instance_name&amp;gt; = DB2数据库实例名 输入TERMINATE退出DB2提示符再重新进入,刷新DB2 Directory Cache 在DB2提示符下,输入: catalog database &amp;lt;db_name&amp;gt; at node &amp;lt;node_name&amp;gt; -- &amp;lt;db_name&amp;gt; = 数据库名 -- &amp;lt;node_name&amp;gt; = 在第二步中定义的节点名 再次刷新DB2 Directory Cache 在DB2提示符下,输入list node directory和list database directory,如果可以看到新的节点和数据库,证明catalog命令已经执行成功. 输入以下命令连接远程DB2数据库,此处的即是第4步定义的 connect to &amp;lt;db_name&amp;gt; user &amp;lt;username&amp;gt; using &amp;lt;password&amp;gt;</summary></entry><entry><title type="html">搬家到Amazon EC2</title><link href="http://alanhan.net/2012/08/05/moving-to-amazon-ec2.html" rel="alternate" type="text/html" title="搬家到Amazon EC2" /><published>2012-08-05T00:00:00+00:00</published><updated>2012-08-05T00:00:00+00:00</updated><id>http://alanhan.net/2012/08/05/moving-to-amazon-ec2</id><content type="html" xml:base="http://alanhan.net/2012/08/05/moving-to-amazon-ec2.html">&lt;p&gt;这几天再次把这个blog折腾了一遍,从用了快两年的Linode迁移到Amazon EC2,用的是Micro Instance,可以免费使用一年.Region选的是US West Oregon,装了ubuntu.试用一两天下来,暂时感觉比Linode要稍微慢那么一些些,基本上是无法察觉的.Micro Instance的内存就已达到613MB,这点比Linode的512MB要好多了.&lt;/p&gt;

&lt;p&gt;这次搬家我选择了LAMP的环境,没有选择nginx的原因很简单,因为之前没有认真的玩过Apache,所以这次想学习一下.总的来说,从最初的deploy instance到最后成功运行wordpress的过程还是比较容易的,网上的教程中英文的已有很多,我也是新手所以在这里我也不多分享了,不想误导了他人.在这里仅记一下我遇到的几个tricky point:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;如需将自己的域名绑定到EC2 instance,需要先建立一个elastic IP,在EC2 Management Console里就可以找到.切记在建立IP之后要associate到你的instance,如果放着不associate是要收费的&lt;/li&gt;
  &lt;li&gt;wordpress permalink需要a2enmod rewrite&lt;/li&gt;
&lt;/ol&gt;</content><author><name></name></author><summary type="html">这几天再次把这个blog折腾了一遍,从用了快两年的Linode迁移到Amazon EC2,用的是Micro Instance,可以免费使用一年.Region选的是US West Oregon,装了ubuntu.试用一两天下来,暂时感觉比Linode要稍微慢那么一些些,基本上是无法察觉的.Micro Instance的内存就已达到613MB,这点比Linode的512MB要好多了. 这次搬家我选择了LAMP的环境,没有选择nginx的原因很简单,因为之前没有认真的玩过Apache,所以这次想学习一下.总的来说,从最初的deploy instance到最后成功运行wordpress的过程还是比较容易的,网上的教程中英文的已有很多,我也是新手所以在这里我也不多分享了,不想误导了他人.在这里仅记一下我遇到的几个tricky point: 如需将自己的域名绑定到EC2 instance,需要先建立一个elastic IP,在EC2 Management Console里就可以找到.切记在建立IP之后要associate到你的instance,如果放着不associate是要收费的 wordpress permalink需要a2enmod rewrite</summary></entry><entry><title type="html">iOS 5中文输入法闪退解决方法</title><link href="http://alanhan.net/2012/04/03/ios5-chinese-input-crash-fix.html" rel="alternate" type="text/html" title="iOS 5中文输入法闪退解决方法" /><published>2012-04-03T00:00:00+00:00</published><updated>2012-04-03T00:00:00+00:00</updated><id>http://alanhan.net/2012/04/03/ios5-chinese-input-crash-fix</id><content type="html" xml:base="http://alanhan.net/2012/04/03/ios5-chinese-input-crash-fix.html">&lt;p&gt;自从我的iPhone 4升级到iOS 5之后，就一直遇到一个奇怪的问题，症状是：在几乎所有的app中，如果从英文转换到拼音，或者拼音转换到其他输入法，又或者用拼音打某些字的情况下，会出现app崩溃并闪退到home screen，几乎每天都会发生。而在另一个iPad上却从来没遇到这个问题。之前以为5.1会修正这个bug，但升级后问题依然存在。google一番之后也没有找到确切的原因。&lt;/p&gt;

&lt;p&gt;我通过一些线索，猜测导致这个Bug的原因：&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;iPhone 4是从iOS 4.x升级上来，然后直接用以前的备份文件restore&lt;/li&gt;
  &lt;li&gt;iPad是原生iOS 5，没有restore，直接开始使用的&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;所以我认为，iOS 5的中文输入法相对于4.x的有重大的变更，如果用4.x时代的备份文件restore，会导致冲突以致于app崩溃闪退。&lt;/p&gt;

&lt;p&gt;最简单的解决办法就是还原iPhone，不要restore，直接使用。后果就是原来所有的无法同步的内容（如信息，游戏存档等）都会丢失。而我现在的解决方法是：进入Settings -&amp;gt; General -&amp;gt; Reset -&amp;gt; Reset Keyboard Dictionary。经过几天的使用，还没有遇到任何问题。在此推荐。&lt;/p&gt;</content><author><name></name></author><summary type="html">自从我的iPhone 4升级到iOS 5之后，就一直遇到一个奇怪的问题，症状是：在几乎所有的app中，如果从英文转换到拼音，或者拼音转换到其他输入法，又或者用拼音打某些字的情况下，会出现app崩溃并闪退到home screen，几乎每天都会发生。而在另一个iPad上却从来没遇到这个问题。之前以为5.1会修正这个bug，但升级后问题依然存在。google一番之后也没有找到确切的原因。 我通过一些线索，猜测导致这个Bug的原因： iPhone 4是从iOS 4.x升级上来，然后直接用以前的备份文件restore iPad是原生iOS 5，没有restore，直接开始使用的 所以我认为，iOS 5的中文输入法相对于4.x的有重大的变更，如果用4.x时代的备份文件restore，会导致冲突以致于app崩溃闪退。 最简单的解决办法就是还原iPhone，不要restore，直接使用。后果就是原来所有的无法同步的内容（如信息，游戏存档等）都会丢失。而我现在的解决方法是：进入Settings -&amp;gt; General -&amp;gt; Reset -&amp;gt; Reset Keyboard Dictionary。经过几天的使用，还没有遇到任何问题。在此推荐。</summary></entry><entry><title type="html">Jetpack by WordPress.com</title><link href="http://alanhan.net/2012/04/02/jetpack-by-wordpress.html" rel="alternate" type="text/html" title="Jetpack by WordPress.com" /><published>2012-04-02T00:00:00+00:00</published><updated>2012-04-02T00:00:00+00:00</updated><id>http://alanhan.net/2012/04/02/jetpack-by-wordpress</id><content type="html" xml:base="http://alanhan.net/2012/04/02/jetpack-by-wordpress.html">&lt;p&gt;今天在wp官网发现了Jetpack插件,是automattic推出的,相当于官方插件了,于是毫不犹豫的安装上.花了点时间试用了一下,发现有几个好处,在此推荐一下:&lt;/p&gt;

&lt;p&gt;这个插件为自己搭建wp的人士提供了wordpress.com上的一些很有用的功能,当前版本1.2.2提供的服务有:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;邮件订阅日志或评论&lt;/li&gt;
  &lt;li&gt;wordpress.com站点统计&lt;/li&gt;
  &lt;li&gt;社会化网络分享按钮&lt;/li&gt;
  &lt;li&gt;后台文字编辑器的拼写检查&lt;/li&gt;
  &lt;li&gt;实时站点备份(需要付费)&lt;/li&gt;
  &lt;li&gt;Gravater悬浮名片&lt;/li&gt;
  &lt;li&gt;wp.me短域名&lt;/li&gt;
  &lt;li&gt;shortcode嵌入代码&lt;/li&gt;
  &lt;li&gt;支持LaTeX&lt;/li&gt;
  &lt;li&gt;RSS链接,twitter和图片widget&lt;/li&gt;
  &lt;li&gt;实时发布日志到搜索引擎&lt;/li&gt;
  &lt;li&gt;more to come…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;这么多的功能不一定每个人都会全部用到,我个人认为分享按钮和shortcode嵌入代码非常有用,直接取代了我使用多年的两个插件,Viper’s Video Quicktags和AddThis!. shortcode的使用方法可以看https://en.support.wordpress.com/tag/shortcode/.&lt;/p&gt;</content><author><name></name></author><summary type="html">今天在wp官网发现了Jetpack插件,是automattic推出的,相当于官方插件了,于是毫不犹豫的安装上.花了点时间试用了一下,发现有几个好处,在此推荐一下: 这个插件为自己搭建wp的人士提供了wordpress.com上的一些很有用的功能,当前版本1.2.2提供的服务有: 邮件订阅日志或评论 wordpress.com站点统计 社会化网络分享按钮 后台文字编辑器的拼写检查 实时站点备份(需要付费) Gravater悬浮名片 wp.me短域名 shortcode嵌入代码 支持LaTeX RSS链接,twitter和图片widget 实时发布日志到搜索引擎 more to come… 这么多的功能不一定每个人都会全部用到,我个人认为分享按钮和shortcode嵌入代码非常有用,直接取代了我使用多年的两个插件,Viper’s Video Quicktags和AddThis!. shortcode的使用方法可以看https://en.support.wordpress.com/tag/shortcode/.</summary></entry></feed>