<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>True EDGE</title>
	<atom:link href="http://blogs.gnome.org/happyaron/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/happyaron</link>
	<description>Hacker builds things.</description>
	<lastBuildDate>Tue, 03 Nov 2009 17:10:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license>		<item>
		<title>Quotation in ConTeXt</title>
		<link>http://blogs.gnome.org/happyaron/2009/11/04/quotation-in-context/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/11/04/quotation-in-context/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 16:56:15 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=169</guid>
		<description><![CDATA[This time I read the guide on ConTeXt Wiki and learned some basic commands doing quotation.
Not very much today in fact.
1.single quotes (&#8217;):

\quote{some text}

2.double quotes (&#8221;):

\quotation{some text}

3.long quote sections:
For single quote:

\startquote ... \stopquote

For double quotes:

\startquotation ... \stopquotation

4.Nested quotations:
Add following lines first:

\setupdelimitedtext
  [quotation]
  [1]
  [left={\symbol[leftquotation]},
   right={\symbol[rightquotation]}]
&#160;
\setupdelimitedtext
  [quotation]
  [2]
  [...]]]></description>
			<content:encoded><![CDATA[<p>This time I read the guide on ConTeXt Wiki and learned some basic commands doing quotation.<br />
Not very much today in fact.<br />
1.single quotes (&#8217;):</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\quote</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">some text</span><span style="color: #E02020; ">}</span></pre></div></div>

<p>2.double quotes (&#8221;):</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\quotation</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">some text</span><span style="color: #E02020; ">}</span></pre></div></div>

<p>3.long quote sections:<br />
For single quote:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\startquote</span> ... <span style="color: #800000; font-weight: normal;">\stopquote</span></pre></div></div>

<p>For double quotes:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\startquotation</span> ... <span style="color: #800000; font-weight: normal;">\stopquotation</span></pre></div></div>

<p>4.Nested quotations:<br />
Add following lines first:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\setupdelimitedtext</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">quotation</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">1</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">left={<span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span><span style="color: #E02020; ">[</span>leftquotation</span><span style="color: #E02020; ">]</span></span><span style="color: #E02020; ">}</span>,
   right=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rightquotation</span><span style="color: #E02020; ">]</span></span><span style="color: #E02020; ">}]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\setupdelimitedtext</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">quotation</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">2</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">left={<span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span><span style="color: #E02020; ">[</span>leftquote</span><span style="color: #E02020; ">]</span></span><span style="color: #E02020; ">}</span>,
   right=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rightquote</span><span style="color: #E02020; ">]</span></span><span style="color: #E02020; ">}]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\setupdelimitedtext</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">quotation</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">3</span><span style="color: #E02020; ">]</span>
  <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">left={<span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span><span style="color: #E02020; ">[</span>leftquotation</span><span style="color: #E02020; ">]</span></span><span style="color: #E02020; ">}</span>,
   right=<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #800000; font-weight: normal;">\symbol</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">rightquotation</span><span style="color: #E02020; ">]</span></span><span style="color: #E02020; ">}]</span></pre></div></div>

<p>Then try with:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\starttext</span>
Testing, <span style="color: #800000; font-weight: normal;">\quotation</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">A long quotation in which one character says,
<span style="color: #800000; font-weight: normal;">\quotation</span><span style="color: #E02020; ">{</span>Eh? What am I supposed to say? Something like, <span style="color: #800000; font-weight: normal;">\quotation</span>
<span style="color: #E02020; ">{</span>Quotations in this sentence are nested</span><span style="color: #E02020; ">}</span>?<span style="color: #E02020; ">}}</span> testing, 1, 2, 3.
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/11/04/quotation-in-context/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Font fallback in ConTeXt Mininals</title>
		<link>http://blogs.gnome.org/happyaron/2009/11/02/font-fallback-in-context-mininals/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/11/02/font-fallback-in-context-mininals/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:53:42 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=138</guid>
		<description><![CDATA[Indubitably, I need to remix Chinese and English in one document. But English characters in Chinese fonts aren&#8217;t look good in most time as others, so font fallback is needed here.
First, make a English font as a fallback of Chinese font:

\definefontsynonym[song][name:adobesongstd]
\definefontfallback[hereos][name:texgyreherosregular][0x0000-0x0400]
\definefontsynonym[fbsong][song][fallbacks=hereos]
&#160;
\definefont[newsong][fbsong]
\setscript[hanzi]
&#160;
\starttext
\newsong 夹杂 English 的中文文本
\stoptext

This means we use texgyreherosregular as the fallback English font and name [...]]]></description>
			<content:encoded><![CDATA[<p>Indubitably, I need to remix Chinese and English in one document. But English characters in Chinese fonts aren&#8217;t look good in most time as others, so font fallback is needed here.<br />
First, make a English font as a fallback of Chinese font:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">song</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontfallback</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hereos</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:texgyreherosregular</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0x0000-0x0400</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">fbsong</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">song</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=hereos</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">newsong</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbsong</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\setscript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hanzi</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttext</span>
<span style="color: #800000; font-weight: normal;">\newsong</span> 夹杂 English 的中文文本
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>This means we use texgyreherosregular as the fallback English font and name it as hereos, 0&#215;0000-0&#215;0400 is the interval of English characters in UTF-8 encoding. Then make &#8220;fbsong&#8221; the new font that is the remix of song (adobesongstd) and fallback hereos (texgyreherosregular).<br />
But on the tutorial I am following, the author said such action will lose some feature when ConTeXt processing English, so change to using a Chinese font as a fallback of English font:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hereos</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:texgyreherosregular</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontfallback</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">song</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0x00400-0x2FA1F</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">fbsong</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">hereos</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=song</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">newsong</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbsong</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\setscript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hanzi</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttext</span>
<span style="color: #800000; font-weight: normal;">\newsong</span> 夹杂~English~的中文文本
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>Then I&#8217;ve rewritten my type-myfonts.tex with fallback font:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\starttypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enserif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavuserif</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enserifbd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavuserifbold</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enserifit</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavuserifitalic</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enserifbi</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavuserifbolditalic</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontfallback</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">umingcn</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:arplumingcn</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0x00400-0x2FA1F</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enserif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=umingcn</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enserifbd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=umingcn</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enserifit</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=umingcn</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifBoldItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enserifbi</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=umingcn</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">ensans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusans</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">ensansbd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansbold</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">ensansob</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansoblique</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">ensansbo</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansboldoblique</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontfallback</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">ukaicn</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:arplukaicn</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0x00400-0x2FA1F</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ensans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=ukaicn</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ensansbd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=ukaicn</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansOblique</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ensansob</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=ukaicn</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansBoldOblique</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ensansbo</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=ukaicn</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enmono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansmono</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enmonobd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansmonobold</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enmonoob</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansmonooblique</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">enmonobo</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:dejavusansmonoboldoblique</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontfallback</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">microhei</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:wenquanyimicroheimono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">0x00400-0x2FA1F</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enmono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=microhei</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enmonobd</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=microhei</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoOblique</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enmonoob</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=microhei</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoBoldOblique</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">enmonobo</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fallbacks=microhei</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">rm</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ss</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">tt</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">fbfont</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\stoptypescript</span></pre></div></div>

<p>And here is an example:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\usetypescriptfile</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">type-myfonts</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\usetypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\setupbodyfont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts,rm,12pt</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\setupbodyfontenvironment</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">default</span><span style="color: #E02020; ">]</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">em=italic</span><span style="color: #E02020; ">]</span> <span style="color: #2C922C; font-style: italic;">% slanted is default emphasize in ConTeXt</span>
<span style="color: #800000; font-weight: normal;">\setscript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hanzi</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\pdfoptionpdfminorversion</span>=6
<span style="color: #800000; font-weight: normal;">\pdfcompresslevel</span>=9
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttext</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\startcomment</span>
this is a test comment, you shouldn't see me.
<span style="color: #800000; font-weight: normal;">\stopcomment</span>
&nbsp;
我们在运行 <span style="color: #800000; font-weight: normal;">\CONTEXT</span><span style="color: #E02020; ">{</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\rm</span> 这是 fbfont 里的 serif，dejavuserif+arplumingcn <span style="color: #E02020; ">\\</span>
<span style="color: #800000; font-weight: normal;">\ss</span> 这是 fbfont 里的 sans，dejavusans+arplukaicn <span style="color: #E02020; ">\\</span>
<span style="color: #800000; font-weight: normal;">\tt</span> 这是 fbfont 里的 mono，dejavusansmono+wenquanyimicroheimono <span style="color: #E02020; ">\\</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>&#8220;setupbodyfontenvironment&#8221; is a command that tell ConTeXt our body&#8217;s font environment, here we change nothing but emphasis to italic instead of default slanted face.<br />
&#8220;%&#8221; is used to take comments and the TeX engine won&#8217;t do anything with items after it to the line&#8217;s ending. Multi-lines comments can be achieved by using &#8220;\startcomment &#8230; \stopcomment&#8221;.<br />
&#8220;\pdfoptionpdfminorversion&#8221; is the setting for pdf option in minor version, and we can have a table to list it:<br />
    * (1993) – PDF 1.0 / Acrobat 1.0<br />
    * (1994) – PDF 1.1 / Acrobat 2.0<br />
    * (1996) – PDF 1.2 / Acrobat 3.0<br />
    * (1999) – PDF 1.3 / Acrobat 4.0<br />
    * (2001) – PDF 1.4 / Acrobat 5.0<br />
    * (2003) – PDF 1.5 / Acrobat 6.0<br />
    * (2005) – PDF 1.6 / Acrobat 7.0<br />
    * (2006) – PDF 1.7 / Acrobat 8.0<br />
    * (2008) – PDF 1.7, Adobe Extension Level 3 / Acrobat 9.0<br />
The value of &#8220;pdfoptionpdfminorversion&#8221; is that x in &#8220;1.x&#8221;, in this example, &#8220;\pdfoptionpdfminorversion=6&#8243;, we set the version to PDF 1.6, correspond to Acrobat 7.0. The default setting is version 5 &#8211; PDF 1.5 for Acrobat 6.0.<br />
&#8220;pdfcompresslevel&#8221; is the compress level of output pdf file, 0 is the least and 9 highest. Default setting is 0.<br />
&#8220;\CONTEXT&#8221; is a sequence to produce the effect of sinking e in TEX. Other interesting are &#8220;\LATEX&#8221; &#8220;\TEX&#8221;, also &#8220;\LaTeX&#8221; and &#8220;\TeX&#8221; is acceptable, but I didn&#8217;t find how to produce a LaTeX2e, not &#8220;\LaTeXe&#8221; in LaTeX.<br />
The {} after &#8220;\CONTEXT{}&#8221; tell the TeX engine don&#8217;t eat all extra whitespace and empty lines.<br />
&#8220;\\&#8221; means force line breaking, we cannot use &#8220;\newline&#8221; as LaTeX does.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/11/02/font-fallback-in-context-mininals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Font model in ConTeXt &#8211; quick view from a starter</title>
		<link>http://blogs.gnome.org/happyaron/2009/11/02/font-model-in-context-quick-view-from-a-starter/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/11/02/font-model-in-context-quick-view-from-a-starter/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:30:14 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=140</guid>
		<description><![CDATA[There are three basic fonts in Chinese, Song, Hei and Fangsong, corresponding to Serif, Sans and Monospace in Latin characters. Another category is numbers, it is recognized as a separate category by ConTeXt.
Using Adobe&#8217;s three fonts as a example, we can define type-myfonts.tex, a typescript file:

\starttypescript[serif][zhfont]
    \definefontsynonym[Serif][name:adobesongstd]
    \definefontsynonym[SerifBold][name:adobesongstd]
  [...]]]></description>
			<content:encoded><![CDATA[<p>There are three basic fonts in Chinese, Song, Hei and Fangsong, corresponding to Serif, Sans and Monospace in Latin characters. Another category is numbers, it is recognized as a separate category by ConTeXt.<br />
Using Adobe&#8217;s three fonts as a example, we can define type-myfonts.tex, a typescript file:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\starttypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SerifBoldItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobesongstd</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobeheitistd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobeheitistd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobeheitistd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">SansBoldItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobeheitistd</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span> <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">Mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobefangsongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoBold</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobefangsongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobefangsongstd</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definefontsynonym</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">MonoBoldItalic</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:adobefangsongstd</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\stoptypescript</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">rm</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">serif</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">ss</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">sans</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
    <span style="color: #800000; font-weight: normal;">\definetypeface</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">tt</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">mono</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">zhfont</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\stoptypescript</span></pre></div></div>

<p>Explanation by line:<br />
&#8220;\starttypescript[serif][zhfont]&#8221; means starting a typescript profile, named &#8220;serif&#8221; and classify it in &#8220;zhfont&#8221;;<br />
&#8220;\definefontsynonym[Serif][name:adobesongstd]&#8221; means start a font synonym definition, and assign &#8220;Serif&#8221; to &#8220;adobesongstd&#8221;;<br />
&#8220;\stoptypescript&#8221; means finishing a profile.<br />
We need to pay some attention at the last profile, that is to say &#8220;\definetypeface[myfonts][rm][serif][zhfont]&#8220;, we define the typeface series &#8220;myfonts&#8221; in this profile, and this line represent the &#8220;rm&#8221;, roman, face is assigned to serif, which we have defined in previous profiles, and &#8220;ss&#8221; fo &#8220;sans&#8221;, &#8220;tt&#8221; for &#8220;teletype&#8221; or rather &#8220;monospace&#8221; as we know.<br />
Then write another file, save as test.tex:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\usetypescriptfile</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">type-myfonts</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\usetypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\setupbodyfont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts,rm,12pt</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttext</span>
所有动物都生而平等，但有些动物比其他动物更平等
<span style="color: #800000; font-weight: normal;">\ss</span> 所有动物都生而平等，但有些动物比其他动物更平等
<span style="color: #800000; font-weight: normal;">\tt</span> 所有动物都生而平等，但有些动物比其他动物更平等
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>For explanation, &#8220;\usetypescriptfile[type-myfonts]&#8221; tell the TeX engine to find a typescript file named type-myfonts.tex in the same directory as current file, and include the contents here;  \usetypescript[myfonts]&#8221; tell it we are using &#8220;myfonts&#8221; typescript set as defined in type-myfonts.tex; &#8220;\setupbodyfont[myfonts,rm,12pt]&#8221; is telling that set the body font to myfonts&#8217;s rm style, with 12pt as the size.<br />
Between &#8220;\starttext&#8221;&#8230;&#8221;\stoptext&#8221; is the text, first line using default font, \rm, and second line change to \ss finaly \tt.<br />
Here is a list to tell font model:<br />
<img src="http://blogs.gnome.org/happyaron/files/2009/11/287aad4478e46712ae62ee809eff9fa9.png" alt="Font model from ConTeXt wiki" /><br />
Next we need to make ConTeXt know how to wrap lines for Chinese, that is, to break a long sentence into lines in a page. What we need to do is add &#8220;\setscript[hanzi]&#8221; to the header. Another example of test.tex:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\usetypescriptfile</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">type-myfonts</span><span style="color: #E02020; ">]</span> 
<span style="color: #800000; font-weight: normal;">\usetypescript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts</span><span style="color: #E02020; ">]</span> 
<span style="color: #800000; font-weight: normal;">\setupbodyfont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">myfonts,rm,12pt</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\setscript</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">hanzi</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #800000; font-weight: normal;">\starttext</span>
明亡后，朝鲜和日本认为中国已亡，日本从此蔑称中国为“支那”。明治维新后，自认为华夏正统的日本曾打着“攘夷主义”的旗号发动甲午战争等对清战争。  
<span style="color: #800000; font-weight: normal;">\stoptext</span> </pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/11/02/font-model-in-context-quick-view-from-a-starter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing ConTeXt Minimals</title>
		<link>http://blogs.gnome.org/happyaron/2009/11/01/installing-context-minimals/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/11/01/installing-context-minimals/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 18:56:29 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=127</guid>
		<description><![CDATA[I&#8217;ve chosen to study a TeX, and finally choose ConTeXt because it uses LuaTeX engine that can support Chinese with less pain than using LaTeX as well as someone is complaining about XeTeX may output a lower quality. I don&#8217;t know who&#8217;s true, but according to my own perception, ConTeXt Minimals with LuaTex may be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve chosen to study a TeX, and finally choose ConTeXt because it uses LuaTeX engine that can support Chinese with less pain than using LaTeX as well as someone is complaining about XeTeX may output a lower quality. I don&#8217;t know who&#8217;s true, but according to my own perception, ConTeXt Minimals with LuaTex may be the best choice, so I start this category of blog to track my course studing it.<br />
Today, I am trying to install it and output my first result file.</p>
<p>Installation is quite easy:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>context <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>context
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>minimals.contextgarden.net<span style="color: #000000; font-weight: bold;">/</span>setup<span style="color: #000000; font-weight: bold;">/</span>first-setup.sh</pre></div></div>

<p>It will call rsync and use ruby to achieve this, so make sure they are installed on system.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sh</span> first-setup.sh</pre></div></div>

<p>This will give you a dev-shot of ConTeXt Minimals, if a stable version is needed, run the following instead:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sh</span> first-setup.sh <span style="color: #660033;">--context</span>=current</pre></div></div>

<p>I continue with the dev version. Note, every time we want do an update of the program or move it somewhere else, we need to run the command above to make all things work.<br />
If we don&#8217;t have a connective Internet available but still want to change the directory, we may run the following command in the context/ folder with tex/ under it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mtxrun <span style="color: #660033;">--verbose</span> <span style="color: #660033;">--script</span> .<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mtx-update.lua <span style="color: #660033;">--update</span> <span style="color: #660033;">--make</span> <span style="color: #660033;">--force</span> <span style="color: #660033;">--engine</span>=all <span style="color: #660033;">--context</span>=beta <span style="color: #660033;">--texroot</span>=<span style="color: #007800;">$PWD</span><span style="color: #000000; font-weight: bold;">/</span>tex $<span style="color: #000000; font-weight: bold;">@</span></pre></div></div>

<p>Next, make sure there are fonts needed installed, on my system it&#8217;s /usr/share/fonts, with wqy-zenhei and wqy-microhei as my Chinese fonts and others like DejaVu and Droid as English fonts.<br />
We need to refresh the system&#8217;s font cache before continue, otherwise some fonts won&#8217;t work.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> fc-cache <span style="color: #660033;">-f</span></pre></div></div>

<p>Then add the system&#8217;s font directory to setuptex, which file is placed at ~/usr/context/tex/setuptex in my installation, add the following line at the end of file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">OSFONTDIR</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>fonts</pre></div></div>

<p>Reload font cache for ConTeXt:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mtxrun <span style="color: #660033;">--script</span> fonts <span style="color: #660033;">--reload</span></pre></div></div>

<p>Generate a list of usable fonts:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mtxrun <span style="color: #660033;">--script</span> fonts <span style="color: #660033;">--list</span> <span style="color: #000000; font-weight: bold;">&gt;</span> font-names.txt</pre></div></div>

<p>First row represents the font name we will use in our tex file, second is descriptions like font name in true life, the third line is the path to the font file in system.<br />
Finally source the setuptex file to make this environment sensible for current console:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">source</span> ~<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>context<span style="color: #000000; font-weight: bold;">/</span>tex<span style="color: #000000; font-weight: bold;">/</span>setuptex</pre></div></div>

<p>Now, we&#8217;ve finished setting up a environment that can work.<br />
The easiest example may be like this:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\starttext</span>
Hello world!
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>Have another test with Chinese:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\definefont</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">uming</span><span style="color: #E02020; ">][</span><span style="color: #C08020; font-weight: normal;">name:arplumingcn</span><span style="color: #E02020; ">]</span>               
<span style="color: #800000; font-weight: normal;">\starttext</span>
<span style="color: #800000; font-weight: normal;">\uming</span>  
终于看到中文了！
<span style="color: #800000; font-weight: normal;">\stoptext</span></pre></div></div>

<p>First line assign &#8220;uming&#8221; as &#8220;arplumingcn&#8221;, that is &#8220;uming&#8221; will be used in the following of this file to represent the &#8220;arplumingcn&#8221;, which is the name of this font that we can see in the first row of former generated font-names.txt.<br />
Second line tell the program we are starting the text, and the next line tell it we are choosing font &#8220;uming&#8221; for following text. And the last line tell it the text is finished.<br />
I save the file as hello.tex, and use this command to produce the result:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">context hello</pre></div></div>

<p>also we can use hello.tex, but like other Tex environment, ConTeXt knows that it is processing a TeX file so the suffix can be omitted safely.<br />
The the program print many things to our console and finally stopped with several hello.* files in our working directory, and hello.pdf is lying there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/11/01/installing-context-minimals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Come with Karmic!</title>
		<link>http://blogs.gnome.org/happyaron/2009/10/29/come-with-karmic/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/10/29/come-with-karmic/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 13:15:46 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=123</guid>
		<description><![CDATA[Hi planet, I am finally part of  Ubunu Member at the point we are releasing Karmic, cheers for myself and everybody!
]]></description>
			<content:encoded><![CDATA[<p>Hi planet, I am finally part of  Ubunu Member at the point we are releasing Karmic, cheers for myself and everybody!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/10/29/come-with-karmic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boosting network for your PC &#8211; DNS settings</title>
		<link>http://blogs.gnome.org/happyaron/2009/08/29/boosting-network-for-your-pc-dns-settings/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/08/29/boosting-network-for-your-pc-dns-settings/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 13:08:34 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=111</guid>
		<description><![CDATA[Do you think your web browser is not so fast as you expected? I decide to write a series of articles to support you speeding up your network. Follow me to tune your settings and get joys surfering the net!
This article is written on Linux, especially I am using Ubuntu 9.04, but I will try [...]]]></description>
			<content:encoded><![CDATA[<p>Do you think your web browser is not so fast as you expected? I decide to write a series of articles to support you speeding up your network. Follow me to tune your settings and get joys surfering the net!</p>
<p>This article is written on Linux, especially I am using Ubuntu 9.04, but I will try to mention notices for other distributions and platforms.</p>
<p>This is the first peice in &#8216;Boosting network for your PC&#8217;, the topic is DNS settings. One question, does your ISP ship low quality DNS service?</p>
<p>At first place, I recommend you to use OpenDNS, whose slogan is &#8216;Safer, Faster and Smarter&#8217;. Let me tell the reason why to turn form your ISP&#8217;s service to this one. OpenDNS is a free service, and there is many features other providers cannot give you, such as a smarter site guide, spell checking, and smart cache to keep your query while the requested site&#8217;s name server is not working properly, phishing and malware site bloking &#8230; Somebody might say we can use client-based tools to do most of them, but do you think it&#8217;s a better way to keep the annoyance away from the source? There is more features provided and I haven&#8217;t listed one by one, but it worth a try.</p>
<p>It is not difficult to turn to OpenDNS, set main DNS server to 208.67.222.222 and backup server to 208.67.220.220 on your PC&#8217;s connection setting or on your router. Generally we can change it in resolv.conf on a Linux machine, but GNOME users should do it on network-manager if you use it because it will rewrite resolv.conf automaticlly. For those who use xDSL, edit your DSL setting, you can find IPv4 option tab, change the method to PPPoE Address Only, and input the two DNS server addresses in order &#8220;main, backup&#8221;.</p>
<p>If you have a static IP address, then you should register on https://www.opendns.com, add your network&#8217;s IP address to your dashboard, then set your own settings for content filtering, enable the SmartCache, block internal IP addresses to avoid DNS Rebinding Attacks, thus these features are not enabled or can be customized. If you use a dynamic IP address, for example, you are a xDSL user, don&#8217;t worry about you cannot have your own account and your custom settings. All you need to do more is install a client to update your address to OpenDNS&#8217;s server, and enable the dynamic update feature in you dashboard. On Windows and Mac, they provide their client programs, you can just install can configure it easily according to the guide; on Linux/Unix, you can use &#8216;ddclient&#8217; which is a free software, you can download it from its homepage on http://ddclient.sourceforge.net, or you may find it just lying in your distribution&#8217;s repository. I recommend you to install it as a service, or called daemon. Here is a example for what I have done on my Ubuntu box:<br />
1. Install ddclient using apt, or synaptic, or whatever package manager you like, here is what I ran in a terminal:</p>
<pre>sudo aptitude install ddclient</pre>
<p>You don&#8217;t need to care about what you have chosen on the debconf interface, soon we&#8217;ll chage the configuration file.</p>
<p>2. Configure ddclient via editing its configuration file, use whatever editor you like to edit /etc/ddclient.conf first, for example I run this command:</p>
<pre>sudo vi /etc/ddclident.conf</pre>
<p>Then make your file look like this:</p>
<pre>daemon=600</pre>
<pre>syslog=yes</pre>
<pre>ssl=yes</pre>
<pre>pid=/var/run/ddclient.pid</pre>
<pre>protocol=dyndns2</pre>
<pre>use=web, web=whatismyip.com</pre>
<pre>server=updates.opendns.com</pre>
<pre>login=your-account-name</pre>
<pre>password='your-account-password'</pre>
<pre>your-lable-in-account-settings</pre>
<p>The first line without # at its start intends to tell ddclient refresh information to the server every 600 seconds if it is running as a daemon. This section is not needed for Ubuntu user in fact, because it is configured in the other file we&#8217;ll look at, just a note here for others who many use it. I think 600 is a suitable value for most network, or you can adjust it to meet your actual needs. Update the information too frequently is a waste of resource, having a too long interval time may let your service not working so properly sometimes.</p>
<p>The second line intends to make every update logged at syslog, you can delete this line if you don&#8217;t want to.</p>
<p>The third line is for turning on ssl support, in other word we can transfer our account information using an encrypted route.</p>
<p>The forth line is the PID file path, don&#8217;t change it unless you know what your are doing exactly.</p>
<p>The fifth line tells what protocal you use, OpenDNS requires dyndns2 protocal.</p>
<p>The sixth line is the way you get your current IP address for transferring to the server, the defaut value was &#8220;use=if, if=&#8221;, than means you can set a net interface such as eth0 here and ddclient will send eth0&#8217;s address. When we are using PPPoE or other virtual connection protocal, this configure may be damnned, so we set it using web to check you real IP, whatismyip.com is the host provide such service, you can change it to something you like, but I think copy-and-paste this line to your configuration is the best choice.<br />
The next three lines is the information about the server and your account, you should copy the server address, and fill in your account name and password there. Don&#8217;t worry about your account&#8217;s security here, the ddclient.conf is only accessable for root user by default, and we have chosen to use ssl at the begging of this configuration.</p>
<p>The last line is the LABLE you have set in your dashboard, they are something might be Home, Office, etc.</p>
<p>Next, we should enable daemon mode for ddclient, edit /etc/default/ddclient.conf with root privilege:</p>
<pre>sudo vi /etc/default/ddclient.conf</pre>
<p>Make sure the following lines are just look like what have shown below:</p>
<pre>run_ipup="true"</pre>
<pre>run_daemon="true"</pre>
<pre>daemon_interval="600"</pre>
<p>The first line is whether ddclient does an update while a new ppp conection is establed, this is useful for those who use a xDSL, or other dial-on-demand connections.</p>
<p>The second line is whether ddclient run as a daemon, we change it to true here. Only run as a daemon, it can perform the set actions automaticlly.<br />
The last line is how long should it takes from one update to another, I was explained before in the first line of previous configuration file.</p>
<p>3. Restart ddclient to make everything into effect.</p>
<pre>sudo /etc/init.d/ddclient restart</pre>
<p>We have finished configuring OpenDNS till here, visit https://www.opendns.com/welcome/ to check!</p>
<p>Second, use DNS cache to speed up the look up action. This is for Linux/Unix users, I don&#8217;t know if there is any good replacement for other platforms. I introduce dnsmasq here to do this task.</p>
<p>1. Install dnsmasq, you can find it in main aspect of distributions‘ repository.</p>
<p>For Ubuntu, perform the following action:</p>
<pre>sudo aptitude install dnsmasq</pre>
<p>2. Edit /etc/dnsmasq.conf to fit our use:</p>
<pre>sudo vi /etc/dnsmasq.conf</pre>
<p>And make sure the following line is uncommented:</p>
<pre>listen-address=127.0.0.1</pre>
<p>You can choose to change other settings if you are interested in the file, there is enough comments for you to know what every options sense, but leave it there is a good solution.</p>
<p>3. Restart dnsmasq</p>
<pre>sudo /etc/init.d/dnsmasq restart</pre>
<p>4. Add 127.0.0.1 to you DNS list. We can edit resolv.conf to make that line at first of ns servers, or change in network-manager.</p>
<p>5. Restart networking, you don&#8217;t need to restart your computer.</p>
<pre>sudo /etc/init.d/networking restart</pre>
<p>So close and re-open your web browser, do you feel web pages load faster?</p>
<p>Third, tune your firefox(if you use it). Input about:config in your firefox location bar, filter the following items and change their values to &#8216;true&#8217;:</p>
<pre>network.http.pipelining</pre>
<pre>network.http.proxy.pipelining</pre>
<pre>plugin.expose_full_path</pre>
<p>And change the following item&#8217;s value to 8 or 10:</p>
<pre>network.http.pipelining.maxrequests</pre>
<p>Add these items to the list via right click and choose &#8216;Add -&gt; Interger&#8217;, note to set the value according to the last number listed below:</p>
<pre>nglayout.initialpaint.delay 0</pre>
<pre>content.notify.backoffcount 5</pre>
<pre>ui.submenuDelay 0</pre>
<p>If you don&#8217;t have IPv6 connection, also change this item&#8217;s value to &#8216;true&#8217;:</p>
<pre>network.dns.disableIPv6</pre>
<p>Restart your firefox will make it effect.</p>
<p>In Ubuntu 9.04, the IPv6 support was built in kernel, if you compile kernel by yourself, you can uncheck this feature if you don&#8217;t need it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/08/29/boosting-network-for-your-pc-dns-settings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Differences among several kernel signals</title>
		<link>http://blogs.gnome.org/happyaron/2009/08/09/differences-among-several-kernel-signals/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/08/09/differences-among-several-kernel-signals/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 18:50:21 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=93</guid>
		<description><![CDATA[Here is the final summary.
Today I was fuzzied by the help content of the command &#8216;timeout&#8217;, as its name suggest, it a COMMAND, and kill it if still running after a specified period of time. Because of its termination action, I met something related to signals. Googled and finally make a summary here, that is, [...]]]></description>
			<content:encoded><![CDATA[<h4>Here is the final <a href="#sum">summary</a>.</h4>
<p>Today I was fuzzied by the help content of the command &#8216;timeout&#8217;, as its name suggest, it a COMMAND, and kill it if still running after a specified period of time. Because of its termination action, I met something related to signals. Googled and finally make a summary here, that is, what&#8217;s the differences among HUP, INT, KILL, TERM, USR1 signal.<br />
Everytime when we shutdown our Linux box, it will show &#8220;Sending all processes the TERM signal&#8221; then &#8220;Sending all processes the KILL signal&#8221;. Definatly, the TERM signal can be more graceful than KILL, but the best thing we should do now might be looking up the manual page.<br />
In the manual page of kill(7), we get something like this (I&#8217;ve ignored things not closely connected to our topic, same below):<br />
Name    Num    Action    Description<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
HUP        1        exit<br />
INT        2        exit<br />
KILL        9        exit        cannot be blocked<br />
TERM    15        exit<br />
USR1            exit<br />
Seems not so much information provided. Anyway, we can know they are all related to the process exit action,and the KILL (9) signal cannot be blocked, in other words it cannot be caught by a process so they don&#8217;t have the chance to have actions to block it.</p>
<p>Then I searched Google and found some hints from Apache httpd documentation.In the section of Stopping and Restarting, we can see content which have the meaning like this (all signals should be sent to a parent process in this place):<br />
TERM &#8211; stop now: The parent immediately attempt to kill off all of its children. It may take it several seconds to complete killing off its children. Then the parent itself exits. Any requests in progress are terminated, and no further requests are served.<br />
USR1 &#8211; graceful restart: The parent &#8220;advise&#8221; the children to exit after their current request (or to exit immediately if they&#8217;re not serving anything). The parent re-reads its configuration files and re-opens its log files. As each child dies off the parent replaces it with a child from the new generation of the configuration, which begins serving new requests immediately.<br />
HUP &#8211; restart: The parent kill off its children like in TERM, but the parent doesn&#8217;t exit. It re-reads its configuration files, and re-opens any log files. Then it spawns a new set of children and continues serving hits.</p>
<p>But things provided still cannot explain our question. Ah, from the last line of manual page of kill(7) we can see there should be another page named &#8217;signal&#8217;. Okay, look up into it and here is what we get :<br />
Signal    Value    Action    Comment<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
SIGHUP    1        Term    Hangup detected on controlling terminal or death of controlling process<br />
SIGINT    2        Term    Interrupt from keyboard<br />
SIGKILL    9        Term    Kill signal<br />
SIGTERM    15        Term    Termination signal<br />
SIGUSR1    30,10,16    Term    User-defined signal 1<br />
SIGUSR2    31,12,17    Term    User-defined signal 2<br />
Hoo! More information are displayed!</p>
<p>Finally, we can have a short <span id="sum">summary</span>:</p>
<p>TERM &#8211; Terminate &#8211; This signal you send if you want to end a process. It allows the process to clean up nicely though, not like the -9 option (KILL) which just ends everything.<br />
INT &#8211; Interrupt &#8211; This is a permission which for instance can be used in an NFS environment. If a process hangs, you can interrupt it with say the Ctrl C option.<br />
KILL &#8211; exactly what it says. It kills a process without allowing it to clean up, meaning, end all threads, kill child processes etc. It just stops it and can leave either files or other processes in an inconsistant state.<br />
HUP &#8211; Hang UP &#8211; What this signal does is, when you send it to say the inetd process, it basically tells inetd to go reread it&#8217;s configuration file as certain changes have been made which you have to incorporate now. The process doesn&#8217;t actually stop, it just, like stated, rereads it&#8217;s config.<br />
USR1 &#8211; This is a user defined signal. For instance, on our Tru64 systems, we use this signal to tell say the binary log daemon to go save it&#8217;s current log file, archive it, and then start a new one. I imagine though it could be used for many other things, thus user defined.</p>
<h4>Reference:</h4>
<p>1.Manual pages <a href="http://manpages.ubuntu.com/manpages/jaunty/en/man1/kill.1.html" target="_blank">kill(1)</a>, <a href="http://manpages.ubuntu.com/manpages/jaunty/en/man7/signal.7.html" target="_blank">signal(7)</a>.<br />
2.Apache HTTP Server Documentation Version 2.2 &#8211; <a href="http://httpd.apache.org/docs/2.2/stopping.html">Stop and Restarting</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/08/09/differences-among-several-kernel-signals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Split .ape files with cue and convert to flac</title>
		<link>http://blogs.gnome.org/happyaron/2009/08/01/split-ape-cue-convert-flac/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/08/01/split-ape-cue-convert-flac/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 10:08:11 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[Multimedia]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=86</guid>
		<description><![CDATA[Split .ape files with cue and convert to flac format is not so difficult.
We do it on an Ubuntu box for example:
First, install the dependency of shntool, flac, mac, cuetools
sudo aptitdue install flac shntool cuetools
and download mac package in form of deb or tarball.
Run the following command in a terminal:
shntool split -f FileName.cue -t '%n. [...]]]></description>
			<content:encoded><![CDATA[<p>Split .ape files with cue and convert to flac format is not so difficult.</p>
<p>We do it on an Ubuntu box for example:</p>
<p>First, install the dependency of shntool, flac, mac, cuetools</p>
<pre>sudo aptitdue install flac shntool cuetools</pre>
<p>and download mac package in form of <a href="http://ubuntu:ubuntuftp@ftp.ubuntu.org.cn/home/cnfavor/soft/mac_3.99-u4-b5-1_i386.deb">deb</a> or <a href="http://ubuntu:ubuntuftp@ftp.ubuntu.org.cn/home/cnfavor/soft/mac_3.99-u4-b5.orig.tar.gz">tarball</a>.</p>
<p>Run the following command in a terminal:</p>
<p><span class="content"><span class="block" style="margin-left: 0px ! important;"><code class="plain">shntool </code><code class="functions">split</code> <code class="plain">-f FileName.cue -t '%n. %t' -o flac FileName.ape</code></span></span></p>
<p><span class="content"><span class="block" style="margin-left: 0px ! important;">and the output .flac files&#8217; name follows this sequence:</span></span></p>
<p>1. Track1name.flac</p>
<p>2.Track2name.flac</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/08/01/split-ape-cue-convert-flac/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Anjuta-old PPA updated</title>
		<link>http://blogs.gnome.org/happyaron/2009/07/25/anjuta-old-update-2ppa2/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/07/25/anjuta-old-update-2ppa2/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 05:51:28 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[Debian Packaging]]></category>
		<category><![CDATA[Anjuta]]></category>
		<category><![CDATA[PPA]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=70</guid>
		<description><![CDATA[Good afternoon!
I have updated anjuta-old packages in my PPA, which contains new Simplified Chinese translations (po/zh_CN.po) by Pengyuan Jin &#60;jinpengyuan at gmail dot com&#62;, and added the packages for Ubuntu Karmic (9.10).
In Jaunty, the version number has changed to anjuta-old &#8211; 1:1.2.4a-2 , and in Karmic, anjuta-old &#8211; 1:1.2.4a-2~ppa2. I modified the build dependency of [...]]]></description>
			<content:encoded><![CDATA[<p>Good afternoon!</p>
<p>I have updated anjuta-old packages in my PPA, which contains new Simplified Chinese translations (po/zh_CN.po) by Pengyuan Jin &lt;jinpengyuan at gmail dot com&gt;, and added the packages for Ubuntu Karmic (9.10).</p>
<p>In Jaunty, the version number has changed to anjuta-old &#8211; 1:1.2.4a-2 , and in Karmic, anjuta-old &#8211; 1:1.2.4a-2~ppa2. I modified the build dependency of libzvt-dev to libvte-dev, the build progress succeeded finally, but I still doubt if these two development libraries are necessary.</p>
<p>Since I changed my username on launchpad after first release of the packages, users needn&#8217;t change the signature keys,  they aren&#8217;t changed, but need to check your source repository lines to:If you have any questions or suggestions, or any problems while using the packages, please contact me.</p>
<p>Ubuntu Jaunty (9.04):</p>
<p>deb http://ppa.launchpad.net/happyaron/anjuta-old/ubuntu jaunty main<br />
deb-src http://ppa.launchpad.net/happyaron/anjuta-old/ubuntu jaunty main</p>
<p>Ubuntu Karmic (9.10):</p>
<p>deb http://ppa.launchpad.net/happyaron/anjuta-old/ubuntu karmic main<br />
deb-src http://ppa.launchpad.net/happyaron/anjuta-old/ubuntu karmic main</p>
<p>Thanks for your support!</p>
<p>Previous entry:<a href="http://blogs.gnome.org/happyaron/2009/05/17/anjuta-old/"> http://blogs.gnome.org/happyaron/2009/05/17/anjuta-old/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/07/25/anjuta-old-update-2ppa2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安全备忘录：保护您的计算机</title>
		<link>http://blogs.gnome.org/happyaron/2009/06/07/security-memorandum/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/06/07/security-memorandum/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 11:44:20 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=54</guid>
		<description><![CDATA[授权信息：
Creative Commons License Deed. 署名-非商业性使用-禁止演绎2.5 中国大陆
作者：远景论坛 系统与网络安全讨论区版主 aronmalache
（Aron Xu &#60;aronmalache (AT) 163 (DOT) com&#62;）
http://blogs.gnome.org/happyaron/2009/06/07/security-memorandum/
转载请注明作者及出处。
版本历史：
2008年12月14日 第一版
2008年12月15日 第一版+词语修正
2009年01月09日 第一版+小改，或者可以叫1.1版
2009年06月07日 第一版+小改
在这里提醒您注意保护您的计算机，保证正常使用和数据安全。
以下是一些注意事项，大多是最实用，最基本，也是“性价比”最高的(针对Windows用户)，如果你有一定的计算机使用经验，这篇应当就算是一个备忘路，而如果你常被安全问题困扰，不论你是高手还是菜鸟与否，我想都会有些帮助或者启发吧：
1.定期给系统打补丁，或者说是进行系统更新。最简单的解决方法是打开系统带的自动更新；但是很多用户因为各种原因不愿意或者不能打开自动更新，这就需要进行手动更新。手动更新可以由360安全卫士，瑞星卡卡安全助手以及部分杀毒软件完成。在平时可以每1-2周进行一次更新，在安全威胁比较高的时期要保证1周能检查安装一次。对于服务器用户最好是能在安装到实际应用的服务器前进行一下测试，以了解安装更新后会带来哪些改变，很多更新是不能完全卸载的。
2.定期更新安全防护软件。基本上所有的安全防护软件都提供了自动更新，推荐将其打开。切记不要同时安装超过一套安全防护软件，即便是看起来没有什么冲突或者错误。因 为系统的底层资源是固定的，多个软件争夺势必造成功能损失。这里推荐几套软件，要说的一点是选择安全产品是要针对用户习惯，需求等来确定的，不要人云亦 云：ESET NOD32，卡巴斯基，Norton，Mcafee，瑞星，江民。对于ARP攻击频繁的地方强烈推荐使用ESET NOD32和瑞星，防御效果相对更好。这里要注意的是ARP攻击分客户端和网关端两种，我们能防御的都是客户端的这种，如果服务器端受到了有效的攻击我们也无能为力，这也是有的朋友遇到了装了ARP攻击防御软件仍然出现问题的原因。最根本的解决办法是ARP双向静态绑定（客户端和网关都绑定）。另外，ADSL用户如果只有一台电脑上网则不存在风险，可以放心关闭ARP防御功能。
3.不要把所有安全责任都丢给安全防护软件。安全防护软件仅仅是保证计算机安全的工具。在中国，U盘，游戏，QQ，网页挂马，局域网已经成为传播病毒的基本途径。很多人的U盘上都有不只一中病毒，而游戏，QQ，网页病毒多数是因为经济利益问题。一般情况下安全软件的主动防御和文件监控能起到比较好的效果，尤其是在有移动设备如U盘，移动硬盘，SD卡等接入前，最好打开这些监控，并查看是否屏蔽了U盘自动运行。不要浏览非法包含非法信息的网站，因为这样的网站多数都带有病毒或者恶意插件安装。即使开启了自动更新，主动防御和文件监控，也要定期进行全盘扫描，一般需要在1-2周进行一次，扫描前需要手工更新杀毒软件的病毒库和引擎到最新版本。不要随便打开别人给的文件，即使对方是可以信任的朋友，因为无法确定他知不知道已经感染了。而且杀毒软件不能有效地控制未知病毒，而很多时候都是有不少用户被感染了，才有安全公司在病毒库上添加了记录。同时不可轻易相信任何杀毒软件的可疑程度检测，那个基本上都是没有多少可信度的。这项技术一直都是实验室水平的，对于实际应用基本没有什么价值，之所以会发布是因为各个公司之间的商业竞争，有的公司拿这个来吸引不知情的用户，导致了恶性的循环。当然，病毒家族检测现在已经比较成熟了，如果杀毒软件提示是哪个病毒的变种，这个就需要小心了。
4.注意文件备份，特别是重要文件更是如此。备份可以使数据丢失时损失尽可能少。有很多 人因为中了病毒辛辛苦苦积累了很多年的文件都因为被病毒感染无法清除而不得不与之挥手告别，实际上可以通过备份来解决这些问题。但是最好不要在当前硬盘或 者U盘中备份，因为我们要保护的就是它们上面的数据。可以采用光盘备份，现在DVD刻录机和光盘的价格也越来越低，这不失为一中好的选择。切记不要以为系统做了Ghost镜像就没有问题了，众所周知，熊猫烧香会删除它能发现的所有Ghost镜像。实际上这个技术是很基础的，主要是看病毒作者是否想要添加这样的功能。
5.注意文件保密，对于有需要的文件进行加密。有些人会在计算机上安装“闪盘窥探者”，会试图把连接到机器上的移动储存设备的文件全部复制到一个指定的地方，这样会使U盘里的重要文件暴露出去。加密方式上有很多U盘和移动硬盘支持加密功能，可以直接使用。但是大部分的还是没有这个功能的，这种情况下，对于Office文档不要直接使用软件自带的加密方式，因为很容易破解。实际上rar,zip等压缩程序的加密也很难应对暴力破解，而这些格式通常都已经有了很完整的暴力破解工具。这里只能提醒大家使用的密码尽量长一点，比如12-16位的一般就很难破解了，同时不要使用英文单词，生日，姓名，游戏帐号等信息作为密码，也不要单纯地使用数字或字母。一个很好的办法是想一句话，然后把这句话的每个单词（如果是英文）或者是每个字的拼音（汉字的话）的第一个字母组成一串，然后在里面添加上标点符号和数字（根据喜好，可以不改变标点符号的位置）。这种方法创建出来的密码既容易记又有很高的保密性，同样适用于其他场合。如果有更高的安全要求，还可以使用GnuPG这样的密钥策略，2048位的密钥容量很是够用，而且配套工具也比较齐全，可以方便使用。
6.谨慎对待各种小程序，小工具，比如注册机，Hash程序等等。因为名气不大所以不会受到很多人的检验，有的时候下载的文件其实和原版的文件不一样，或者原版的文件就包含了恶意代码。部分内存注册机会被一些杀毒软件报毒，是因为在程序运行时正常情况下一个程序不应该直接修改其他应用程序的内存，而内存注册机却正是通过这种办法实现破解的。
7.不要随便点“确定”“是”“允许”“下一步”一类的按钮。通常情况下很多用户习惯了看见对话框或者提示就点这些内容，但是这种习惯也为病毒感染提供了条件，很多时候杀毒软件或者系统的UAC(针对Vista)会阻止不应该运行的程序运行，但是如果点了这些，很多时候是允许他们运行，这是一个习惯问题，不要因为每天点“允许”花了眼，手一滑就让不该运行的东西运行了。这样也能阻止很多恶意插件的安装。很多人安装应用程序的时候总是一路点击下一步，这样也会导致很多的不需要的插件被安装。而每一次这样的软件安装，都是会给软件作者一定的收入的，而且收入相当高，一般每安装成功一例就是1元钱左右。
8.不懂的情况下不要玩病毒或者研究黑客技术。因为很多时候那些工具也都被封装者添加了病毒，而你又不能让杀毒软件来捣鬼，这个时候就很无奈了。没有解决不了的问题，还是不要因为一点小事而要把别人黑了或者怎么样了。
]]></description>
			<content:encoded><![CDATA[<p>授权信息：<br />
Creative Commons License Deed. 署名-非商业性使用-禁止演绎2.5 中国大陆</p>
<p align="left">作者：远景论坛 系统与网络安全讨论区版主 aronmalache</p>
<p>（Aron Xu &lt;aronmalache (AT) 163 (DOT) com&gt;）</p>
<p><a href="http://blogs.gnome.org/happyaron/2009/06/07/security-memorandum/" target="_blank"><span id="sample-permalink">http://blogs.gnome.org/happyaron/2009/06/07/<span id="editable-post-name" title="Click to edit this part of the permalink">security-memorandum</span>/</span></a><br />
转载请注明作者及出处。</p>
<p>版本历史：<br />
2008年12月14日 第一版<br />
2008年12月15日 第一版+词语修正<br />
2009年01月09日 第一版+小改，或者可以叫1.1版<br />
2009年06月07日 第一版+小改</p>
<p>在这里提醒您注意保护您的计算机，保证正常使用和数据安全。</p>
<p>以下是一些注意事项，大多是最实用，最基本，也是“性价比”最高的(针对Windows用户)，如果你有一定的计算机使用经验，这篇应当就算是一个备忘路，而如果你常被安全问题困扰，不论你是高手还是菜鸟与否，我想都会有些帮助或者启发吧：</p>
<p>1.定期给系统打补丁，或者说是进行系统更新。最简单的解决方法是打开系统带的自动更新；但是很多用户因为各种原因不愿意或者不能打开自动更新，这就需要进行手动更新。手动更新可以由360安全卫士，瑞星卡卡安全助手以及部分杀毒软件完成。在平时可以每1-2周进行一次更新，在安全威胁比较高的时期要保证1周能检查安装一次。对于服务器用户最好是能在安装到实际应用的服务器前进行一下测试，以了解安装更新后会带来哪些改变，很多更新是不能完全卸载的。</p>
<p>2.定期更新安全防护软件。基本上所有的安全防护软件都提供了自动更新，推荐将其打开。切记不要同时安装超过一套安全防护软件，即便是看起来没有什么冲突或者错误。因 为系统的底层资源是固定的，多个软件争夺势必造成功能损失。这里推荐几套软件，要说的一点是选择安全产品是要针对用户习惯，需求等来确定的，不要人云亦 云：ESET NOD32，卡巴斯基，Norton，Mcafee，瑞星，江民。对于ARP攻击频繁的地方强烈推荐使用ESET NOD32和瑞星，防御效果相对更好。这里要注意的是ARP攻击分客户端和网关端两种，我们能防御的都是客户端的这种，如果服务器端受到了有效的攻击我们也无能为力，这也是有的朋友遇到了装了ARP攻击防御软件仍然出现问题的原因。最根本的解决办法是ARP双向静态绑定（客户端和网关都绑定）。另外，ADSL用户如果只有一台电脑上网则不存在风险，可以放心关闭ARP防御功能。</p>
<p>3.不要把所有安全责任都丢给安全防护软件。安全防护软件仅仅是保证计算机安全的工具。在中国，U盘，游戏，QQ，网页挂马，局域网已经成为传播病毒的基本途径。很多人的U盘上都有不只一中病毒，而游戏，QQ，网页病毒多数是因为经济利益问题。一般情况下安全软件的主动防御和文件监控能起到比较好的效果，尤其是在有移动设备如U盘，移动硬盘，SD卡等接入前，最好打开这些监控，并查看是否屏蔽了U盘自动运行。不要浏览非法包含非法信息的网站，因为这样的网站多数都带有病毒或者恶意插件安装。即使开启了自动更新，主动防御和文件监控，也要定期进行全盘扫描，一般需要在1-2周进行一次，扫描前需要手工更新杀毒软件的病毒库和引擎到最新版本。不要随便打开别人给的文件，即使对方是可以信任的朋友，因为无法确定他知不知道已经感染了。而且杀毒软件不能有效地控制未知病毒，而很多时候都是有不少用户被感染了，才有安全公司在病毒库上添加了记录。同时不可轻易相信任何杀毒软件的可疑程度检测，那个基本上都是没有多少可信度的。这项技术一直都是实验室水平的，对于实际应用基本没有什么价值，之所以会发布是因为各个公司之间的商业竞争，有的公司拿这个来吸引不知情的用户，导致了恶性的循环。当然，病毒家族检测现在已经比较成熟了，如果杀毒软件提示是哪个病毒的变种，这个就需要小心了。</p>
<p>4.注意文件备份，特别是重要文件更是如此。备份可以使数据丢失时损失尽可能少。有很多 人因为中了病毒辛辛苦苦积累了很多年的文件都因为被病毒感染无法清除而不得不与之挥手告别，实际上可以通过备份来解决这些问题。但是最好不要在当前硬盘或 者U盘中备份，因为我们要保护的就是它们上面的数据。可以采用光盘备份，现在DVD刻录机和光盘的价格也越来越低，这不失为一中好的选择。切记不要以为系统做了Ghost镜像就没有问题了，众所周知，熊猫烧香会删除它能发现的所有Ghost镜像。实际上这个技术是很基础的，主要是看病毒作者是否想要添加这样的功能。</p>
<p>5.注意文件保密，对于有需要的文件进行加密。有些人会在计算机上安装“闪盘窥探者”，会试图把连接到机器上的移动储存设备的文件全部复制到一个指定的地方，这样会使U盘里的重要文件暴露出去。加密方式上有很多U盘和移动硬盘支持加密功能，可以直接使用。但是大部分的还是没有这个功能的，这种情况下，对于Office文档不要直接使用软件自带的加密方式，因为很容易破解。实际上rar,zip等压缩程序的加密也很难应对暴力破解，而这些格式通常都已经有了很完整的暴力破解工具。这里只能提醒大家使用的密码尽量长一点，比如12-16位的一般就很难破解了，同时不要使用英文单词，生日，姓名，游戏帐号等信息作为密码，也不要单纯地使用数字或字母。一个很好的办法是想一句话，然后把这句话的每个单词（如果是英文）或者是每个字的拼音（汉字的话）的第一个字母组成一串，然后在里面添加上标点符号和数字（根据喜好，可以不改变标点符号的位置）。这种方法创建出来的密码既容易记又有很高的保密性，同样适用于其他场合。如果有更高的安全要求，还可以使用GnuPG这样的密钥策略，2048位的密钥容量很是够用，而且配套工具也比较齐全，可以方便使用。</p>
<p>6.谨慎对待各种小程序，小工具，比如注册机，Hash程序等等。因为名气不大所以不会受到很多人的检验，有的时候下载的文件其实和原版的文件不一样，或者原版的文件就包含了恶意代码。部分内存注册机会被一些杀毒软件报毒，是因为在程序运行时正常情况下一个程序不应该直接修改其他应用程序的内存，而内存注册机却正是通过这种办法实现破解的。</p>
<p>7.不要随便点“确定”“是”“允许”“下一步”一类的按钮。通常情况下很多用户习惯了看见对话框或者提示就点这些内容，但是这种习惯也为病毒感染提供了条件，很多时候杀毒软件或者系统的UAC(针对Vista)会阻止不应该运行的程序运行，但是如果点了这些，很多时候是允许他们运行，这是一个习惯问题，不要因为每天点“允许”花了眼，手一滑就让不该运行的东西运行了。这样也能阻止很多恶意插件的安装。很多人安装应用程序的时候总是一路点击下一步，这样也会导致很多的不需要的插件被安装。而每一次这样的软件安装，都是会给软件作者一定的收入的，而且收入相当高，一般每安装成功一例就是1元钱左右。</p>
<p>8.不懂的情况下不要玩病毒或者研究黑客技术。因为很多时候那些工具也都被封装者添加了病毒，而你又不能让杀毒软件来捣鬼，这个时候就很无奈了。没有解决不了的问题，还是不要因为一点小事而要把别人黑了或者怎么样了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/06/07/security-memorandum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ace Online Course System</title>
		<link>http://blogs.gnome.org/happyaron/2009/06/01/ace-online-course-system/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/06/01/ace-online-course-system/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 14:15:42 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[aceoc]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=49</guid>
		<description><![CDATA[Aim: Provide a suitable platform for the Ace Onlice Course, not too complex but just fit it well.
Modules: Account, Course, Judge, CMS, Interactive
Details:
1.Account: Core Module
Functions:
1) Register, Log in/out, Recover Password, Import/Export Profile
2) Course Progress (&#38; Information) with Graphics
3) Intergrated with Course Module and Interactive Module
Development Focus: Profile Management and Intergration
2.Course: Content Frontend
Functions:
1) Add/Remove Content sorted [...]]]></description>
			<content:encoded><![CDATA[<p>Aim: Provide a suitable platform for the Ace Onlice Course, not too complex but just fit it well.</p>
<p>Modules: Account, Course, Judge, CMS, Interactive</p>
<p>Details:</p>
<p>1.Account: Core Module<br />
Functions:<br />
1) Register, Log in/out, Recover Password, Import/Export Profile<br />
2) Course Progress (&amp; Information) with Graphics<br />
3) Intergrated with Course Module and Interactive Module<br />
Development Focus: Profile Management and Intergration</p>
<p>2.Course: Content Frontend<br />
Functions:<br />
1) Add/Remove Content sorted by Chapter/Section, with the Descriptions and Questions<br />
2) Intergrated with Account Module and Judge Module<br />
3) Communicate with Judge Module to pass the submitted answer source code as well as the compiling status and running information with the Only Inline Key ID for each file<br />
4) Return the messages from Judge Module to the user, and track the progress with Account Module<br />
Devlopment Focus: Content Management and Intergration</p>
<p>3.Judge: Main Backend<br />
Functions:<br />
1) Support Multicompilers: GCC(G++) and FPC with certain version<br />
2) Compile: Require check file before compiling, (for file mime type, compiler flags, disabled functions, and etc.)<br />
3) Run: Time and Memory limitation, server side security (consider to call ClamAV to check virus first)<br />
4) Compare: Return AC/WA/TLE/MLE or other result to Course Module<br />
5) Work with Course Module, consider about the Inline Key only<br />
Development Focus: Time and Memory Limitation, Intergration with Course Module</p>
<p>4. CMS: Easy Target, consider an avaliable CMS<br />
Functions: Provide home page, about page, contact page, and etc.<br />
Development Focus: Choose the CMS and Polish to fit the project</p>
<p>5. Interactive: Way of communication, consider an avaliable forum system, like phpBB<br />
Functions: Bug Report, Wishlist, Recommends, Others<br />
Development Focus: I(ntergration with Account Module</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/06/01/ace-online-course-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up an Ubuntu mirror</title>
		<link>http://blogs.gnome.org/happyaron/2009/05/24/settin-up-an-ubuntu-mirror/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/05/24/settin-up-an-ubuntu-mirror/#comments</comments>
		<pubDate>Sun, 24 May 2009 14:09:49 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[Server Maintainace]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vsftpd]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=20</guid>
		<description><![CDATA[One of my friend planed to start an Ubuntu source services through the support of his college, so I helped him to do that. It&#8217;s also the first time for me, but I think it&#8217;s not so complex.
1.Determination about what you really want to serve
There are two kinds of mirrors, one served as archive and [...]]]></description>
			<content:encoded><![CDATA[<p>One of my friend planed to start an Ubuntu source services through the support of his college, so I helped him to do that. It&#8217;s also the first time for me, but I think it&#8217;s not so complex.</p>
<p>1.Determination about what you really want to serve</p>
<p>There are two kinds of mirrors, one served as archive and another release. Follow the instructions on http://www.ubuntu.com/getubuntu/mirror, we know that we need how much disk to host them.</p>
<p>Of course my friend want to serve as an archive because that can be more beneficial. On his first stage, he doesn&#8217;t want to host the whole mirror, just for the latest version &#8211; Ubuntu 9.04 for a test run. This will cost less than 200GB disk storage.</p>
<p>2.Considerations about hardware</p>
<p>As a mirror which serves many file transfers, we need good hard disks as well as good Internet link, the disk space is the more the better, and of course the link speed is the faster the better,:)</p>
<p>But for my friend, on the first stage, he cannot choose them because now should be a qualification for his college, if he&#8217;s going well, soon he can do it as a big project.</p>
<p>3.Decisions on software</p>
<p>Firstly, we need to choose an operating system.<br />
Here I recommend Debian, Ubuntu Server and CentOS to my friend, he finally chose Debian lenny with its ext3 file system. In my opinion, the server will deal with mostly files, so we need a platform to make our work easier. Consider about ext4, that&#8217;s a good file system.</p>
<p>Secondly, we need to chose a software to handle the HTTP requests and another for FTP. Just like what I have repeated for times, we just serve files, so we don&#8217;t need PHP and other web application at all. For this reason, Apache may not be a good choice. Here we choose Nginx for HTTP service, and vsftpd for FTP service and installed with debian packages, we don&#8217;t need to compile them because there is not alternative changes need to be done. Lighttpd is also a good candidate for HTTP. The configuration process is kind of troublesome, we spent too much time to do it than expected. All in all, it can work well finally.<br />
Here are the configuration files for both software:<br />
1)nginx:/etc/nginx/nginx.conf &amp; /etc/nginx/sites-enabled/default</p>
<p>a) /etc/nginx/nginx.conf:</p>
<p>user www-data www-data;<br />
worker_processes  3;<br />
error_log  /var/log/nginx/error.log;<br />
pid        /var/run/nginx.pid;<br />
worker_rlimit_nofile 51200;<br />
events {<br />
use epoll;<br />
worker_connections  51200;<br />
}<br />
http {<br />
include       /etc/nginx/mime.types;<br />
default_type  application/octet-stream;<br />
access_log  /var/log/nginx/access.log;<br />
server_names_hash_bucket_size 128;<br />
client_header_buffer_size 32k;<br />
large_client_header_buffers 4 32k;<br />
client_max_body_size 16m;<br />
sendfile        on;<br />
tcp_nopush     on;<br />
#keepalive_timeout  0;<br />
keepalive_timeout  65;<br />
tcp_nodelay        on;<br />
gzip  on;<br />
gzip_min_length  1k;<br />
gzip_buffers     4 16k;<br />
gzip_http_version 1.0;<br />
gzip_comp_level 2;<br />
gzip_types       text/plain application/x-javascript text/css application/xml;<br />
gzip_vary on;<br />
limit_zone   limit  $binary_remote_addr  10m;<br />
include /etc/nginx/conf.d/*.conf;<br />
include /etc/nginx/sites-enabled/*;<br />
}</p>
<p>b)/etc/nginx/sites-enabled/default:</p>
<p>server {<br />
listen   80;<br />
//replace the server_name section with your real server name.<br />
server_name  repo.domain;<br />
access_log  /var/log/nginx/repo.access.log;</p>
<p>location  / {<br />
root   /var/repo;<br />
index  index.html index.htm;<br />
limit_conn   limit  50;<br />
autoindex on;<br />
}<br />
error_page   500 502 503 504  /50x.html;<br />
location = /50x.html {<br />
root   /var/www/nginx-default;<br />
}<br />
}</p>
<p>2)vsftpd: /etc/vsftpd.conf</p>
<p>anonymous_enable=YES<br />
anon_root=/var/repo/<br />
local_enable=NO<br />
write_enable=NO<br />
local_umask=022<br />
dirmessage_enable=YES<br />
xferlog_enable=YES<br />
connect_from_port_20=YES<br />
xferlog_std_format=YES<br />
idle_session_timeout=60<br />
data_connection_timeout=120<br />
ftpd_banner=Welcome to NJNU Ubuntu FTP mirror service.<br />
listen=YES<br />
listen_ipv6=NO<br />
pam_service_name=vsftpd<br />
tcp_wrappers=YES</p>
<p>Thirdly, get rsync work, here is an script to do it:</p>
<p>#!/bin/sh<br />
RSYNCSOURCE=rsync://archive.ubuntu.com/ubuntu<br />
BASEDIR=/var/repo/<br />
rsync &#8211;recursive &#8211;times &#8211;links &#8211;hard-links<br />
&#8211;stats<br />
&#8211;exclude &#8220;Packages*&#8221; &#8211;exclude &#8220;Sources*&#8221;<br />
&#8211;exclude &#8220;Release*&#8221;<br />
${RSYNCSOURCE} ${BASEDIR}<br />
rsync &#8211;recursive &#8211;times &#8211;links &#8211;hard-links<br />
&#8211;stats &#8211;delete &#8211;delete-after<br />
&#8211;exclude &#8220;project/trace/${HOSTNAME}&#8221;<br />
${RSYNCSOURCE} ${BASEDIR}</p>
<p>This script will do a two-stage rsync, so it can secure that users won&#8217;t get error while we are running rsync.<br />
Then add this script to the crontab of a specific user, so that it will run every 24 hours.</p>
<p>5.Long-term maintainance</p>
<p>It&#8217;s simply a server, so you need to care about issues about the stablity, security and also think about the development of your own source server. You may need to consider if you want to be an official mirror or just a private one.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/05/24/settin-up-an-ubuntu-mirror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anjuta-Old</title>
		<link>http://blogs.gnome.org/happyaron/2009/05/17/anjuta-old/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/05/17/anjuta-old/#comments</comments>
		<pubDate>Sun, 17 May 2009 07:48:29 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[Debian Packaging]]></category>
		<category><![CDATA[Anjuta]]></category>
		<category><![CDATA[PPA]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/happyaron/?p=9</guid>
		<description><![CDATA[Latest update: http://blogs.gnome.org/happyaron/2009/07/25/anjuta-old-update-2ppa2/
PPA address:
https://launchpad.net/~happyaron/+archive/anjuta-old
This PPA contains the Anjuta 1.2.4a debian packages for Ubuntu Jaunty with updates after the last official release. It is started by Aron Xu for the students who participate in the Olympiad in Informatics and prefer Anjuta 1 to Anjuta 2. Users can get updates when new translations or other useful hacks [...]]]></description>
			<content:encoded><![CDATA[<p>Latest update: <a href="http://blogs.gnome.org/happyaron/2009/07/25/anjuta-old-update-2ppa2/">http://blogs.gnome.org/happyaron/2009/07/25/anjuta-old-update-2ppa2/</a><a href="http://blogs.gnome.org/happyaron/2009/07/25/anjuta-old-ppa-updated/"></a></p>
<p>PPA address:</p>
<p><a href="https://launchpad.net/~happyaron/+archive/anjuta-old" target="_blank">https://launchpad.net/~happyaron/+archive/anjuta-old</a></p>
<p>This PPA contains the Anjuta 1.2.4a debian packages for Ubuntu Jaunty with updates after the last official release. It is started by Aron Xu for the students who participate in the Olympiad in Informatics and prefer Anjuta 1 to Anjuta 2. Users can get updates when new translations or other useful hacks come to Anjuta 1.2.4a. Now, it contains the new Simplified Chinese translation done by Aron, updated nearly 90% from the original one.</p>
<p>You can import the key that signed the packages in this PPA with the following command:</p>
<blockquote>
<pre>sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0x9c96ee1fbaa2c9d79a0af615fa9c98d5dda4db69</pre>
</blockquote>
<p>Then add the following deb lines to your apt source list, you can simply do it in Synaptic:</p>
<p>Ubuntu Jaunty (9.04):</p>
<pre>deb http://ppa.launchpad.net/happyaron/anjuta-old/ubuntu jaunty main</pre>
<pre>deb-src http://ppa.launchpad.net/happyaron/anjuta-old/ubuntu jaunty main</pre>
<p>Ubuntu Karmic (9.10):</p>
<pre>deb http://ppa.launchpad.net/happyaron/anjuta-old/ubuntu karmic main</pre>
<pre>deb-src http://ppa.launchpad.net/happyaron/anjuta-old/ubuntu karmic main</pre>
<p>Don&#8217;t forget refresh the package information after adding the source via this command in a terminal:</p>
<pre>      sudo apt-get update</pre>
<p>The package&#8217;s names are anjuta-old and anjuta-old-common. After you have imported the key and added the PPA, run this command in a terminal:</p>
<blockquote>
<pre>sudo apt-get install anjuta-old</pre>
</blockquote>
<p>Then you will install the anjuta-old package, and anjuta-old-common will be installed automatically by dependency. This operation will warn then delete the original anjuta and anjuta-common packages whatever version you have installed.</p>
<p>If you have any suggestion or problem, or you want to help translate the software, please contact me.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/05/17/anjuta-old/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://blogs.gnome.org/happyaron/2009/05/17/hello-world/</link>
		<comments>http://blogs.gnome.org/happyaron/2009/05/17/hello-world/#comments</comments>
		<pubDate>Sat, 16 May 2009 21:18:26 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi everyone,
I use this blog to communicate with you about technique related issues.
]]></description>
			<content:encoded><![CDATA[<p>Hi everyone,</p>
<p>I use this blog to communicate with you about technique related issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/happyaron/2009/05/17/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
