<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CUYNRXY8eSp7ImA9WxNUGE0.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552</id><updated>2009-11-09T13:46:34.871-08:00</updated><title type="text">Vincent Liu - Coding Is An Art</title><subtitle type="html">Writing good software takes time, experience and dedication, in which I try to chronicle my thoughts as a software developer in my blog to share with you.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.vinceliu.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>143</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><geo:lat>37.766529</geo:lat><geo:long>-122.39577</geo:long><logo>http://www.vinceliu.com/vinceliu.ico</logo><link rel="self" href="http://feeds.feedburner.com/VincentLiu" type="application/atom+xml" /><feedburner:emailServiceId>VincentLiu</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FVincentLiu" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FVincentLiu" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FVincentLiu" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/VincentLiu" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FVincentLiu" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FVincentLiu" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FVincentLiu" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:browserFriendly>Hi there, this is my personal blog about my personal thoughts in software, and other news that captures my attention. If you share the same interests as I do, do feel free to subscribe to my blog feed, or leave a comment!</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gd:etag="W/&quot;DU8HRXwyeSp7ImA9WxNXFE4.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-1416452307747350246</id><published>2009-10-01T15:57:00.000-07:00</published><updated>2009-10-01T15:57:14.291-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-01T15:57:14.291-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Software Development" /><title>Why you should Blame your Tools, sometimes.</title><content type="html">As software developers, we would all wish to have 3rd party libraries that works magically immediately after installation. While this is to be expected and holds true for popular and widely used libraries, people do tend to forget that it is still more of a rule of thumb than an iron-cast fact.&lt;br /&gt;
&lt;br /&gt;
Like the urban myth goes, "a good workman never blames his tools", this mindset is so ingrained in the software development culture, that it is always bad form to assume that bug may reside in a library rather than in your code. After all, it is more likely that you are the offending culprit, given it is less likely a widely used code base will make a mistake when compared to code just seen by you alone. But with everything statistical, there is always a chance that an outlier event can happen.&lt;br /&gt;
&lt;br /&gt;
And it did for me. &lt;br /&gt;
&lt;br /&gt;
Internally, we rely on log4cxx as our logging library, which a peculiar bug seems to only be triggered upon the termination of our application. After spending more than 2 days of debugging, the error seemed to have consistently been at the line where the logger object is being accessed. And like all true developers, I bit my lip and kept soldiering on, reading through my own code, checking the same lines over and over again, trying to see if I had missed defining a variable, or if I had forgotten to allocate memory for it. Naturally, after while of doing so, I began to start questioning my personal sanity rather than the lines of code I've written, amid this 'impossibility' that the error could actually be from the library.&lt;br /&gt;
&lt;br /&gt;
And then I popped.&lt;br /&gt;
&lt;br /&gt;
I turned over to my colleague and mentioned to him that the code kept failing on the logging line. The team had known that I've been stuck on this problem for the last day. Even as I started, I could see the mild derision on his face, "it can't be the library. Maybe gdb is not showing what actually is going on."&lt;br /&gt;
&lt;br /&gt;
So on and on the circle I went. Then someone else suggested using valgrind.&lt;br /&gt;
&lt;br /&gt;
Since I was running out of options, I didn't see any harm trying. At most I'll waste an hour more to the day I've already wasted, anyway.&lt;br /&gt;
&lt;br /&gt;
Valgrind didn't really show anything more different to what gdb was showing. Basically saying the same thing - that log4cxx is accessing an invalid memory location. Given I wasn't an expert on valgrind, I got someone else to come over and discussed what we were seeing on the stack trace.&lt;br /&gt;
&lt;br /&gt;
No luck still.&lt;br /&gt;
&lt;br /&gt;
It's gone past the point of frustration, into the point of desperation that I decided to just fucking comment out the offending statement and see if the problem goes away.&lt;br /&gt;
&lt;br /&gt;
After recompling and re-running the application 30+ times without the bug re-surfacing, I was very certain to point at the logger library being the culprit. But of course if I did, I couldn't definitively prove it, and worse, I had no workaround; the entire code base is reliant on it for logging, and to take it away would mean a major re-engineering exercise.&lt;br /&gt;
&lt;br /&gt;
Sometimes talking to others help. Sometimes they offer a difference in perspective, and other times, they may have caught something you hadn't.&lt;br /&gt;
&lt;br /&gt;
Given that we had multiple threads that were still operating when a shutdown signal is received, I thought maybe it'll be worth trying to stop those threads safely before the termination signal is processed - since it's likely that some portions or memory may be freed while the threads are still utilising them. But I was just shooting wildly - it was a very long shot, given how the threading interactions were designed, it was difficult to believe that it could have been the problem. But trying something is better than doing nothing.&lt;br /&gt;
&lt;br /&gt;
So I sat down with another colleague of mine, and talked him through what I wanted to do, and invariably the discussion lead to another where we talked about the valgrind backtrace that I had generated, which showed memory destruction caused by exit(). After a bit of theorising back and forth about the behaviour, and on how I'd would write a quick hack to test my hypothesis, my colleague decided to do a ubiquity search on '&lt;a href="http://www.google.ie/search?q=log4cxx+exit+crash"&gt;log4cxx exit crash&lt;/a&gt;^H^H^H^H', which then our eyes popped when we saw the preview result before it changed into something else that he was meaning to type.&lt;br /&gt;
&lt;br /&gt;
"Go back again", I said excitedly. He was already as excited as I was, so there wasn't really the need for any prompting.&lt;br /&gt;
&lt;br /&gt;
It turns out that there is a known problem in log4cxx found months ago, and someone had even posted a patch on it already. But here's the thing about software: unless you are willing to roll your own fixes, be prepared to wait for a long time before someone eventually fixes it. And even if someone did fix it, the upstream maintainer will still take a while before committing it into the main trunk. Or even worse, he may just choose to ignore it. And yes it does happen - ask &lt;a href="http://en.wikipedia.org/wiki/Ulrich_Drepper"&gt;Ulrich Drepper&lt;/a&gt;. :P&lt;br /&gt;
&lt;br /&gt;
On how to fix it, and package it up nicely for use, I'll write about that in a later post, for now I want to share an invaluable lesson when it comes to software development, which also equally applies in life: while established conventions are more often right than wrong, it never hurts to question them just in case they aren't. It may not be okay to blame your tools all the time, but it sometimes worth to know when to call a shoddy spade when you see one.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-1416452307747350246?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=hXwkrO-kipc:au0tkDEkGdM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=hXwkrO-kipc:au0tkDEkGdM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=hXwkrO-kipc:au0tkDEkGdM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=hXwkrO-kipc:au0tkDEkGdM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=hXwkrO-kipc:au0tkDEkGdM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=hXwkrO-kipc:au0tkDEkGdM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=hXwkrO-kipc:au0tkDEkGdM:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=hXwkrO-kipc:au0tkDEkGdM:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/hXwkrO-kipc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/1416452307747350246/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/10/why-you-should-blame-your-tools.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/1416452307747350246?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/1416452307747350246?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/hXwkrO-kipc/why-you-should-blame-your-tools.html" title="Why you should Blame your Tools, sometimes." /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/10/why-you-should-blame-your-tools.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMAQ3k5cCp7ImA9WxNQGU0.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-5811944451309347985</id><published>2009-09-22T15:14:00.000-07:00</published><updated>2009-09-25T11:47:22.728-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-25T11:47:22.728-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Gdb" /><title>How to build a Debian Package for GDB</title><content type="html">I've resisted titling this post as 'building an Ubuntu package' even though I'm building it for Ubuntu - technically it's more proper to call it a Debian package given its lineage. Nevertheless the mechanism behind building your own packages is pretty much the same for the two.&lt;br /&gt;&lt;br /&gt;I'll use GDB as an example of how to build your own package - for a good reason, firstly because the stock version of GDB that is shipped with Ubuntu is &lt;span style="font-weight: bold;"&gt;terribly broken&lt;/span&gt;. Here's what I mean:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;% gdb --args java&lt;br /&gt;GNU gdb 6.8-debian&lt;br /&gt;Copyright (C) 2008 Free Software Foundation, Inc.&lt;br /&gt;License GPLv3+: GNU GPL version 3 or later &lt;span style="text-decoration: underline;"&gt;&amp;lt;&lt;/span&gt;&lt;a href="http://gnu.org/licenses/gpl.html"&gt;http://gnu.org/licenses/gpl.html&lt;/a&gt;&amp;gt;&lt;br /&gt;This is free software: you are free to change and redistribute it.&lt;br /&gt;There is NO WARRANTY, to the extent permitted by law.  Type "show copying"&lt;br /&gt;and "show warranty" for details.&lt;br /&gt;This GDB was configured as "i486-linux-gnu"...&lt;br /&gt;(no debugging symbols found)&lt;br /&gt;(gdb) r&lt;br /&gt;Starting program: /usr/bin/java Test&lt;br /&gt;(no debugging symbols found)&lt;br /&gt;(no debugging symbols found)&lt;br /&gt;(no debugging symbols found)&lt;br /&gt;(no debugging symbols found)&lt;br /&gt;[Thread debugging using libthread_db enabled]&lt;br /&gt;[New process 16487]&lt;br /&gt;Executing new program: /usr/lib/jvm/java-6-openjdk/jre/bin/java&lt;br /&gt;warning: Cannot initialize thread debugging library: generic error&lt;br /&gt;warning: Cannot initialize thread debugging library: generic error&lt;br /&gt;warning: Cannot initialize thread debugging library: generic error&lt;br /&gt;warning: Cannot initialize thread debugging library: generic error&lt;br /&gt;[New process 16487]&lt;br /&gt;[Thread debugging using libthread_db enabled]&lt;br /&gt;Segmentation fault&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The stock build of GDB doesn't handle multi-threaded applications properly, among other minor issue like not setting the path to point to the correct debug library paths, which makes it unusable for serious debugging tasks.&lt;br /&gt;&lt;br /&gt;Secondly, &lt;a href="http://blog.vinceliu.com/2009/09/gdb-70-is-out.html"&gt;GDB 7.0 has reversible debugging&lt;/a&gt;, which makes it doubly tempting to roll my own. Finally, GDB has minimal external and library dependencies, which is an easy example to build a package without going into the complexity of having to generate a &lt;code&gt;chroot&lt;/code&gt;ed environment.&lt;br /&gt;&lt;br /&gt;But why not just do the typical &lt;code&gt;'configure &amp;amp;&amp;amp; make install'&lt;/code&gt; combination?&lt;br /&gt;&lt;br /&gt;The drawback in doing so, is that the process is &lt;span style="font-style: italic;"&gt;one-way&lt;/span&gt;: once you've installed it like that, there is no easy way of uninstalling it, short of remembering the list of what's being installed and removing them manually. Do-able? Sure, but certainly cumbersome. The neater way to do this is to create a package and have the package manager deal with installation/uninstallation for you.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Building GDB&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We need to perform the usual compiling and installing steps like we normally do; the only difference is that we want the installer to place all the resultant files into a separate directory for generating a package. Doing this is straightforward using the prefix flag provided by &lt;code&gt;configure&lt;/code&gt;. The steps are commented and reproduced below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# Assuming that you're in the current source directory /home/user/gdb-sources&lt;br /&gt;% mkdir -p custom-gdb-7.0-amd64/usr/&lt;br /&gt;% configure --prefix=/home/user/gdb-sources/custom-gdb-7.0-amd64/&lt;br /&gt;% make &amp;amp;&amp;amp; make install&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There are dependencies that GDB will need in order to compile properly (things like bison, lex as far as I remember), but I'll assume that you know how to resolve these dependencies yourself. Otherwise, the source should finish compiling and installing to the destination &lt;code&gt;/home/user/gdb-sources/custom-gdb-7.0-amd64/&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Generating the Control file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In order to generate a package, a Debian control file is required, which contains the information that the 'dpkg-deb' package generator will need. Here's how we write one:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;% mkdir custom-gdb-7.0-amd64/DEBIAN&lt;br /&gt;% cat &gt; custom-gdb-7.0-amd64/DEBIAN/control&lt;br /&gt;Package: customgdb&lt;br /&gt;Version: 7.0&lt;br /&gt;Section: base&lt;br /&gt;Priority: optional&lt;br /&gt;Architecture: amd64&lt;br /&gt;Depends: lex, bison&lt;br /&gt;Maintainer: Vincent Liu &lt;blog@vinceliu.com&gt;&amp;lt;blog@vinceliu.com&amp;gt;&lt;br /&gt;Description: Custom build of GDB&lt;br /&gt;This version of GDB provides cutting edge&lt;br /&gt;capabilities that the stock package does not provide.&lt;br /&gt;^D&lt;br /&gt;%&lt;br /&gt;# The control-D symbol above is to indicate the&lt;br /&gt;# file termination character&lt;br /&gt;&lt;/blog@vinceliu.com&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There are plenty of details I've omitted here, and you will have to read more to understand and tune your own control file configuration. Here's the &lt;a href="http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/"&gt;tutorial&lt;/a&gt; I referenced, and the &lt;a href="http://www.debian.org/doc/debian-policy/ch-controlfields.html"&gt;Debian manual&lt;/a&gt; to help you figure out the details of each control field.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Generating and Installing the Package&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Once you've got the control file generated, building the package is just a single &lt;code&gt;dpkg-deb&lt;/code&gt; away:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;% fakeroot dpkg-deb --build custom-gdb-7.0-amd64&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You will get a resulting &lt;code&gt;custom-gdb-7.0-amd64.deb&lt;/code&gt; package generated for installation. To install it, you'll have to remove the existing GDB package, as it conflicts with your new installation. Do the following:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# remove the original gdb&lt;br /&gt;% dpkg -r gdb&lt;br /&gt;&lt;br /&gt;# install the new gdb&lt;br /&gt;% dpkg -i custom-gdb-7.0-amd64.deb&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you ever needed to revert back to the stock versions of GDB, you can now easily remove your custom version by &lt;code&gt;dpkg -r customgdb&lt;/code&gt;, and reinstalling it using &lt;code&gt;apt-get&lt;/code&gt; or your own favourite package manager.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-5811944451309347985?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=UhPUtPA_yXk:GtRxpUBkR1M:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=UhPUtPA_yXk:GtRxpUBkR1M:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=UhPUtPA_yXk:GtRxpUBkR1M:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=UhPUtPA_yXk:GtRxpUBkR1M:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=UhPUtPA_yXk:GtRxpUBkR1M:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=UhPUtPA_yXk:GtRxpUBkR1M:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=UhPUtPA_yXk:GtRxpUBkR1M:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=UhPUtPA_yXk:GtRxpUBkR1M:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/UhPUtPA_yXk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/5811944451309347985/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/09/how-to-build-debian-package-for-gdb.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/5811944451309347985?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/5811944451309347985?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/UhPUtPA_yXk/how-to-build-debian-package-for-gdb.html" title="How to build a Debian Package for GDB" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/09/how-to-build-debian-package-for-gdb.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08NRXk-fCp7ImA9WxNUFUU.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-2712905179839379877</id><published>2009-09-17T15:13:00.000-07:00</published><updated>2009-11-07T01:24:54.754-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-07T01:24:54.754-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Gdb" /><title>GDB 7.0 Is Out!</title><content type="html">Read the announcement &lt;a href="http://sourceware.org/ml/gdb-announce/2009/msg00000.html"&gt;here&lt;/a&gt;. It's actually the pre-release version, nevertheless it's quite stable.&lt;br /&gt;
&lt;br /&gt;
What makes this version interesting? It's got &lt;a href="http://www.gnu.org/software/gdb/news/reversible.html"&gt;reversible debugging&lt;/a&gt;, which means that it's the first time you can actually make your code go &lt;span style="font-style: italic;"&gt;back in time&lt;/span&gt; to find out what it did before it crashed.&lt;br /&gt;
&lt;br /&gt;
I've tried the new commands, but I'm haven't been successful in stepping backwards still - well more experimenting ahead!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Update:&lt;/b&gt; The tutorial is available at &lt;br /&gt;
&lt;a href="http://www.sourceware.org/gdb/wiki/ProcessRecord/Tutorial"&gt;http://www.sourceware.org/gdb/wiki/ProcessRecord/Tutorial&lt;/a&gt;. (Thanks to Michael!)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-2712905179839379877?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=stkOSQLihJk:ddL4wtnLLxA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=stkOSQLihJk:ddL4wtnLLxA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=stkOSQLihJk:ddL4wtnLLxA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=stkOSQLihJk:ddL4wtnLLxA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=stkOSQLihJk:ddL4wtnLLxA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=stkOSQLihJk:ddL4wtnLLxA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=stkOSQLihJk:ddL4wtnLLxA:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=stkOSQLihJk:ddL4wtnLLxA:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/stkOSQLihJk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/2712905179839379877/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/09/gdb-70-is-out.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/2712905179839379877?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/2712905179839379877?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/stkOSQLihJk/gdb-70-is-out.html" title="GDB 7.0 Is Out!" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/09/gdb-70-is-out.html</feedburner:origLink></entry><entry><title type="text">Links for 2009-09-17 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/nN28rshjaCs/vincentliu79" /><updated>2009-09-18T00:00:00-07:00</updated><id>http://del.icio.us/vincentliu79#2009-09-17</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.appscout.com/2009/09/bing_snags_10-percent_of_us_se.php"&gt;Bing Snags 10-Percent of U.S. Search - AppScout&lt;/a&gt;&lt;br/&gt;
People may hate Microsoft, but I actually admire the company for its tenacious competitive spirit. Don&amp;#039;t bash me, my Microsoft hating lemmings, erm I meant friends - learn to recognise a good thing when you see one ;)&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/nN28rshjaCs" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/vincentliu79#2009-09-17</feedburner:origLink></entry><entry><title type="text">Links for 2009-09-12 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/NALkbee_lx0/vincentliu79" /><updated>2009-09-13T00:00:00-07:00</updated><id>http://del.icio.us/vincentliu79#2009-09-12</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blogs.law.harvard.edu/philg/2009/09/12/obama-will-not-rest/"&gt;Obama will not rest&amp;hellip;&lt;/a&gt;&lt;br/&gt;
… until Americans are paying more for a set of tires than Indians pay for an entire car. Is America foolhardy enough to engage in a trade war with China?&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/NALkbee_lx0" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/vincentliu79#2009-09-12</feedburner:origLink></entry><entry><title type="text">Links for 2009-08-31 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/6L6JPIUiGyA/vincentliu79" /><updated>2009-09-01T00:00:00-07:00</updated><id>http://del.icio.us/vincentliu79#2009-08-31</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://lbrandy.com/blog/2009/08/the-programmers-wife/"&gt;The Programmer's Wife&lt;/a&gt;&lt;br/&gt;
Be weary the next time some woman comes up to you and starts sprouting about Linux, Python, C++ and The Penguin. ;)&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/6L6JPIUiGyA" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/vincentliu79#2009-08-31</feedburner:origLink></entry><entry><title type="text">Links for 2009-08-23 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/S86yRFFv3k8/vincentliu79" /><updated>2009-08-24T00:00:00-07:00</updated><id>http://del.icio.us/vincentliu79#2009-08-23</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.rollingstone.com/news/story/29787673/the_boy_who_heard_too_much/print"&gt;The Boy Who Heard Too Much&lt;/a&gt;&lt;br/&gt;
He was a 14-year-old blind kid, angry and alone. Then he discovered that he possessed a strange and fearsome superpower — one that put him in the cross hairs of the FBI.&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/S86yRFFv3k8" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/vincentliu79#2009-08-23</feedburner:origLink></entry><entry><title type="text">Links for 2009-08-20 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/CUDOIOTVElc/vincentliu79" /><updated>2009-08-21T00:00:00-07:00</updated><id>http://del.icio.us/vincentliu79#2009-08-20</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.cisco.com/web/about/security/intelligence/bots.html"&gt;Infiltrating a Botnet - Cisco Systems&lt;/a&gt;&lt;br/&gt;
Fascinating read into the mind of a botmaster.&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/CUDOIOTVElc" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/vincentliu79#2009-08-20</feedburner:origLink></entry><entry><title type="text">Links for 2009-08-19 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/jfbJZG646Vw/vincentliu79" /><updated>2009-08-20T00:00:00-07:00</updated><id>http://del.icio.us/vincentliu79#2009-08-19</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://taxidiary.blogspot.com/"&gt;A Singapore Taxi Driver's Diary&lt;/a&gt;&lt;br/&gt;
Probably the only taxi driver in this world with a PhD from Stanford and a proven track record of scientific accomplishments, I have been forced out of my research job at the height of my scientific career, and unable to find another one, for reasons I can only describe as something &amp;quot;uniquely Singapore&amp;quot;. As a result, I am driving taxi to make a living and writing these real life stories just to make the dull job a little more interesting. I hope that these stories are interesting to you too.&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/jfbJZG646Vw" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/vincentliu79#2009-08-19</feedburner:origLink></entry><entry><title type="text">Links for 2009-08-18 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/swfTL-yOMDY/vincentliu79" /><updated>2009-08-19T00:00:00-07:00</updated><id>http://del.icio.us/vincentliu79#2009-08-18</id><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://bash.org/?213586"&gt;Is there any way I can set the compiler in strict C++ mode, I don't want to learn C/C++ mix mode&lt;/a&gt;&lt;br/&gt;
How to become a Code-Nazi ;)&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/swfTL-yOMDY" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/vincentliu79#2009-08-18</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUMRHo_fyp7ImA9WxNTEk0.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-5151588950787752548</id><published>2009-08-13T13:52:00.000-07:00</published><updated>2009-08-13T15:58:05.447-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-13T15:58:05.447-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Software Development" /><category scheme="http://www.blogger.com/atom/ns#" term="Mercurial" /><title>Bug Hunting with Revision Control using Mercurial</title><content type="html">My impression through reading other software developers' blogs is that, when presented a choice of distributed revision control, there seem to be a majority preference for Git over Mercurial. This popularity does not come as surprising, since it is the brainchild of the most prominent icon of open source software today, the famed Linux kernel hacker Linus Torvalds.&lt;br /&gt;&lt;br /&gt;It feels like the Mercurial camp is a little bit unrepresented, but today's post isn't about a blow-by-blow account between the two software revision control systems; you will probably be more informed by experts out there who have better qualifications in critiquing the pros and cons among the two. More importantly, I feel these differences are mostly nitpicking to general laypeople - when the demands of our projects do not scale to a level where the performance differences are visible, &lt;span style="font-style: italic;"&gt;it really doesn't matter&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;People will have their biases, and the git-vs-mercurial battle will probably be not too different from the perennial ideological battles between the emacs-vs-&lt;a href="http://blog.vinceliu.com/search/label/Vim"&gt;vim&lt;/a&gt; crowds. And obviously, you should have detected my bias in this case already :)&lt;br /&gt;&lt;br /&gt;Anyway, back to our original discussion.&lt;br /&gt;&lt;br /&gt;I have only used git briefly, and I'll not comment much on it given my limited impression. I'd agree with most people that it is a remarkable software revision control tool and leave it as that. It must strike you as curious to why I am using Mercurial then - it's largely of based on pragmatism, given I've acquired much familiarity through constant use at work. Besides, if I haven't been complaining enough to be tempted to try out git again, it must have not been that bad, right?&lt;br /&gt;&lt;br /&gt;I'll share with you the best thing I love about using these revision control tools, namely, for their amazing ability to find out where the sources of your bugs are. It's not uncommon for software to break between the revisions you've check in; and sometimes these breakages fail to be noticed until you've checked it in after a bunch of some other code, making your original error even harder to find.&lt;br /&gt;&lt;br /&gt;Well, not anymore.&lt;br /&gt;&lt;br /&gt;Mercurial has this ability called 'bisect' which allows you to toggle between revisions until you're able to zone down to the exact patch where your code first breaks. Given that most code check-ins tend to be of small increments, knowing which patch that causes the break helps you narrow down the error to a very small subset where you can focus your efforts on finding the bug.&lt;br /&gt;&lt;br /&gt;How does this work? Let me show you a real life session of how bisect works in finding an erroneous commit:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code"&gt;&lt;br /&gt;vincentliu@vm1:~/replicode$ hg bisect -g 1614&lt;br /&gt;vincentliu@vm1:~/replicode$ hg bisect -b 1671&lt;br /&gt;Testing changeset 1666:ee86f6717c42 (57 changesets remaining, ~5 tests)&lt;br /&gt;36 files updated, 0 files merged, 8 files removed, 0 files unresolved&lt;br /&gt;vincentliu@vm1:~/replicode$ hg bisect -b 1666&lt;br /&gt;Testing changeset 1630:6e221cda7176 (28 changesets remaining, ~4 tests)&lt;br /&gt;28 files updated, 0 files merged, 2 files removed, 0 files unresolved&lt;br /&gt;vincentliu@vm1:~/replicode$ hg bisect -b 1630&lt;br /&gt;Testing changeset 1623:f7b12d17a79b (14 changesets remaining, ~3 tests)&lt;br /&gt;10 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br /&gt;vincentliu@vm1:~/replicode$ hg bisect -b 1623&lt;br /&gt;Testing changeset 1618:ac9135ec8e99 (9 changesets remaining, ~3 tests)&lt;br /&gt;17 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br /&gt;vincentliu@vm1:~/replicode$ hg bisect -g 1618&lt;br /&gt;Testing changeset 1620:032f83fb6b8c (5 changesets remaining, ~2 tests)&lt;br /&gt;26 files updated, 0 files merged, 1 files removed, 0 files unresolved&lt;br /&gt;vincentliu@vm1:~/replicode$ hg bisect -g 1620&lt;br /&gt;Testing changeset 1621:1d8191199d0d (3 changesets remaining, ~1 tests)&lt;br /&gt;5 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br /&gt;vincentliu@vm1:~/replicode$ hg bisect -g 1621&lt;br /&gt;Testing changeset 1622:65b4f19e8941 (2 changesets remaining, ~1 tests)&lt;br /&gt;9 files updated, 0 files merged, 0 files removed, 0 files unresolved&lt;br /&gt;vincentliu@vm1:~/replicode$ hg bisect -g 1622&lt;br /&gt;The first bad revision is:&lt;br /&gt;changeset:   1623:f7b12d17a79b&lt;br /&gt;parent:      1618:ac9135ec8e99&lt;br /&gt;parent:      1622:65b4f19e8941&lt;br /&gt;user:        Anonymous Person &amp;lt;xxx@xxx.xxx&amp;gt;&lt;br /&gt;date:        Fri Aug 07 14:13:56 2009 +0100&lt;br /&gt;summary:     Automated merge with http://xxx&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Some of the output has been slightly modified to protect the innocent[&lt;a href="http://blog.vinceliu.com/2009/08/bug-hunting-with-revision-control-using.html#sub1"&gt;1&lt;/a&gt;].&lt;br /&gt;&lt;br /&gt;The first two bisect commands, with the &lt;code&gt;-g&lt;/code&gt; and &lt;code&gt;-b&lt;/code&gt; arguments indicate the two changesets that you know for certain which are good and bad respectively. With the boundaries set, Mercurial goes on its way and starts checking out changesets that are committed in between.&lt;br /&gt;&lt;br /&gt;For each checked out changeset, you'll have the opportunity of testing it out; once you are done, you can indicate whether if the changeset is good or bad by using the same commands with the checked out changeset number. Mercurial then checks out the next changeset for you to test.&lt;br /&gt;&lt;br /&gt;Here's where there is some serious voodoo at work; notice that I had 57 changesets in between. It's going to be a nightmare if I had to test out every single one of them - instead, Mercurial tries to subdivide through the changeset smartly to isolate the problem (hence the term 'bisect') and gives you a general estimate of how many more tests you have to do before Mercurial can definitively point out the problematic changeset. In my case, it took me 8 tries. Pretty impressive eh?&lt;br /&gt;&lt;br /&gt;I certainly have my few criticisms about Mercurial, like my initial incredulity of how the developers came up with the command of &lt;code&gt;hg&lt;/code&gt; when their software system is called 'Mercurial'; but past those kinks and initial gag-reflexes, I have to admit that my experiences using has largely remained satisfactory. And if you're one of those who are still at two minds about using a distributed revision control system, I urge you to give it a try. You just might like it!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;[&lt;a name="sub1"&gt;1&lt;/a&gt;] It's not nice to put the names of the people I work with on my blog without their consent.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-5151588950787752548?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=vweIV8WLu7U:mgFYeeHzEIE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=vweIV8WLu7U:mgFYeeHzEIE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=vweIV8WLu7U:mgFYeeHzEIE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=vweIV8WLu7U:mgFYeeHzEIE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=vweIV8WLu7U:mgFYeeHzEIE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=vweIV8WLu7U:mgFYeeHzEIE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=vweIV8WLu7U:mgFYeeHzEIE:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=vweIV8WLu7U:mgFYeeHzEIE:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/vweIV8WLu7U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/5151588950787752548/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/08/bug-hunting-with-revision-control-using.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/5151588950787752548?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/5151588950787752548?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/vweIV8WLu7U/bug-hunting-with-revision-control-using.html" title="Bug Hunting with Revision Control using Mercurial" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/08/bug-hunting-with-revision-control-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AGRHk4eSp7ImA9WxJaEkQ.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-4502754948766199967</id><published>2009-08-03T04:11:00.000-07:00</published><updated>2009-08-03T04:42:05.731-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-03T04:42:05.731-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Humour" /><title>The Recession is Over</title><content type="html">I'm no economist and I certainly did no research. I have neither volumes of literature, nor data or statistics to back me up. But rather than listening to the talking heads on CNBC and Bloomsberg, why not try one of my observations for a change?&lt;br /&gt;&lt;br /&gt;I got reminded that we are in a recession by a French flutist at a gig I attended last night. If news has reached as far as to a band of travelling hippie-musicians, surely we must have lived through the worst of it all already?&lt;br /&gt;&lt;br /&gt;You know the adage that it is time to get out of the markets when cab drivers are tipping you on stocks? Well, maybe this is just the same, only in reverse.&lt;br /&gt;&lt;br /&gt;Eat your heart out &lt;a href="http://www.rgemonitor.com/"&gt;Roubini&lt;/a&gt;, it's time for a celebration, Champagne anyone?&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-4502754948766199967?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=I3G4gOMuwkk:HGlBGTrjdOQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=I3G4gOMuwkk:HGlBGTrjdOQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=I3G4gOMuwkk:HGlBGTrjdOQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=I3G4gOMuwkk:HGlBGTrjdOQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=I3G4gOMuwkk:HGlBGTrjdOQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=I3G4gOMuwkk:HGlBGTrjdOQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=I3G4gOMuwkk:HGlBGTrjdOQ:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=I3G4gOMuwkk:HGlBGTrjdOQ:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/I3G4gOMuwkk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/4502754948766199967/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/08/recession-is-over.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/4502754948766199967?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/4502754948766199967?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/I3G4gOMuwkk/recession-is-over.html" title="The Recession is Over" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/08/recession-is-over.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AARHg8fyp7ImA9WxJbE0g.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-321272178163245766</id><published>2009-07-22T15:14:00.000-07:00</published><updated>2009-07-23T06:29:05.677-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-23T06:29:05.677-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><title>Java is not the JVM</title><content type="html">For many IT people, it sounds funny to assert that the Java language has nothing to with the JVM itself. But as incredulous as it sounds, this is actually true. Let me explain, using some code as a shallow illustration how this is the case.&lt;br /&gt;&lt;br /&gt;When I was hacking at the Java bytecode level, one of the things that I do is to optimise for memory efficiency. There is a need for storing an array of booleans, and the most obvious way of saving memory is to store it at a bitwise level, by stashing 8 boolean values within a byte.&lt;br /&gt;&lt;br /&gt;Within the JVM, &lt;code&gt;booleans&lt;/code&gt; are stored as bytes (&lt;span style="font-style: italic;"&gt;executionally, they are worse&lt;/span&gt;: the VM treats &lt;code&gt;booleans&lt;/code&gt; as &lt;code&gt;int&lt;/code&gt;s!). Furthermore, in Java, there isn't a low-level means of utilising booleans as integral types like C can. If you had to write code in pure Java, at best you'll end up writing code like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;// assume z == boolean[8]&lt;br /&gt;byte b = 0;&lt;br /&gt;for ( int i=0; i &amp;lt; 8; i++ ) {&lt;br /&gt;&lt;z.length;i++) int="" j="z[0]" 1="" b=""&gt;  if  ( z[i] == true ) {&lt;br /&gt;  b |= ( 1 &lt;/z.length;i++)&gt;&amp;lt;&amp;lt;&lt;z.length;i++) int="" j="z[0]" 1="" b=""&gt; i );&lt;br /&gt;}&lt;br /&gt;} &lt;/z.length;i++)&gt;&lt;/pre&gt;&lt;br /&gt;Unlike C, the code is clunky, as you are having to perform a conditional check on a boolean, before you can perform bitwise operations on the values, because Java considers booleans as a non-integral type. How annoying!&lt;br /&gt;&lt;br /&gt;But this constrain only affects the Java language - the same rules do not apply when it comes to the JVM. On the VM, it is perfectly legit for you to express code like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;// assume z == boolean[8]&lt;br /&gt;byte b = 0;&lt;br /&gt;for ( int i=0; i &amp;lt; 8; i++ ) {&lt;br /&gt;&lt;z.length;i++) int="" j="z[0]" 1="" b=""&gt;  b |= z[i] &amp;lt;&amp;lt; i;&lt;br /&gt;} &lt;/z.length;i++)&gt;&lt;/pre&gt;&lt;z.length;i++) b=""&gt;&lt;br /&gt;However, just about any Java compiler disallows this code to compile - the operations on the boolean violates type-safety. But don't blame the compilers, they are just conforming to the language specifications. But since the JVM has nothing to do with the Java language, there is nothing illegal in doing so outside the Java language, let say by using bytecode assembly. Here's an equivalent, using jasmin assembly code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;.source BooleanToByte.j&lt;br /&gt;.class BooleanToByte&lt;br /&gt;.super java/lang/Object&lt;br /&gt;&lt;br /&gt;&lt;init&gt;&lt;init&gt;.method public static main([Ljava/lang/String;)V&lt;br /&gt;.limit stack 4&lt;br /&gt;.limit locals 3&lt;br /&gt;&lt;br /&gt;iconst_0&lt;br /&gt;istore_1      ; byte b = 0;&lt;br /&gt;&lt;br /&gt;iconst_0&lt;br /&gt;istore_2      ; int i = 0;&lt;br /&gt;&lt;br /&gt;LOOP:&lt;br /&gt;&lt;br /&gt;iload_2&lt;br /&gt;bipush 8&lt;br /&gt;if_icmpge EXIT_LOOP:       ; if i&gt;=z.length exit loop&lt;br /&gt;&lt;br /&gt;; here's the magic code that allows you to do direct&lt;br /&gt;; bitwise &lt;/init&gt;&lt;/init&gt;b |= z[i] &lt;&lt; b=""&gt;&lt;init&gt;&lt;init&gt;&lt;br /&gt;iload_1&lt;br /&gt;aload_0&lt;br /&gt;iload_2&lt;br /&gt;baload&lt;br /&gt;iload_2&lt;br /&gt;ishl&lt;br /&gt;ior&lt;br /&gt;istore_1&lt;br /&gt;&lt;br /&gt;iinc 2 1&lt;br /&gt;goto LOOP:&lt;br /&gt;&lt;br /&gt;LOOP_EXIT:&lt;br /&gt;&lt;br /&gt;return&lt;br /&gt;&lt;br /&gt;.end method&lt;br /&gt;&lt;/init&gt;&lt;/init&gt;&lt;/pre&gt;&lt;br /&gt;The jasmin code will probably assemble, but don't expect the JVM to execute it; it serves only as an example, and lacks a few things (I'm missing the constructor block and other nitty gritty little things that's needed to satisfy the bytecode verifier). It is but a case study to separate the JVM from the Java language as people typically assume.&lt;br /&gt;&lt;br /&gt;There has been a number of other languages that has since mushroomed which relies on the JVM as its core; these languages include Groovy, Scala, Jython and JRuby, many of which are rather interesting, although they are more of a curiosity at this stage - I've yet to see any of these implementations deployed in a production environment, although I don't say that as a criticism of any of these languages. In fact, I am actually quite impressed with the &lt;a href="http://www.jruby.org/"&gt;JRuby&lt;/a&gt;, and I recommend you give it a try. It's very faithful to the actual Ruby implementation and allows you to use Java directly. Good fun, I'd say, especially when it combines the expressive of the former with the features of the latter. It's quite impressive that the JVM has been able to be so versatile in allowing other languages to plug into it directly.&lt;br /&gt;&lt;/z.length;i++)&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-321272178163245766?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=GiF27H-_Zpo:4sAGkNL5fXI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=GiF27H-_Zpo:4sAGkNL5fXI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=GiF27H-_Zpo:4sAGkNL5fXI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=GiF27H-_Zpo:4sAGkNL5fXI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=GiF27H-_Zpo:4sAGkNL5fXI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=GiF27H-_Zpo:4sAGkNL5fXI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=GiF27H-_Zpo:4sAGkNL5fXI:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=GiF27H-_Zpo:4sAGkNL5fXI:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/GiF27H-_Zpo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/321272178163245766/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/07/java-is-not-jvm.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/321272178163245766?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/321272178163245766?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/GiF27H-_Zpo/java-is-not-jvm.html" title="Java is not the JVM" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/07/java-is-not-jvm.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYAQ387fCp7ImA9WxNTGUo.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-3730402457646178256</id><published>2009-07-22T12:47:00.000-07:00</published><updated>2009-08-22T14:55:42.104-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-22T14:55:42.104-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Software Development" /><category scheme="http://www.blogger.com/atom/ns#" term="Gdb" /><title>GDB: Relaying Trapped OS Signals</title><content type="html">By chance, I have managed to land myself in a situation where the bug occurs only at a signal handler. In my situation, this means that it happens only when I try to kill the program using a &lt;code&gt;SIGINT&lt;/code&gt;, or more commonly known as the '&lt;code&gt;ctrl-c&lt;/code&gt;' keystroke.&lt;br /&gt;&lt;br /&gt;GDB usually traps this signal, and other signals such as &lt;code&gt;SIGSEGV&lt;/code&gt; (Segmentation Fault), so that you can trace buggy behaviour that is causing your application to fail. But once in a while, the error may occur after the signal is sent, when the code failure resides within the signal handler.&lt;br /&gt;&lt;br /&gt;However the default behaviour of GDB is to trap these signals and subsequently consume them, in effect preventing the bug from occurring. To prevent unwanted behaviour in rare cases such as mine, you need to issue the following command:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(gdb) handle SIGINT pass&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Given that GDB utilises this signal internally, it will ask you for a confirmation to change it. Say '&lt;code&gt;y&lt;/code&gt;' to it, and GDB will correspondingly pass the signal to the application after trapping, which will give you a chance to debug the handler code that is causing the bug.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-3730402457646178256?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=uYACHmNWjqU:DyzHlXg8Fg0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=uYACHmNWjqU:DyzHlXg8Fg0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=uYACHmNWjqU:DyzHlXg8Fg0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=uYACHmNWjqU:DyzHlXg8Fg0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=uYACHmNWjqU:DyzHlXg8Fg0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=uYACHmNWjqU:DyzHlXg8Fg0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=uYACHmNWjqU:DyzHlXg8Fg0:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=uYACHmNWjqU:DyzHlXg8Fg0:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/uYACHmNWjqU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/3730402457646178256/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/07/gdb-relaying-trapped-os-signals.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/3730402457646178256?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/3730402457646178256?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/uYACHmNWjqU/gdb-relaying-trapped-os-signals.html" title="GDB: Relaying Trapped OS Signals" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/07/gdb-relaying-trapped-os-signals.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUAR385fSp7ImA9WxNTGUo.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-1741433672376369247</id><published>2009-07-19T03:14:00.000-07:00</published><updated>2009-08-22T14:57:26.125-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-22T14:57:26.125-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Software Development" /><category scheme="http://www.blogger.com/atom/ns#" term="Gdb" /><title>GDB's Conditional Breakpoints</title><content type="html">&lt;span style="font-weight: bold;"&gt;Conditional Breakpoints for Scalar Types&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let's assume that you, the brilliant hacker, has coded up some really uber-cool stuffs, like this piece of code below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;1: for ( int i = 0; i &amp;lt; gazillion; i++ ) {&lt;br /&gt;2:   doSlightlyBuggyButUberCoolStuffs(i)&lt;br /&gt;3: }&lt;br /&gt;4:&lt;br /&gt;5: void doSlightlyBuggyButUberCoolStuffs(int i) {&lt;br /&gt;6:   // your code here that needs some&lt;br /&gt;7:   // fixing before it becomes uber-cool&lt;br /&gt;8: }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It is doing all the cool stuffs as intended, but somehow something always goes wrong when the code executes up to 2147483648, which is kind of puzzling.&lt;br /&gt;&lt;br /&gt;So what to do?&lt;br /&gt;&lt;br /&gt;You may be tempted to breakpoint at line 5, at the start of the &lt;code&gt;doSlightlyBuggyButUberCoolStuffs()&lt;/code&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(gdb) br doSlightlyBuggyButUberCoolStuffs&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And &lt;code&gt;gdb&lt;/code&gt; dutifully does what it's told; every single time &lt;code&gt;doSlightlyBuggyButUberCoolStuffs()&lt;/code&gt; gets executed, it stops and waits for you to act on it:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Breakpoint 1, doBuggyButUberCoolStuffs (i=1) at test.cpp:6&lt;br /&gt;6:        // start of your uber-cool code&lt;br /&gt;(gdb) c&lt;br /&gt;&lt;br /&gt;Breakpoint 1, doBuggyButUberCoolStuffs (i=2) at test.cpp:6&lt;br /&gt;6:        // start of your uber-cool code&lt;br /&gt;(gdb) c&lt;br /&gt;&lt;br /&gt;.....&lt;br /&gt;&lt;br /&gt;Breakpoint 1, doBuggyButUberCoolStuffs (i=100) at test.cpp:6&lt;br /&gt;6:        // start of your uber-cool code&lt;br /&gt;(gdb) c&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After 100 iterations, you think you've had enough! So it's time to do it the smart way, by setting a conditional:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(gdb) br test.cpp:2&lt;br /&gt;Breakpoint 1 at 0x1234: file test.cpp, line 2.&lt;br /&gt;(gdb) cond 1 i==2147483648&lt;br /&gt;(gdb) run&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After the breakpoint is set, gdb only notifies you when the loop is at its 2147483648th iteration:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Breakpoint 1 at 0x5678: file test.cpp:2&lt;br /&gt;2:   doBuggyButUberCoolStuffs(i)&lt;br /&gt;(gdb) s&lt;br /&gt;6:         // start of your uber-cool code&lt;br /&gt;(gdb) p i&lt;br /&gt;$1 = 2147483648&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Jackpot! You're now at the 2147483648th iteration! And very soon after, you found the offending piece of code, caused by a numerical overflow of a signed integer. Another bug trampled, and peace returns to your realm once more.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conditional Breakpoints for char* Strings&lt;/span&gt;&lt;br /&gt;But very soon after, you run into another irritating problem which is happening within another section of your uber-cool code. This time, the conditional depends on parsing a huge portion of text that comes from,  &lt;span style="font-style: italic;"&gt;um...&lt;/span&gt;, &lt;code&gt;/dev/random&lt;/code&gt; :P&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;1: while ( true ) {&lt;br /&gt;2:   char* c = getStringFromDevRandom();&lt;br /&gt;3:   launchNuclearMissileIfCodeMatch(c);&lt;br /&gt;4:}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Somehow, you are absolutely convinced that &lt;code&gt;/dev/random&lt;/code&gt; will eventually provide correct codes to launch the nuclear missile, but given that &lt;code&gt;launchNuclearMissileIfCodeMatch()&lt;/code&gt; is a really top-secret and highly obfuscated code residing in an external library called &lt;code&gt;libtopsecret.so&lt;/code&gt;, it isn't such a good idea to debug into the call unless you want the &lt;a href="http://www.nsa.gov/"&gt;NSA&lt;/a&gt; bursting through your front doors...&lt;br /&gt;&lt;br /&gt;But since you &lt;span style="font-style: italic;"&gt;do know the launch code&lt;/span&gt; (it's one of &lt;span style="font-style: italic;"&gt;those&lt;/span&gt; things that you'll have to kill your friends if you ever told them), you can perform a conditional check on the string, and breakpoint at it to tell you if the secret code is ever generated by &lt;code&gt;/dev/random&lt;/code&gt; to find out if &lt;code&gt;launchNuclearMissileIfCodeMatch()&lt;/code&gt; is really a hoax:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(gdb) br test.cpp:3&lt;br /&gt;Breakpoint 1 at 0xdeadbabe: file test.cpp, line 3.&lt;br /&gt;(gdb) set $secret_code = "MyUberSecretivePassword"&lt;br /&gt;(gdb) cond 1 strcmp ( $secret_code, c ) == 0&lt;br /&gt;(gdb) run&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And then, you let your code run... &lt;span style="font-style: italic;"&gt;(!)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Well, unfortunately, you get sick of sitting around and waiting for it to happen after a whole day. It seems like &lt;code&gt;/dev/random&lt;/code&gt; doesn't really generate your uber-secret nuclear launch codes as frequently as you would like to think. In the meantime, the world thanks their lucky stars that you haven't caused a nuclear winter to materialise just yet... :)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-1741433672376369247?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=ZdAdxmEjpJM:jc7P1M5OcKw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=ZdAdxmEjpJM:jc7P1M5OcKw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=ZdAdxmEjpJM:jc7P1M5OcKw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=ZdAdxmEjpJM:jc7P1M5OcKw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=ZdAdxmEjpJM:jc7P1M5OcKw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=ZdAdxmEjpJM:jc7P1M5OcKw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=ZdAdxmEjpJM:jc7P1M5OcKw:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=ZdAdxmEjpJM:jc7P1M5OcKw:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/ZdAdxmEjpJM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/1741433672376369247/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/07/gdbs-conditional-breakpoints.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/1741433672376369247?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/1741433672376369247?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/ZdAdxmEjpJM/gdbs-conditional-breakpoints.html" title="GDB's Conditional Breakpoints" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/07/gdbs-conditional-breakpoints.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkEMR3Y-eip7ImA9WxJUE04.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-1769330106941128853</id><published>2009-07-11T09:50:00.000-07:00</published><updated>2009-07-11T11:58:06.852-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-11T11:58:06.852-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Health" /><category scheme="http://www.blogger.com/atom/ns#" term="Philosophy" /><title>How to lose weight and be healthy</title><content type="html">I have little patience with people who complain about their weight problems, and for a good reason - I have a really simple way for losing weight which does not involve going on a crazy exercise binge or starving yourself silly. Sounds miraculous? Well, read on.&lt;br /&gt;&lt;br /&gt;The easy part that you already know, is to make some wise choices about your diet, exercise moderately, and be consistent at both. Yes, it is both sensible and achievable.&lt;br /&gt;&lt;br /&gt;The second part is usually what squeezes the life out of one, when I say:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"Stop eating chocolates, cake and ice-cream!"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;My advice makes me sound like I'm a Nazi Dictator violating their &lt;a href="http://en.wikipedia.org/wiki/Eighth_Amendment_to_the_United_States_Constitution"&gt;8th Amendment rights&lt;/a&gt;. But no, and let me reassert this again, it is that&lt;span style="font-style: italic;"&gt; &lt;/span&gt;simple.&lt;br /&gt;&lt;br /&gt;I'm &lt;span style="font-style: italic;"&gt;deadly serious&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Chocolates, cake and Ice-cream belong to a broader category I classify as &lt;span style="font-style: italic;"&gt;'leisure food'. &lt;/span&gt;It's leisure because people eat these food for their own enjoyment, not for sustenance. This applies to all other snacks (cookies, biscuits, sweets, chips and flavoured drinks) - if that is what you are usually consuming when you're not hungry, then you shouldn't be having it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"But, but... that's impossible!"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I'll tell you a story about a friend of mine. Let's call him 'Bryan'. (Oh, &lt;span style="font-style: italic;"&gt;that is your real name&lt;/span&gt;! Let's see how long before someone points you to read this entry :P) Bryan has a minor weight issue, and he once told me about this amazing story that his household fridge was like &lt;a href="http://en.wikipedia.org/wiki/Bag_of_holding"&gt;The Bag of Holding&lt;/a&gt;; each time he opens it, there will be a slice of chocolate cake or other sweet delights waiting for him. No surprises to why he isn't able to keep his hands off the sugary stuffs.&lt;br /&gt;&lt;br /&gt;Now let me tell you another story of another friend of mine. Let's call him 'Vincent'. (Oh hey, that's me!) Vincent grew up in a poor household where there's no cake awaiting for him in the fridge any time he opens it. In fact, there's nothing there for him whenever he opens it. Poor Vincent! You might even begin think that his childhood is real deprived!&lt;br /&gt;&lt;br /&gt;On the contrary, Vincent had never been hungry in his life; there is always food on the table, and the meals involve a simple serving of rice, vegetables, and either eggs, chicken, fish or other protein sources. Given the tight budget Vincent's mum had, there wasn't enough money to buy chocolates, snacks and fizzy drinks anyway. 20 years later, Vincent do not have much cravings for these &lt;span style="font-style: italic;"&gt;'leisure foods' &lt;/span&gt;. To others, he just seems to have an incredible self-control.&lt;br /&gt;&lt;br /&gt;No, this isn't a &lt;span style="font-style: italic;"&gt;tit-for-tat&lt;/span&gt; competition here, all I'm saying is that good moderate choices makes harder things easier in the long run.&lt;br /&gt;&lt;br /&gt;So what do you do if you grew up in the life of Bryan?&lt;br /&gt;&lt;br /&gt;Start small, and be consistent. &lt;span style="font-style: italic;"&gt;Consistency&lt;/span&gt; is the key, my friend. In the long run, it will get easier for you. Just don't get into the delusion of wanting instant results&lt;span style="font-style: italic;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is this one other issue, like what if:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"I get hungry really easily!"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That is why you should stop eating chocolates, cake and ice-cream! And eat &lt;span style="font-style: italic;"&gt;more &lt;/span&gt;meat!&lt;br /&gt;&lt;br /&gt;Some of you might be puzzled. &lt;span style="font-style: italic;"&gt;More meat&lt;/span&gt;? Let me explain why in my own personal, anecdotal example. If you ever read food labels, you'll find that a 40g bar of Cadbury's chocolate contains 205 Calories of energy. In comparison, 125g of chicken breast contains only 133 Calories of energy!&lt;br /&gt;&lt;br /&gt;I'll answer how these number translate to in human terms. If I have more than a good portion of chicken for lunch, say 250g, I'll have consumed 266 Calories and it will keep me from being hungry till dinner. In comparison, if I had two chocolate bars for lunch, I would have consumed 410 Calories of energy &lt;span style="font-weight: bold;"&gt;AND&lt;/span&gt; I'll be hungry again 2 hours later!&lt;br /&gt;&lt;br /&gt;I'm aware that there are some scientific studies out there that supports my claim, but what's more important, is that I know &lt;span style="font-style: italic;"&gt;it works for me&lt;/span&gt;. This I want you to keep in mind. I certainly can tell that something within meat (or protein, I suspect) keeps one from feeling hungry sooner. Carbohydrates just don't do the same thing. It's no wonder some people swear by faddish regimes like the &lt;a href="http://en.wikipedia.org/wiki/Atkins_diet"&gt;Atkin's Diet&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But I do not recommend anybody from trying funny diet plans, or simply going on diets &lt;span style="font-weight: bold;"&gt;at all&lt;/span&gt;. Firstly, if you are starving yourself, you are doing it &lt;span style="font-style: italic;"&gt;wrong. &lt;/span&gt;Because it'll never work - primal instinct will &lt;span style="font-style: italic;"&gt;always &lt;/span&gt;override any artificial discipline that you try inflicting on yourself. Secondly, diets promote deprivation, and the deprivation of essential nutrients to your body is certainly always &lt;span style="font-style: italic;"&gt;harmful&lt;/span&gt;. All I'm saying, is to cut down on unnecessary leisure food carbohydrates, and have more meat &lt;span style="font-weight: bold;"&gt;if your body reacts to hunger the same way as I do&lt;/span&gt;. In addition, do stick to what the doctors recommend with regards to healthy servings of fruits and vegetables.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Eating less is good for you&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Recently, it's been proven that caloric restriction will improve health and extend longevity. And this includes us &lt;a href="http://www.newscientist.com/article/dn17439"&gt;primates&lt;/a&gt;, and not just in &lt;a href="http://www.newscientist.com/article/dn8950-cutting-calories-may-boost-your-lifespan.html"&gt;lab mice&lt;/a&gt;. If you're too lazy to read the links, here's a visual difference between two monkeys where one is on caloric restriction and the other isn't. Guess which one is which?&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.newscientist.com/data/images/ns/cms/dn17439/dn17439-2_300.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 300px; height: 210px;" src="http://www.newscientist.com/data/images/ns/cms/dn17439/dn17439-2_300.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;If you're cringing in horror about how miserable the rest of your life will be starving yourself, think again. You'll be surprised how it does not involve starving. There's no contradiction, and I'll use myself as an example. For the numbers to make sense, we need to know how much Calories I need -  and there are plenty of calculators out there that will help to figure this out, Google it.&lt;br /&gt;&lt;br /&gt;Now, for a 30 year-old, 1.75m, 65kg guy, my Caloric requirement is about +/- 2500 Calories, depending on which calculators used. A 25% Caloric reduction is what they've used in the scientific studies, so that brings my figure to 1875 Calories. Now, lets calculate what I eat on a given day, which includes breakfast, lunch and dinner with no snacks.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;Breakfast&lt;/span&gt;&lt;br /&gt;4 slices of bread, 68g - 200 Calories&lt;br /&gt;Nutella, 18g spread! - 98 Calories&lt;br /&gt;Tea - 2 Calories&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Lunch&lt;/span&gt;&lt;br /&gt;200g Chicken - 212 Calories&lt;br /&gt;250g Rice - 867 Calories&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Dinner&lt;/span&gt;&lt;br /&gt;300g Salmon - 447 Calories&lt;br /&gt;100g Broccoli - 35 Calories&lt;br /&gt;133g Apple - 65 Calories&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Total Calorie Count : &lt;/span&gt;1926 Calories&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;It's slightly more than 1875, but it's not too far off range. And I'm not rationing myself either - I've given generous estimates for the spreads (18g spreads to 67g of bread!), and dinner is 2 portions of Salmon (supermarkets estimate of portion sizes are ridiculous!). Give and take, that is what I normally have without having to feel hungry at all, it's quite amazing to know that I'm still within their bounds of 'Caloric Reduction'!&lt;br /&gt;&lt;br /&gt;If you've noticed, it is the carbohydrate foods that are giving an amazingly high Caloric count - look at rice at 867 Calories at 250g! And I never knew this until I looked this up myself!&lt;br /&gt;&lt;br /&gt;More chicken from now on, please!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Supersized Nations&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Being fat is a peculiar problem that exists only in industralised nations. No surprises, since that  is where all the money is. Indulgence is an economic problem if you actually think about it - it only afflicts people who &lt;span style="font-style: italic;"&gt;can&lt;/span&gt; afford it. I'm just 'lucky' I grew up in a circumstance where I do not have a luxury to indulge in leisure foods, although this doesn't make the make me the model case study for solving the fat nations problem.&lt;br /&gt;&lt;br /&gt;It is really not a problem if you understand this is how capitalism works. Businesses are incentivised to create things you want, and for food companies, to create foods that are tasty, so that you'll buy them. Tasty foods means that you'll want to have more. People often cite the reasons of growing fat on the an abundance of food and the general lack of exercise in the modern world - it is &lt;span style="font-style: italic;"&gt;true&lt;/span&gt;, but it's no more correct to blame it on the companies who make tasty foods, than to attribute blame on themselves. If food companies are predatory to the addiction of your taste buds, should we go after them like we do on hard drugs?&lt;br /&gt;&lt;br /&gt;I like capitalism - it is your prerogative to see how best to spend your money, so it is within your rights to eat yourself silly, and then spend a fortune on treatment - that is a personal choice.&lt;br /&gt;&lt;br /&gt;But it irks me to see how governments are socialising these costs at the expense of sensible people - it's just one of the things in our society I like to describe as 'mad'. If it's 'too big to fail', nobody should have allowed it to grow that big in the first place. So far, governments are just plain inept at dealing with both supersized companies and supersized people.&lt;br /&gt;&lt;br /&gt;So, do not bring weight loss problems as a conversation to my dinner table. And if anybody does have the temerity to raise it, be prepared for a session of  ridicule - and if he or she takes it in good humour, maybe I'll refer them to what I have to say on this subject matter.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-1769330106941128853?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=VXa0GJ23UDc:XDVzBp9phHQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=VXa0GJ23UDc:XDVzBp9phHQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=VXa0GJ23UDc:XDVzBp9phHQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=VXa0GJ23UDc:XDVzBp9phHQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=VXa0GJ23UDc:XDVzBp9phHQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=VXa0GJ23UDc:XDVzBp9phHQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=VXa0GJ23UDc:XDVzBp9phHQ:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=VXa0GJ23UDc:XDVzBp9phHQ:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/VXa0GJ23UDc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/1769330106941128853/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/07/how-to-lose-weight-and-be-healthy.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/1769330106941128853?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/1769330106941128853?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/VXa0GJ23UDc/how-to-lose-weight-and-be-healthy.html" title="How to lose weight and be healthy" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/07/how-to-lose-weight-and-be-healthy.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcMQ3c5eyp7ImA9WxJVFks.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-1337885701200353649</id><published>2009-07-03T15:25:00.001-07:00</published><updated>2009-07-03T15:28:02.923-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-03T15:28:02.923-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Personal Life" /><title>Scottish Whisky</title><content type="html">&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_lSk990LIlbk/Sk6FggP3jjI/AAAAAAAAAOk/gnQAk8hjBlw/s1600-h/P1030132.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_lSk990LIlbk/Sk6FggP3jjI/AAAAAAAAAOk/gnQAk8hjBlw/s400/P1030132.JPG" alt="" id="BLOGGER_PHOTO_ID_5354363800448896562" border="0" /&gt;&lt;/a&gt;Feels like you've drunk a cigar.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-1337885701200353649?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=990ugq3AXRs:S1UA27ZjUZY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=990ugq3AXRs:S1UA27ZjUZY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=990ugq3AXRs:S1UA27ZjUZY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=990ugq3AXRs:S1UA27ZjUZY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=990ugq3AXRs:S1UA27ZjUZY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=990ugq3AXRs:S1UA27ZjUZY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=990ugq3AXRs:S1UA27ZjUZY:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=990ugq3AXRs:S1UA27ZjUZY:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/990ugq3AXRs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/1337885701200353649/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/07/scottish-whisky.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/1337885701200353649?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/1337885701200353649?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/990ugq3AXRs/scottish-whisky.html" title="Scottish Whisky" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_lSk990LIlbk/Sk6FggP3jjI/AAAAAAAAAOk/gnQAk8hjBlw/s72-c/P1030132.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/07/scottish-whisky.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EDRHk8cSp7ImA9WxJWGUg.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-3112327022508402045</id><published>2009-06-24T03:14:00.000-07:00</published><updated>2009-06-25T10:41:15.779-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-25T10:41:15.779-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Personal Life" /><category scheme="http://www.blogger.com/atom/ns#" term="Travel" /><title>I ♥ Amsterdam!</title><content type="html">First Stop, Brussels. Ok, you must be scratching your head now, and asking "&lt;span style="font-style: italic;"&gt;Brussels&lt;/span&gt;? Like did you read your maps upside-down and got lost?" Well, the truth can't be any simpler: it is cheaper if I fly into Charleroi and drove to Amsterdam! Seeing two cities for the price of one, nice!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/SkKJCzuDs-I/AAAAAAAAANM/wRq2-DhmNYM/s1600-h/P1020781.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/SkKJCzuDs-I/AAAAAAAAANM/wRq2-DhmNYM/s400/P1020781.JPG" alt="" id="BLOGGER_PHOTO_ID_5350989988605703138" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;That's the town centre of Brussels, &lt;span style="font-style: italic;"&gt;gorgeous&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_lSk990LIlbk/SkKJgoCZgBI/AAAAAAAAANU/jcK0-xYx8mI/s1600-h/P1020791.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_lSk990LIlbk/SkKJgoCZgBI/AAAAAAAAANU/jcK0-xYx8mI/s400/P1020791.JPG" alt="" id="BLOGGER_PHOTO_ID_5350990500865867794" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In one part of the city, there's a wall with the mural of &lt;a href="http://en.wikipedia.org/wiki/The_Adventures_of_Tintin"&gt;&lt;span style="font-style: italic;"&gt;Tin Tin&lt;/span&gt;&lt;/a&gt;. There's quite a bit of Tin Tin stuffs here, no surprises, given this the birthplace of its author, Herge.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_lSk990LIlbk/SkKJ2fY--fI/AAAAAAAAANc/CcU1628lgg0/s1600-h/P1020797.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_lSk990LIlbk/SkKJ2fY--fI/AAAAAAAAANc/CcU1628lgg0/s400/P1020797.JPG" alt="" id="BLOGGER_PHOTO_ID_5350990876501801458" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Belgium waffles! Quite delectable, I had the one covered with strawberries and laced with chocolate, mmmmh! And it was &lt;span style="font-style: italic;"&gt;free&lt;/span&gt;! Not from the shop, but from a new friend of mine that I've met while travelling out from Dublin airport, a fellow Singaporean traveller, which is as rare as hen's teeth! Surprisingly, he was from Singapore's Ministry of Foreign Affairs, and remarked that I'm quite possibly the &lt;span style="font-style: italic;"&gt;only&lt;/span&gt; Singaporean living here! &lt;span style="font-style: italic;"&gt;I feel so special already&lt;/span&gt;! :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_lSk990LIlbk/SkKKO02iKuI/AAAAAAAAANk/ka6NSZm0llQ/s1600-h/P1020802.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_lSk990LIlbk/SkKKO02iKuI/AAAAAAAAANk/ka6NSZm0llQ/s400/P1020802.JPG" alt="" id="BLOGGER_PHOTO_ID_5350991294579747554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The architecture in the town centre is just incredible. Look at all the life-like statutes that are part of the walls of the buildings. For the lack of time, since I had a long drive ahead, that's all from Brussels. After which I had to take off and drive down to my newest favourite city, Amsterdam!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_lSk990LIlbk/SkKKmvoyYlI/AAAAAAAAANs/ErTTZ-4oCvM/s1600-h/P1020831.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_lSk990LIlbk/SkKKmvoyYlI/AAAAAAAAANs/ErTTZ-4oCvM/s400/P1020831.JPG" alt="" id="BLOGGER_PHOTO_ID_5350991705496773202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;My new friend had actually spent a few days in Amsterdam already, so essentially I've gotten a free guide to show me around, which was really cool. It's really a quirk of fate, given that most Singaporeans may gladly give Ireland a pass, but not him - being an avid reader, and a fan of &lt;a href="http://en.wikipedia.org/wiki/James_Joyce"&gt;James Joyce&lt;/a&gt;, which was the main reason why we got to cross paths.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_lSk990LIlbk/SkKLTgQhGYI/AAAAAAAAAN0/_-yLlIypCg4/s1600-h/P1020833.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 300px; height: 400px;" src="http://4.bp.blogspot.com/_lSk990LIlbk/SkKLTgQhGYI/AAAAAAAAAN0/_-yLlIypCg4/s400/P1020833.JPG" alt="" id="BLOGGER_PHOTO_ID_5350992474462558594" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Weed&lt;/span&gt;! You can now understand why I find this place so charming - not the soft drugs if that's what you're thinking about! It's the &lt;span style="font-style: italic;"&gt;liberalism&lt;/span&gt;, dammit! People are free to do whatever they want here, but take the responsibility for their actions, of course. Still can't believe that I'm travelling with a ranked civil servant here - hopefully he picks up a few lessons and report to his political masters that it is fine to have more liberalism! There aren't any major law and order problems here just because soft drugs are available - proves that we certainly &lt;a href="http://blog.vinceliu.com/2007/08/on.html"&gt;don't need to hang people just because they have a bit of grass in their pockets&lt;/a&gt;. Well, even &lt;a href="http://politicalticker.blogs.cnn.com/2007/11/26/obama-yes-i-inhaled%E2%80%94that-was-the-point/"&gt;Barack Obama has inhaled it&lt;/a&gt; ... had he been living in Singapore rather than America, they would have snuffed the life out of him before he can ever live up his potential to become the 44th President of the United States.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_lSk990LIlbk/SkKLeV945eI/AAAAAAAAAN8/aHJeCh9Wo7c/s1600-h/P1020837.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_lSk990LIlbk/SkKLeV945eI/AAAAAAAAAN8/aHJeCh9Wo7c/s400/P1020837.JPG" alt="" id="BLOGGER_PHOTO_ID_5350992660678632930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Sorry guys, if you are looking for &lt;a href="http://en.wikipedia.org/wiki/Not_safe_for_work"&gt;NSFW&lt;/a&gt; pictures - for consolation, you can see that I'm in the 'red light district' of Amsterdam. There's an Erotic Museum where I was told you'll be able to learn all you need to know about the history of sex. Fortunately, or unfortunately, Amsterdam has cleaned up quite a fair bit the last couple of years - I was told that half the city centre used to be areas where you can see skimpily dressed women behind glass boxes. Today, it's reduced to a only small section within &lt;span style="font-style: italic;"&gt;one&lt;/span&gt; alley - and there isn't much to see as well. Hell, there's probably more naked bodies lying on &lt;a href="http://www.youtube.com/watch?v=i7_6MhRp91c"&gt;Bondi Beach&lt;/a&gt; (NSFW!) any given summer day than in Amsterdam!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_lSk990LIlbk/SkKLwDZdyPI/AAAAAAAAAOE/JzFAjZoE8q4/s1600-h/P1020843.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 300px; height: 400px;" src="http://2.bp.blogspot.com/_lSk990LIlbk/SkKLwDZdyPI/AAAAAAAAAOE/JzFAjZoE8q4/s400/P1020843.JPG" alt="" id="BLOGGER_PHOTO_ID_5350992964931668210" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The only nakedness I've witnessed was from a drunken Englishman who had decided that his penis was probably a better show than all the ladies there. The crowd were wild, clapping, cheering and cat-whistling while he's twirling his thing out of his pants and flashing it to the crowd. On a related note, the booth you see up there is a peeing booth - yes, you go in and pee on the side of the streets, pretty visible to everybody else. No prizes for guessing what that dark patch on the floor is. ;)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_lSk990LIlbk/SkKMB_gGbjI/AAAAAAAAAOM/wD2e8ipiFMY/s1600-h/P1020885.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_lSk990LIlbk/SkKMB_gGbjI/AAAAAAAAAOM/wD2e8ipiFMY/s400/P1020885.JPG" alt="" id="BLOGGER_PHOTO_ID_5350993273123401266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Amsterdam is full of canals and quaint little houses, some tilted with age, as you can see up there. Quite charming, although I wouldn't want to be living in there if there's a serious risk of it toppling over.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_lSk990LIlbk/SkKMVWa6e7I/AAAAAAAAAOU/AERfsK88tJ8/s1600-h/P1020892.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_lSk990LIlbk/SkKMVWa6e7I/AAAAAAAAAOU/AERfsK88tJ8/s400/P1020892.JPG" alt="" id="BLOGGER_PHOTO_ID_5350993605693176754" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;That's how beautiful Amsterdam is. Oh, yeah you can see that it's devoid of people in the picture, which is kind of cool - that's because I woke up at 5am on a Sunday morning to take a wander about. The only people left on the streets were the few revellers who were probably too drunk to know how to go home.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/SkKMmkyAGKI/AAAAAAAAAOc/HJfokI70r_E/s1600-h/P1020903.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/SkKMmkyAGKI/AAAAAAAAAOc/HJfokI70r_E/s400/P1020903.JPG" alt="" id="BLOGGER_PHOTO_ID_5350993901605886114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I'll leave you with a final picture of one of the canals of Amsterdam. It's absolutely gorgeous for a place, and certainly one of the best cities I've been to in my life, and if you ever have the opportunity to visit it, &lt;span style="font-style: italic;"&gt;go&lt;/span&gt; - I assure you won't regret it!&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-3112327022508402045?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=fEDepB8qm-g:dqvfAtp-H-k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=fEDepB8qm-g:dqvfAtp-H-k:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=fEDepB8qm-g:dqvfAtp-H-k:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=fEDepB8qm-g:dqvfAtp-H-k:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=fEDepB8qm-g:dqvfAtp-H-k:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=fEDepB8qm-g:dqvfAtp-H-k:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=fEDepB8qm-g:dqvfAtp-H-k:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=fEDepB8qm-g:dqvfAtp-H-k:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/fEDepB8qm-g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/3112327022508402045/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/06/i-amsterdam.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/3112327022508402045?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/3112327022508402045?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/fEDepB8qm-g/i-amsterdam.html" title="I ♥ Amsterdam!" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_lSk990LIlbk/SkKJCzuDs-I/AAAAAAAAANM/wRq2-DhmNYM/s72-c/P1020781.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/06/i-amsterdam.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4DQ38_eSp7ImA9WxJWFk8.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-7403887654964120263</id><published>2009-06-21T03:14:00.000-07:00</published><updated>2009-06-21T15:39:32.141-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-21T15:39:32.141-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Configuring your Linux Firewall using iptables</title><content type="html">When I first started out using Linux, I was quite daunted by 'iptables', the built-in firewall that is bundled with the Linux kernel. Given there is a general misconception from a lot of people's that configuring it is anything but easy has also compounded towards my reluctance to try to learn it in detail initially - but no surprises here, as the &lt;a href="http://iptables-tutorial.frozentux.net/iptables-tutorial.html"&gt;good tutorial I've referenced has 16 chapters and 10 appendices&lt;/a&gt;! It's little wonder why some people might be scared away by that.&lt;br /&gt;&lt;br /&gt;But there is a good reason why a tutorial about iptables is that big - computer security is all about the details, most of the time you know all the details on the different aspects of network security to understand the whole picture before you can design a comprehensive firewall that provides all features you want without letting malicious traffic through.&lt;br /&gt;&lt;br /&gt;Still, if you're just setting up a simple home network + firewall, it shouldn't be that difficult. And it isn't really. I'll show you a few recipes you can use to set things up properly without having too much &lt;a href="http://blog.vinceliu.com/2007/09/do-not-rtfm.html"&gt;RTFM&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;For illustration, I'll use the following setup that I'm running at home as an example:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/SjkSPdvWGRI/AAAAAAAAANE/W68yDQQ0KTs/s1600-h/firewall.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 113px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/SjkSPdvWGRI/AAAAAAAAANE/W68yDQQ0KTs/s400/firewall.png" alt="" id="BLOGGER_PHOTO_ID_5348326089369721106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;My server&lt;/span&gt; is an old Celeron PC which acts as the firewall. It has an ethernet card which connects to a wireless switch where the Internet connection gets shared by all my laptops connected to &lt;span style="font-style: italic;"&gt;My LAN&lt;/span&gt;. How the server connects to the Internet is via my &lt;a href="http://blog.vinceliu.com/2009/05/huawei-e220-modem-on-linux.html"&gt;Huawei E220 broadband modem&lt;/a&gt;. It just convenient to have my configuration this way as well, since my old iBookG4 has no suitable drivers. The broadband device is recognized as ppp0 as shown in the diagram above. Let me now show you a few interesting things you can do with your 'iptables' firewall.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Recipe #1 Forward Internet Connections using IP Masquerading&lt;/span&gt;&lt;br /&gt;You want to let your LAN make connections from the Internet. This is one of the cool features that iptables provide that makes it more than just a firewall. Before you make changes to your firewall entries, you'll need to make some changes to your kernel's configuration to enable it to forward IP traffic. To do this dynamically, run the following command:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The changes you've made above will be lost the next time you reset your computer. To make this change permanent, you have to make changes to &lt;code&gt;/etc/sysctl.conf&lt;/code&gt; to include the following line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;net.ipv4.ip_forward=1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once that's set up, we can issue the commands to &lt;code&gt;iptables&lt;/code&gt; to start forwarding traffic from the LAN to the Internet:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE&lt;br /&gt;iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT&lt;br /&gt;iptables -A FORWARD -i ppp0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The formal name for forwarding network traffic is called 'Network Address Translation', or NAT for short. This explains why the first &lt;code&gt;iptables&lt;/code&gt; command has &lt;code&gt;nat&lt;/code&gt; in it. It basically instructs the firewall to remember the connection that gets forwarded out the Internet. It needs to do this do multiplex different connections from the LAN into a single connection out to the Internet, and then smartly demultiplexes the received data back to the requesters. The next two iptables directives tell the firewall to allow forwarding of packets to the Internet from the LAN, and only allow data packets from the Internet to be sent back to the LAN only if there previously are connections requesting for it. This effectively denies any illegal traffic from coming into the LAN unless computers within it explicitly allows it to.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Recipe #2 Differentiating Traffic between LAN and the Internet&lt;/span&gt;&lt;br /&gt;Often, you'll want to assign different rights to traffic from your LAN vs. the Internet. Traffic from your LAN is usually trusted, and hence is within the &lt;span style="font-style: italic;"&gt;safe&lt;/span&gt; boundary, while Internet traffic is regarded as hostile, hence classified as &lt;span style="font-style: italic;"&gt;unsafe&lt;/span&gt;. Like the diagram shown in my example above, data from the Internet via device ppp0 is the &lt;span style="font-style: italic;"&gt;unsafe&lt;/span&gt; network which I'll want to have differentiating rules from my &lt;span style="font-style: italic;"&gt;safe&lt;/span&gt; LAN network originating from eth0.&lt;br /&gt;&lt;br /&gt;Firstly we want to create the two different chains to represent traffic from eth0 and ppp0:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;iptables -N ETH0_FILTER&lt;br /&gt;iptables -N PPP0_FILTER&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once the chains are created, we have to tell the main INPUT traffic chain to segregate the traffic between the two networks:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;iptables -A INPUT -i eth0 -j ETH0_FILTER&lt;br /&gt;iptables -A INPUT -i ppp0 -j PPP0_FILTER&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once the different changes are linked to the main input, we can now provide rules to treat the different networks separately. For example, if we want to let our LAN network access everything, and only allow SSH traffic from the Internet, we can put rules like these:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;iptables -A ETH0_FILTER -j ACCEPT&lt;br /&gt;iptables -A PPP0_FILTER -p tcp -m tcp --dport 22 -j ACCEPT&lt;br /&gt;iptables -A PPPo_FILTER -j DROP&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This will drop all other traffic except SSH on &lt;code&gt;ppp0&lt;/code&gt;. For other interesting ways of configuring how you want to filter your traffic between the different chains keep reading the remaining tips.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Recipe #3 Logging Suspicious Traffic&lt;br /&gt;&lt;/span&gt;&lt;span&gt;How&lt;/span&gt;&lt;span&gt; would&lt;/span&gt;&lt;span&gt; you know if you are under attack by malicious Internet traffic? Simple, by logging these intrusions. Here's one way of logging these intrusions:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;iptables -A PPP0_FILTER -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 2 --name DEFAULT --rsource -j LOG --log-prefix "DROPPED:"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;The example above says that if there are more than 2 consecutive connections from the Internet to my SSH port (22) within the last 60 seconds, then LOG the message with the prefix &lt;span style="font-style: italic;"&gt;"DROPPED:"&lt;/span&gt;&lt;/span&gt;&lt;span&gt;. Obviously, this line only logs the connection, what I've omitted is to drop the connection (see Recipe #4 below).&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Recipe #4 Rate Limit Spam Traffic&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Bots and spammers usually rely on software that repeatedly scan and access your server to try to bruteforce their way in. On machines with a noisy harddisk like mine, the repeated clicking sound is a dead-giveaway (not to mention the annoyance!) So to stop from them from repeatedly doing so, we enact a rule that drops packets if too many incoming new connections are attempted within a short period of time&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;pre&gt;&lt;br /&gt;iptables -A PPP0_FILTER -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 2 --name DEFAULT --rsource -j DROP&lt;br /&gt;iptables -A PPP0_FILTER -p tcp -m tcp --dport 22 -j ACCEPT&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The first line tells the firewall to log all new incoming connections - if more than 2 new connections are attempted within 60 seconds, then all the remaining connections will be dropped until the 60 second period times out. Given my default policy of my firewall is to drop connections, the second line is included to explicitly ACCEPT the connection, if the first rule does not match (ie, no more than 2 connections are seen within the last 60 seconds).&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Recipe #5 Fight Back Spammers By Tarpitting&lt;br /&gt;&lt;/span&gt;&lt;span&gt;A tarpit connection is one that delays incoming network connections as long as possible. This technique causes spam connections to slow down, limiting the amount of computers that it can spam. However the iptables version of tarpit is a slightly more advanced variant: it sets the TCP acknowledgement window of the network packet to 1, forcing the sender to generate a full TCP packet per 1 byte of data it tries to send, making it computationally costly for spammers as it saps the computer's CPU resources. If you like to fight back against spammers, then this tip is for you.&lt;br /&gt;&lt;br /&gt;To enable tarpitting, this requires you to patch and recompile your kernel, which is an entire post itself, so read my more detailed post on &lt;a href="http://blog.vinceliu.com/2009/06/setting-up-tarpit-on-ubuntu-linux.html"&gt;how to enable tarpitting.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Recipe #6 Making Your Firewall Changes Permanent&lt;br /&gt;&lt;/span&gt;After making all those nifty changes, it would be a shame if they got lost the next time your computer rebooted. So here's how you can make these firewall settings permanent. Once you are satisfied with all the changes you are making to your firewall, save it by invoking &lt;code&gt;iptables-save&lt;/code&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;iptables-save &gt; /etc/iptables.rules&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above command pipes all the configuration into /etc/iptables.rules file. Once you have that, you'll want to restore the configuration every single time your computer starts up. There are quite a few places where you can start restoring the firewall, I do it in my &lt;code&gt;/etc/rc.local&lt;/code&gt; file, after my ppp connection is started, where I insert the following line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;iptables-restore &lt; /etc/iptables.rules &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And you're all done. Now you can sit back, relax and enjoy the security features of your firewall!&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-7403887654964120263?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=-BMRrRG4tmU:XJYcZ68zr4k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=-BMRrRG4tmU:XJYcZ68zr4k:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=-BMRrRG4tmU:XJYcZ68zr4k:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=-BMRrRG4tmU:XJYcZ68zr4k:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=-BMRrRG4tmU:XJYcZ68zr4k:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=-BMRrRG4tmU:XJYcZ68zr4k:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=-BMRrRG4tmU:XJYcZ68zr4k:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=-BMRrRG4tmU:XJYcZ68zr4k:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/-BMRrRG4tmU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/7403887654964120263/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/06/configuring-your-linux-firewall-using.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/7403887654964120263?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/7403887654964120263?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/-BMRrRG4tmU/configuring-your-linux-firewall-using.html" title="Configuring your Linux Firewall using iptables" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_lSk990LIlbk/SjkSPdvWGRI/AAAAAAAAANE/W68yDQQ0KTs/s72-c/firewall.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/06/configuring-your-linux-firewall-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8AQXs9eCp7ImA9WxJWEko.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-661807898364696016</id><published>2009-06-17T15:14:00.000-07:00</published><updated>2009-06-17T15:14:00.560-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-17T15:14:00.560-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Getting System Information from Linux</title><content type="html">Here are some commands that I commonly use to find information about my system. The amount of information you can get on your computer can be vast and varied - it depends on how detailed you want to go into each of the subsystem on your computer. I'll try to group them in order that is most sensible, and also, note that these commands may be Ubuntu/Debian specific.&lt;br /&gt;&lt;br /&gt;Listing devices on your mainboard:&lt;br /&gt;&lt;pre&gt; &lt;br /&gt;biosdecode                 # information about your BIOS&lt;br /&gt;lshw                       # gets quite a bit of information on everything about your CPU&lt;br /&gt;lspci                      # get devices on your PCI bus&lt;br /&gt;lsusb                      # list devices on your USB&lt;br /&gt;dmidecode                  # get device information via BIOS&lt;br /&gt;fdisk -l                   # get partition info on your harddisk&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Getting information on your OS:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cat /proc/cpuinfo          # get information about your processor &lt;br /&gt;cat /proc/meminfo          # shows memory usage&lt;br /&gt;free                       # show available free memory&lt;br /&gt;top                        # detailed memory usage by process&lt;br /&gt;htop                       # a better version of top&lt;br /&gt;lsof                       # shows which file handle is opened by processes&lt;br /&gt;lsmod                      # shows loaded kernel modules&lt;br /&gt;dmesg                      # output bootup information&lt;br /&gt;lsb_release -a             # see which distro of OS you're using&lt;br /&gt;ps -e aux                  # list all running processes&lt;br /&gt;df --si                    # show amount of free disk space&lt;br /&gt;hdparm -t harddisk_device  # show performance of harddisk&lt;br /&gt;ifconfig                   # show network configuration&lt;br /&gt;route                      # show network routing configuration&lt;br /&gt;iwconfig                   # show wireless network information&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-661807898364696016?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=V6f_WCsRxFE:UQy3His893M:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=V6f_WCsRxFE:UQy3His893M:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=V6f_WCsRxFE:UQy3His893M:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=V6f_WCsRxFE:UQy3His893M:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=V6f_WCsRxFE:UQy3His893M:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=V6f_WCsRxFE:UQy3His893M:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=V6f_WCsRxFE:UQy3His893M:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=V6f_WCsRxFE:UQy3His893M:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/V6f_WCsRxFE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/661807898364696016/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/06/getting-system-information-from-linux.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/661807898364696016?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/661807898364696016?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/V6f_WCsRxFE/getting-system-information-from-linux.html" title="Getting System Information from Linux" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/06/getting-system-information-from-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAMQXwzeip7ImA9WxJXGUs.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-1736579185060779139</id><published>2009-06-14T01:23:00.000-07:00</published><updated>2009-06-14T01:23:00.282-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-14T01:23:00.282-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Ubuntu on iBook G4</title><content type="html">People must think I am going gaga; I have installed Ubuntu on every different CPU architecture I have laid my hands on, and now on my Macbook G4!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/SjOEEmD_yhI/AAAAAAAAAM0/Wiu_aD1tuIg/s1600-h/P1020767.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/SjOEEmD_yhI/AAAAAAAAAM0/Wiu_aD1tuIg/s400/P1020767.JPG" alt="" id="BLOGGER_PHOTO_ID_5346762397090564626" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Mac Zealots won't be pleased. But, don't you worry - the Mac OSX image is still living somewhere in the system. Unfortunately Ubuntu isn't as efficient in power utilisation as the Mac OSX is on the iBook G4: the machine gets hotter much quicker and you can hear the fan whirring at a much more regular interval.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_lSk990LIlbk/SjOEOc5VQxI/AAAAAAAAAM8/adQ9fxrSAfY/s1600-h/P1020768.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_lSk990LIlbk/SjOEOc5VQxI/AAAAAAAAAM8/adQ9fxrSAfY/s400/P1020768.JPG" alt="" id="BLOGGER_PHOTO_ID_5346762566428607250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;So I've got Ubuntu/Xubuntu living in various incarnations now; on an UltraSparc, PowerPC, x86 and AMD64 (ok, I've double counted if you consider 64-bit as a variant of the x86 architecture ;)&lt;br /&gt;&lt;br /&gt;Before I get labelled an Ubuntu zealot, I need to clear the air a little. I've installed Linux because it has plenty of development tools that a software developer needs; and Ubuntu because it's an easy distro for installation. Still I'm no less impressed by the vast amount of hardware Linux supports.&lt;br /&gt;&lt;br /&gt;I certainly think Linux takes the crown for being an ubiquitous OS, in spite of being driven by a purely free software development movement - remember that nobody gets paid to do this, and yet people are generous enough to donate code and effort to make this all happen. The irony in this, is that it is exactly of Linux's free nature that makes supporting so many different hardware possible in the first place.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Related Posts:&lt;/span&gt; &lt;a href="http://www.blogger.com/2009/02/its-alive.html"&gt;It's Alive!&lt;/a&gt; (Linux on UltraSparc)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-1736579185060779139?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=Q6pKXJnchUc:bStxxoyLAVE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=Q6pKXJnchUc:bStxxoyLAVE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=Q6pKXJnchUc:bStxxoyLAVE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=Q6pKXJnchUc:bStxxoyLAVE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=Q6pKXJnchUc:bStxxoyLAVE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=Q6pKXJnchUc:bStxxoyLAVE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=Q6pKXJnchUc:bStxxoyLAVE:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=Q6pKXJnchUc:bStxxoyLAVE:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/Q6pKXJnchUc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/1736579185060779139/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/06/ubuntu-on-ibook-g4.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/1736579185060779139?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/1736579185060779139?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/Q6pKXJnchUc/ubuntu-on-ibook-g4.html" title="Ubuntu on iBook G4" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_lSk990LIlbk/SjOEEmD_yhI/AAAAAAAAAM0/Wiu_aD1tuIg/s72-c/P1020767.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/06/ubuntu-on-ibook-g4.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMGR305eip7ImA9WxJVFUg.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-7797261324317876259</id><published>2009-06-11T07:57:00.000-07:00</published><updated>2009-07-02T09:00:26.322-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-02T09:00:26.322-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Setting up a tarpit on Ubuntu Linux</title><content type="html">It's amazing to see how big botnets can grow up till these days, and they really have plenty of computing power to spare. So what do botnet owners do with these unused free computing power after looting all valuable information from the poor victim? They waste it on scanning on any potential possibilities no matter how minute a chance of finding an opening is.&lt;br /&gt;&lt;br /&gt;In the days when computer resources are scarce, computer bots don't bother port scanning addresses when ping requests doesn't provide a response. But not anymore. They know that there are people out there who are slightly more tech-savvy and do not want to be annoyed - so today's bots have no qualms in trying to scan every single port on a network address, even if ping does not respond.&lt;br /&gt;&lt;br /&gt;Well, my computer security philosophy is simple: scanning the ports on my computer constitutes as aggression - if you engage in such activity, then it means I am free to retaliate in response to it.&lt;br /&gt;&lt;br /&gt;Even so, I do not mean launching an attack on the infected computer; but I'll make your bots waste it's resources by making connections that leads to a dead end. On the flip side, in the process of doing that, this scheme will not waste my own resources by doing it. Typically, an activity like this is termed as 'tarpitting'. So let's see how we can set up a tarpit to fight these bots.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Patching the Kernel&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;In order to perform tarpitting, we need to rely on Linux's firewall, iptables and the 'tarpit' module. But since the 'tarpit' module on iptables isn't supported on default on Debian/Ubuntu anymore, the only way to enable it is to patch the kernel and recompile it. This may sound daunting to a novice user, but there really isn't a need to; all you need is just some basic knowledge and patience to set things up.&lt;br /&gt;&lt;br /&gt;Firstly, a patch to the kernel becomes necessary. It's currently unofficially maintained at http://enterprise.bih.harvard.edu/pub/tarpit-updates/, and marked as being 'unsupported' or 'obsolete' by netfilter team themselves, which essentially means &lt;span style="font-style: italic;"&gt;use at your own risk&lt;/span&gt;! I'm usually a risk-taker (only when it comes to computer software ;) so it's not a big issue. You should work out if this is right for you.&lt;br /&gt;&lt;br /&gt;You'll first need to download the kernel sources, and set up the corresponding environment for recompiling your kernel. A detailed step-by-step procedure is provided in the &lt;a href="https://help.ubuntu.com/community/Kernel/Compile"&gt;Ubuntu Wiki&lt;/a&gt;. I'm just going to skim through the details from the wiki, and show you the commands that is relevant for version Ubuntu Intrepid:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% apt-get install linux-kernel-devel fakeroot build-essential makedumpfile&lt;br /&gt;% apt-get install build-dep linux&lt;br /&gt;% apt-get source linux-source&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now you need to find out what version of the kernel you're running before you can download and apply the corresponding patch. The version is shown as the directory name of the source you've downloaded, eg:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% ls -l /usr/src/&lt;br /&gt;linux-source-&lt;span style="font-weight: bold;"&gt;2.6.27&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;What we are interested is the number indicated in bold. In my case, it's 2.6.27. We need to do a few things here: firstly we want to inherit all the old configuration that came with your currently working kernel, so that the newly compiled kernel will be the same as the original. Then we can download the patch and apply it to the linux source, so that only change is the addition of the tarpit feature:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% cd /usr/src/linux-source-2.6.27&lt;br /&gt;% make oldconfig&lt;br /&gt;% wget http://enterprise.bih.harvard.edu/pub/tarpit-updates/tarpit-2.6.27.patch&lt;br /&gt;% patch -p1 &amp;lt; tarpit-2.6.27.patch&lt;/pre&gt;&lt;br /&gt;The patch should apply cleanly, which means now you have the tarpit feature in the kernel. But that's not enough, you need to make sure tarpit is compiled, as a module generally. To do this run:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% make menuconfig&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And select &lt;code&gt;'M'&lt;/code&gt; from the menu options &lt;code&gt;Networking Support -&gt; Network packet filtering framework (Netfilter) -&gt;Core Netfilter Configuration -&gt; "TARPIT" target support&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Compile Time!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is when you need to sit back, go make yourself a cup of coffee, and be patient. On my 500Mhz Celeron box, it took about 6-8 hours of compilation time on a Saturday morning. Essentially, I just left it compiling while I went out to enjoy a bit of the sunshine - you should too, especially if you are compiling on a slow computer like me.&lt;br /&gt;&lt;br /&gt;There really isn't anything too exciting watching a computer churn out code, kind of like watching grass grow. :)&lt;br /&gt;&lt;br /&gt;Issue the following commands to start the compiling process, and then wait:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;make-kpkg clean # only needed if you want to do a "clean" build&lt;br /&gt;fakeroot make-kpkg --initrd --append-to-version=-tarpit kernel-image kernel-headers&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If Ubuntu complains about not finding make-kpkg, then you may have to install 'kernel-package' (&lt;code&gt;apt-get install kernel-package&lt;/code&gt;). This will start off the compilation. Once you've completed there should be 2 Debian packages resulting from the compilation. All that's left to do is to install them:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% ls *.deb&lt;br /&gt;linux-headers-2.6.27.18-tarpit_2.6.27.18-tarpit-10.00.Custom_i386.deb&lt;br /&gt;linux-image-2.6.27.18-tarpit_2.6.27.18-tarpit-10.00.Custom_i386.deb&lt;br /&gt;&lt;br /&gt;% dpkg -i linux-image-2.6.27.18-tarpit_2.6.27.18-tarpit-10.00.Custom_i386.deb&lt;br /&gt;% dpkg -i linux-headers-2.6.27.18-tarpit_2.6.27.18-tarpit-10.00.Custom_i386.deb&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The installer will make modifications to the boot loader (usually GRUB these days), and adds two new entries into your boot menu. If you haven't made any customised changes to it, usually the installation process will not require any intervention and should complete automatically.&lt;br /&gt;&lt;br /&gt;Reboot your computer and you're set for setting a tarpit up!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Configuring 'iptables' for Tarpitting&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To utilise tarpit, you need to configure the rules on your firewall (iptables) to tarpit on incoming connections. There are plenty of excellent tutorials out there explaining how to use iptables to achieve what you want to do with your firewall, and it's beyond the scope of my entry to cover it all here. I'll just give a few simple examples on how you can use it to waste the resources of bots and spammers.&lt;br /&gt;&lt;br /&gt;To tarpit SMTP connections (assuming that you are not running an SMTP server):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;iptables -A INPUT -p tcp -m tcp --dport 25 -j TARPIT&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To tarpit incoming botnet bruteforce attacks on SSH:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;iptables -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --rsource&lt;br /&gt;iptables -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 2 --rsource -j TARPIT&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The example limits SSH attempts to 2 connections in 60 seconds. And if any connection tries to connect at a rate higher than that, then the connection is sent to the tarpit immediately. My actual configuration is even more stringent than that; given that my SSH connections are verified by keys and not by password, there is never a chance that I could have sent a wrong password and hence tarpitting myself. For an average user who accidentally connects to my server, it isn't really too much of a problem - the connection will eventually time out.&lt;br /&gt;&lt;br /&gt;But lets see what happens when a spambot tries to connect repeatedly. I'll simulate this by using nc to act as a spammer. Let see what happens when I set the rule to just DROP:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# iptables -I INPUT 1 -p tcp -m tcp --dport 25 -j DROP&lt;br /&gt;# nc localhost 25&lt;br /&gt;^C&lt;br /&gt;# nc localhost 25&lt;br /&gt;^C&lt;br /&gt;# nc localhost 25&lt;br /&gt;^C&lt;br /&gt;# nc localhost 25&lt;br /&gt;^C&lt;br /&gt;# nc localhost 25&lt;br /&gt;^C&lt;br /&gt;# netstat -apn&lt;br /&gt;Active Internet connections (servers and established)&lt;br /&gt;Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name&lt;br /&gt;tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      4227/sshd      &lt;span style="font-family:Georgia,serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;DROP just does what it's told; that is to drop the packet, and that's the end of the story. The spambot will just shrug its shoulders and move on to find another spamming target. But see what happens when when we turn tarpitting on:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# iptables -D INPUT 1&lt;br /&gt;# iptables -I INPUT 1 -p tcp -m tcp --dport 25 -j TARPIT&lt;br /&gt;# nc localhost 25&lt;br /&gt;^C&lt;br /&gt;# nc localhost 25&lt;br /&gt;^C&lt;br /&gt;# nc localhost 25&lt;br /&gt;^C&lt;br /&gt;# nc localhost 25&lt;br /&gt;^C&lt;br /&gt;# nc localhost 25&lt;br /&gt;^C&lt;br /&gt;# netstat -apn&lt;br /&gt;Active Internet connections (servers and established)&lt;br /&gt;Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name&lt;br /&gt;tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      4227/sshd   &lt;br /&gt;tcp        0      1 127.0.0.1:36183         127.0.0.1:25            &lt;span style="font-weight: bold;"&gt;FIN_WAIT1&lt;/span&gt;   -           &lt;br /&gt;tcp        0      1 127.0.0.1:36185         127.0.0.1:25            &lt;span style="font-weight: bold;"&gt;FIN_WAIT1&lt;/span&gt;   -           &lt;br /&gt;tcp        0      1 127.0.0.1:36184         127.0.0.1:25            &lt;span style="font-weight: bold;"&gt;FIN_WAIT1&lt;/span&gt;   -           &lt;br /&gt;tcp        0      1 127.0.0.1:36181         127.0.0.1:25            &lt;span style="font-weight: bold;"&gt;FIN_WAIT1&lt;/span&gt;   -           &lt;br /&gt;tcp        0      1 127.0.0.1:36182         127.0.0.1:25            &lt;span style="font-weight: bold;"&gt;FIN_WAIT1&lt;/span&gt;   -           &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As you can see, the connections are stuck in the FIN_WAIT1 state, waiting for socket time outs to occur. So tarpitting works like a reverse syn-flood attack, but in this case the 'damage' is self-inflicted - the more aggressive a spambot is in trying to make a connection to us, the more it gets its resources exhausted. This helps to use up the computing resources of the spam computer, and engaging it in unproductive activities, thus preventing it from spamming more targets.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What if the 90% of the world Tarpits?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately, most spambot code writers have wisen up to these techniques, and correspondingly have adapted their system to make their socket timeouts relatively short, thereby minimising the impact of such a defensive system. However, if most of the computer systems in the world utilises such a system, it will make it prohibitively expensive for spammers to engage in such activities.&lt;br /&gt;&lt;br /&gt;But the reality is, the majority of computer users do not understand the implications of this philosophy for it to work out. In fact, tarpitting will have been a good way of deterring most spam without adding more costs to paying customers like us. Imagine if 90% of all the computers are adversarial like this; then spam bots will have been wasting their resources 90% of the time. That should make the economics of spam a bad proposition to spammers, rather than the reverse situation we are having today - the majority of spam is handled by ISP's filtering, wasting 90% of the Internet's email traffic  on spam, annoying email users, and charging consumers money to take away the problem.&lt;br /&gt;&lt;br /&gt;If you haven't noticed it yet, in essence, we are indirectly paying for the costs these spammers incur. And that pisses me off.&lt;br /&gt;&lt;br /&gt;As a parting note to my post, I hate all spammers with a passion, so let this be a warning to all link-spammers on my blog - as much as I dislike spammers that I'll tarpit their connections, I do not take kindly to your link spam on my blog. Don't even bother do try, they are screened, and if your comments are just superficial irrelevant stuffs, you can bet your ass that it's never going to see the light of the day! And don't ever let me get my hands on your IP address ... :P&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-7797261324317876259?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=Q0s2v_pV60g:yYNm9RWBQUc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=Q0s2v_pV60g:yYNm9RWBQUc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=Q0s2v_pV60g:yYNm9RWBQUc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=Q0s2v_pV60g:yYNm9RWBQUc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=Q0s2v_pV60g:yYNm9RWBQUc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=Q0s2v_pV60g:yYNm9RWBQUc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=Q0s2v_pV60g:yYNm9RWBQUc:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=Q0s2v_pV60g:yYNm9RWBQUc:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/Q0s2v_pV60g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/7797261324317876259/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/06/setting-up-tarpit-on-ubuntu-linux.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/7797261324317876259?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/7797261324317876259?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/Q0s2v_pV60g/setting-up-tarpit-on-ubuntu-linux.html" title="Setting up a tarpit on Ubuntu Linux" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/06/setting-up-tarpit-on-ubuntu-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYDQnszeyp7ImA9WxJXEk4.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-2706494744838229684</id><published>2009-06-03T18:42:00.000-07:00</published><updated>2009-06-05T13:36:13.583-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-05T13:36:13.583-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Examining binary files in Linux</title><content type="html">A few different tips assembled together for one to find out information about an executable binary in Linux.&lt;br /&gt;&lt;br /&gt;To assert that the file is a binary executable (or some other file types):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;file file.bin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To see what the legible strings within the binary file is:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;strings file.bin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To do a hexdump of the file:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;od -tx1 file.bin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To disassemble a compiled binary:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;readelf -b file.bin -m i8086&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To disassemble an binary object file:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;objdump -DaflSx -b file.bin -m i8086&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To list the symbols in an object file:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;nm file.bin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To see what shared library it's being linked with:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ldd file.bin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To see a trace of what libraries it calls / files open dynamically:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;dtrace file.bin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To debug through it's execution:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;gdb file.bin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To unmangle function names if code is compiled with C++:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;echo "&amp;lt;mangled_symbol_name&amp;gt;" | c++filt&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-2706494744838229684?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=T6zFVeoou0g:BSEa-gKph-A:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=T6zFVeoou0g:BSEa-gKph-A:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=T6zFVeoou0g:BSEa-gKph-A:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=T6zFVeoou0g:BSEa-gKph-A:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=T6zFVeoou0g:BSEa-gKph-A:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=T6zFVeoou0g:BSEa-gKph-A:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=T6zFVeoou0g:BSEa-gKph-A:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=T6zFVeoou0g:BSEa-gKph-A:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/T6zFVeoou0g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/2706494744838229684/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/06/examining-binary-files-in-linux.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/2706494744838229684?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/2706494744838229684?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/T6zFVeoou0g/examining-binary-files-in-linux.html" title="Examining binary files in Linux" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/06/examining-binary-files-in-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcHR388fyp7ImA9WxJXEk4.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-4051771998887246176</id><published>2009-06-01T13:21:00.000-07:00</published><updated>2009-06-05T13:33:56.177-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-05T13:33:56.177-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>How to 'make' a Euro / Sterling Key In Linux</title><content type="html">I never had to deal with the problem of handling foreign currency symbols, given that the countries I've lived in the past use the same terminology, where the only difference is the prefixing of their respective country name to the word 'dollar'.&lt;br /&gt;&lt;br /&gt;But living in the Eurozone and for being so near to the UK, the idea of expressing money in dollars is relatively quaint experience to them as much 'a quid' is to me. This difference is visibly noticed when it comes to computer keyboards.&lt;br /&gt;&lt;br /&gt;Keyboards for Europe with the exception of the UK have their default currency symbols mapped to the '€/£' symbol by default - there are key other layout quirks which make these keyboards infuriating to use but I'll leave them for another day.&lt;br /&gt;&lt;br /&gt;Even though I still reflexively swap Euros for Dollars in my daily conversations, at least my 'foreign' accent helps people to contextually frame what I meant, but typing '$' signs when you mean '€' certainly confuses people. My workaround in the past was to type 'Euros' at every instance when I mean currency, which is really becoming tiresome.&lt;br /&gt;&lt;br /&gt;So, the impetus aside, here's a quick tutorial to show you how to generate a Euro sign.&lt;br /&gt;&lt;br /&gt;First, we need to find out the keycodes of the keys that we want to remap. We do this by invoking 'xev', which traps all keystrokes and mouse movements. The keys we want to trap are the currency symbol, which is usually the same key as the numerical key '4' on the alphabetical side of the keyboard, and the right 'alt' key, which I will use as the special shift key to get € and £ without losing the $ symbol. A capture of xev looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% xev&lt;br /&gt;KeyPress event, serial 31, synthetic NO, window 0x2800001,&lt;br /&gt;  root 0x6b, subw 0x0, time 2804155, (256,85), root:(807,409),&lt;br /&gt;  state 0x0, keycode 13 (keysym 0x34, 4), same_screen YES,&lt;br /&gt;  XLookupString gives 1 bytes: (34) "4"&lt;br /&gt;  XmbLookupString gives 1 bytes: (34) "4"&lt;br /&gt;  XFilterEvent returns: False&lt;br /&gt;&lt;br /&gt;KeyRelease event, serial 34, synthetic NO, window 0x2800001,&lt;br /&gt;  root 0x6b, subw 0x0, time 2804251, (256,85), root:(807,409),&lt;br /&gt;  state 0x0, keycode 13 (keysym 0x34, 4), same_screen YES,&lt;br /&gt;  XLookupString gives 1 bytes: (34) "4"&lt;br /&gt;  XFilterEvent returns: False&lt;br /&gt;&lt;br /&gt;KeyPress event, serial 34, synthetic NO, window 0x2800001,&lt;br /&gt;  root 0x6b, subw 0x0, time 2807796, (256,85), root:(807,409),&lt;br /&gt;  state 0x0, keycode 108 (keysym 0xff7e, Alt_R), same_screen YES,&lt;br /&gt;  XLookupString gives 0 bytes:&lt;br /&gt;  XmbLookupString gives 0 bytes:&lt;br /&gt;  XFilterEvent returns: False&lt;br /&gt;&lt;br /&gt;KeyRelease event, serial 34, synthetic NO, window 0x2800001,&lt;br /&gt;  root 0x6b, subw 0x0, time 2807933, (256,85), root:(807,409),&lt;br /&gt;  state 0x2000, keycode 108 (keysym 0xff7e, Alt_R), same_screen YES,&lt;br /&gt;  XLookupString gives 0 bytes:&lt;br /&gt;  XFilterEvent returns: False&lt;br /&gt;&lt;br /&gt;ClientMessage event, serial 34, synthetic YES, window 0x2800001,&lt;br /&gt;  message_type 0x11a (WM_PROTOCOLS), format 32, message 0x118 (WM_DELETE_WINDOW)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There's a number of other events being truncated so that I'm only showing the relevant portions. The first two keypress/keyrelease set shows the keycode for '4' as 13 and the second set shows that my right 'alt' key has the keycode of 108.&lt;br /&gt;&lt;br /&gt;Armed with these numbers, let's create a &lt;code&gt;.xmodmaprc&lt;/code&gt; file in your home directory:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;keycode 108 = Mode_switch&lt;br /&gt;keycode 13 = 4 dollar EuroSign sterling&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Once the file is created, to activate the change immediate, simply issue xmodmap:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% xmodmap ~/.xmodmaprc&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And viola*, by pressing 'right alt' + '4' gives me '€' and 'shift' + 'right alt' + '4' gives me '£'!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style="font-size:85%;"&gt;* Don't even get me started on umlauts and accents ;P&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-4051771998887246176?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=UvXDhT0s16U:kmNfETKqo3I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=UvXDhT0s16U:kmNfETKqo3I:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=UvXDhT0s16U:kmNfETKqo3I:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=UvXDhT0s16U:kmNfETKqo3I:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=UvXDhT0s16U:kmNfETKqo3I:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=UvXDhT0s16U:kmNfETKqo3I:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=UvXDhT0s16U:kmNfETKqo3I:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=UvXDhT0s16U:kmNfETKqo3I:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/UvXDhT0s16U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/4051771998887246176/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/06/how-to-make-euro-sterling-key-in-linux.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/4051771998887246176?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/4051771998887246176?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/UvXDhT0s16U/how-to-make-euro-sterling-key-in-linux.html" title="How to 'make' a Euro / Sterling Key In Linux" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/06/how-to-make-euro-sterling-key-in-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUACSXo8fyp7ImA9WxJXEk4.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-8440811204550962908</id><published>2009-05-29T11:00:00.000-07:00</published><updated>2009-06-05T13:29:28.477-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-05T13:29:28.477-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Huawei E220 Modem on Linux</title><content type="html">Unfortunately for mobile broadband Internet connections, network setups are usually difficult and inconsistent experiences between the different network providers. Getting the modem to work can be a rather frustrating experience if things don't work straight out of the box.&lt;br /&gt;&lt;br /&gt;Before I start, I'll let you know that some of the settings here may be specific only to my provider, O2 Ireland, which you may have to do your own specific tweaks, and as the saying goes, "your mileage may vary".&lt;br /&gt;&lt;br /&gt;On the good side, the Huawei E220 modem seems to be a rather popular and well supported device, and it did on one instance worked straight out of the box on one of my friend's computer running Ubuntu 9.04 with Network Manager. It doesn't seem to work on 8.10, not on my machine (Ubuntu) or my laptop (Xubuntu), which may just boil down to configuration issues, or not. On the funny side, when I tried to get the settings off my friend's computer by right-clicking on it, it simply froze the machine entirely. (Windows users, insert your jibes here ;p)&lt;br /&gt;&lt;br /&gt;This problem is probably specific to O2, since I had a Vodafone modem dongle that I had borrowed before, which worked flawlessly on when plugged into my laptop, which I had assumed will be the case when I got O2, but it turned out not to be so.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Update:&lt;/span&gt; Found the reason why &lt;a href="https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/290177"&gt;Network Manager will work in 9.04 but not 8.10&lt;/a&gt;, the newer release had included Modem Manager which had specific setup that will request for a PIN which the O2 card was set up in default. By comparison, the Vodafone dongle did not require a PIN, hence network manager worked without a hitch.&lt;br /&gt;&lt;br /&gt;Anyhow, maybe these information I've gleaned from will help you find out what you need to get things to work.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What the lights on the modem really means.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ignore what the documentation says (partially) that came with the subscription. From my personal observation, if the light is green and flashing, it means that the modem is active, just that it's not authenticated to the provider. That should be a sign that your modem is working.&lt;br /&gt;&lt;br /&gt;The modem is also capable of flashing in blue colour (which is nowhere explained in the booklet). This means that your connection is authenticated with the provider, but currently is not having ppp connection established.&lt;br /&gt;&lt;br /&gt;If the lights are in solid green, blue, or light blue, it means that your connection is active, and in various different operating speeds (GPRS, 3G, HSDPA respectively) as explained in the booklet. From my observations, it seems like the connection typically reside in the 3G mode (dark blue colour) when it's passive, and only switches to HSDPA mode whenever you start sending or receiving data from the network.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Modem doesn't work with Network Manager&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;A number of sources suggests that the E220 modem works straight with Linux via Network Manager, but it certainly didn't work for me straight off. So I had do some reading on the wireless broadband forums to try to find answers. Most of them are geared towards solving problems for Vodafone, and the information is really spotty when it comes to O2. Given that I had no idea where to look to find out what's actually happening inside Network Manager, I had to try some other alternatives.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Update: &lt;/span&gt;I didn't know where to look before, but I've since found that Network Manager logs to /var/log/daemon.log - still the messages are not too helpful to actually tell you what exactly is the problem.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The saviour - wvdial&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;'wvdial' is the alternative application that got the connection to work after a bit of reading. The documentation on wvdial can be confusing, and even as I've gotten it to work, I still don't fully understand the relationship between wvdial and pppd. Here's the excerpted config I had in '/etc/wvdial.conf', it's a little half-baked, and sometimes still fails:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;[Dialer O2]&lt;br /&gt;ISDN = 0&lt;br /&gt;Baud = 460800&lt;br /&gt;Modem = /dev/ttyUSB0&lt;br /&gt;Phone = *99#&lt;br /&gt;Modem Type = Analog Modem&lt;br /&gt;Stupid Mode = 1&lt;br /&gt;Username = gprs&lt;br /&gt;Password = gprs&lt;br /&gt;Init1 = ATZ&lt;br /&gt;Init2 = ATQ0 V1 E1 S0=0 &amp;amp;C1 &amp;amp;D2&lt;br /&gt;Init3 = AT+CPIN="1234"&lt;br /&gt;Init5 = AT+CGDCONT=1,"IP","open.internet"&lt;br /&gt;&lt;br /&gt;[Dialer O22]&lt;br /&gt;ISDN = 0&lt;br /&gt;Baud = 460800&lt;br /&gt;Modem = /dev/ttyUSB0&lt;br /&gt;Phone = *99#&lt;br /&gt;Modem Type = Analog Modem&lt;br /&gt;Stupid Mode = 1&lt;br /&gt;Username = gprs&lt;br /&gt;Password = gprs&lt;br /&gt;Init1 = ATZ&lt;br /&gt;Init2 = ATQ0 V1 E1 S0=0 &amp;amp;C1 &amp;amp;D2&lt;br /&gt;#Init3 = AT+CPIN="1234"&lt;br /&gt;Init5 = AT+CGDCONT=1,"IP","open.internet"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Do replace '1234' with the actual PIN number that you have.&lt;br /&gt;&lt;br /&gt;You can see that I have 2 entries for the connection, which the only difference between the two is that the second entry doesn't have a PIN authentication command. This is the intentional, because wvdial does not know whether the modem is in authenticated mode or not (ie, whether if it's flashing blue or flashing green. The ATZ command does not seem to reset this authenticated state.)&lt;br /&gt;&lt;br /&gt;If you started your computer fresh and your modem is showing a flashing green light, invoke wvdial this way:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% wvdial O2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That should work if you started your modem cold. Sometimes the first connection gets dropped for no reason, and to try to reestablish the connection, run wvdial with the O22 connection instead. If you succeed, you should see an output like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;--&gt; WvDial: Internet dialer version 1.60&lt;br /&gt;--&gt; Cannot get information for serial port.&lt;br /&gt;--&gt; Initializing modem.&lt;br /&gt;--&gt; Sending: ATZ&lt;br /&gt;ATZ&lt;br /&gt;OK&lt;br /&gt;--&gt; Sending: ATQ0 V1 E1 S0=0 &amp;amp;C1 &amp;amp;D2&lt;br /&gt;ATQ0 V1 E1 S0=0 &amp;amp;C1 &amp;amp;D2&lt;br /&gt;OK&lt;br /&gt;--&gt; Sending: AT+CGDCONT=1,"IP","open.internet"&lt;br /&gt;AT+CGDCONT=1,"IP","open.internet"&lt;br /&gt;OK&lt;br /&gt;--&gt; Modem initialized.&lt;br /&gt;--&gt; Sending: ATDT*99#&lt;br /&gt;--&gt; Waiting for carrier.&lt;br /&gt;ATDT*99#&lt;br /&gt;CONNECT&lt;br /&gt;--&gt; Carrier detected.  Starting PPP immediately.&lt;br /&gt;--&gt; Starting pppd at Sat May 30 08:20:44 2009&lt;br /&gt;--&gt; Pid of pppd: 7312&lt;br /&gt;--&gt; Using interface ppp0&lt;br /&gt;--&gt; pppd: H�c X�c ��c&lt;br /&gt;--&gt; pppd: H�c X�c ��c&lt;br /&gt;--&gt; pppd: H�c X�c ��c&lt;br /&gt;--&gt; pppd: H�c X�c ��c&lt;br /&gt;--&gt; pppd: H�c X�c ��c&lt;br /&gt;--&gt; pppd: H�c X�c ��c&lt;br /&gt;--&gt; local  IP address 89.204.199.133&lt;br /&gt;--&gt; pppd: H�c X�c ��c&lt;br /&gt;--&gt; remote IP address 10.64.64.64&lt;br /&gt;--&gt; pppd: H�c X�c ��c&lt;br /&gt;--&gt; primary   DNS address 62.40.32.33&lt;br /&gt;--&gt; pppd: H�c X�c ��c&lt;br /&gt;--&gt; secondary DNS address 62.40.32.34&lt;br /&gt;--&gt; pppd: H�c X�c ��c&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Trying Network Manager Again&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you have established a connection successfully before, but got dropped for some reason, the light on your modem should be flashing blue.  In this case your modem is in the authenticated state, and Network Manager will start working happily if you wanted to use it now.&lt;br /&gt;&lt;br /&gt;As I said, Network Manager did work with one of my friend's computer - the difference being that when I tried connecting, his version of Network Manager prompted me to key in my PIN, while my didn't. Even manually setting the PIN in the configuration won't make it work.&lt;br /&gt;&lt;br /&gt;But at least it'll work indirectly, and tells us that the problem lies within authentication.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Fun things to do with the modem&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;- AT Commands&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Through using wvdial, I realised that the usb modem actually uses a variant of the AT commands of the phone modems I used to have for dialups and BBSes. It kind of piqued my interest a bit, and good for reliving the good old days of fiddling around with AT commands on my modem.&lt;br /&gt;&lt;br /&gt;To do so, we'll need to find the interface in which you can send and receive commands to - 'dmesg' will be helpful for these occasions:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;[   21.839161] usb-storage: device found at 2&lt;br /&gt;[   21.839163] usb-storage: waiting for device to settle before scanning&lt;br /&gt;[   21.849151] usbserial: USB Serial support registered for GSM modem (1-port)&lt;br /&gt;[   21.849175] option 4-1:1.0: GSM modem (1-port) converter detected&lt;br /&gt;[   21.849429] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0&lt;br /&gt;[   21.849441] option 4-1:1.1: GSM modem (1-port) converter detected&lt;br /&gt;[   21.849519] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1&lt;br /&gt;[   21.849535] usbcore: registered new interface driver option&lt;br /&gt;[   21.849538] option: USB Driver for GSM modems: v0.7.2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, /dev/ttyUSB0 is the interface in which Network Manager/wvdial uses to connect to the mobile phone provider, which kind of perplexed me why there is an additional /dev/ttyUSB1 interface. One of the things that came up from googling was an out-of-date &lt;a href="http://oozie.fm.interia.pl/pro/huawei-e220/"&gt;kernel support page&lt;/a&gt; for the modem.&lt;br /&gt;&lt;br /&gt;It provided a tool to read the signal strength of the modem, which out of curiosity, I downloaded the source code and waded through it. That's when I realised that /dev/ttyUSB1 is the interface in which you can issue AT commands to.&lt;br /&gt;&lt;br /&gt;Armed with that knowledge, we can now start issuing commands straight into the device! Relying on a primitive method, do this by starting two terminal windows side by side. On one window, do:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ cat /dev/ttyUSB1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This shows you what's the output coming out from the commands issued. On the other window it is where you issue your commands. For example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ echo "AT" &gt; /dev/ttyUSB1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You should see "OK" coming out from the other window, showing that the modem has acknowledge your 'attention' command. Pretty cool eh?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Fun Things To Do #1: Disabling PIN Authentication&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Remember the problem with PIN authentication that prevented Network Manager from working properly? Well you can side-step the problem by disabling the PIN authentication feature on the SIM card:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;echo 'AT+CLCK="SC",0,"1234"' &gt; /dev/ttyUSB1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;Replace '1234' with the actual PIN number that you have. This should disable the need for authentication. &lt;span style="font-weight: bold;"&gt;A word of caution&lt;/span&gt;: do this only if you're not too concerned about the physical security of your modem, otherwise if it gets lost or stolen, others can start using your Internet connection for free!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Fun Things To Do #2: Get SMS Messages&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For linux users, we aren't provided with any GUI for us to access and send SMS messages from the SIM card. Unfortunately the O2 site registration assumes that we are all Windoze users, which is the only way in which we can pull out the authentication SMS message that it sends to the mobile phone.&lt;br /&gt;&lt;br /&gt;Well fret no more, here's how we can gain access to SMS messages simply by using AT commands:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ echo 'AT+CMGF=1' &gt; /dev/ttyUSB1&lt;br /&gt;$ echo 'AT+CMGL="ALL"' &gt; /dev/ttyUSB1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This should turn on SMS mode on the modem and dump out all the received SMSes. And from the output messages, you can pick out the authentication message that looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;+CMGL: 0,"REC READ","02",,"25/05/27,20:33:07+04"&lt;br /&gt;&lt;br /&gt;Welcome to O2 Broadband! Should you have any queries, visit www.o2.ie/broadbandfaq or our interactive forum on http://forums.o2online.ie. Best wishes, O2.&lt;br /&gt;&lt;br /&gt;+CMGL: 1,"REC READ","0000000000",,"26/05/28,21:04:54+04"&lt;br /&gt;&lt;br /&gt;Your verification code is XXXXXXXX. Please go to o2.ie and continue your registration.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is at least useful if you don't want the hassle of manually pulling out the SIM card to put in into your phone to get the SMS message for authentication.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;More References&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The Wikipedia page on the &lt;a href="http://en.wikipedia.org/wiki/Hayes_command_set"&gt;Hayes modem command set&lt;/a&gt; has a set of good starter commands on AT commands. Or to read up more on SMS AT &lt;a href="http://www.developershome.com/sms/howToSendSMSFromPC.asp"&gt;write commands&lt;/a&gt; or &lt;a href="http://www.developershome.com/sms/howToReceiveSMSUsingPC.asp"&gt;read commands&lt;/a&gt; can be found in these links.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-8440811204550962908?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=ywetwOAJWj0:Zo-Z4T8UUUE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=ywetwOAJWj0:Zo-Z4T8UUUE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=ywetwOAJWj0:Zo-Z4T8UUUE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=ywetwOAJWj0:Zo-Z4T8UUUE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=ywetwOAJWj0:Zo-Z4T8UUUE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=ywetwOAJWj0:Zo-Z4T8UUUE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=ywetwOAJWj0:Zo-Z4T8UUUE:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=ywetwOAJWj0:Zo-Z4T8UUUE:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/ywetwOAJWj0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/8440811204550962908/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/05/huawei-e220-modem-on-linux.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/8440811204550962908?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/8440811204550962908?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/ywetwOAJWj0/huawei-e220-modem-on-linux.html" title="Huawei E220 Modem on Linux" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/05/huawei-e220-modem-on-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAGQH49fip7ImA9WxJQFUk.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-2432750822706989213</id><published>2009-05-28T14:30:00.000-07:00</published><updated>2009-05-28T14:55:21.066-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-28T14:55:21.066-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Personal Life" /><title>Internet, Finally!</title><content type="html">I finally have Internet at home!&lt;br /&gt;&lt;br /&gt;After 3 long months of going cold turkey involuntarily. I have finally gotten an Internet connection to my home, via mobile broadband. It's clocking about 300kbps download at best, which isn't great, but at least I can use it to type whimsical blog posts like these in the leisure of my home, rather than having to deal with late nights in the office. With commuting time after hours being unreliable and subjected to long half hour waits, it seriously isn't worth wasting the time just to be able to use the Internet, really.&lt;br /&gt;&lt;br /&gt;Surprisingly, the new place that I've moved in does not have a fibre-to-the-curb connection to my apartment - and it's only built 2 years ago! Not only that, the apartment does not even come with a phone line, which means I can't even get ASDL. I can get a technician to get it especially wired to my place, but that means installation charges + line rental for a phone that I do not want in order to get Internet access, making it a rather expensive proposition.&lt;br /&gt;&lt;br /&gt;So the only alternative left was to rely on cheap wireless broadband, which at 20 Euros is the cheapest by Irish standards (That's excluding VAT, which is another major bloodsucker in this country :P). That's roughly about $40 dollars AUD/SGD, which I suppose would have gotten me a decent network connection, and without any download restrictions (on a land line)?&lt;br /&gt;&lt;br /&gt;Oh well, at least for an el-cheapo bastard like me, it should suffice, since I don't do much that consumes a large amount of bandwidth anyway. 10Gb is quite hard to use up no matter how much blog posts, email or news I do in a day, but obviously it's never quite enough for the YouTube generation.&lt;br /&gt;&lt;br /&gt;Which is fine for an 'old fogey' like me - I belong to the &lt;a href="http://www.google.ie/search?q=640k+ought+to+be+enough+for+anybody"&gt;'640k ought to be enough for anybody&lt;/a&gt;' generation anyway, ;)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-2432750822706989213?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=85IdBnlEbYE:hWFYfPGkeyg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=85IdBnlEbYE:hWFYfPGkeyg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=85IdBnlEbYE:hWFYfPGkeyg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=85IdBnlEbYE:hWFYfPGkeyg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=85IdBnlEbYE:hWFYfPGkeyg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=85IdBnlEbYE:hWFYfPGkeyg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=85IdBnlEbYE:hWFYfPGkeyg:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=85IdBnlEbYE:hWFYfPGkeyg:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/85IdBnlEbYE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/2432750822706989213/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/05/internet-finally.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/2432750822706989213?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/2432750822706989213?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/85IdBnlEbYE/internet-finally.html" title="Internet, Finally!" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/05/internet-finally.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkECSXc7fCp7ImA9WxJTEEQ.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-6923016973416114730</id><published>2009-04-18T11:58:00.000-07:00</published><updated>2009-04-18T14:37:48.904-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-18T14:37:48.904-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Personal Life" /><title>A Good Friday It Is!</title><content type="html">Decided that I wanted a reckless, unplanned holiday over the Easter weekend, so I packed my bag with only a toothbrush, a set of clothes, and took off on my bicycle.&lt;br /&gt;&lt;br /&gt;Given that I had a 4-day weekend, I had this 'delusion of grandeur' that I'll try to cycle to Waterford and back, which when I recounted my little adventure to my friends later, they all had thought that I was a little 'ambitious'. I'm sure they were  just be polite with me not to point out that I was deranged to try to cycle 320km to and back. :)&lt;br /&gt;&lt;br /&gt;Without even a map or any plans on how I'm supposed to get there, I cycled aimlessly south, passing through Shankill, Bray then Greystones. I had never been in those places before, and each of them were a lovely little towns of their own, with Bray the biggest, Shankill the smallest, and Greystones just nice. In a way this Goldilocks (yours truly) is certainly tempting fate without even planning for where he's going - it is really not funny trying to tough it out on the streets; there's still plenty of cold in mid-April to try to sleep on the streets when you're in Ireland!&lt;br /&gt;&lt;br /&gt;Stopped in each town for a while, and had plenty of soft-serve vanilla ice-cream cones along the way, which was when I noticed this Irish anomaly on their menus called the 'Special 99'. Even after later when I try to figure out they story behind the name by asking my Irish colleagues, nobody seems to know why having a stick of chocolate in the  ice-cream makes it a 'Special 99'. Very well then, I'm just going to have to make up my own story, and bluff anybody who asks that an Irishman invented this in '99, which took the whole country by storm which is how the name came about. So take note that you've heard it here first!&lt;br /&gt;&lt;br /&gt;Along the way, I met a couple of French backpackers whom I started chatting up with. They were asking for directions and I found out that they are travelling to Glendalough (pronounced 'Glen-da-lock'), where the main attraction there is some old ruins. They were lost, but they had a plan where I had none, so I thought I could give them a hand by trying to look up the place they are going on my Blackberry-cum-GPS, which only gave me a rough idea of where we were, and had no relevance to any of the landmarks that they have shown me on their map. ( &lt;span style="font-weight: bold;"&gt;A mental note to self:&lt;/span&gt; don't ever rely on the Blackberry's GPS to find your way out of the woods if your life depended on it! )&lt;br /&gt;&lt;br /&gt;Anyhow, given that I didn't have a plan, and they were quite adamant to go there, I thought they must be on to something, so I decided to abandon my original plan to  Waterford via zipping along the coastal fringe, and follow them inland instead.&lt;br /&gt;&lt;br /&gt;With hindsight, this had probably turned out to be a pretty good choice.&lt;br /&gt;&lt;br /&gt;Given that they were travelling by foot, and didn't have too much luck with hitch-hiking, we decided to camp out in someone's paddock:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/SeojCNuuhRI/AAAAAAAAAJE/Y31uVLd97z8/s1600-h/P1020342.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/SeojCNuuhRI/AAAAAAAAAJE/Y31uVLd97z8/s400/P1020342.JPG" alt="" id="BLOGGER_PHOTO_ID_5326108030271390994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Obviously it was a little illegal, given that we're trespassing, but certainly the tripedation made it a little bit more exciting. Claire set up the tent while Alexandre and I started to look around for some wood to start a little campfire of our own. (When I recounted the story to an older guy later, he was curious where I got my firewood from - unbeknown my insanely dumb luck in retrospect, he was surprised that we managed to get some wood for burning; someone had left some strewn around when cutting down some overgrowth.)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/SeojIXYd-bI/AAAAAAAAAJM/f66VDHM_PM4/s1600-h/P1020346.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/SeojIXYd-bI/AAAAAAAAAJM/f66VDHM_PM4/s400/P1020346.JPG" alt="" id="BLOGGER_PHOTO_ID_5326108135941601714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Spent the evening camping out with them, to which later they mentioned the fact that I had no place to stay. They had only a two-men tent, and didn't have any room for me, so I had go try my luck when they pointed out that there is a "Bed and Breakfast" somewhere adjacent to the street across the paddock. It just might be as well, to leave them some privacy to have some romantic personal time under the nice Irish moonlight. I think they did enjoy their camp there, but they did try their darn best not to make me feel left out by admitting to me about how cold the night was before, and that I must have had a better time living under a properly heated shelter.&lt;br /&gt;&lt;br /&gt;To me, living in a 'Bed &amp;amp; Breakfast' was a rather interesting experience . I had never lived in one before this, and certainly had no knowledge of the existence of such a concept. I had this mistaken idea that it was just another style of commercial hotelier gimmicks where they charge you extra by tagging breakfast to your bill compulsorily. Armed with this half-baked idea in my head, I was kind of worried when I made my approach to the residential property the BnB was signposted, and getting rather concerned that I won't be having a place to stay for the night.&lt;br /&gt;&lt;br /&gt;While the place did turn out to be a BnB, my lack of knowledge became even more of a comedy later when I was seated with the hostess in the living room for a rest when I remarked about how much the place resembled a family home, to which she responded in confusion, "but, aren't you looking for a Bed and Breakfast?" She would have gotten into bed that night confused, not only until the next morning would she have found out that I had absolutely no idea what I was in for when confessed that I thought I was going to be living in some funny-styled, breakfast-included hotel.&lt;br /&gt;&lt;br /&gt;The next Saturday morning past Good Friday turned out to be another glorious day, with the sun streaking above the country fields. I joined the couple once they got packed up and started on our way again:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/SeojQsnMhHI/AAAAAAAAAJU/Q4c6OwdV8lY/s1600-h/P1020347.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/SeojQsnMhHI/AAAAAAAAAJU/Q4c6OwdV8lY/s400/P1020347.JPG" alt="" id="BLOGGER_PHOTO_ID_5326108279079470194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Even when one is outside a city, nobody can really escape into what is truly countryside anymore, as a helicopter hovered nearby in mid-air:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/SeokI9JPxLI/AAAAAAAAAJ8/Co25q1WcGhY/s1600-h/P1020357.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/SeokI9JPxLI/AAAAAAAAAJ8/Co25q1WcGhY/s400/P1020357.JPG" alt="" id="BLOGGER_PHOTO_ID_5326109245589931186" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Glendalough was still a while away, and the French couple hitched their way there, while I was left to cycle in the vast country road in the early morning. It was an absolute bliss, all nice and serene, which is only irregularly punctured by a car whizzing through once in a while. And then I got to my intended destination:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_lSk990LIlbk/SeolBaVw-UI/AAAAAAAAAKU/JT1q1KcyboY/s1600-h/P1020367.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 300px; height: 400px;" src="http://2.bp.blogspot.com/_lSk990LIlbk/SeolBaVw-UI/AAAAAAAAAKU/JT1q1KcyboY/s400/P1020367.JPG" alt="" id="BLOGGER_PHOTO_ID_5326110215499741506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Glendalough is like a nice national park, certainly reminded me of Yosemite, just a lot less crowded and commercial. If I had my way, I can certainly spend the remainder of my life here - if not only for this damn thing in life called 'work'!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_lSk990LIlbk/SeokQqOvmZI/AAAAAAAAAKE/aoG9aU8N-K4/s1600-h/P1020364.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_lSk990LIlbk/SeokQqOvmZI/AAAAAAAAAKE/aoG9aU8N-K4/s400/P1020364.JPG" alt="" id="BLOGGER_PHOTO_ID_5326109377951668626" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Along the way, I got to know a few more friends - this is Fabio from Italy. I bumped into him along the way cycling. He and his mate happens to be heading towards the same direction as me, so I became the new party in their convoy. It's always fun to meet people from different cultures, you get to learn how very much people are different from you first hand. One of the early things I've come to learn ab0ut the Italians are they're rather fond of appending 'no' after their phrases, when they are actually wanting to mean 'yes' - talk about confusion!&lt;br /&gt;&lt;br /&gt;It was my good fortune to bump into them, as they had been instrumental in my return journey. I had no map, and had a lame-GPS that was running out of battery. Since they knew their way, and happen to be cycling their way back to Dublin, I decided to not push my luck any further, and tag along their return journey home.&lt;br /&gt;&lt;br /&gt;Along the way back, there's more of the lovely Irish countryside:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/Seojem4olmI/AAAAAAAAAJk/MbqFJ5kTqgQ/s1600-h/P1020352.JPG"&gt;&lt;img style="margin: 5px; cursor: pointer; width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/Seojem4olmI/AAAAAAAAAJk/MbqFJ5kTqgQ/s400/P1020352.JPG" alt="" id="BLOGGER_PHOTO_ID_5326108518060168802" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/Seoj8r440jI/AAAAAAAAAJ0/9ssHfWSt39o/s1600-h/P1020354.JPG"&gt;&lt;img style="margin: 5px; cursor: pointer; width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/Seoj8r440jI/AAAAAAAAAJ0/9ssHfWSt39o/s400/P1020354.JPG" alt="" id="BLOGGER_PHOTO_ID_5326109034799485490" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/SeojnHTCcuI/AAAAAAAAAJs/LDpdkxxvsvA/s1600-h/P1020353.JPG"&gt;&lt;img style="margin: 5px; cursor: pointer; width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/SeojnHTCcuI/AAAAAAAAAJs/LDpdkxxvsvA/s400/P1020353.JPG" alt="" id="BLOGGER_PHOTO_ID_5326108664199803618" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_lSk990LIlbk/SeojWmxyLUI/AAAAAAAAAJc/z1E_xLZp7xg/s1600-h/P1020351.JPG"&gt;&lt;img style="margin: 5px; cursor: pointer; width: 200px; height: 150px;" src="http://1.bp.blogspot.com/_lSk990LIlbk/SeojWmxyLUI/AAAAAAAAAJc/z1E_xLZp7xg/s400/P1020351.JPG" alt="" id="BLOGGER_PHOTO_ID_5326108380592483650" border="0" /&gt;&lt;/a&gt;&lt;/center&gt;&lt;br /&gt;Sheep! The damn cutest thing in the whole wide world! Baaaaa!&lt;br /&gt;&lt;br /&gt;In the Chinese Almanac, I'm born in the year of the Sheep/Goat/Lamb (what's the difference?), maybe that explains why I have this weird sense of affection towards these cuddly little creatures. :)&lt;br /&gt;&lt;br /&gt;For an absolutely unplanned weekend, I must say the outcome has certainly been wildly positive. I can't believe my incredible luck I had for the couple of days - had a few firsts, made a few friends, and enjoyed an incredibly lovely weather for a country more renowned for cloudy, rainy weather - I must have had a 4-leafed clover stuck in the underside of my pants somewhere! So then, all that's left for me to do in this country is to catch some Leprechauns and find the pot of gold at the end of the rainbow! (Apologies to my Irish friends for such corny jokes ;p)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-6923016973416114730?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=tRRc9WnD2r0:160Wipsw5ls:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=tRRc9WnD2r0:160Wipsw5ls:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=tRRc9WnD2r0:160Wipsw5ls:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=tRRc9WnD2r0:160Wipsw5ls:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=tRRc9WnD2r0:160Wipsw5ls:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=tRRc9WnD2r0:160Wipsw5ls:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=tRRc9WnD2r0:160Wipsw5ls:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=tRRc9WnD2r0:160Wipsw5ls:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/tRRc9WnD2r0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/6923016973416114730/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/04/good-friday-it-is.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/6923016973416114730?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/6923016973416114730?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/tRRc9WnD2r0/good-friday-it-is.html" title="A Good Friday It Is!" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_lSk990LIlbk/SeojCNuuhRI/AAAAAAAAAJE/Y31uVLd97z8/s72-c/P1020342.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/04/good-friday-it-is.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAGQnk9fCp7ImA9WxVbEEg.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-895996715736811544</id><published>2009-03-26T02:10:00.000-07:00</published><updated>2009-03-26T02:12:03.764-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-26T02:12:03.764-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Personal Life" /><category scheme="http://www.blogger.com/atom/ns#" term="Philosophy" /><title>Happiness is ...</title><content type="html">Happiness is a warm steaming bowl of instant noodles&lt;br /&gt; when you are feeling cold and hungry.&lt;br /&gt;&lt;br /&gt;Happiness is a warm fuzzy feeling of a full tummy&lt;br /&gt; after a piping hot bowl of instant noodles.&lt;br /&gt;&lt;br /&gt;Sometimes happiness isn't too hard to attain after all :)&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-895996715736811544?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=jd84UbbCI1Y:0UrHjrIynBM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=jd84UbbCI1Y:0UrHjrIynBM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=jd84UbbCI1Y:0UrHjrIynBM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=jd84UbbCI1Y:0UrHjrIynBM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=jd84UbbCI1Y:0UrHjrIynBM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=jd84UbbCI1Y:0UrHjrIynBM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=jd84UbbCI1Y:0UrHjrIynBM:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=jd84UbbCI1Y:0UrHjrIynBM:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/jd84UbbCI1Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/895996715736811544/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/03/happiness-is.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/895996715736811544?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/895996715736811544?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/jd84UbbCI1Y/happiness-is.html" title="Happiness is ..." /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/03/happiness-is.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8CQH87cSp7ImA9WxVXFU8.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-3169496599334920715</id><published>2009-02-13T04:41:00.000-08:00</published><updated>2009-02-13T04:41:01.109-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-13T04:41:01.109-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Reanabling FCKEditor for MoinMoin Wiki</title><content type="html">&lt;span style="font-weight: bold;"&gt;The Costs of Free Software&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;FCKEditor, the rich text editor feature in MoinMoin wiki has been removed from the Debian/Ubuntu distributions from a decision the maintainer(s) made after notification of a security issue of enabling it. Obviously I wasn't the only person who &lt;a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=507081"&gt;got annoyed&lt;/a&gt; by its removal, given that the rich text editing feature has been the first place why many, like I, have used the wiki altogether.&lt;br /&gt;&lt;br /&gt;So even the 'free' as in 'freedom' in software turns out to be not so free anyway - given that I had no freedom in weighing my own pros and the cons of dealing with the potential security problem. For me, the answer is clear as day - the wiki is only used in a secured local area network and has no editing rights, not even reading rights to anybody outside the intranet - so why should anybody dictate that I can't use FCKEditor with MoinMoin?&lt;br /&gt;&lt;br /&gt;(No) thanks to them, this post wouldn't have existed if not for the shortsightedness in destroying the appeal of what otherwise would be an attractive software package. For all that FOSS is worth, it's main Achilles heel is certainly the lack of attention to the needs of end customers. That's why FOSS companies have to make their money out of service - because there is none!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How to Reanable FCKEditor for Debian/Ubuntu's MoinMoin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The workaround to using Debian/Ubuntu's version of MoinMoin is downloading the current version from the website and install it. Converting it to use your existing settings should be a relatively painless task.&lt;br /&gt;&lt;a href="http://moinmo.in/MoinMoinDownload"&gt;&lt;br /&gt;Download the package&lt;/a&gt; and install a local version of MoinMoin. Follow the same instructions as given on how to install as given in &lt;a href="http://moinmo.in/HelpOnInstalling/BasicInstallation"&gt;BasicInstallation&lt;/a&gt; section. I'll assume that you've installed it in &lt;code&gt;/usr/local/&lt;/code&gt; as was given in the example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% python setup.py install --prefix='/usr/local' --record=install.log&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Using &lt;code&gt;/usr/local&lt;/code&gt; will separate the Debian/Ubuntu copy from your self installed copy.&lt;br /&gt;&lt;br /&gt;You can then proceed on to installing MoinMoin using the &lt;a href="https://help.ubuntu.com/7.04/server/C/moinmoin.html"&gt;same instructions from Ubuntu 7.04&lt;/a&gt; - the instructions are still valid, but the thing that you have to watch out is to remember to replace all references of &lt;code&gt;/usr/share/&lt;/code&gt; with &lt;code&gt;/usr/local/share&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;In addition, you will have to modify the &lt;code&gt;moin.cgi&lt;/code&gt; file. In downloaded version, it does not point to the &lt;code&gt;/etc/moin&lt;/code&gt; configuration path. In order to reuse your old configuration, add the following line in red into your &lt;code&gt;moin.cgi&lt;/code&gt; file:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#sys.path.insert(0, '/path/to/wikiconfigdir')&lt;br /&gt;#sys.path.insert(0, '/path/to/farmconfigdir')&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;sys.path.insert(0, '/etc/moin')&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will make the wiki start reading from the &lt;code&gt;/etc/moin&lt;/code&gt; directory like your Debian/Ubuntu package does.&lt;br /&gt;&lt;br /&gt;Debian/Ubuntu has made further changes in the configuration to ensure you don't use the GUI editor, so you have to revert them back by adding or modifying the two lines your &lt;code&gt;/etc/moin/mywiki.py&lt;/code&gt; file:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;strike&gt;# The GUI WYSISYG editor is not installed with Debian.&lt;br /&gt;# See /usr/share/doc/$(cdbs_curpkg)/README.Debian for more info&lt;br /&gt;editor_force = True&lt;br /&gt;editor_default = 'text'  # internal default, just for completeness&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;editor_force=False&lt;br /&gt;editor_default='gui'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Once the changes are made, restart apache, and FCKEditor should be reenabled again.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-3169496599334920715?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=9FoVrD3SwEU:jmElMBuSv0o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=9FoVrD3SwEU:jmElMBuSv0o:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=9FoVrD3SwEU:jmElMBuSv0o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=9FoVrD3SwEU:jmElMBuSv0o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=9FoVrD3SwEU:jmElMBuSv0o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=9FoVrD3SwEU:jmElMBuSv0o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=9FoVrD3SwEU:jmElMBuSv0o:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=9FoVrD3SwEU:jmElMBuSv0o:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/9FoVrD3SwEU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/3169496599334920715/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/02/reanabling-fckeditor-for-moinmoin-wiki.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/3169496599334920715?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/3169496599334920715?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/9FoVrD3SwEU/reanabling-fckeditor-for-moinmoin-wiki.html" title="Reanabling FCKEditor for MoinMoin Wiki" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/02/reanabling-fckeditor-for-moinmoin-wiki.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUHSHo6eCp7ImA9WxJTEEs.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-8818551046563191299</id><published>2009-02-11T06:55:00.000-08:00</published><updated>2009-04-18T08:23:59.410-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-18T08:23:59.410-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Setting Dual-Head Displays with Radeon HD 3650 in Ubuntu Linux</title><content type="html">I'm using a Sapphire's ATI Radeon HD 3650 card, which may help you if you are using the same thing and want to set up a dual-head display properly.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_lSk990LIlbk/SZFUFAzuKlI/AAAAAAAAAIo/5d5SRc7WtvI/s1600-h/P1020229.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_lSk990LIlbk/SZFUFAzuKlI/AAAAAAAAAIo/5d5SRc7WtvI/s400/P1020229.JPG" alt="" id="BLOGGER_PHOTO_ID_5301110681484798546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;From my experiences, I found that Ubuntu versions 7.10, 8.04 and 8.10 will get the card to work straight out of the box, but I had no luck to get it to work for dual displays perfectly except for version 8.10 (You'll still need some modifications to xorg though, see below).&lt;br /&gt;&lt;br /&gt;For the two older version 7.10 and 8.04, the closest thing that I have come to making it work on the older versions is by downloading and installing ATI's driver straight from their &lt;a href="http://ati.amd.com/support/drivers/linux/linux-radeon.html"&gt;support site&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;With the older versions, both the &lt;code&gt;xserver-xorg-fglrx&lt;/code&gt; (did not work - black screen) and the &lt;code&gt;xserver-xorg-fglrx-envy&lt;/code&gt; (defers to the Mesa driver, making it horridly slow) packages weren't the most fruitful experiences when I tried installing them, so avoid unless you're keen on experimenting.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Installing via the ATI Installer&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I'll recommend not to use this option if you have planning to upgrade to Ubuntu 8.10. There are a few quirks with the installer version that will not work well with your window manager if you wanted a rotated screen (See later section).&lt;br /&gt;&lt;br /&gt;The steps are straightforward in this case: just execute the downloaded installer and follow the instructions. It's important to note the that the uninstaller is located at &lt;code&gt;/usr/share/ati/fglrx-uninstall.sh&lt;/code&gt;, which may become necessary to do to prevent conflicting installations if you decided to apt-get from Ubuntu's repository later.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Upgrading and Installing from Ubuntu 8.10's Repository&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;These steps are probably not necessary if you've installed Ubuntu 8.10 fresh, but may be essential if you got here through an upgrade path like I did.&lt;br /&gt;&lt;br /&gt;The main things you want to apt-get are: &lt;code&gt;xorg-driver-fglrx&lt;/code&gt;, &lt;code&gt;jockey-common&lt;/code&gt;, &lt;code&gt;jockey-gtk&lt;/code&gt;. As a non-dependent package, jockey-common is surprisingly crucial to getting your setup to work, as it contains working versions of &lt;code&gt;amdpcsdb&lt;/code&gt; and various important files in &lt;code&gt;/etc/ati&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Once you the packages installed, if you are running gnome, go to &lt;code&gt;'System -&gt; Administration -&gt; Hardware Drivers'&lt;/code&gt; and you should see the ATI Driver available for installation. Click on 'Activate' to download the driver and install. It may take a while before the installation completes.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_lSk990LIlbk/SY77uaYngsI/AAAAAAAAAIY/VmUG_4Tfb3I/s1600-h/Hardware+Drivers"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 352px; height: 400px;" src="http://1.bp.blogspot.com/_lSk990LIlbk/SY77uaYngsI/AAAAAAAAAIY/VmUG_4Tfb3I/s400/Hardware+Drivers" alt="" id="BLOGGER_PHOTO_ID_5300450586236781250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After the installation, you may be prompted to restart your machine. Before you do, just check that the &lt;code&gt;'fglrx'&lt;/code&gt; driver is mentioned in &lt;code&gt;/etc/X11/xorg.conf&lt;/code&gt;. Check that the following line is present in your "Device" Section, eg:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Section "Device"&lt;br /&gt;Identifier    "Configured Video Device"&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Driver            "fglrx"&lt;/span&gt;&lt;br /&gt;EndSection&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Add the line in red into your &lt;code&gt;xorg.conf&lt;/code&gt; if it isn't present. Here's an example &lt;code&gt;&lt;a href="http://www.vinceliu.com/xorg.conf-failsafe-fglrx"&gt;xorg.conf&lt;/a&gt;&lt;/code&gt; that may help. Once you are done with the changes, restart your machine.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Checking that fglrx Driver is Running&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;With luck, your X should be running on your system after the installation. The first thing to do is you check that you have the &lt;code&gt;'fglrx'&lt;/code&gt; driver running. You should get something like this from the output of &lt;code&gt;'fglrxinfo'&lt;/code&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% fglrxinfo&lt;br /&gt;display: :0&lt;br /&gt;OpenGL vendor string: ATI Technologies Inc.&lt;br /&gt;OpenGL renderer string: ATI Radeon HD 3600 Series&lt;br /&gt;OpenGL version string: 2.1.8087 Release&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can also run &lt;code&gt;fgl_glxgears&lt;/code&gt; to verify that the card is running correctly visually.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Setting up the Dual Display Configuration&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;( &lt;span style="font-weight: bold;"&gt;Update:&lt;/span&gt; Compiz does work OK with dual-display, and out of the box as well, just not with rotated-screens. If you don't use rotated screens, this should be fine, so skip the following section. )&lt;br /&gt;&lt;br /&gt;&lt;strike&gt;The dual-head display set up does not work well with the compositing manager - this is troublesome for Gnome because the default manager is Compiz. You'll have to pass the eye-candy and rely Metacity instead. If you don't, your reconfigured X server either conks out with a backtrace failing on some deprecated calls, or you're greeted with just a wallpaper background or a black screen.&lt;/strike&gt;&lt;br /&gt;&lt;br /&gt;To get access to the settings, you'll need &lt;code&gt;gconf-editor&lt;/code&gt; which is an X application, so you should change this setting before you try restarting X in dual-head mode.&lt;br /&gt;&lt;br /&gt;Run &lt;code&gt;gconf-editor&lt;/code&gt; and change the key value in &lt;code&gt;/desktop/gnome/applications/window_manager/default&lt;/code&gt; and &lt;code&gt;/desktop/gnome/applications/window_manager/current&lt;/code&gt; from &lt;code&gt;'/usr/bin/compiz'&lt;/code&gt; to &lt;code&gt;'/usr/bin/metacity'&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lSk990LIlbk/SY778hzoXqI/AAAAAAAAAIg/5EfubnGJHU4/s1600-h/gconf-editor.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 326px;" src="http://3.bp.blogspot.com/_lSk990LIlbk/SY778hzoXqI/AAAAAAAAAIg/5EfubnGJHU4/s400/gconf-editor.png" alt="" id="BLOGGER_PHOTO_ID_5300450828747300514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next is to make changes in your &lt;code&gt;xorg.conf&lt;/code&gt; file. While ATI provided the default tools like &lt;code&gt;'aticonfig'&lt;/code&gt; and ATI's Catalyst Control Centre (&lt;code&gt;'amdcccle'&lt;/code&gt;), I'll recommend you avoid them for now (see &lt;b&gt;Troubleshooting&lt;/b&gt; for why).&lt;br /&gt;&lt;br /&gt;Here's an excerpt from my &lt;code&gt;xorg.conf&lt;/code&gt; as an example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Section "Device"&lt;br /&gt;Identifier    "ATI Radeon HD 3650 [0]"&lt;br /&gt;Driver         "fglrx"&lt;br /&gt;BusID         "PCI:1:0:0"&lt;br /&gt;Screen       0&lt;br /&gt;&lt;br /&gt;# only need to set it one time for a dual-head card&lt;br /&gt;#  Option       "UseFastTLS" "1"&lt;br /&gt;#  Option       "VideoOverlay"    "on"&lt;br /&gt;#  Option       "OpenGLOverlay"    "off"&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;Section "Device"&lt;br /&gt;Identifier    "ATI Radeon HD 3650 [1]"&lt;br /&gt;Driver      "fglrx"&lt;br /&gt;BusID       "PCI:1:0:0"&lt;br /&gt;Screen            1&lt;br /&gt;&lt;br /&gt;# Rotation: Not supported as an option directly at the moment&lt;br /&gt;#    Option          "RandRRotation"&lt;br /&gt;#    Option            "Rotate" "CCW"&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;Section "Monitor"&lt;br /&gt;Identifier    "Monitor 0"&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;Section "Screen"&lt;br /&gt;Identifier            "Screen 0"&lt;br /&gt;Monitor              "Monitor 0"&lt;br /&gt;Device                "ATI Radeon HD 3650 [0]"&lt;br /&gt;DefaultDepth     24&lt;br /&gt;SubSection "Display"&lt;br /&gt;   Viewport   0 0&lt;br /&gt;   Depth        24&lt;br /&gt;EndSubSection&lt;br /&gt;Option               "DPMS"&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;Section "Screen"&lt;br /&gt;Identifier           "Screen 1"&lt;br /&gt;Monitor             "Monitor 1"&lt;br /&gt;Device               "ATI Radeon HD 3650 [1]"&lt;br /&gt;DefaultDepth    24&lt;br /&gt;SubSection "Display"&lt;br /&gt;   Viewport   0 0&lt;br /&gt;   Depth        24&lt;br /&gt;EndSubSection&lt;br /&gt;Option               "DPMS"&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;Section "ServerLayout"&lt;br /&gt;Identifier    "Default Layout"&lt;br /&gt;Screen          "Screen 0"&lt;br /&gt;Screen          "Screen 1" RightOf "Screen 0"&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;Section "ServerFlags"&lt;br /&gt;# have to disable xinerama if I want screen rotation&lt;br /&gt;Option        "Xinerama" "off"&lt;br /&gt;EndSection&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The full &lt;code&gt;xorg.conf&lt;/code&gt; file can be found &lt;a href="http://www.vinceliu.com/xorg.conf-dual"&gt;here&lt;/a&gt;. Make the relevant changes, keep your fingers crossed, and restart your computer.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Screen Rotation&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you've managed to get this far, I'd assume that you have your dual head display working by now. If you wanted more fun out of your display, you can try the rotation capabilities provided by &lt;a href="http://en.wikipedia.org/wiki/XRandR"&gt;randr&lt;/a&gt;. The randr extensions are disabled by default; if you tried &lt;code&gt;xrandr&lt;/code&gt; without enabling the extensions you're going to get this message:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% xrandr --output default --rotate left&lt;br /&gt;xrandr: output default cannot use rotation "left" reflection "none"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To enable the randr extenstions, use the &lt;code&gt;'aticonfig'&lt;/code&gt; tool:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% aticonfig --set-pcs-str='DDX,EnableRandr12,TRUE'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Restart X or your computer after you made the changes.&lt;br /&gt;&lt;br /&gt;While the ATI installer versions works without a hitch on older versions of Ubuntu, rotation is the only case it doesn't work right. For your window manager to detect it's dimensions properly, you'll have to install Ubuntu's version of &lt;code&gt;fglrx&lt;/code&gt;, which somehow takes care of the rotation properly compared to the ATI installer version. Rotation also will not work if you are running in Xinerama configuration - you'll end up with areas on your workspace not being accessible by your mouse.&lt;br /&gt;&lt;br /&gt;While Gnome allows the option to change its screen rotation from its menu, it doesn't seem to be able to rotate the screen even when the option is set. This means the screen you want rotated will always start landscape every single time it starts up. At least &lt;code&gt;xrandr&lt;/code&gt; now can detect all the screens that you have available on your card and perform rotation on it:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% xrandr&lt;br /&gt;Screen 1: minimum 320 x 200, current 1024 x 1280, maximum 1280 x 1280&lt;br /&gt;DFP1 disconnected (normal left inverted right x axis y axis)&lt;br /&gt;DFP2 connected 1024x1280+0+0 left (normal left inverted right x axis y axis) 338mm x 270mm&lt;br /&gt;1280x1024      60.0*+   75.0     75.0     70.0     60.0*&lt;br /&gt;1280x960       60.0     60.0&lt;br /&gt;1152x864       75.0     70.0     60.0&lt;br /&gt;1280x768       59.9&lt;br /&gt;1280x720       60.0&lt;br /&gt;1024x768       75.0     75.0     72.0     70.1     60.0&lt;br /&gt;800x600        72.2     75.0     70.0     60.3     56.2&lt;br /&gt;720x480        60.0&lt;br /&gt;640x480        75.0     72.8     75.0     60.0&lt;br /&gt;640x432        60.0&lt;br /&gt;640x400        75.1     59.9&lt;br /&gt;512x384        60.0     74.9&lt;br /&gt;400x300        75.0     60.7&lt;br /&gt;320x240        75.6     60.0&lt;br /&gt;320x200        75.5     60.1&lt;br /&gt;CRT1 disconnected (normal left inverted right x axis y axis)&lt;br /&gt;CRT2 disconnected (normal left inverted right x axis y axis)&lt;br /&gt;TV disconnected (normal left inverted right x axis y axis)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To do rotation, you'll have to invoke this command every single time you log in:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% xrandr --output DFP2 --rotate left&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Replace &lt;code&gt;DFP2&lt;/code&gt; with whatever screen &lt;code&gt;xrandr&lt;/code&gt; reports you have.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Troubleshooting&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1) There are a few times I had my run-ins with the utility tools ATI provides. Firstly with &lt;code&gt;'aticonfig'&lt;/code&gt;. While it proves useful sometimes, at others, it screws up your &lt;code&gt;xorg.conf&lt;/code&gt; configurations. What I'll recommend is that you play around with &lt;code&gt;aticonfig&lt;/code&gt;, and copy the relevant parts it generated into your own &lt;code&gt;xorg.conf&lt;/code&gt; file, instead of relying on it blindly.&lt;br /&gt;&lt;br /&gt;2) The other tool, ATI's Catalyst Control Centre ' - amdcccle', is just pure evil IMHO. The ATI drivers install an important file called &lt;code&gt;'/etc/ati/amdpcsdb'&lt;/code&gt;, which it loads independently from &lt;code&gt;xorg.conf&lt;/code&gt;. If you're finding that X isn't working anymore even with an &lt;code&gt;xorg.conf&lt;/code&gt; file you know to have worked previously, it's most likely that the &lt;code&gt;amdpcsdb&lt;/code&gt; has been corrupted, which I find that happening from tinkering around with &lt;code&gt;amdcccle&lt;/code&gt;, which is probably the biggest time wasted in trying to hunt down spurious problems.&lt;br /&gt;&lt;br /&gt;If your card hangs even if Sysreq keys doesn't work no matter what &lt;code&gt;xorg.conf&lt;/code&gt; parameters you've changed, the first thing is probably to try to restore the database. The way I got it to work again was by coping over the &lt;code&gt;amdpcsdb.default&lt;/code&gt; file to &lt;code&gt;amdpcsdb&lt;/code&gt;, eg:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;% cp /etc/ati/amdpcsdb.default /etc/ati/amdpcsdb&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Do make backups of the original file before you do that, I'm not responsible for any loss or damage it would cause!&lt;br /&gt;&lt;br /&gt;3) If X turns into a black screen after you've logged out, try adding or modifying the following line inside &lt;code&gt;/etc/gdm/gdm.conf&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# If you are having trouble with using a single server for a long time and want&lt;br /&gt;# GDM to kill/restart the server, turn this on.  On Solaris, this value is&lt;br /&gt;# always true and this configuration setting is ignored.&lt;br /&gt;AlwaysRestartServer=true&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-8818551046563191299?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=QQT9A4NymD8:gHSdc5EOOEc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=QQT9A4NymD8:gHSdc5EOOEc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=QQT9A4NymD8:gHSdc5EOOEc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=QQT9A4NymD8:gHSdc5EOOEc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=QQT9A4NymD8:gHSdc5EOOEc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=QQT9A4NymD8:gHSdc5EOOEc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=QQT9A4NymD8:gHSdc5EOOEc:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=QQT9A4NymD8:gHSdc5EOOEc:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/QQT9A4NymD8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/8818551046563191299/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/02/setting-dual-head-displays-with-radeon.html#comment-form" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/8818551046563191299?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/8818551046563191299?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/QQT9A4NymD8/setting-dual-head-displays-with-radeon.html" title="Setting Dual-Head Displays with Radeon HD 3650 in Ubuntu Linux" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_lSk990LIlbk/SZFUFAzuKlI/AAAAAAAAAIo/5d5SRc7WtvI/s72-c/P1020229.JPG" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">5</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/02/setting-dual-head-displays-with-radeon.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQCQXw_cSp7ImA9WxVXEks.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-5230672113502918147</id><published>2009-02-09T10:52:00.000-08:00</published><updated>2009-02-10T02:06:00.249-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-10T02:06:00.249-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Humour" /><title>Confessions of a 'Ctrl-Alt-Del' Addict</title><content type="html">Growing up in a world where MS-DOS was the first operating system I've ever used certainly leaves me rather brain-damaged when it comes to the 3-finger salute of &lt;code&gt;'Ctrl-Alt-Del'&lt;/code&gt;. That key combination literally is the 'One Keystroke That Rules Them All' - more or less, it's the last thing that will probably still work in the face of a catastrophic computer failure.&lt;br /&gt;&lt;br /&gt;Obviously, I never did wean off from my un-elite MS heritage, so it should come as no surprise that I sometimes still use &lt;code&gt;'Ctrl-Alt-Del'&lt;/code&gt; to solve my problems in Linux. Still, it's nice to know that Linux on the whole has always been accommodating enough to include that magic keystroke to satisfy the likes of people like me - most distributions secretly sneak in a line in &lt;code&gt;/etc/inittab&lt;/code&gt; (or &lt;code&gt;/etc/event.d&lt;/code&gt; for Ubuntu's Upstart) to make it reboot should I fancy myself into fondling those keys when my urge arises, although I must say I have less urges to do so these days ever since I've migrated to Linux, so thanks for asking!&lt;br /&gt;&lt;br /&gt;Even when in graphical mode (it's called 'X-Windows' by the way, but you can simply call it 'X' if you want to be a smarty pants, but calling it 'Windows' is plainly an insult!), most window-managers still associate it with some behaviour, like invoking &lt;code&gt;'xkill'&lt;/code&gt; or popup for a shutdown menu. I think some window-managers even invoke the screensaver for that! (I don't even want to go there - that's just plain wierd!)&lt;br /&gt;&lt;br /&gt;Shame to say, I've only recently discovered the equivalent of &lt;code&gt;'Ctrl-Alt-Del'&lt;/code&gt; in the Linux world after using it for 8 years!&lt;br /&gt;&lt;br /&gt;The magic keys are known as 'System Request' (Sysreq) keys, the all powerful keystrokes a man can invoke (then pray) if your system ever gets f**ked or becomes totally unresponsive. Before you even hit the power switch, try holding down the &lt;code&gt;'Alt-PrintScreen'&lt;/code&gt; keys, and type in the following letters: &lt;span style="font-weight: bold;"&gt;r&lt;/span&gt;-&lt;span style="font-weight: bold;"&gt;s&lt;/span&gt;-&lt;span style="font-weight: bold;"&gt;e&lt;/span&gt;-&lt;span style="font-weight: bold;"&gt;i&lt;/span&gt;-&lt;span style="font-weight: bold;"&gt;u&lt;/span&gt;-&lt;span style="font-weight: bold;"&gt;b&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A good way to remember it is by the phrase:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;"&lt;span style="font-weight: bold;"&gt;R&lt;/span&gt;eboot &lt;span style="font-weight: bold;"&gt;S&lt;/span&gt;ystem &lt;span style="font-weight: bold;"&gt;E&lt;/span&gt;ven &lt;span style="font-weight: bold;"&gt;I&lt;/span&gt;f &lt;span style="font-weight: bold;"&gt;U&lt;/span&gt;tterly &lt;span style="font-weight: bold;"&gt;B&lt;/span&gt;orked"&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;With luck, that will try to kill all processes gracefully, sync all data to your drives, unmount them, and reboot your system. There's more to the Magic Sysreq keys than I have let on, and more details can be found &lt;a href="http://www.debian-administration.org/articles/457."&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;There are a few other neat tricks with the Sysreq keys, like killing off errant applications that's chewing off too much of your system memory with &lt;code&gt;'Alt-PrintScreen'&lt;/code&gt; + &lt;span style="font-weight: bold;"&gt;r&lt;/span&gt;-&lt;span style="font-weight: bold;"&gt;f&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;A pity that I've only learnt it after such a long while, for it would have been really helpful when I was tearing my hair off a while ago when &lt;a href="http://blog.vinceliu.com/2008/11/if-you-think-rubygem-is-slow-thats.html"&gt;Rubygems was chewing up all my free memory and thrashing my harddisk&lt;/a&gt; from all that silly swapping.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-5230672113502918147?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=CQzvfIHNHAA:C7r-Cw2iv9g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=CQzvfIHNHAA:C7r-Cw2iv9g:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=CQzvfIHNHAA:C7r-Cw2iv9g:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=CQzvfIHNHAA:C7r-Cw2iv9g:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=CQzvfIHNHAA:C7r-Cw2iv9g:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=CQzvfIHNHAA:C7r-Cw2iv9g:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=CQzvfIHNHAA:C7r-Cw2iv9g:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=CQzvfIHNHAA:C7r-Cw2iv9g:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/CQzvfIHNHAA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/5230672113502918147/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/02/confessions-of-ctrl-alt-del-addict.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/5230672113502918147?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/5230672113502918147?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/CQzvfIHNHAA/confessions-of-ctrl-alt-del-addict.html" title="Confessions of a 'Ctrl-Alt-Del' Addict" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/02/confessions-of-ctrl-alt-del-addict.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4AQX44fip7ImA9WxVXGE0.&quot;"><id>tag:blogger.com,1999:blog-6787189684621789552.post-8793551349740011279</id><published>2009-02-07T10:31:00.000-08:00</published><updated>2009-02-16T08:15:40.036-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-16T08:15:40.036-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Ubuntu 8.04's Generic Kernel Hangs Machine</title><content type="html">&lt;span style="font-style: italic;"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Updated:&lt;/span&gt;&lt;span style="font-style: italic;"&gt; To solve your problem, upgrade to Ubuntu 8.10. The newer kernel does not suffer from the problem mentioned below)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you are using a Vostro 200, this post may apply to you, but bear with my few paragraphs of rant before I give you a fix to the problem. :)&lt;br /&gt;&lt;br /&gt;Bloody linux has done it again, borking up my machine during an upgrade cycle. That's always why I'm hesitant on upgrading unless there is no choice. I'll leave the FOSS purists to argue about the concept of 'free' in whatever way they like, but I've always been mindful that there is a hidden cost involved in using Open Source software - you're paying it with your time as a guinea pig for the developers to solve the problems you've encountered.&lt;br /&gt;&lt;br /&gt;One way to mitigate that cost is by not using the most cutting edge versions of software - in that way, you're relatively safe from any initial teething issues that still needs to be fixed. But the bad news is, stable/working probably equals to 5 years or more in the FOSS world, and computer hardware moves faster than that.&lt;br /&gt;&lt;br /&gt;Given the fast turnover of computer peripherals, no sensible shop will stock 5 year old hardwares to sell it to you, and hence my problems started when I added a new ATI Radeon card to the system. The last known working kernel for the Vostro had been &lt;code&gt;2.6.22-14-generic&lt;/code&gt;, which I had found out a long time ago when I had 'apt-getted' a &lt;code&gt;2.6.22-16-generic&lt;/code&gt; kernel. The obvious quick-fix then was to be make GRUB boot my older kernel, to which I left it at that.&lt;br /&gt;&lt;br /&gt;But given that I had installed a new card and needed to install ATI's newest driver, the driver installer, in cahoots with dkms, decided that I wanted a &lt;code&gt;2.6.22-16-generic&lt;/code&gt; kernel module, which obviously screws up X, and hangs my machine whenever the xserver tries to start.&lt;br /&gt;&lt;br /&gt;So I'm left with the situation that either the kernel will hang, or X will. Greeeeat.&lt;br /&gt;&lt;br /&gt;Since I had been holding off upgrading from Gutsy to Hardy for a long while, I decided to take a gamble to see if the upgrade to a newer kernel would have solved the problem, since it's probably 1 year past the last release cycle. But it turns out to be a real awful mistake - upgrading to &lt;code&gt;2.6.24-23-generic&lt;/code&gt; still screws up the SATA controller, ejecting me to busybox's prompt after giving the following messages:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ata1.00: qc timeout (cmd 0x27)&lt;br /&gt;ata1.00: failed to read native max address (err_mask=0x4)&lt;br /&gt;ata1: failed to recover some devices, retrying in 5 secs&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;ata2.00: qc timeout (cmd 0x27)&lt;br /&gt;ata2.00: failed to read native max address (err_mask=0x4)&lt;br /&gt;ata2: failed to recover some devices, retrying in 5 secs&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I can imagine Mac users laughing with derision at me right now - 'Get a Mac, it just works!'&lt;br /&gt;&lt;br /&gt;After wasting two nights of precious time booting into my old kernel and trying to coax xserver and the fglrx driver to play nice, I decided to revisit the issue of fixing the kernel problem. After a bit of digging, I found the solution in launchpad's bug report: '&lt;a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/206635"&gt;Ata Revalidation Failed&lt;/a&gt;'. To solve the problem, add the argument &lt;code&gt;'irqpoll all_generic_ide'&lt;/code&gt; into the kernel line in GRUB:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;title        Ubuntu 8.04.2, kernel 2.6.24-23-generic&lt;br /&gt;root        (hd0,0)&lt;br /&gt;kernel     /boot/vmlinuz-2.6.24-23-generic root=UUID=&lt;your&gt; ro &lt;span style="color:red;"&gt;irqpoll all_generic_ide&lt;/span&gt;&lt;br /&gt;initrd        /boot/initrd.img-2.6.24-23-generic&lt;br /&gt;quiet&lt;br /&gt;&lt;/your&gt;&lt;/pre&gt;&lt;br /&gt;I don't know what exactly the kernel flag does, but I suppose the SATA controller wouldn't jive with the kernel and needed a jolt of forcible of polling from the kernel for it to work.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7827109100899293";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "0000FF";google_color_text = "000000";google_color_url = "008000";google_ui_features = "rc:6";//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6787189684621789552-8793551349740011279?l=blog.vinceliu.com'/&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=x4gcvM1wsGs:YB5-Ry2gmuc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=x4gcvM1wsGs:YB5-Ry2gmuc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=x4gcvM1wsGs:YB5-Ry2gmuc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=x4gcvM1wsGs:YB5-Ry2gmuc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=x4gcvM1wsGs:YB5-Ry2gmuc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=x4gcvM1wsGs:YB5-Ry2gmuc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/VincentLiu?a=x4gcvM1wsGs:YB5-Ry2gmuc:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/VincentLiu?i=x4gcvM1wsGs:YB5-Ry2gmuc:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/VincentLiu/~4/x4gcvM1wsGs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.vinceliu.com/feeds/8793551349740011279/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.vinceliu.com/2009/02/ubuntu-804s-generic-kernel-hangs.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/8793551349740011279?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6787189684621789552/posts/default/8793551349740011279?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/VincentLiu/~3/x4gcvM1wsGs/ubuntu-804s-generic-kernel-hangs.html" title="Ubuntu 8.04's Generic Kernel Hangs Machine" /><author><name>Vincent Liu</name><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="11478202932375690324" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.vinceliu.com/2009/02/ubuntu-804s-generic-kernel-hangs.html</feedburner:origLink></entry></feed>
