<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
  <channel>
    <title><![CDATA[Q.yuhen]]></title> 
    <link>http://www.rainsts.net/</link> 
    <description><![CDATA[秋雨漏更夜，琴音动心痕。RainTrail Studio.China 2000-2010]]></description> 
    <language>zh-cn</language> 
    <copyright><![CDATA[Copyright 2010, Q.yuhen]]></copyright> 
    <webMaster><![CDATA[qyuhen@hotmail.com (Q.yuhen)]]></webMaster> 
    <generator>LBS v2.0.313</generator> 
    <pubDate>Sat, 31 Jul 2010 00:10:43 +0800</pubDate> 
    <ttl>60</ttl>
  
    <item>
      <title><![CDATA[MongoDB: 6. Optimization]]></title> 
      <link><![CDATA[http://www.rainsts.net/article.asp?id=1035]]></link> 
      <category><![CDATA[Database]]></category> 
      <author><![CDATA[yuhen <null@null.com>]]></author> 
      <pubDate>Thu, 29 Jul 2010 10:20:09 +0800</pubDate> 
      <description><![CDATA[<b>1. Profiler</b><br /><br />MongoDB 自带 Profiler，可以非常方便地记录下所有耗时过长操作，以便于调优。<br /><pre class="code">&gt; db.setProfilingLevel(n)

n: 
   0: Off; 
   1: Log Slow Operations; 
   2: Log All Operations.</pre><br />通常我们只关心 Slow Operation，Level 1 默认记录 &gt;100ms 的操作，当然我们也可以自己调整 &quot;db.setProfilingLevel(2, 300)&quot;。<br />Profiler 信息保存在 system.profile (Capped Collection) 中。<br /><br />准备 1000000 条数据测试一下。<br /><pre class="code">&gt;&gt;&gt; from pymongo import *
&gt;&gt;&gt; from random import randint</pre>]]></description>
      <wfw:commentRss><![CDATA[http://www.rainsts.net/feed.asp?q=comment&id=1035]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[MongoDB: 5. Admin]]></title> 
      <link><![CDATA[http://www.rainsts.net/article.asp?id=1034]]></link> 
      <category><![CDATA[Database]]></category> 
      <author><![CDATA[yuhen <null@null.com>]]></author> 
      <pubDate>Sun, 25 Jul 2010 03:12:56 +0800</pubDate> 
      <description><![CDATA[Mongod 是 MongoDB 核心程序，通常情况下我们只需折腾该程序即可。<br /><br /><b>1. dbpath &amp; port</b><br /><br />默认数据存储路径是 /data/db，默认端口 27017，默认 HTTP 端口 28017。用 --dbpath 和 --port 改吧。<br /><pre class="code">$ sudo ./mongod --dbpath /var/mongodb --port 1234

Sat Jul 24 22:58:50 MongoDB starting : pid=1683 port=1234 dbpath=/var/mongodb 64-bit

** NOTE: This is a development version (1.5.4) of MongoDB.
**       Not recommended for production.</pre>]]></description>
      <wfw:commentRss><![CDATA[http://www.rainsts.net/feed.asp?q=comment&id=1034]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[MongoDB: 4. Index]]></title> 
      <link><![CDATA[http://www.rainsts.net/article.asp?id=1033]]></link> 
      <category><![CDATA[Database]]></category> 
      <author><![CDATA[yuhen <null@null.com>]]></author> 
      <pubDate>Sat, 24 Jul 2010 15:52:58 +0800</pubDate> 
      <description><![CDATA[MongoDB 提供了多样性的索引支持。<br /><pre class="code">&gt; for (var i = 0; i &lt; 30; i++) {
...     u = { name : &quot;user&quot; + i,
...           age : 20 + i,
...           contact : {
...              address : [&quot;address1_&quot; + i, &quot;address2_&quot; + i],
...              postcode : 100000 + i,
...           }
...     };
...     db.users.insert(u);
... }</pre><br />索引信息被保存在 system.indexes 中，且默认总是为 _id 创建索引。<br /><pre class="code">&gt; show collections
system.indexes</pre>]]></description>
      <wfw:commentRss><![CDATA[http://www.rainsts.net/feed.asp?q=comment&id=1033]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[MongoDB: 3. Schema Design]]></title> 
      <link><![CDATA[http://www.rainsts.net/article.asp?id=1032]]></link> 
      <category><![CDATA[Database]]></category> 
      <author><![CDATA[yuhen <null@null.com>]]></author> 
      <pubDate>Thu, 22 Jul 2010 10:36:03 +0800</pubDate> 
      <description><![CDATA[<b>1. Document-Oriented</b><br /><br />MongoDB 是一种面向文档(document-oriented)的数据库，其内存储的是一种 JSON-like 结构化数据。尽管拥有和关系型数据库 Database/Table 类似的的 DB/Collection 概念，但同一 Collection 内的 Document 可以拥有不同的属性。<br /><br />(注: 以下 &gt; 提示符表示 mongo JS 代码，&gt;&gt;&gt; 为 Python 代码)<br /><pre class="code">&gt; use blog
switched to db blog

&gt; db.users.insert({name:&quot;user1&quot;, age:15})
&gt; db.users.insert({name:&quot;user2&quot;, age:20, sex:1})

&gt; db.users.find()
{ &quot;_id&quot; : ObjectId(&quot;4c479885089df9b53474170a&quot;), </pre>]]></description>
      <wfw:commentRss><![CDATA[http://www.rainsts.net/feed.asp?q=comment&id=1032]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[MongoDB: 2. Basic Usage]]></title> 
      <link><![CDATA[http://www.rainsts.net/article.asp?id=1031]]></link> 
      <category><![CDATA[Database]]></category> 
      <author><![CDATA[yuhen <null@null.com>]]></author> 
      <pubDate>Tue, 20 Jul 2010 14:19:14 +0800</pubDate> 
      <description><![CDATA[须安装 PyMongo (<a href="http://api.mongodb.org/python/current/index.html" title="http://api.mongodb.org/python/current/index.html" target="_blank">Documentation</a>)。<br /><pre class="code">$ sudo easy_install -U pymongo</pre><br />(注: 以下 &gt; 提示符表示 mongo JS 代码，&gt;&gt;&gt; 为 Python 代码)<br /><br /><b>1. INSERT</b><br /><br />使用 insert 插入文档。<br /><pre class="code">&gt; use blog
switched to db blog

&gt; u = { name:&quot;user1&quot;, age:23 }
{ &quot;name&quot; : &quot;user1&quot;, &quot;age&quot; : 23 }

&gt; db.users.insert(u)

&gt; u2 = db.users.findOne({name:&quot;user1&quot;})</pre>]]></description>
      <wfw:commentRss><![CDATA[http://www.rainsts.net/feed.asp?q=comment&id=1031]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[MongoDB: 1. Database]]></title> 
      <link><![CDATA[http://www.rainsts.net/article.asp?id=1030]]></link> 
      <category><![CDATA[Database]]></category> 
      <author><![CDATA[yuhen <null@null.com>]]></author> 
      <pubDate>Tue, 20 Jul 2010 09:19:19 +0800</pubDate> 
      <description><![CDATA[mongo 是 <a href="http://www.mongodb.org/" title="http://www.mongodb.org/" target="_blank">MongoDB</a> 自带的交互式 Javascript shell，用来对 Mongod 进行操作和管理的交互式环境。<br /><br />使用 &quot;./mongo --help&quot; 可查看相关连接参数。<br /><pre class="code">$ ./mongo --help

MongoDB shell version: 1.5.3

usage: ./mongo [options] [db address] [file names (ending in .js)]

db address can be:
  foo                   foo database on local machine
  192.169.0.5/foo       foo database on 192.168.0.5 machine</pre>]]></description>
      <wfw:commentRss><![CDATA[http://www.rainsts.net/feed.asp?q=comment&id=1030]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[IPython Magic Functions]]></title> 
      <link><![CDATA[http://www.rainsts.net/article.asp?id=1029]]></link> 
      <category><![CDATA[Tools]]></category> 
      <author><![CDATA[yuhen <null@null.com>]]></author> 
      <pubDate>Mon, 19 Jul 2010 22:03:24 +0800</pubDate> 
      <description><![CDATA[将 IPython 用熟了，可以轻松在试验、编码、测试间 &quot;无缝折腾&quot;。<img src="http://www.rainsts.net/styles/default/images/smilies/icon_lol.gif" border="0" alt="[lol]" /> <br /><pre class="code">$ ipython

Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.

IPython 0.10 -- An enhanced Interactive Python.
?         -&gt; Introduction and overview of IPython&#39;s features.
%quickref -&gt; Quick reference.
help      -&gt; Python&#39;s own help system.
object?   -&gt; Details about &#39;object&#39;. </pre>]]></description>
      <wfw:commentRss><![CDATA[http://www.rainsts.net/feed.asp?q=comment&id=1029]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[Git Commands]]></title> 
      <link><![CDATA[http://www.rainsts.net/article.asp?id=1028]]></link> 
      <category><![CDATA[Tools]]></category> 
      <author><![CDATA[yuhen <null@null.com>]]></author> 
      <pubDate>Sun, 18 Jul 2010 16:42:25 +0800</pubDate> 
      <description><![CDATA[<b>1. 系统设置</b><br /><br />通常情况下，我们只需简单设置用户信息和着色即可。<br /><pre class="code">$ git config --global user.name &quot;Q.yuhen&quot;
$ git config --global user.email qyuhen@abc.com
$ git config --global color.ui true </pre><br />可以使用 &quot;--list&quot; 查看当前设置。<pre class="code">$ git config --list</pre><br /><b>2. 初始化</b><br /><br />创建项目目录，然后执行 &quot;git init&quot; 初始化。这会在项目目录创建 &quot;.git&quot; 目录，即为元数据信息所在。<br /><pre class="code">$ git init</pre><br />通常我们还需要创建一个忽略配置文件 &quot;.gitignore&quot;，并不是什么都需要加到代码仓库中的。<br /><br />]]></description>
      <wfw:commentRss><![CDATA[http://www.rainsts.net/feed.asp?q=comment&id=1028]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[LVM]]></title> 
      <link><![CDATA[http://www.rainsts.net/article.asp?id=1027]]></link> 
      <category><![CDATA[Linux]]></category> 
      <author><![CDATA[yuhen <null@null.com>]]></author> 
      <pubDate>Sun, 11 Jul 2010 16:23:15 +0800</pubDate> 
      <description><![CDATA[LVM 是 &quot;逻辑卷管理 (Logical Volume Manager)&quot; 的简称。简单点说，就是将多个 &quot;物理卷(Physical Volume, PV, 通常是物理硬盘分区)&quot; 合并成一个更大的 &quot;逻辑卷组(Volume Group, VG)&quot;，然后在其上切分和传统分区相同用途的 &quot;逻辑卷 (Logical Volume, LV)&quot;。逻辑卷允许我们在不中断系统运行的情况随时调整文件系统容量大小，理论上具备 &quot;无限&quot; 的热扩容能力。<br /><br /><b>操作步骤:</b><br /><br />(1) 物理硬盘分区(fdisk)<br />(2) 创建物理卷(pvcreate)<br />(3) 创建卷组(vgcreate)<br />(4) 激活卷组(vgchange)<br />(5) 创建逻辑卷(lvcreate)<br />(6) 卷组扩容(vgextend) 或 逻辑卷扩容(lvextent) <br /><br />下面是一个在虚拟机上的操作演示。<br /><br /><b>1. 对新硬盘分区</b><br />]]></description>
      <wfw:commentRss><![CDATA[http://www.rainsts.net/feed.asp?q=comment&id=1027]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[日志: 1000！]]></title> 
      <link><![CDATA[http://www.rainsts.net/article.asp?id=1026]]></link> 
      <category><![CDATA[Misc]]></category> 
      <author><![CDATA[yuhen <null@null.com>]]></author> 
      <pubDate>Thu, 01 Jul 2010 13:12:19 +0800</pubDate> 
      <description><![CDATA[这是我的第 1000 篇博客！<br /><br />从最早在博客园写，到后来 &quot;自立门户&quot;，足足坚持了不少年头，尤其是对一个 IT 技术人员来说。我本来专门为此写了一篇 &quot;长长&quot; 的杂文以资纪念，但末了还是被乱飞的砖头所吓倒，遂心不甘情不愿地放弃了。不管怎么说，这 1000 是个不错的成绩，本老头本菜鸟还是非常高兴滴。<br /><br />开放评论三天，欢迎新老朋友以及路过的 &quot;到此一游&quot;。<br /><br />(直接写名字、验证码和内容即可，不用管那个密码和注册什么的)]]></description>
      <wfw:commentRss><![CDATA[http://www.rainsts.net/feed.asp?q=comment&id=1026]]></wfw:commentRss>
    </item>
      
  </channel>
</rss>
