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

<channel>
	<title>Space Station Lambda &#187; Hack</title>
	<atom:link href="http://blog.viridian-project.de/sections/hack/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.viridian-project.de</link>
	<description>Leslie P. Polzer on code, music, literature, design and free software business.</description>
	<lastBuildDate>Wed, 19 May 2010 07:44:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Starcraft on VirtualBox (and Hamachi)</title>
		<link>http://blog.viridian-project.de/2009/06/24/starcraft-on-virtualbox-and-hamachi/</link>
		<comments>http://blog.viridian-project.de/2009/06/24/starcraft-on-virtualbox-and-hamachi/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 20:37:35 +0000</pubDate>
		<dc:creator>Leslie</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[broodwar]]></category>
		<category><![CDATA[dib]]></category>
		<category><![CDATA[hamachi]]></category>
		<category><![CDATA[scbw]]></category>
		<category><![CDATA[slow]]></category>
		<category><![CDATA[starcraft]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://blog.viridian-project.de/?p=166</guid>
		<description><![CDATA[Rationale Starcraft on Wine is horribly slow due to the missing DIB engine. Handling DIBs is a crucial component when it comes to fast 2D drawing. Other games like Age of Empires and even applications like Adobe Photoshop are affected by this weakness in Wine. Work on this has started last year as a Summer [...]]]></description>
			<content:encoded><![CDATA[<h2>Rationale</h2>
<p>Starcraft on Wine is horribly slow due to the missing <a href="http://wiki.winehq.org/DIBEngine">DIB engine</a>.</p>
<p>Handling DIBs is a crucial component when it comes to fast 2D drawing. Other games like Age of Empires and even applications like Adobe Photoshop are affected by this weakness in Wine.</p>
<p>Work on this has started last year as a Summer of Code program, but progress has slowed down recently.</p>
<p>All in all I guess we won&#8217;t get a usable implementation within the next few years except if another dedicated effort is spent on it.</p>
<h2>Enter VirtualBox</h2>
<p>Luckily another solution has come up recently: Sun&#8217;s <a href="http://www.virtualbox.org/">VirtualBox</a> virtualization product is free (as in beer and freedom), easy to use and works well enough with Starcraft.</p>
<p>Here&#8217;s my basic setup: VirtualBox 3.0.0 (in beta state right now but so far it hasn&#8217;t crashed on me) with guest additions, Windows XP and Starcraft Brood War 1.16.1.</p>
<p>I have enabled DirectDraw acceleration and bridging as network mode in VirtualBox. Both are simple point-and-click settings; you need to make sure the <tt>vboxnetflt</tt> module is loaded, though.</p>
<p>All of Starcraft is usable and very importantly fast.</p>
<h2>Resolution issues</h2>
<p><strong>Update:</strong> You can just use <a href="http://www.virtualbox.org/manual/UserManual.html#vboxsdl"><code>VBoxSDL</code></a> to start your VM in proper fullscreen mode without jumping through the hoops below. Makes it much more convenient and reliable.</p>
<p>VirtualBox does not have a real full-screen mode. With the guest additions you&#8217;re able to get a Desktop that resizes automatically to fit, but fixed resolutions (Starcraft uses 640&#215;480) will not be scaled up to fill the VirtualBox window or the whole screen.</p>
<p>I have tried <a href="http://www.x.org/wiki/Projects/XRandR">XRandR</a> but it just made the viewport smaller which is worse than useless.</p>
<p>The kludge here is to copy over your X config, remove all resolutions except for 640&#215;480 and start a new X server. I cannot go into the full detail here but it boils down to this:</p>
<pre>
xinit /home/sky/scripts/xinitrc.2 -display :1 \
  -- :1 -ac -config xorg.conf.lowres
</pre>
<p>Put in some lightweight window manager or VirtualBox itself at the end of <tt>xinitrc.2</tt>.</p>
<p>After that just use VirtualBox as you have before and switch to full screen.</p>
<p>You should be ready to get the full experience of playing Starcraft now!</p>
<h2>Bonus: Hamachi integration</h2>
<p><a href="https://secure.logmein.com/products/hamachi/vpn.asp?lang=en">Hamachi</a> is a proprietary cross-platform VPN solution that is also beginner-friendly and gratis. It works well with my VirtualBox setup, too.</p>
<p>However the latest version (1.0.3.0) does seem to have some problems with UDP networking.</p>
<p>Downgrading to <a href="http://www.filehippo.com/download_hamachi/2101/">1.0.1.4</a> helped, and I was even able to play Starcraft via a VPN. Don&#8217;t forget to turn off the helpful Windows firewall least it might interfere with your network.</p>
<h2>Did this post help you?</h2>
<p>If yes, then I&#8217;d like to know about it. Please also tell me about other games that work or don&#8217;t work with this setup.</p>
<p>If you&#8217;re really happy about it you may also <a href="http://www.amazon.de/gp/registry/registry.html?ie=UTF8&#038;type=wishlist&#038;id=2NRMXK4NC27QE">send me a gift</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.viridian-project.de/2009/06/24/starcraft-on-virtualbox-and-hamachi/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Partial MP3 decoder in Haskell</title>
		<link>http://blog.viridian-project.de/2008/10/06/partial-mp3-decoder-in-haskell/</link>
		<comments>http://blog.viridian-project.de/2008/10/06/partial-mp3-decoder-in-haskell/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 12:06:37 +0000</pubDate>
		<dc:creator>Leslie</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[decoder]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[mp3]]></category>

		<guid isPermaLink="false">http://blog.viridian-project.de/?p=135</guid>
		<description><![CDATA[Here&#8217;s a partially conforming MP3 decoder in Haskell. It looks pretty clean even to me, not being a Haskell programmer. Who&#8217;s up for it in Common Lisp? :)]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a <a href="http://blog.bjrn.se/2008/10/lets-build-mp3-decoder.html">partially conforming MP3 decoder in Haskell</a>.</p>
<p>It looks pretty clean even to me, not being a Haskell programmer.</p>
<p>Who&#8217;s up for it in Common Lisp? :)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.viridian-project.de/2008/10/06/partial-mp3-decoder-in-haskell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hard Disk Sentinel</title>
		<link>http://blog.viridian-project.de/2008/09/28/hard-disk-sentinel/</link>
		<comments>http://blog.viridian-project.de/2008/09/28/hard-disk-sentinel/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 12:27:00 +0000</pubDate>
		<dc:creator>Leslie</dc:creator>
				<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[aur]]></category>
		<category><![CDATA[failure]]></category>
		<category><![CDATA[hard disk]]></category>
		<category><![CDATA[hdd]]></category>
		<category><![CDATA[hdsentinel]]></category>
		<category><![CDATA[prediction]]></category>
		<category><![CDATA[smart]]></category>

		<guid isPermaLink="false">http://blog.viridian-project.de/?p=109</guid>
		<description><![CDATA[HDSentinel is an utility that interprets the SMART information of your hard disk drives. Their flagship product is an extensive GUI tool for Win32, but they also have a small command-line application for GNU/Linux. It was recently uploaded to ArchLinux AUR and I gave it a whirl. Its output for one of my disks claimed [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.hdsentinel.com/">HDSentinel</a> is an utility that interprets the <a href="http://en.wikipedia.org/wiki/Self-Monitoring,_Analysis,_and_Reporting_Technology">SMART</a> information of your hard disk drives. Their flagship product is an extensive GUI tool for Win32, but they also have a <a href="http://www.hdsentinel.com/hdslin.php">small command-line application for GNU/Linux</a>.</p>
<p>It was recently <a href="http://aur.archlinux.org/packages.php?ID=20276">uploaded to ArchLinux AUR</a> and I gave it a whirl.</p>
<p>Its output for one of my disks claimed it to be close to failure:</p>
<pre>
HDD Device  2: /dev/sda
HDD Model ID : ST3160023A
HDD Serial No: 5JS2NX0R
HDD Revision : 3.06
HDD Size     : 152628 MB
Interface    : IDE/ATA
Temperature  : 42 °C
Health       : 13 %
Performance  : 100 %
Power on time: 658 days, 7 hours
Est. lifetime: 19 days
</pre>
<p>The <a href="http://www.hdsentinel.com/smart/index.php">theory behind HDSentinel</a> seems sound, so I&#8217;m looking forward to see whether the prediction will hold.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.viridian-project.de/2008/09/28/hard-disk-sentinel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Finance::Quote to watch exchange rates</title>
		<link>http://blog.viridian-project.de/2008/09/13/using-financequote-to-watch-exchange-rates/</link>
		<comments>http://blog.viridian-project.de/2008/09/13/using-financequote-to-watch-exchange-rates/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 09:04:44 +0000</pubDate>
		<dc:creator>Leslie</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[currencies]]></category>
		<category><![CDATA[currency]]></category>
		<category><![CDATA[dollar]]></category>
		<category><![CDATA[eur]]></category>
		<category><![CDATA[euro]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[quick]]></category>
		<category><![CDATA[rate]]></category>
		<category><![CDATA[rates]]></category>
		<category><![CDATA[usd]]></category>

		<guid isPermaLink="false">http://blog.viridian-project.de/?p=103</guid>
		<description><![CDATA[Since I&#8217;m often receiving payments in USD I need to keep track of the USD/EUR exchange rates. I don&#8217;t want to run any GUI apps for that though or visit web sites, so I just slightly adapted the Finance::Quote Perl module&#8217;s simple example to do what I need: #!/usr/bin/perl &#160; use Finance::Quote; &#160; $q = [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m often receiving payments in USD I need to keep track of the USD/EUR exchange rates.</p>
<p>I don&#8217;t want to run any GUI apps for that though or visit web sites, so I just slightly adapted the <a href="http://search.cpan.org/dist/Finance-Quote/lib/Finance/Quote.pm">Finance::Quote</a> Perl module&#8217;s <a href="http://search.cpan.org/dist/Finance-Quote/lib/Finance/Quote.pm#SYNOPSIS">simple example</a> to do what I need:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> Finance<span style="color: #339933;">::</span><span style="color: #006600;">Quote</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$q</span> <span style="color: #339933;">=</span> Finance<span style="color: #339933;">::</span><span style="color: #006600;">Quote</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$q</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">timeout</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$q</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">currency</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;USD&quot;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;EUR&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>A functional interface for trivial queries like that would be nice in any case. Finance::Quote has one but it&#8217;s deprecated; maybe the authors are Java zealots.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.viridian-project.de/2008/09/13/using-financequote-to-watch-exchange-rates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trimming silence at the beginning and end of an audio file</title>
		<link>http://blog.viridian-project.de/2008/07/03/trimming-silence-at-the-beginning-and-end-of-an-audio-file/</link>
		<comments>http://blog.viridian-project.de/2008/07/03/trimming-silence-at-the-beginning-and-end-of-an-audio-file/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 13:31:50 +0000</pubDate>
		<dc:creator>Leslie</dc:creator>
				<category><![CDATA[GNU/Linux Audio Production]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[beginning]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[end]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[silence]]></category>
		<category><![CDATA[trim]]></category>
		<category><![CDATA[trimming]]></category>

		<guid isPermaLink="false">http://blog.viridian-project.de/?p=81</guid>
		<description><![CDATA[Here&#8217;s a simple shell script that uses the amazing Ecasound to remove any silence from the beginning and end of an audio file: #!/bin/sh # # from http://osdir.com/ml/audio.ecasound.general/2005-08/msg00002.html # # description: removes silence from the beginning and the end # of a file # version: 20050807-1 # usage: ecatrimsilence.sh &#60;inputfile&#62; &#160; tmp=ecatrimsilence-tmp.wav &#160; if test [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple shell script that uses the amazing <a href="http://www.eca.cx/ecasound/">Ecasound</a> to remove any silence from the beginning and end of an audio file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># from http://osdir.com/ml/audio.ecasound.general/2005-08/msg00002.html</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># description: removes silence from the beginning and the end</span>
<span style="color: #666666; font-style: italic;">#              of a file</span>
<span style="color: #666666; font-style: italic;"># version: 20050807-1</span>
<span style="color: #666666; font-style: italic;"># usage: ecatrimsilence.sh &lt;inputfile&gt;</span>
&nbsp;
<span style="color: #007800;">tmp</span>=ecatrimsilence-tmp.wav
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$tmp</span>&quot;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;error: temp file <span style="color: #007800;">$tmp</span> exists, unable to continue...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;$1&quot;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;error: input file $1 does not exist, unable to continue...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">2</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">format</span>=<span style="color: #000000; font-weight: bold;">`</span>ecalength <span style="color: #660033;">-sf</span> <span style="color: #ff0000;">&quot;$1&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Trimming file <span style="color: #007800;">${1}</span>.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Removing silence at the end...&quot;</span>
ecasound <span style="color: #660033;">-q</span> -f:<span style="color: #800000;">${format}</span> <span style="color: #660033;">-i</span> reverse,<span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${tmp}</span>&quot;</span> -ge:<span style="color: #000000;">1</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> -b:<span style="color: #000000;">256</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Removing silence at the beginning...&quot;</span>
ecasound <span style="color: #660033;">-q</span> -f:<span style="color: #800000;">${format}</span> <span style="color: #660033;">-i</span> reverse,<span style="color: #ff0000;">&quot;<span style="color: #007800;">${tmp}</span>&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span> -ge:<span style="color: #000000;">1</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> -b:<span style="color: #000000;">256</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${tmp}</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Done.&quot;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>inputfile<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>I know some GUI programs that offer this functionality (Audacity, for example), but no other command-line tool.</p>
<p>Do you?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.viridian-project.de/2008/07/03/trimming-silence-at-the-beginning-and-end-of-an-audio-file/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Unicode nickname support in UnrealIRCd</title>
		<link>http://blog.viridian-project.de/2008/05/15/unicode-nickname-support-in-unrealircd/</link>
		<comments>http://blog.viridian-project.de/2008/05/15/unicode-nickname-support-in-unrealircd/#comments</comments>
		<pubDate>Thu, 15 May 2008 08:05:13 +0000</pubDate>
		<dc:creator>Leslie</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[codepage]]></category>
		<category><![CDATA[codepages]]></category>
		<category><![CDATA[irc daemon]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[unrealircd]]></category>
		<category><![CDATA[utf-16]]></category>
		<category><![CDATA[utf-8]]></category>
		<category><![CDATA[utf16]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://blog.viridian-project.de/?p=76</guid>
		<description><![CDATA[A recent release of UnrealIRCd has brought us support for some latin codepages and even mulitbyte encodings. Unicode, however, is not included, so that it looks a bit like a kludge. But there&#8217;s a comprehensive discussion along with patches for better codepage support in the project&#8217;s bug tracker. Unfortunately, some of the patches are not [...]]]></description>
			<content:encoded><![CDATA[<p>A recent release of UnrealIRCd has brought us support for some latin codepages and even mulitbyte encodings. Unicode, however, is not included, so that it looks a bit like a kludge.</p>
<p>But there&#8217;s a <a href="http://bugs.unrealircd.org/print_bug_page.php?bug_id=2852">comprehensive discussion along with patches</a> for better codepage support in the project&#8217;s bug tracker. Unfortunately, some of the patches are not done right, and the rest of them are a bit, uh, stale.</p>
<p>This procedure worked for me:</p>
<ol>
<li>Get UnrealIRCd 3.2.5 (3.2.x might work, too)</li>
<li>Patch with <code>unreal3.2.5.cvs.codepages-2.diff</code> (allowed fuzz of five or so)</li>
<li>Edit <code>src/modules/Makefile.in</code> manually (the patch was rejected here for me), adding <code>m_names.so m_codepage.so</code> to R_MODULES and COMMANDS.</li>
<li>To allow full UTF8 nick names, change the conditional in <code>src/modules/m_nick.c</code> around line 150 to read:

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">        <span style="color: #808080; font-style: italic;">/* For a local clients, do proper nickname checking via do_nick_name()
         * and reject the nick if it returns false.
         * For remote clients, do a quick check by using do_remote_nick_name(),
         * if this returned false then reject and kill it. -- Syzop
         */</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>do_remote_nick_name<span style="color: #009900;">&#40;</span>nick<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #808080; font-style: italic;">/* just do some basic checking */</span>
        <span style="color: #009900;">&#123;</span></pre></div></div>

<p>That way you still won&#8217;t have</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">\xA0<span style="color: #339933;">!+%</span>@<span style="color: #339933;">&amp;</span>~<span style="color: #339933;">#$:'\&quot;?*,.</span></pre></div></div>

<p>but I guess this is a limitation of the IRC protocol.</p>
<p>After that you should be ready to run <code>./Config &#038;&#038; make</code>, and set up your <code>unrealircd.conf</code>. It&#8217;s best to also enabled UTF-8 as the default in <code>codepage.conf</code>.</p>
<p>Happy hacking!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.viridian-project.de/2008/05/15/unicode-nickname-support-in-unrealircd/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Poor man&#8217;s ALSA sound server</title>
		<link>http://blog.viridian-project.de/2008/04/05/poor-mans-alsa-sound-server/</link>
		<comments>http://blog.viridian-project.de/2008/04/05/poor-mans-alsa-sound-server/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 09:57:52 +0000</pubDate>
		<dc:creator>Leslie</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[alsa]]></category>
		<category><![CDATA[aplay]]></category>
		<category><![CDATA[arecord]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[kiss]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[netcat]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[sound server]]></category>
		<category><![CDATA[trivial]]></category>

		<guid isPermaLink="false">http://blog.viridian-project.de/2008/04/05/poor-mans-alsa-sound-server/</guid>
		<description><![CDATA[I&#8217;m currently visiting my family, and an inevitable part of it is playing some good old games with my brothers. The hardware situation here is a bit peculiar, though; I need to play on two different machines, and only one of them has speakers. Those speakers are built-in, too, so I can&#8217;t change them easily. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently visiting my family, and an inevitable part of it is playing some good old games with my brothers. The hardware situation here is a bit peculiar, though; I need to play on two different machines, and only one of them has speakers.</p>
<p>Those speakers are built-in, too, so I can&#8217;t change them easily.<br />
No problem, there&#8217;s <a href="http://www.tux.org/~ricdude/EsounD.html">ESD</a>, right? Well. The Enlightened Sound Daemon might have deserved its name when it was released, but since then a bunch of years have passed and it didn&#8217;t show acceptable quality when I tried it here.</p>
<p><a href="http://www.pulseaudio.org/">PulseAudio</a> to the rescue! This modern solution runs even on Microsoft Windows (although not on the 9x series, it seems), has dead simple GUI tools and is the best thing since sliced bread. A real sports car.<br />
Except, for some unknown reason, I couldn&#8217;t get it to work on one of the machines in question. No sliced bread for me, I guess.</p>
<p>But then I came across a real slick solution in the ALSA wiki: a <a href="http://alsa.opensrc.org/index.php/Network">sound server using Netcat and the out-of-the-box ALSA utilities <em>aplay</em> and <em>arecord</em></a>.</p>
<p>Setup is as simple as:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># on the server:</span>
nc <span style="color: #660033;">-u</span> <span style="color: #660033;">-l</span> <span style="color: #660033;">-p</span> <span style="color: #000000;">9999</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">aplay</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># on the client</span>
<span style="color: #c20cb9; font-weight: bold;">arecord</span> <span style="color: #660033;">-t</span> wav <span style="color: #660033;">-f</span> <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">|</span> nc <span style="color: #660033;">-u</span> SERVER <span style="color: #000000;">9999</span></pre></div></div>

<p>Now just set your recording source via <code>alsamixer -Vc</code> to &#8220;Mix&#8221; and adjust the output volume levels on client, server and speaker.</p>
<p>Made me slap my head &#8217;cause I didn&#8217;t think of it myself.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.viridian-project.de/2008/04/05/poor-mans-alsa-sound-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A minimalistic web site compiler</title>
		<link>http://blog.viridian-project.de/2008/03/18/a-minimalistic-web-site-compiler/</link>
		<comments>http://blog.viridian-project.de/2008/03/18/a-minimalistic-web-site-compiler/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 12:00:05 +0000</pubDate>
		<dc:creator>Leslie</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web engineering]]></category>
		<category><![CDATA[clean]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[generation]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[kiss]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[static]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[templating]]></category>

		<guid isPermaLink="false">http://blog.viridian-project.de/2008/03/18/a-minimalistic-web-site-compiler/</guid>
		<description><![CDATA[The setup of small non-dynamic web sites is an often recurring task. Unfortunately, there&#8217;s a lot of repeated content, most of it in the header of the sites that doesn&#8217;t change except for the title. SSI doesn&#8217;t really help because its syntax is clumsy and the files are compiled again on each request. It also [...]]]></description>
			<content:encoded><![CDATA[<p>The setup of small non-dynamic web sites is an often recurring task. Unfortunately, there&#8217;s a lot of repeated content, most of it in the header of the sites that doesn&#8217;t change except for the title.</p>
<p>SSI doesn&#8217;t really help because its syntax is clumsy and the files are compiled again on each request. It also needs to be enabled on the target host.</p>
<p>A solution that compiles standard HTML from templates is best for performance and portability. It&#8217;s possible to use on of the many HTML template toolkits out there, but why bother? All I want is a standardized header and footer and a page title varying with each HTML file.</p>
<p>So let&#8217;s do just that:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">-e</span>
&nbsp;
<span style="color: #007800;">OUTDIR</span>=.<span style="color: #000000; font-weight: bold;">/</span>build
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$OUTDIR</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># wrap header and footer, set &lt;title&gt; from first line of body</span>
<span style="color: #000000; font-weight: bold;">for</span> f <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>page1,page2,page3<span style="color: #7a0874; font-weight: bold;">&#125;</span>.html; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #007800;">TITLE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-n1</span> <span style="color: #007800;">$f</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-p</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^TITLE: *(.*?)$/$1/'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s|TITLE|<span style="color: #007800;">$TITLE</span>|&quot;</span> header.html ;
   <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'1d'</span> <span style="color: #007800;">$f</span>;
   <span style="color: #c20cb9; font-weight: bold;">cat</span> footer.html<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$OUTDIR</span>/<span style="color: #007800;">$f</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># auxiliary files</span>
<span style="color: #000000; font-weight: bold;">for</span> f <span style="color: #000000; font-weight: bold;">in</span> logo.png default.css; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #007800;">$f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$OUTDIR</span>/<span style="color: #007800;">$f</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>title<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>The files that get wrapped into header and footer need to set their title on the first line:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">TITLE: my page title
&lt;p&gt;So this is it...&lt;/p&gt;</pre></div></div>

<p>If you don&#8217;t like Perl, you can also whip up a sed or awk script in its place.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.viridian-project.de/2008/03/18/a-minimalistic-web-site-compiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classical hack: Apache httpd as CMS</title>
		<link>http://blog.viridian-project.de/2008/01/13/classical-hack-apache-httpd-as-cms/</link>
		<comments>http://blog.viridian-project.de/2008/01/13/classical-hack-apache-httpd-as-cms/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 11:50:38 +0000</pubDate>
		<dc:creator>Leslie</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[Web engineering]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[content management]]></category>
		<category><![CDATA[content management system]]></category>
		<category><![CDATA[elegant]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[kiss]]></category>
		<category><![CDATA[simple]]></category>

		<guid isPermaLink="false">http://blog.viridian-project.de/2008/01/13/classical-hack-apache-httpd-as-cms/</guid>
		<description><![CDATA[In search of a light-weight content management system, I came across this KISS solution. It&#8217;s obviously not really a CMS that one would install for a customer, but it&#8217;s a nice thing for your typical software projects: a flock of small pages gathering around the most important thing, namely the downloads. Well done!]]></description>
			<content:encoded><![CDATA[<p>In search of a light-weight content management system, I came across <a href="http://www.webcodr.com/34/build-a-lightweight-cms-using-htaccess/">this KISS solution</a>.</p>
<p>It&#8217;s obviously not really a CMS that one would install for a customer, but it&#8217;s a nice thing<br />
for your typical software projects: a flock of small pages gathering around the most important thing,<br />
namely the downloads.</p>
<p>Well done!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.viridian-project.de/2008/01/13/classical-hack-apache-httpd-as-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
