<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Lunesu - Knowledge Base</title>
    <link>http://lunesu.com/</link>
    <description>Random Notes</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.6 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Show current GIT branch in TCC</title>
    <link>http://lunesu.com/index.php?/archives/133-Show-current-GIT-branch-in-TCC.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/133-Show-current-GIT-branch-in-TCC.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=133</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=133</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    I&#039;m getting more and more familiar with the GIT workflow, which goes kinda like this:&lt;blockquote&gt;git checkout -b topicbranchX&lt;br /&gt;
git add somefile&lt;br /&gt;
git commit -m&quot;commit message&quot;&lt;br /&gt;
git pull&lt;br /&gt;
git rebase master&lt;br /&gt;
git push&lt;/blockquote&gt;&lt;br /&gt;
Unfortunately this means that you&#039;ll end up with a bunch of branches (which you can delete once they get pulled into origin/master) but I keep forgetting what branch I currently have checked out. I&#039;ve seen bash prompts that show the current branch and I decided to do something similar for &lt;a href=&quot;http://jpsoft.com&quot; title=&quot;JP Software&quot;&gt;TCC/LE&lt;/a&gt;.&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;c&quot;&gt;/&amp;#42;
@cl &quot;/Tp%~f0&quot; /nologo /GS- /link /SUBSYSTEM:console /nodefaultlib /entry:_main kernel32.lib
@goto :EOF
*/
#define WIN32_LEAN_AND_MEAN
#include &amp;lt;windows.h&gt;
const WCHAR root[] = L&quot;..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\.git\\HEAD&quot;;
int __stdcall _main() {
  int offset = sizeof(root)/2 - 10;
  while (offset &gt;= 0) {
    HANDLE h = CreateFileW(root + offset, GENERIC_READ, FILE_SHARE_READ, NULL, 
      OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
    if (h != INVALID_HANDLE_VALUE) {
      char buf[64];
      DWORD read = 0;
      if (ReadFile(h, buf, sizeof(buf), &amp;read, NULL) &amp;&amp;amp; read &gt; 16) {
        DWORD off = 0;
        DWORD len = 7;            // show 7 hex digits
        if ((int&amp;)buf[0] == &#039;:fer&#039;) {
          off = 16;               // skip ref: refs/heads/
          len = read - off ;     // keep LF
        }
        WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), buf + off, len, NULL, NULL);
      }
      return 13 - offset / 3;
    }
    offset -= 3;
  }
  return 0;
}&lt;/pre&gt;&lt;br /&gt;
What&#039;s fun about this file is that you can save it as &quot;gb.cmd&quot;. When you then enter &quot;gb&quot; on the command line, it will actually invoke the C compiler (remember to run vcvars32) to generate the gb.exe. Next time, the exe will be invoked instead.&lt;br /&gt;
&lt;br /&gt;
This is the final prompt:&lt;br /&gt;
&lt;blockquote&gt;prompt %%@exec[@gb.exe]$e[1m$P$e[0m$_$+$g&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Fri, 03 May 2013 07:02:39 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/133-guid.html</guid>
    
</item>
<item>
    <title>Finally: unbound + dnsmasq</title>
    <link>http://lunesu.com/index.php?/archives/128-Finally-unbound-+-dnsmasq.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/128-Finally-unbound-+-dnsmasq.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=128</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=128</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    I&#039;ve been using &lt;a href=&quot;http://unbound.net/&quot; title=&quot;Unbound&quot;&gt;unbound&lt;/a&gt; as my only DNS server for over a year now. It&#039;s a recursive and caching DNS server with DNSSEC (a.o.) support. &lt;br /&gt;
&lt;br /&gt;
This is particularly interesting for people living in China: the GFW&#039;s first line of defense (if you can call it that) is spoofing DNS. If you use the DNS server provided by any of the Chinese ISPs, you&#039;re unlikely to get any meaningful IP for domain such as facebook or twitter. But if you go through the whole recursive query yourself (ie. ask the root-servers for &quot;com&quot;, ask the .com servers for &quot;facebook&quot; and ask the facebook servers for &quot;www&quot;) then you will get an IP, which you can potentially verify using DNSSEC. Because facebook and others constantly add new servers to their datacenters, with new IPs, it&#039;s likely that once you get the right IP, you can actually connect to the server, without the need for VPN.&lt;br /&gt;
&lt;br /&gt;
Unbound is easy to setup. For me, &quot;opkg install unbound&quot; was half the battle. The other half involved editing /etc/unbound/unbound.conf. For a detailed walk through, check &lt;a href=&quot;https://calomel.org/unbound_dns.html&quot; title=&quot;Calomel&quot;&gt;this &lt;/a&gt;great site [calomel.org]. Here&#039;s my current unbound.conf:&lt;blockquote&gt;server:&lt;br /&gt;
        neg-cache-size: 0&lt;br /&gt;
        use-caps-for-id: yes&lt;br /&gt;
        prefetch: yes&lt;br /&gt;
        port: 533&lt;br /&gt;
        do-udp: yes&lt;br /&gt;
        do-tcp: yes&lt;br /&gt;
        interface: 0.0.0.0&lt;br /&gt;
        #interface: ::0&lt;br /&gt;
        #do-ip6: no&lt;br /&gt;
        val-clean-additional: yes&lt;br /&gt;
        harden-glue: yes&lt;br /&gt;
        harden-dnssec-stripped: yes&lt;br /&gt;
        rrset-cache-size: 1m&lt;br /&gt;
        rrset-cache-slabs: 2&lt;br /&gt;
        root-hints: &quot;named.cache&quot;&lt;br /&gt;
        auto-trust-anchor-file: &quot;root.autokey&quot;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
All this was working fine, but the problem was that local names in my LAN no longer got resolved. Unbound doesn&#039;t no anything about DHCP and it won&#039;t accept DNS registrations from local machines. Dnsmasq does know about local names, since it&#039;s the one handing out the IPs in the first place. Ideally, I use both DNS servers: unbound for external queries and dnsmasq for internal (and internal only!) queries.&lt;br /&gt;
&lt;br /&gt;
Most of the time I query external names, so I&#039;d tried to get Unbound to forward local queries to Dnsmasq. I configured Unbound to use port 53 and Dnsmasq to use port 533. Then, I added a forward-zone to unbound.conf:&lt;blockquote&gt;    forward-zone:&lt;br /&gt;
       name: &quot;lan&quot;&lt;br /&gt;
       forward-addr: 127.0.0.1@533&lt;/blockquote&gt;&lt;br /&gt;
This was supposed to forward all queries in the &quot;lan&quot; domain (the local domain, as configured in dnsmasq/dhcp) to the dnsmasq server listening on port 533. Unfortunately, this didn&#039;t work. No queries got forwarded, even though a lookup for a local name did get suffixed with &quot;.lan&quot; by the clients.&lt;br /&gt;
&lt;br /&gt;
So I flipped it around: dnsmasq on port 53, unbound on 533. Add the following to /etc/config/dhcp:&lt;blockquote&gt;        option &#039;nonegcache&#039; &#039;1&#039;&lt;br /&gt;
        list &#039;server&#039; &#039;127.0.0.1#533&#039;&lt;br /&gt;
        option &#039;port&#039; &#039;53&#039;&lt;br /&gt;
        option &#039;noresolv&#039; &#039;1&#039;&lt;br /&gt;
&lt;/blockquote&gt;This works: I can successfully ping my local computers and NAS, while still having other queries resolved (recursively) by unbound. I used &lt;a href=&quot;https://calomel.org/dns_verify.html&quot; title=&quot;DNS verification script&quot;&gt;dns_verify.sh&lt;/a&gt; to check my setup:&lt;blockquote&gt;root@OpenWrt:~# ./dns_verify.sh&lt;br /&gt;
&lt;br /&gt;
        ip        -&gt;     hostname      -&gt; ip&lt;br /&gt;
--------------------------------------------------------&lt;br /&gt;
ok      192.168.2.1 -&gt; OpenWrt.lan. -&gt; 192.168.2.1&lt;br /&gt;
ok      192.168.2.2 -&gt; DaWang.lan. -&gt; 192.168.2.2&lt;br /&gt;
&lt;br /&gt;
DONE.&lt;/blockquote&gt;By the way, the script needs &lt;strong&gt;dig&lt;/strong&gt;, which you can get by doing &quot;opkg install bind-dig&quot;. 
    </content:encoded>

    <pubDate>Mon, 25 Jun 2012 13:33:57 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/128-guid.html</guid>
    
</item>
<item>
    <title>Real life example</title>
    <link>http://lunesu.com/index.php?/archives/127-Real-life-example.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/127-Real-life-example.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=127</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=127</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    I never found the need to study those common unix utilities like &lt;strong&gt;sed&lt;/strong&gt;, &lt;strong&gt;awk&lt;/strong&gt;, &lt;strong&gt;xargs&lt;/strong&gt;. Even my knowledge of grep didn&#039;t go further than &lt;strong&gt;blah | grep foo&lt;/strong&gt;. Until yesterday, when I needed to accomplish a task that just happened to involve all of these utilities:&lt;blockquote&gt;grep ppp /proc/net/dev | sed &quot;s/:/ /&quot; | awk &#039;($2+$10&gt;1000000000){print $1}&#039; | xargs --max-args=1 --no-run-if-empty ppp-off&lt;/blockquote&gt;&lt;br /&gt;
First, &lt;strong&gt;grep &lt;/strong&gt;filters all lines from &lt;em&gt;/proc/net/dev&lt;/em&gt; that contain &lt;em&gt;ppp&lt;/em&gt;.&lt;br /&gt;
Then, &lt;strong&gt;sed &lt;/strong&gt;changes the colon into a space using the regex &lt;em&gt;s/:/ /&lt;/em&gt;.&lt;br /&gt;
Next, &lt;strong&gt;awk &lt;/strong&gt;parses the values of the 2nd and 10th column [bytes sent and received] and if the sum exceeds 1GB it prints the value in the first column [the interface].&lt;br /&gt;
Finally, &lt;strong&gt;xargs &lt;/strong&gt;invokes ppp-off for every interface returned.&lt;br /&gt;
&lt;br /&gt;
Why I needed this is left as an exercise to the reader. 
    </content:encoded>

    <pubDate>Sat, 11 Feb 2012 09:37:27 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/127-guid.html</guid>
    
</item>
<item>
    <title>Server-side email filtering</title>
    <link>http://lunesu.com/index.php?/archives/125-Server-side-email-filtering.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/125-Server-side-email-filtering.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=125</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=125</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    I hate etc/ and everything in it, but I realize it might not be etc/&#039;s fault. The fault might lie with Google and Bing: most of the results I get are people asking the same question on some forum. These threads often end without any answer. Or worse, wrong information. About half the threads eventually end up with the members discussing a complete different issue. Anyway, I figured it out. The following example assumes you&#039;re &lt;a href=&quot;http://lunesu.com/index.php?/archives/112-Converting-mailbox-format-from-mbox-to-Maildir.html&quot; title=&quot;Converting mailbox format from mbox to Maildir&quot;&gt;using the &lt;strong&gt;maildir&lt;/strong&gt; format for your mailbox&lt;/a&gt;.&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Create a file called &lt;strong&gt;.procmailrc&lt;/strong&gt; in your home folder and add the following contents:&lt;blockquote&gt;DEFAULT=$HOME/Maildir/&lt;br /&gt;
MAILDIR=$HOME/Maildir&lt;br /&gt;
&lt;br /&gt;
:0:&lt;br /&gt;
* ^Mailing-list: list staff@somedomain\.com&lt;br /&gt;
.SomeFolder/&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;li&gt;Tell postfix to use &lt;strong&gt;procmail &lt;/strong&gt;for mail filtering/processing by adding/changing the following line to /etc/postfix/main.cf:&lt;blockquote&gt;mailbox_command = procmail -a &quot;$EXTENSION&quot;&lt;/li&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Restart postfix&lt;blockquote&gt;sudo /etc/init.d/postfix reload&lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;
&lt;/ol&gt;&lt;br /&gt;
As you can see, the rules in .procmailrc use regular expressions to find the right mail. Each rule starts with colon-zero-colon (see &lt;strong&gt;man procmailrc &lt;/strong&gt;for more options), followed by a line with the regular expression. Here, &lt;strong&gt;^&lt;/strong&gt; means beginning of the line. Note that dots must be escaped with a backslash. A wildcard would be written as &lt;strong&gt;.*&lt;/strong&gt;&lt;br /&gt;
The next line describes what to do when the regular expression is matched. In this case we want procmail to deliver the mail to a folder called SomeFolder. (If you&#039;re using &lt;strong&gt;mbox &lt;/strong&gt;instead of maildir this would be a filename rather than a folder name.)&lt;br /&gt;
&lt;br /&gt;
Add as many rules as you want, separating them with an empty line. 
    </content:encoded>

    <pubDate>Tue, 24 Jan 2012 08:58:04 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/125-guid.html</guid>
    
</item>
<item>
    <title>&quot;110V&quot; really means 110V</title>
    <link>http://lunesu.com/index.php?/archives/118-110V-really-means-110V.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/118-110V-really-means-110V.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=118</wfw:comment>

    <slash:comments>9</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=118</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    Long story short: I&#039;ve been to the US a few weeks ago and I thought I&#039;d pick up a new Xbox 360 250GB while I was there, seeing as those are hard to find in China. I assumed its power supply would accept both 110V and 220V (like my PS3 and most modern PCs and laptops.) Well, it did not.&lt;br /&gt;
&lt;br /&gt;
Of course, I did not just plug it in and watch explode. I first opened up the power supply (not an easy feat, let me tell you) and only plugged it in after noticing the board inside had &quot;250V&quot; written on it, with a check mark next to it. Not sure what that meant though. It still blew up after I plugged it in.&lt;br /&gt;
&lt;br /&gt;
I already had a plan B from the moment I bought the Xbox: the power supply output 12V and 5V, much like a regular PC power supply. So I bought a (mini) ATX power supply and went online to see if I could find the pinout. &lt;a href=&quot;http://www.google.com.hk/images?q=atx%20psu%20pinout&amp;hl=en&amp;um=1&amp;ie=UTF-8&amp;source=og&amp;sa=N&amp;tab=wi&amp;biw=1746&amp;bih=822&quot; title=&quot;atx psu pinout&quot;&gt;Plenty&lt;/a&gt;. When I  plugged in the ATX power source, I measured the voltage on a few pins, but got nothing. Then I remembered the fact that an ATX power supply does not really turn on until the PC tells it to. This is done by shorting pin 14 of the ATX plug (green wire) to ground (black, any will do.) Once I did that, I got all the power I needed.&lt;br /&gt;
&lt;br /&gt;
The pinout on the Xbox side was harder to come by. I had found a few for the old Xbox 360, but none for the new slim model. Fortunately there were some hints on the PSU&#039;s board:&lt;blockquote&gt;Yellow 12V&lt;br /&gt;
Black GND&lt;br /&gt;
Red 5VSB&lt;br /&gt;
Blue PS_ON&lt;br /&gt;
Gray RSENSE&lt;/blockquote&gt;&lt;br /&gt;
I thought I&#039;d check what I could get away with: I connected the yellow wire from the Xbox to the yellow wire of the PSU. Same for the red wires, and black wires, matching the colors. Then, I turned on the power supply by connecting the green wire on pin 14 to a black wire. I pressed the button on the Xbox: success!&lt;br /&gt;
&lt;a class=&quot;serendipity_image_link&quot;  href=&#039;http://lunesu.com/uploads/P1030006.JPG&#039;&gt;&lt;!-- s9ymdb:83 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;83&quot; height=&quot;110&quot;  src=&quot;http://lunesu.com/uploads/P1030006.serendipityThumb.JPG&quot;  alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Having the power supply turned on all the time was not something I liked though. So the next step was to get the power supply to turn on together with the Xbox. By measuring the voltage I saw the blue PS_ON wire being pulled up (~3.3V) when the Xbox wants to turn on. In order to do this, the Xbox needs some power though. This is done by the red &quot;5VSB&quot; wire. The &quot;SB&quot; stands for Stand By. This means that the red wire from the Xbox must not be attached to the red ATX wires, but to the purple wire on pin 9.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://forums.xbox-scene.com/index.php?showtopic=512276&quot; title=&quot;ATX power supply for Xbox 360&quot;&gt;This page &lt;/a&gt;explained how: use a transistor or optocoupler that will connect the green ATX wire to GND when the blue Xbox wire goes up. I had no optocoupler lying around, or so I thought. I then noticed the blown up power supply on the table. There were some things on it that looked a lot like optocouplers. Sure enough:&lt;br /&gt;
&lt;a class=&quot;serendipity_image_link&quot;  href=&#039;http://lunesu.com/uploads/P1030009.JPG&#039;&gt;&lt;!-- s9ymdb:84 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;110&quot; height=&quot;52&quot;  src=&quot;http://lunesu.com/uploads/P1030009.serendipityThumb.JPG&quot;  alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
The datasheet for the EL817 can be found &lt;a href=&quot;http://www.sztuofeng.com/pdf/%E4%BA%BF%E5%85%89EL817.pdf&quot; title=&quot;EL817 datasheet&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
So, pin 1 of the optocoupler (the pin near the dot) will be pulled high, to ~3.3V. We want to give the LED inside about ~1.2V, that leaves 2.1V for a resistor. At about 20mA this means we need a V/I=R 2.1/0.02= ~100 Ohm resistor. 100 Ohm = 10*10, 10 times 10 to the power 1: we need a resistor with Brown, Black, Brown rings. Luckily I found one &lt;img src=&quot;http://lunesu.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
I had everything I needed:&lt;blockquote&gt;Yellow (Xbox) - Yellow (ATX)&lt;br /&gt;
Red (Xbox) - Purple (ATX)&lt;br /&gt;
Blue (Xbox) - Resistor - Optocoupler pin 1&lt;br /&gt;
Black (Xbox) - Black (ATX)&lt;br /&gt;
Optocoupler pin 2 - Black (ATX)&lt;br /&gt;
Optocoupler pin 3 - Black (ATX)&lt;br /&gt;
Optocoupler pin 4 - Green (ATX)&lt;br /&gt;
Gray (Xbox) - unused&lt;/blockquote&gt;&lt;br /&gt;
I had no idea what the gray RSENSE wire was for, so I just ignored it and it worked fine! Once I got everything figured out, I opened up the ATX PSU and removed all the wires I didn&#039;t use. Important: there was a brown wire that got connected to a orange (3.3V) wire IN the ATX power connector. So after cutting of the connector I had to connect the brown wire to 3.3V somewhere inside the PSU.&lt;br /&gt;
&lt;a class=&quot;serendipity_image_link&quot;  href=&#039;http://lunesu.com/uploads/P1030007.JPG&#039;&gt;&lt;!-- s9ymdb:82 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;110&quot; height=&quot;83&quot;  src=&quot;http://lunesu.com/uploads/P1030007.serendipityThumb.JPG&quot;  alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
And all it cost me was an ATX power supply and 1 blister. Not bad &lt;img src=&quot;http://lunesu.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;UPDATE:&lt;/strong&gt; Here&#039;s the schematic for the whole thing:&lt;br /&gt;
&lt;!-- s9ymdb:85 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;566&quot; height=&quot;293&quot;  src=&quot;http://lunesu.com/uploads/xbox360psu.png&quot;  alt=&quot;&quot; /&gt; 
    </content:encoded>

    <pubDate>Mon, 16 Aug 2010 12:37:14 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/118-guid.html</guid>
    
</item>
<item>
    <title>LinkStation playing music!</title>
    <link>http://lunesu.com/index.php?/archives/104-LinkStation-playing-music!.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/104-LinkStation-playing-music!.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=104</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=104</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    Inspired by this page on &lt;a href=&quot;http://buffalo.nas-central.org/wiki/Add_a_USB_sound_card&quot; title=&quot;Add a USB sound card&quot;&gt;NAS-Central&lt;/a&gt;, I ordered a &lt;a href=&quot;http://item.taobao.com/item_detail.jhtml?item_id=50334a3c57df67f334cf4d7b70b6d67c&amp;x_id=db1&quot; title=&quot;USB 5.1声卡&quot;&gt;USB sound card on TaoBao&lt;/a&gt; (15 RMB including delivery!) and plugged it into my &lt;a href=&quot;http://lunesu.com/index.php?/archives/96-Heh.html&quot; title=&quot;Open stock LinkStation&quot;&gt;LinkStation&lt;/a&gt;. A quick &lt;em&gt;dmesg&lt;/em&gt; showed that the device was detected, but not recognized.&lt;br /&gt;
&lt;br /&gt;
The NAS-Central page mentions that some kernel modules are needed to get USB audio to work, but of course, the device does not have these modules by default. After googling for a few hours I still could not find any precompiled modules that matched my LinkStation&#039;s kernel version, 2.6.22. I decided to jump in and try to compile the modules myself.&lt;br /&gt;
&lt;br /&gt;
So how do you compile kernel modules? &lt;br /&gt;
&lt;br /&gt;
Well, first of all you&#039;ll need the correct kernel sources, but that&#039;s easy: &lt;a href=&quot;http://opensource.buffalo.jp/gpl_storage.html&quot; title=&quot;Buffalo NAS sources&quot;&gt;Buffalo provides them&lt;/a&gt;. Download the &lt;em&gt;linux-*&lt;/em&gt; package that matches your NAS.&lt;br /&gt;
&lt;br /&gt;
Now you need a compiler. Turns out Buffalo uses CodeSourcery so we best stick to that as well. Get the pre-compiled cross-compilation toolchain &lt;a href=&quot;http://www.codesourcery.com/sgpp/lite/arm/releases/2005q3-2&quot; title=&quot;CodeSourcery cross-compilation toolchain&quot;&gt;here&lt;/a&gt;. Select &quot;ARM GNU/linux&quot; and the operating system that you will use for building. No need to download the toolchain source.&lt;br /&gt;
&lt;br /&gt;
Before we can compile the modules we need a kernel configuration file. Some Buffalo source packages seem to include it (the file is called &lt;em&gt;.config&lt;/em&gt; and is hidden because of the leading dot) but the one I downloaded did not include one. Copy this file into the root of the folder where you&#039;ve extracted the Buffalo sources. This .config file most likely has all support for audio disabled so we&#039;ll enable it by adding &lt;em&gt;CONFIG_SND=m&lt;/em&gt; (or check whether there&#039;s a &lt;em&gt;CONFIG_SND&lt;/em&gt; present and change that to &lt;em&gt;=m&lt;/em&gt;). The &#039;m&#039; tells the make file to build it as a separately loadable module, instead of building it into the kernel. (Since I didn&#039;t want to change the stock kernel, I had to build loadable modules instead.)&lt;br /&gt;
&lt;br /&gt;
Now the good part starts: &lt;em&gt;make modules&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
The make file should notice the new CONFIG_SND directive and ask you about the specific sound related modules. Make sure you answer &#039;m&#039; to all of &#039;em. You don&#039;t need them all, but figuring which you need/don&#039;t need is too much work.&lt;br /&gt;
&lt;br /&gt;
When make is done we need to &#039;install&#039; the modules, but not in our host/build system of course! Use the INSTALL_MOD_PATH directive to copy the built modules into a separate folder: &lt;em&gt;make modules_install INSTALL_MOD_PATH=/tmp/MyModules&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
When done, copy all the files from /tmp/MyModules/lib/modules/2.6.22.7ownkernel/kernel/sound (recursive) to your NAS. Now comes another the tricky part: loading the needed modules. The module you &lt;strong&gt;need&lt;/strong&gt; is &lt;em&gt;snd-usb-audio&lt;/em&gt; and &lt;em&gt;snd-pcm-oss&lt;/em&gt;, but before this one will need you&#039;ll have to load a couple of others. The normal way this is done is to move the modules into the NAS&#039;s kernel folder and issue a &lt;em&gt;depmod -a&lt;/em&gt; to update the module dependecies and a &lt;em&gt;modprobe snd-usb-audio&lt;/em&gt; to load the module with its dependencies. I did it the wrong way: using &lt;em&gt;insmod&lt;/em&gt; to load each module by hand, and trying to figure out the order in which to load them by trial-and-error. Eventually, &lt;em&gt;insmod snd-usb-audio.ko&lt;/em&gt; loaded without complaints.&lt;br /&gt;
&lt;br /&gt;
Last step: create the device nodes. As per the NAS-Central page:&lt;blockquote&gt;cd /dev&lt;br /&gt;
addgroup audio&lt;br /&gt;
mknod -m 660 mixer c 14 0 ; chgrp audio mixer&lt;br /&gt;
mknod -m 660 mixer1 c 14 16 ; chgrp audio mixer1&lt;br /&gt;
mknod -m 660 dsp c 14 3 ; chgrp audio dsp&lt;br /&gt;
mknod -m 660 dsp1 c 14 19 ; chgrp audio dsp1&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
I am now able to stream music using mpg123, madplay, mpd (all installable using ipkg.)&lt;br /&gt;
&lt;br /&gt;
The sound quality of that 15 RMB sound card sucks though &lt;img src=&quot;http://lunesu.com/templates/default/img/emoticons/sad.png&quot; alt=&quot;:-(&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the final &lt;a href=&quot;http://lunesu.com/uploads/config.bz2&quot; title=&quot;config.bz2&quot; target=&quot;_blank&quot;&gt;.config&lt;/a&gt; file I used to build the sound modules. 
    </content:encoded>

    <pubDate>Fri, 19 Mar 2010 06:02:40 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/104-guid.html</guid>
    
</item>
<item>
    <title>My first published Android app!</title>
    <link>http://lunesu.com/index.php?/archives/103-My-first-published-Android-app!.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/103-My-first-published-Android-app!.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=103</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=103</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    &lt;!-- s9ymdb:69 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;195&quot; height=&quot;195&quot;  src=&quot;http://lunesu.com/uploads/qrcode.png&quot;  alt=&quot;BeijingAir qr code&quot; /&gt;I&#039;ve just finished my first app and have published it on the market! The app is very simple: it shows the current air quality in Beijing, as measured by the US Embassy. Scan the QR Code on the right and my app will pop up in the market app.&lt;br /&gt;
&lt;br /&gt;
(&lt;a href=&quot;http://code.google.com/p/bjair/&quot; title=&quot;BeijingAir project page&quot;&gt;project page on Google code&lt;/a&gt;) 
    </content:encoded>

    <pubDate>Thu, 11 Mar 2010 14:51:47 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/103-guid.html</guid>
    
</item>
<item>
    <title>DKIM: DomainKeys identified mail</title>
    <link>http://lunesu.com/index.php?/archives/101-DKIM-DomainKeys-identified-mail.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/101-DKIM-DomainKeys-identified-mail.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=101</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=101</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    In a last effort to save e-mail from being obsoleted, some guys at Yahoo thought of the DomainKeys system to prevent message spoofing. SMTP servers that are DomainKeys-aware can check the contents of the message to find out whether it was really sent by the person mentioned in the From: mail header.&lt;br /&gt;
&lt;br /&gt;
To be honest, I&#039;m more of a fan of SPF. It&#039;s an incredibly simple protocol and I really can&#039;t think of any reason it shouldn&#039;t be used by any mail server. (Interestingly, the Yahoo mail servers don&#039;t use it, probably to boost acceptance of DomainKeys.)&lt;br /&gt;
&lt;br /&gt;
Let&#039;s explain SPF first, since it so much easier. In a nutshell: SPF uses DNS records to identify which IPs are allowed to send mail for a domain. So a server receiving mail for somebody@example.com would fetch the SPF record from example.com and check whether the IP of the connected SMTP client is actually allowed to send mail originating from the example.com domain. &lt;br /&gt;
&lt;br /&gt;
That&#039;s it, it&#039;s that easy. Since I&#039;m hosting my own mail server, my domain&#039;s SPF record just mentions my mail server&#039;s IP (actually, it doesn&#039;t mention the IP directly, but refers to its DNS A record.) A server receiving an e-mail that was allegedly sent by me will just have to check whether the SMTP client is in fact my own mail server and if it isn&#039;t, reject the mail.&lt;br /&gt;
&lt;br /&gt;
DomainKeys is a little more advanced. Instead of checking the IP, it will check all contents of the message. It&#039;s like the mail server is signing the message on your behalf. Using DKIM, each outgoing message will be signed using the server&#039;s private key, and DKIM signatures present in the incoming message will be checked against the originating server&#039;s public key. That public key, by they way, is distributed using a DNS record, similar to the way SPF records are distributed.&lt;br /&gt;
&lt;br /&gt;
Here are the steps I did to get DKIM working on my server. First, create an RSA key pair:&lt;br /&gt;
&lt;blockquote&gt;openssl genrsa -out private.key 1024&lt;br /&gt;
openssl rsa -in private.key -out public.key -pubout -outform PEM&lt;br /&gt;
sudo mkdir /etc/mail&lt;br /&gt;
sudo cp private.key /etc/mail/dkim.key&lt;br /&gt;
&lt;/blockquote&gt;Now you&#039;ll have to add the public key to your domain(s) DNS entry. Do this by adding a TXT record for &lt;em&gt;selector._domainkeys.yourdomain.com&lt;/em&gt;, where &lt;em&gt;selector &lt;/em&gt;can be anything, but make sure to mention the same selector in the config file.&lt;br /&gt;
&lt;br /&gt;
Next, install dkim-filter and edit the /etc/dkim-filter.conf Domain, KeyFile and Selector settings. Domain= comma separated list of domains for which to sign the mail; KeyFile= path to above keyfile; Selector= domain name prefix.&lt;blockquote&gt;sudo apt-get  install dkim-filter&lt;br /&gt;
sudo vi /etc/dkim-filter.conf&lt;br /&gt;
sudo /etc/init.d/dkim-filter restart&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
Add the following to /etc/postfix/main.conf:&lt;br /&gt;
&lt;blockquote&gt;# DKIM&lt;br /&gt;
milter_default_action = accept&lt;br /&gt;
milter_protocol = 2&lt;br /&gt;
smtpd_milters = inet:localhost:8891&lt;br /&gt;
non_smtpd_milters = inet:localhost:8891&lt;/blockquote&gt;and restart postfix.&lt;br /&gt;
&lt;br /&gt;
To test whether it&#039;s working as it should, send yourself a mail and inspect the headers. Or, you could for example send a mail to a gmail account and gmail will show that the mail is &quot;signed-by&quot; your server. 
    </content:encoded>

    <pubDate>Tue, 09 Mar 2010 04:53:00 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/101-guid.html</guid>
    
</item>
<item>
    <title>Site moved!</title>
    <link>http://lunesu.com/index.php?/archives/100-Site-moved!.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/100-Site-moved!.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=100</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=100</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    I&#039;ve moved this blog from &lt;a href=&quot;http://directnic.com&quot; title=&quot;DirectNic&quot;&gt;directnic.com&lt;/a&gt; to my own VPS. This blog is using &lt;a href=&quot;http://www.s9y.org/&quot; title=&quot;Serendipity Blog Software&quot;&gt;Serendipity&lt;/a&gt;, which consists of a bunch of files for the webserver and a MySQL database. (I during the move I noticed that the new version supports SQLite backend, which would have made this whole process a lot easier.)&lt;br /&gt;
&lt;br /&gt;
What I did:&lt;br /&gt;
&lt;ul&gt;&lt;li/&gt;Copy all files from the old server to the new server, using &lt;a href=&quot;http://www.ncftp.com/&quot; title=&quot;NcFTP&quot;&gt;ncftp&lt;/a&gt;&#039;s recursive mget.&lt;br /&gt;
&lt;li/&gt;Dump the MySQL database using &lt;em&gt;mysqldump&lt;/em&gt;&lt;br /&gt;
&lt;li/&gt;In MySQL client: create a new database using &lt;em&gt;CREATE DATABASE xxx&lt;/em&gt;, select it using &lt;em&gt;use xxx&lt;/em&gt; and execute the exported SQL script using &lt;em&gt;source dumpfile&lt;/em&gt;&lt;br /&gt;
&lt;li/&gt;Configure an Apache virtual server for the lunesu.com domain. Note to self: must check &lt;em&gt;Include all addresses&lt;/em&gt; in Webmin&#039;s &lt;em&gt;Networking and Addresses&lt;/em&gt; Apache configuration tab.&lt;br /&gt;
&lt;li/&gt;Apply the new Apache configuration.&lt;br /&gt;
&lt;li/&gt;Add lunesu.com to my local &lt;em&gt;hosts&lt;/em&gt; file, to be able to test the new site without having to change the DNS settings.&lt;br /&gt;
&lt;li/&gt;Oops: ncftp did not get the &lt;em&gt;serendipity_config_local.inc.php&lt;/em&gt; because it was readable by user httpd only! The only way I was able to copy this file was by uploading a dummy PHP script with the following contents: &lt;em&gt;&amp;lt;? header(&#039;Content-Type: text/plain&#039; ); readfile(&quot;serendipity_config_local.inc.php&quot;);&lt;/em&gt;&lt;br /&gt;
&lt;li/&gt;&lt;em&gt;UPDATE serendipityConfig SET value=&quot;/var/bla/path&quot; where name=&quot;serendipityPath&quot;;&lt;/em&gt;&lt;br /&gt;
&lt;li/&gt;I also had to change some folder permissions: &lt;em&gt;chmod 1777 . archives upload plugins templates_c&lt;/em&gt;&lt;br /&gt;
&lt;/ul&gt;&lt;br /&gt;
The serendipity Weather sidebar plugin failed to work. I read that it needs the PEAR:Services-and-Weather module for PHP so I installed that using &lt;em&gt;sudo apt-get install php-services-weather&lt;/em&gt;. Unfortunately, that completely borked my site. I was able to track this down to a function in Serendipity called get_plugin_title. Apparently, even with that module installed, the weather plugin still wouldn&#039;t work. Fix: disable the weather plugin. 
    </content:encoded>

    <pubDate>Sat, 27 Feb 2010 10:25:22 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/100-guid.html</guid>
    
</item>
<item>
    <title>Mail troubles</title>
    <link>http://lunesu.com/index.php?/archives/83-Mail-troubles.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/83-Mail-troubles.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=83</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=83</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    Back from holiday, no job, but my lunesu.com mail stopped working so that should keep me busy a couple of weeks.&lt;br /&gt;
&lt;br /&gt;
The mail (like this site) was still hosted at directnic, so when their mail server stopped working this morning I had enough motivation to move my lunesu.com mail to my new VPS.&lt;br /&gt;
&lt;br /&gt;
Since &lt;a href=&quot;http://www.postfix.org/&quot; title=&quot;The Postfix mail server&quot;&gt;postfix &lt;/a&gt;was up and running from the beginning, there was little left to do. I just had to instruct postfix to accept mail from all my domains, not just the main one from the hostname. This could be done from within webmin: &lt;em&gt;Server, Postfix Mail Server, General Options, What domains to receive mail for&lt;/em&gt;. Select the last option. I just appended lunesu.com to the comma separated domain list. Click &lt;em&gt;Save and apply&lt;/em&gt;.&lt;br /&gt;
&lt;br /&gt;
Next step: fix the certificate warning I get when trying to send mail through my own server. The fix: in Webmin&#039;s Postfix page, select &lt;em&gt;SMTP Authentication And Encryption&lt;/em&gt;. Change the paths of the certificate and private key files to the &lt;a href=&quot;http://lunesu.com/index.php?/archives/80-Creating-my-own-keys.html&quot; title=&quot;Creating my own keys&quot;&gt;ones created before&lt;/a&gt;. Save.&lt;br /&gt;
&lt;br /&gt;
I also use a lot of aliases. Basically, I create a new mail alias each time a vague site wants my email address. Since I have about 25 aliases, I use Webmin&#039;s &lt;em&gt;Edit Map Manually&lt;/em&gt; option in its &lt;em&gt;Mail Aliases&lt;/em&gt; page. This works fine, but it won&#039;t be applied automatically after save! I had to run the following command as root for the aliases to start working:&lt;br /&gt;
&lt;blockquote&gt;newaliases&lt;/blockquote&gt;&lt;br /&gt;
Another thing I noticed is that Postifx apparently always recognizes addresses of the form &lt;em&gt;account+suffix@domain&lt;/em&gt; and delivers them to &lt;em&gt;account&lt;/em&gt;, without the suffix. This how I made most of my aliases in the first place, so all of those with a plus sign could be removed from the aliases map. (Of course, the part before the plus sign must still be an existing account name or alias.)&lt;br /&gt;
&lt;br /&gt;
So, most of it seems to be working at the moment, but no anti-spam yet, which is really the next thing I need to figure out before I get drowned in spam messages. 
    </content:encoded>

    <pubDate>Thu, 10 Sep 2009 14:52:02 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/83-guid.html</guid>
    
</item>
<item>
    <title>Static assert in C#!</title>
    <link>http://lunesu.com/index.php?/archives/62-Static-assert-in-C!.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/62-Static-assert-in-C!.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=62</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=62</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    &lt;blockquote&gt;&lt;br /&gt;
partial class StaticAssert&lt;br /&gt;
{&lt;br /&gt;
	byte a = RenderQuality.Low &lt; RenderQuality.Medium ? 0 : -1;&lt;br /&gt;
	byte b = RenderQuality.Medium &lt; RenderQuality.High ? 0 : -1;&lt;br /&gt;
}&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
Apparently ?: is being folded at compile time, resulting in the following error if the constant expression before it evaluates to false:&lt;br /&gt;
&lt;blockquote&gt;Constant value &#039;-1&#039; cannot be converted to a &#039;byte&#039;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
I use partial class to prevent collisions with multiple static asserts in the same namespace, although you will still have to come up with unique variable names.&lt;br /&gt;
&lt;br /&gt;
Also, I&#039;ve hidden my post about [tee&#039;bet] to see if that will lift the blockade of my site in China. 
    </content:encoded>

    <pubDate>Tue, 17 Feb 2009 08:48:27 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/62-guid.html</guid>
    
</item>
<item>
    <title>How to change the language for GIMP/SVN</title>
    <link>http://lunesu.com/index.php?/archives/3-How-to-change-the-language-for-GIMPSVN.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/3-How-to-change-the-language-for-GIMPSVN.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=3</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=3</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    The language for the GIMP and the SubVersion command line tools can be changed to another language by setting the LANG-environmentvariable to &quot;en&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;LANG=en&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Wed, 07 Nov 2007 14:01:00 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/3-guid.html</guid>
    
</item>
<item>
    <title>Tunneling wget</title>
    <link>http://lunesu.com/index.php?/archives/20-Tunneling-wget.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/20-Tunneling-wget.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=20</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=20</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    It&#039;s too bad wget does not support a SOCKS proxy. To tunnel wget through an SSH tunnel you&#039;ll have to rely on a statically mapped port:&lt;br /&gt;
&lt;blockquote&gt;plink -L 8080:example.com:80 server&lt;/blockquote&gt;&lt;br /&gt;
This command opens a local TCP port 8080 and routes all connections to &lt;em&gt;example.com&lt;/em&gt; port 80, using an SSH connection to &lt;em&gt;server&lt;/em&gt;. Here, &lt;em&gt;server&lt;/em&gt; can be either  the URL or IP of an SSH server or the name of a putty profile. &lt;br /&gt;
&lt;br /&gt;
wget can now be pointed to the &lt;em&gt;localhost:8080&lt;/em&gt;, but this won&#039;t work if the HTTP server is using virtual hosts. Use the &lt;em&gt;--header=&lt;/em&gt; option to insert a fake host string in the HTTP request:&lt;br /&gt;
&lt;blockquote&gt;wget --header=&quot;Host: example.com&quot; http://localhost:8080/.....&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Tue, 10 Apr 2007 06:02:00 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/20-guid.html</guid>
    
</item>
<item>
    <title>How to add a reference to an assembly inside the GAC</title>
    <link>http://lunesu.com/index.php?/archives/6-How-to-add-a-reference-to-an-assembly-inside-the-GAC.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/6-How-to-add-a-reference-to-an-assembly-inside-the-GAC.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=6</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=6</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    From &lt;a href=&quot;http://www.mztools.com/articles/2008/..%5C2007%5CMZ2007012.aspx&quot;&gt;mztools.com&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
You can follow this procedure to extract the assembly from the GAC:&lt;br /&gt;
&lt;br /&gt;
Open a MS-DOS command window (click Start, Run... type cmd and press enter) &lt;br /&gt;
Use the SUBST command to map a drive letter to the GAC folder: &lt;br /&gt;
&lt;blockquote&gt;SUBST G: C:\Windows\Assembly&lt;/blockquote&gt;&lt;br /&gt;
That maps the drive letter G: to the GAC folder. With the SUBST command you bypass the shell extension.&lt;br /&gt;
&lt;br /&gt;
Use Windows Explorer to browse the G: folder. You will see the actual folders, with names like GAC, GAC_32, GAC_MSIL and one subfolder for each assembly. Once you locate the assembly DLL that you are looking for, you can copy it outside the GAC, to the \bin folder of your add-in project and add a reference to it. &lt;br /&gt;
&lt;br /&gt;
When done, you can undo the mapping using:&lt;br /&gt;
&lt;blockquote&gt;SUBST G: /D &lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Sun, 04 Mar 2007 05:41:00 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/6-guid.html</guid>
    
</item>
<item>
    <title>Outlook and OE address book support in Thunderbird</title>
    <link>http://lunesu.com/index.php?/archives/5-Outlook-and-OE-address-book-support-in-Thunderbird.html</link>
            <category>Knowledge Base</category>
    
    <comments>http://lunesu.com/index.php?/archives/5-Outlook-and-OE-address-book-support-in-Thunderbird.html#comments</comments>
    <wfw:comment>http://lunesu.com/wfwcomment.php?cid=5</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://lunesu.com/rss.php?version=2.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    

    <author>nospam@example.com (Lio)</author>
    <content:encoded>
    From &lt;a href=&quot;http://ilias.ca/blog/2006/03/outlook-and-oe-address-book-support-in-thunderbird/&quot; title=&quot;Chris Ilias&#039; Blog&quot;&gt;Chris Ilias&#039; Blog&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
To make Thunderbird use your Outlook Express address book, close Thunderbird, and add the following lines to your prefs.js file:&lt;br /&gt;
&lt;blockquote&gt;user_pref(&quot;ldap_2.servers.OE.description&quot;, &quot;Outlook Express&quot;);&lt;br /&gt;
user_pref(&quot;ldap_2.servers.OE.dirType&quot;, 3);&lt;br /&gt;
user_pref(&quot;ldap_2.servers.OE.uri&quot;, &quot;moz-aboutlookdirectory://oe/&quot;);&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
For Outlook Contacts, use these lines:&lt;br /&gt;
&lt;blockquote&gt;user_pref(&quot;ldap_2.servers.Outlook.description&quot;, &quot;Outlook&quot;);&lt;br /&gt;
user_pref(&quot;ldap_2.servers.Outlook.dirType&quot;, 3);&lt;br /&gt;
user_pref(&quot;ldap_2.servers.Outlook.uri&quot;, &quot;moz-aboutlookdirectory://op/&quot;);&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
One important note: in order for it to work with Outlook, Outlook must be set as the system default mail client. 
    </content:encoded>

    <pubDate>Sun, 04 Mar 2007 00:17:00 +0000</pubDate>
    <guid isPermaLink="false">http://lunesu.com/index.php?/archives/5-guid.html</guid>
    
</item>

</channel>
</rss>