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

<channel>
	<title>lonnie hacks</title>
	<atom:link href="http://tech.liulonnie.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://tech.liulonnie.net</link>
	<description>yet not a hacker</description>
	<lastBuildDate>Wed, 24 Feb 2010 11:18:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Install ns2 on Macbook Snowleopard</title>
		<link>http://tech.liulonnie.net/?p=405</link>
		<comments>http://tech.liulonnie.net/?p=405#comments</comments>
		<pubDate>Wed, 24 Feb 2010 11:17:02 +0000</pubDate>
		<dc:creator>lonnie</dc:creator>
				<category><![CDATA[_]]></category>

		<guid isPermaLink="false">http://tech.liulonnie.net/?p=405</guid>
		<description><![CDATA[Essentially, two things. First, when configure, add --x-libraries /usr/X11R6/lib --x-includes /usr/X11R6/include. Second, add -framework CoreFoundation into each Makefile.in you need to build. Probably there should be a better way to add this flag with less effort, there is an &#8220;all-recursive&#8221; dependency item in &#8220;ns&#8221; makefile, which is quite a bit amount of labor work to [...]]]></description>
			<content:encoded><![CDATA[<p>Essentially, two things. First, when configure, add <code>--x-libraries /usr/X11R6/lib --x-includes /usr/X11R6/include</code>. Second, add <code>-framework CoreFoundation</code> into each <code>Makefile.in</code> you need to build. Probably there should be a better way to add this flag with less effort, there is an &#8220;all-recursive&#8221; dependency item in &#8220;ns&#8221; makefile, which is quite a bit amount of labor work to modify all those &#8220;recursively&#8221;.</p>
<p>The &#8220;./install&#8221; is really somehow ugly written. For example, when &#8220;nam&#8221;&#8216;s compilation failed, it will not stop. I really suggest you build each separately by hand, which maybe even easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.liulonnie.net/?feed=rss2&amp;p=405</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install nam 1.14 in Ubuntu</title>
		<link>http://tech.liulonnie.net/?p=393</link>
		<comments>http://tech.liulonnie.net/?p=393#comments</comments>
		<pubDate>Tue, 23 Feb 2010 22:03:20 +0000</pubDate>
		<dc:creator>lonnie</dc:creator>
				<category><![CDATA[_]]></category>

		<guid isPermaLink="false">http://tech.liulonnie.net/?p=393</guid>
		<description><![CDATA[It seems that by default nam is not built automatically, at least for me, using Ubuntu 64-bit 9.10. Here is how to make it work. Install some libs: sudo apt-get install xlibs-dev Run these under folder nam-1.14: ./configure make]]></description>
			<content:encoded><![CDATA[<p>It seems that by default nam is not built automatically, at least for me, using Ubuntu 64-bit 9.10. Here is how to make it work.</p>
<ol>
<li>Install some libs:
<pre>sudo apt-get install xlibs-dev</pre>
</li>
<li>Run these under folder <code>nam-1.14</code>:
<pre>./configure
make</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tech.liulonnie.net/?feed=rss2&amp;p=393</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install NS 2.34 in Ubuntu</title>
		<link>http://tech.liulonnie.net/?p=386</link>
		<comments>http://tech.liulonnie.net/?p=386#comments</comments>
		<pubDate>Tue, 23 Feb 2010 21:32:41 +0000</pubDate>
		<dc:creator>lonnie</dc:creator>
				<category><![CDATA[_]]></category>

		<guid isPermaLink="false">http://tech.liulonnie.net/?p=386</guid>
		<description><![CDATA[Download source code here. Install dependencies: sudo apt-get install tk8.4-dev (Otherwise otcl will complain for X headers. I really wonder if this is the right package. Anyway, it works.) Run installation: ./install (optional) Run validation: cd ns-2.34 ./validate]]></description>
			<content:encoded><![CDATA[<ol>
<li>Download source code <a href="http://sourceforge.net/projects/nsnam/">here</a>.</li>
<li>Install dependencies:
<pre>sudo apt-get install tk8.4-dev</pre>
<p>(Otherwise otcl will complain for X headers. I really wonder if this is the right package. Anyway, it works.)</p>
</li>
<li>Run installation:
<pre>./install</pre>
</li>
<li>(optional) Run validation:
<pre>cd ns-2.34
./validate</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tech.liulonnie.net/?feed=rss2&amp;p=386</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>svn+ssh on port other than 22</title>
		<link>http://tech.liulonnie.net/?p=377</link>
		<comments>http://tech.liulonnie.net/?p=377#comments</comments>
		<pubDate>Wed, 17 Feb 2010 09:22:46 +0000</pubDate>
		<dc:creator>lonnie</dc:creator>
				<category><![CDATA[_]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://tech.liulonnie.net/?p=377</guid>
		<description><![CDATA[I changed my desktop&#8217;s ssh port from 22 to another number because there are username/password scanners running in campus every minute. However, this introduces a disadvantage on running an svn server on this machine, because svn+ssh does not support port other than 22 by default. There are plenty of dirty hacks on this problem, like [...]]]></description>
			<content:encoded><![CDATA[<p>I changed my desktop&#8217;s ssh port from 22 to another number because there are username/password scanners running in campus every minute. However, this introduces a disadvantage on running an svn server on this machine, because svn+ssh does not support port other than 22 by default.</p>
<p>There are plenty of dirty hacks on this problem, like export <code>SVN_SSH="ssh -p 5555"</code>, where 5555 is (hypothetically) the alternative ssh port. I am not satisfied with this hacking because it will ruin other svn+ssh repository using port 22, and I am always working with multiple projects.</p>
<p>It is a pain until I find <a href="http://svn.haxx.se/users/archive-2004-09/0574.shtml">this solution</a>. What it says there is create a <code>~/.ssh/config</code> file, and add lines like:</p>
<pre>host hellen
    Hostname liulonnie.ucsd.edu
    Port 5555
    ForwardAgent no
    ForwardX11 no
</pre>
<p><code>hellen</code> is an alias for my office desktop. Then when using svn, use <code>svn+ssh://hellen</code> instead of <code>svn+ssh://liulonnie.ucsd.edu</code>.</p>
<p>I should really learn more about command <code>ssh</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.liulonnie.net/?feed=rss2&amp;p=377</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Another way to fix Shiki Firefox Theme bugs for Firefox.</title>
		<link>http://tech.liulonnie.net/?p=375</link>
		<comments>http://tech.liulonnie.net/?p=375#comments</comments>
		<pubDate>Fri, 22 Jan 2010 21:10:49 +0000</pubDate>
		<dc:creator>lonnie</dc:creator>
				<category><![CDATA[_]]></category>

		<guid isPermaLink="false">http://tech.liulonnie.net/?p=375</guid>
		<description><![CDATA[http://userstyles.org/styles/10822 A really cool fix with stylish. Better than mine.]]></description>
			<content:encoded><![CDATA[<p><a href="http://userstyles.org/styles/10822">http://userstyles.org/styles/10822</a></p>
<p>A really cool fix with stylish. Better than <a href="http://tech.liulonnie.net/?p=337">mine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.liulonnie.net/?feed=rss2&amp;p=375</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to hack down wqy in Ubuntu.</title>
		<link>http://tech.liulonnie.net/?p=371</link>
		<comments>http://tech.liulonnie.net/?p=371#comments</comments>
		<pubDate>Thu, 21 Jan 2010 02:29:35 +0000</pubDate>
		<dc:creator>lonnie</dc:creator>
				<category><![CDATA[_]]></category>

		<guid isPermaLink="false">http://tech.liulonnie.net/?p=371</guid>
		<description><![CDATA[When default ubuntu language support for Simplified Chinese is installed, wqy fonts will be set as default, and even your own .fonts.conf will be blinded. To fix this, you need to edit /etc/fonts/conf.d/44-wqy-zenhei.conf and comment down this arrogant configuration part: &#60;!-- &#60;alias&#62; &#60;family&#62;serif&#60;/family&#62; &#60;prefer&#62; &#60;family&#62;Bitstream Vera Serif&#60;/family&#62; &#60;family&#62;DejaVu Serif&#60;/family&#62; &#60;family&#62;WenQuanYi Zen Hei&#60;/family&#62; &#60;/prefer&#62; &#60;/alias&#62; &#60;alias&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>When default ubuntu language support for Simplified Chinese is installed, wqy fonts will be set as default, and even your own <code>.fonts.conf</code> will be blinded. To fix this, you need to edit <code>/etc/fonts/conf.d/44-wqy-zenhei.conf</code> and comment down this arrogant configuration part:</p>
<pre>&lt;!--
 &lt;alias&gt;
 &lt;family&gt;serif&lt;/family&gt;
 &lt;prefer&gt;
 &lt;family&gt;Bitstream Vera Serif&lt;/family&gt;
 &lt;family&gt;DejaVu Serif&lt;/family&gt;
 &lt;family&gt;WenQuanYi Zen Hei&lt;/family&gt;
 &lt;/prefer&gt;
 &lt;/alias&gt;
 &lt;alias&gt;
 &lt;family&gt;sans-serif&lt;/family&gt;
 &lt;prefer&gt;
 &lt;family&gt;Bitstream Vera Sans&lt;/family&gt;
 &lt;family&gt;DejaVu Sans&lt;/family&gt;
 &lt;family&gt;WenQuanYi Zen Hei&lt;/family&gt;
 &lt;/prefer&gt;
 &lt;/alias&gt;
 &lt;alias&gt;
 &lt;family&gt;monospace&lt;/family&gt;
 &lt;prefer&gt;
 &lt;family&gt;Bitstream Vera Sans Mono&lt;/family&gt;
 &lt;family&gt;DejaVu Sans Mono&lt;/family&gt;
 &lt;family&gt;WenQuanYi Zen Hei Mono&lt;/family&gt;
 &lt;/prefer&gt;
 &lt;/alias&gt;
--&gt;</pre>
<p>And then your own <code>~/.fonts.conf</code> will work again.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.liulonnie.net/?feed=rss2&amp;p=371</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What to do with 3-inch CD with Macbook?</title>
		<link>http://tech.liulonnie.net/?p=364</link>
		<comments>http://tech.liulonnie.net/?p=364#comments</comments>
		<pubDate>Sat, 03 Oct 2009 01:17:24 +0000</pubDate>
		<dc:creator>lonnie</dc:creator>
				<category><![CDATA[_]]></category>

		<guid isPermaLink="false">http://tech.liulonnie.net/?p=364</guid>
		<description><![CDATA[This is technically not a tech post but an experience sharing. I put a 3-inch CD into my Macbook, and was expecting my laptop could do something with it. Obviously, nothing happened, except that I could not take the disc out. Then my girlfriend sent me a link from zhidao.baidu. And I followed its instruction: [...]]]></description>
			<content:encoded><![CDATA[<p>This is technically not a tech post but an experience sharing. I put a 3-inch CD into my Macbook, and was expecting my laptop could do something with it. Obviously, nothing happened, except that I could not take the disc out.</p>
<p>Then my girlfriend sent me a link from zhidao.baidu. And I followed its instruction:</p>
<ol>
<li>Close your macbook</li>
<li>Grab your macbook firmly, with your CD slot towards downside</li>
<li>Throw down fast, and then stop throwing suddenly, for several times</li>
</ol>
<p>And finally I get it out. Stupid Macbook&#8230;</p>
<p>ref: <a href="http://zhidao.baidu.com/question/39736306.html">http://zhidao.baidu.com/question/39736306.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tech.liulonnie.net/?feed=rss2&amp;p=364</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modifying Firefox Theme</title>
		<link>http://tech.liulonnie.net/?p=337</link>
		<comments>http://tech.liulonnie.net/?p=337#comments</comments>
		<pubDate>Mon, 27 Jul 2009 06:12:22 +0000</pubDate>
		<dc:creator>lonnie</dc:creator>
				<category><![CDATA[_]]></category>

		<guid isPermaLink="false">http://tech.liulonnie.net/?p=337</guid>
		<description><![CDATA[I have personally upgraded to Firefox 3.5.1 myself, by downloading the binary from Mozilla and manually change the firefox symbolic link under /usr/bin to my new downloaded version. It seems to be a litter bit faster. But one thing is that the link color of the auto-completion menu is defined to dark-blue(#0000FF I think) as [...]]]></description>
			<content:encoded><![CDATA[<p>I have personally upgraded to Firefox 3.5.1 myself, by downloading the binary from Mozilla and manually change the firefox symbolic link under <code>/usr/bin</code> to my new downloaded version. It seems to be a litter bit faster. But one thing is that the link color of the auto-completion menu is defined to dark-blue(<code>#0000FF</code> I think) as default. The auto-completion is the menu that pops out when you type something in the url input box. The background color of that auto-completion bar is set to menu background color, and mine is black. Dark-blue text can be hardly seen under black. So I make some personal modifications on the theme files.</p>
<p>My theme files which I am using are stored in a folder like this:</p>
<pre>/home/lonnie/.mozilla/firefox/rsh6zrom.default/extensions/{1ebc69c0-92ff-11dc-8314-0800200c9a66}</pre>
<p>I do not know what it stands for, I find this by blind guess+test. The theme style files are written in a css like form and I think the structure this css describing is well defined by Mozilla or something. I didn&#8217;t find out a line of correct written code to modify the url text color in auto-completion, but I have found a way to modify the background and other title text colors. They are defined in a file called <code>./chrome/gnome/global/autocomplete.css</code> in that theme folder and I make the following modification:</p>
<pre>141c141,142
&lt;   background-color: transparent;
---
&gt;   /* background-color: transparent; */
&gt;   background-color: -moz-Field;
151c152
&lt;   color: MenuText;
---
&gt;   /* color: MenuText; */</pre>
<p>For reference, here is also a part of the origin file, generated by <code>grep . -n</code></p>
<pre>137:/* ::::: richlistbox autocomplete ::::: */
139:.autocomplete-richlistbox {
140:  margin: 1px;
141:  background-color: transparent;
142:}
144:.autocomplete-richlistitem[selected="true"] {
145:  background-color: Highlight;
146:  color: HighlightText;
147:}
149:.autocomplete-richlistitem {
150:  padding: 1px 2px;
151:  color: MenuText;
152:}
154:.autocomplete-richlistitem:not(:first-child) {
155:  border-top: 1px solid ThreeDLightShadow;
156:}</pre>
<p>And now the color of the auto-completion menu is much easy for me to read.</p>
<p>However, there are still some potential problems for Firefox 3.5. First, the firefox3.5 from ubuntu source simply can not be started properly. Second, my downloaded firefox3.5 binaries refuse to response from time to time, especially while dealing with some flash or sound or other multimedia things. I think there is something incompatible with the add-ons. And crashed firefox cannot be killed by <code>killall</code> command, and refuse to restart a new session (I think something is deadlocked or similar) and I have to restart my computer (or at least logout X I guess) to make it work properly again. This is somehow irritating&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.liulonnie.net/?feed=rss2&amp;p=337</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using ThuThesis</title>
		<link>http://tech.liulonnie.net/?p=335</link>
		<comments>http://tech.liulonnie.net/?p=335#comments</comments>
		<pubDate>Sat, 13 Jun 2009 17:24:41 +0000</pubDate>
		<dc:creator>lonnie</dc:creator>
				<category><![CDATA[_]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[thuthesis]]></category>

		<guid isPermaLink="false">http://lonnfish.net9.org/lonnie/techblog/?p=335</guid>
		<description><![CDATA[It is time to write final thesis. There is a LaTeX thesis template called thuthesis. It is good, but the document is not well maintained and the installation and configuration of latex with Chinese support to compile thuthesis template is quite complex and also time consuming. Luckily, we have this. Just download an iso and [...]]]></description>
			<content:encoded><![CDATA[<p>It is time to write final thesis. There is a LaTeX thesis template called <a href="http://thuthesis.sourceforge.net/">thuthesis</a>. It is good, but the document is not well maintained and the installation and configuration of latex with Chinese support to compile <em>thuthesis</em> template is quite complex and also time consuming. Luckily, we have <a href="http://thinfilm.ustc.edu.cn/~liangzi/software/CTeXlive/">this</a>. Just download an <code>iso</code> and replace your latex (if you have installed one) with the version in the <code>iso</code> (by mounting or mirroring or extracting to some place) and then add the <code>bin</code> directory into your path, then the thuthesis will be able to compile correctly.</p>
<p><span style="text-decoration: underline;">Tip 1</span>: To modify the <code>$PATH</code> in linux, please modify <code>.profile</code> instead of <code>.bashrc</code>. This will make your <code>$PATH</code> modification applied to every program including GUI program (such as <code>scite</code>) after a reboot, instead of only interactive command line programs.</p>
<p><span style="text-decoration: underline;">Tip 2</span>: You do not really need to use <code>make clean thesis</code> to rebuild it every time. I personally prefer a script like this (utf-8 version only):</p>
<pre>pdflatex main.tex
bibtex main
pdflatex main.tex
pdflatex main.tex</pre>
<p>I named it as <code>build.bat</code> so that it is useful in both linux and window command line. You need to build it twice to make the content list updated correctly. To deal with the gbk verison, an additional command line <code>gbk2uni main</code> must be inserted between the two <code>main.tex</code>. (<a href="http://santazhang.blogspot.com/2009/03/thuthesis.html">ref</a>)</p>
<p><span style="text-decoration: underline;">Tip 3</span>: The blank line for signatures of the second page (acknowledgement page) are too long by default and the last one wraps to next line (probably because of font rendering in my ubuntu is different from windows). To fix this (for bachelor template), I modified <code>thuthesis.cls</code> at line 700 and line 701 (line number for <code>thuthesis-4.5.1</code> utf-8 version). I replaced each <code>\thu@underline</code> in these two lines with <code>\thu@underline[5em]</code> (by default, it is 6em).</p>
<p>If you want to learn more on TeX, you may visit <a href="http://www.newsmth.net/bbsdoc.php?board=TeX">TeX board</a> on <a href="http://www.newsmth.net">newsmth.net</a>. There are a bunch of skilful folks hanging around but they seemingly do not write easy-to-read documents and maintain them very often (this is a quite common problem for open-source and also closed-source tech-supporting&#8230;) It is somehow a shame that they do not make Chinese support for TeX a really good module or package or patch or something for LaTeX system. Although some people have brunched the CTeX and CTeXLive for easy installation and using, it is still a little bit complex to add Chinese support to an existing general LaTeX distribution to for example make it suitable for thuthesis. Maybe it is because thuthesis is using out-of-date packages (I do not like the <code>CJK</code> environment by the way, it makes me somehow feel wierd to use an environment before using any Chinese character). Anyway, it is just a layout and printing tool for me; why bother?</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.liulonnie.net/?feed=rss2&amp;p=335</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A script for linux to simulate effect of Win+Left in Win7</title>
		<link>http://tech.liulonnie.net/?p=329</link>
		<comments>http://tech.liulonnie.net/?p=329#comments</comments>
		<pubDate>Sat, 13 Jun 2009 16:33:25 +0000</pubDate>
		<dc:creator>lonnie</dc:creator>
				<category><![CDATA[_]]></category>
		<category><![CDATA[hotkey]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://lonnfish.net9.org/lonnie/techblog/?p=329</guid>
		<description><![CDATA[Usage: halfwin.py left Win+Left in Windows 7 halfwin.py right Win+Right in Windows 7 halfwin.py top Win+Up in Windows 7 The python script is here: #!/usr/bin/env python import gtk import wnck import sys def halfwin(k): screen = wnck.screen_get_default() while gtk.events_pending(): gtk.main_iteration() win = screen.get_active_window() h = screen.get_height() w = screen.get_width() if win.is_maximized() and k != 'top': [...]]]></description>
			<content:encoded><![CDATA[<pre>Usage:
    halfwin.py left    Win+Left in Windows 7
    halfwin.py right   Win+Right in Windows 7
    halfwin.py top     Win+Up in Windows 7</pre>
<p>The python script is here:</p>
<pre>#!/usr/bin/env python
import gtk
import wnck
import sys

def halfwin(k):
    screen = wnck.screen_get_default()
    while gtk.events_pending(): gtk.main_iteration()

    win = screen.get_active_window()
    h = screen.get_height()
    w = screen.get_width()
    if win.is_maximized() and k != 'top':
        win.unmaximize()
    if win.is_minimized():
        win.unminimize()
    f = (wnck.WINDOW_CHANGE_X | wnck.WINDOW_CHANGE_Y
            | wnck.WINDOW_CHANGE_WIDTH | wnck.WINDOW_CHANGE_HEIGHT)
    if (k == "left"):
        win.set_geometry(wnck.WINDOW_GRAVITY_CURRENT, f, -4, 0,
                w / 2, h + 2)
    elif (k == "right"):
        win.set_geometry(wnck.WINDOW_GRAVITY_CURRENT, f, w / 2, 0,
                w / 2, h)
    elif (k == "top" and not win.is_maximized()):
        win.maximize();

def main():
    argv = sys.argv
    if len(argv) &lt;= 1:
        pass
    elif argv[1] == 'left':
        halfwin('left')
    elif argv[1] == 'right':
        halfwin('right')
    elif argv[1] == 'top':
        halfwin('top')

if __name__ == '__main__':
    main()</pre>
<p>It is not working perfectly well, but fairly good already.</p>
<p>To bind a command with a hot-key in ubuntu, please play with <strong>System-&gt;Preference-&gt;Keyboard Shortcuts</strong>. I am very sure you will find it.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.liulonnie.net/?feed=rss2&amp;p=329</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
