<?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>Draakwired &#187; Drakonen</title>
	<atom:link href="http://drakonen.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://drakonen.com</link>
	<description>Here be Dragons  -  Drakonen&#039;s Blog</description>
	<lastBuildDate>Mon, 23 Jan 2012 12:53:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Javascript parent constructor being run when defining inheritance and a solution</title>
		<link>http://drakonen.com/2012/javascript-parent-constructor-being-run-when-defining-inheritance-and-a-solution/</link>
		<comments>http://drakonen.com/2012/javascript-parent-constructor-being-run-when-defining-inheritance-and-a-solution/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 12:53:32 +0000</pubDate>
		<dc:creator>Drakonen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://drakonen.com/?p=188</guid>
		<description><![CDATA[When using the traditional Javascript methods to do some sort of inheritance, the constructor of the parent will always be run when trying to inherit it. This seems to be a unfortunate side effect of using new a(). The problem Consider this code. Here b inherits from a function a&#40;&#41; &#123; console.log&#40;&#34;a&#34;&#41;; &#125; &#160; function [...]]]></description>
			<content:encoded><![CDATA[<p>When using the traditional Javascript methods to do some sort of inheritance, the constructor of the parent will always be run when trying to inherit it. This seems to be a unfortunate side effect of using <code>new a()</code>.</p>
<h2>The problem</h2>
<p>Consider this code. Here b inherits from a</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> a<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> b<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    a.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;b&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
b.<span style="color: #660066;">prototype</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> a<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// a's constructor will be run here!</span>
b.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">constructor</span> <span style="color: #339933;">=</span> b<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">new</span> b<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// run once</span>
<span style="color: #003366; font-weight: bold;">new</span> b<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// run twice</span></pre></div></div>

<p>Here a&#8217;s constructor will be run 3 times.</p>
<pre>
a
a
b
a
b
</pre>
<h2>The solution</h2>
<p>There is a simple fix for this, but its only in Ecmascript 5.<br />
Change this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">b.<span style="color: #660066;">prototype</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> a<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Into this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">b.<span style="color: #660066;">prototype</span> <span style="color: #339933;">=</span> Object.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">prototype</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And the constructor will only be run when actually being called:</p>
<pre>
a
b
a
b
</pre>
]]></content:encoded>
			<wfw:commentRss>http://drakonen.com/2012/javascript-parent-constructor-being-run-when-defining-inheritance-and-a-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using hgtools with mercurial tags to automatically version packages</title>
		<link>http://drakonen.com/2012/using-hgtools-with-mercurial-tags-to-automatically-version-packages/</link>
		<comments>http://drakonen.com/2012/using-hgtools-with-mercurial-tags-to-automatically-version-packages/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 21:50:59 +0000</pubDate>
		<dc:creator>Drakonen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://drakonen.com/?p=166</guid>
		<description><![CDATA[I liked to automate my python package versioning a bit more and did this with hgtools. With hgtools it is quite easy to store the version numbers only in your repository as tags, and not having it again in setup.py. A minimal setup.py can look like this: from setuptools import setup, find_packages setup&#40; name=&#34;HelloWorld&#34;, use_hg_version=True, [...]]]></description>
			<content:encoded><![CDATA[<p>I liked to automate my python package versioning a bit more and did this with <a href="http://pypi.python.org/pypi/hgtools" onclick="pageTracker._trackPageview('/outgoing/pypi.python.org/pypi/hgtools?referer=');">hgtools</a>. With hgtools it is quite easy to store the version numbers only in your repository as tags, and not having it again in <code>setup.py</code>.</p>
<p>A minimal <code>setup.py</code> can look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> setuptools <span style="color: #ff7700;font-weight:bold;">import</span> setup, find_packages
setup<span style="color: black;">&#40;</span>
    name=<span style="color: #483d8b;">&quot;HelloWorld&quot;</span>,
    use_hg_version=<span style="color: #008000;">True</span>,
    packages=find_packages<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>,
    setup_requires=<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;hgtools&quot;</span><span style="color: black;">&#93;</span>,
<span style="color: black;">&#41;</span></pre></div></div>

<p>Just give a revision a tag and make an sdist, or bdist and setuptools will use the version from your tag.<br />
Tags have to conform to <a href="http://epydoc.sourceforge.net/stdlib/distutils.version.StrictVersion-class.html" onclick="pageTracker._trackPageview('/outgoing/epydoc.sourceforge.net/stdlib/distutils.version.StrictVersion-class.html?referer=');">strict version formatting from distutils</a> to be used by hgtools.</p>
<p>Later I also made it a step in a Jenkins setup, to always build a <code>sdist</code> and copy it to a HTTP accessible directory so it could be installed with pip. This gave me a nice history of available release packages and also, dev versions.</p>
]]></content:encoded>
			<wfw:commentRss>http://drakonen.com/2012/using-hgtools-with-mercurial-tags-to-automatically-version-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django class based views and testing them</title>
		<link>http://drakonen.com/2010/django-class-based-views-and-testing-them/</link>
		<comments>http://drakonen.com/2010/django-class-based-views-and-testing-them/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 13:41:07 +0000</pubDate>
		<dc:creator>Drakonen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://drakonen.com/?p=139</guid>
		<description><![CDATA[One of the problems described well by Honza Král&#8217;s presentation on Djangocon.eu 2010, is how to test properly and make it easier. In his presentation he touches on using class based views instead of using normal functions (around 14:14 in the link video). This is not as straight forwards as it seems at first. There are [...]]]></description>
			<content:encoded><![CDATA[<p>One of the problems described well by Honza Král&#8217;s <a href="http://djangoconeu.blip.tv/file/3677324/" onclick="pageTracker._trackPageview('/outgoing/djangoconeu.blip.tv/file/3677324/?referer=');">presentation</a> on Djangocon.eu 2010, is how to test properly and make it easier. In his presentation he touches on using class based views instead of using normal functions (around 14:14 in the link video). This is not as straight forwards as it seems at first. There are some problems with thead-safety for one.</p>
<p>To have fast tests you should avoid hitting the database as much as you can, and after using this method I have to agree.</p>
<h2>Making a class based view</h2>
<p>We have this simple view:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">shortcuts</span> <span style="color: #ff7700;font-weight:bold;">import</span> render_to_response, get_object_or_404
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> mysite.<span style="color: black;">polls</span>.<span style="color: black;">models</span> <span style="color: #ff7700;font-weight:bold;">import</span> Poll
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> simple_view<span style="color: black;">&#40;</span>request, poll_id<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot; A simple view, which takes an id from a url, shows it in a template. &quot;&quot;&quot;</span>
    poll = get_object_or_404<span style="color: black;">&#40;</span>Poll, pk=poll_id<span style="color: black;">&#41;</span>
    poll.<span style="color: black;">access_counter</span> += <span style="color: #ff4500;">1</span>
    poll.<span style="color: black;">save</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> render_to_response<span style="color: black;">&#40;</span><span style="color: #483d8b;">'polls/detail.html'</span>, <span style="color: black;">&#123;</span><span style="color: #483d8b;">'poll'</span>: poll<span style="color: black;">&#125;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>And now as a Class based view:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">template</span> <span style="color: #ff7700;font-weight:bold;">import</span> Context, loader
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">http</span> <span style="color: #ff7700;font-weight:bold;">import</span> HttpResponse
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> mysite.<span style="color: black;">polls</span>.<span style="color: black;">models</span> <span style="color: #ff7700;font-weight:bold;">import</span> Poll
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> simple_view<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> get_objects<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, poll_id<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;&quot; Return poll object for given poll_id. &quot;&quot;&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> get_object_or_404<span style="color: black;">&#40;</span>Poll, pk=poll_id<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> process<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, poll<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;&quot; Manipulate data and return the manipulated, unsaved object. &quot;&quot;&quot;</span>
        poll.<span style="color: black;">access_counter</span> += <span style="color: #ff4500;">1</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> poll
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> render<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, poll<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;&quot; Return HTML. &quot;&quot;&quot;</span>
        template = loader.<span style="color: black;">get_template</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'polls/detail.html'</span><span style="color: black;">&#41;</span>
        context = Context<span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'poll'</span>: poll<span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> template.<span style="color: black;">render</span><span style="color: black;">&#40;</span>context<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__call__</span><span style="color: black;">&#40;</span>request, poll_id<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;&quot; Show a Poll, increment the access_counter each time. &quot;&quot;&quot;</span>
        poll = <span style="color: #008000;">self</span>.<span style="color: black;">get_objects</span><span style="color: black;">&#40;</span>poll_id<span style="color: black;">&#41;</span>
        poll = <span style="color: #008000;">self</span>.<span style="color: black;">process</span><span style="color: black;">&#40;</span>poll<span style="color: black;">&#41;</span>
        poll.<span style="color: black;">save</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        output = <span style="color: #008000;">self</span>.<span style="color: black;">render</span><span style="color: black;">&#40;</span>poll<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponse<span style="color: black;">&#40;</span>output<span style="color: black;">&#41;</span></pre></div></div>

<p>What did we do here? We separated the functionality into methods. We have four functions now:</p>
<ul>
<li><code>get_objects</code> which gets and returns the data, not more, not less. If you have more then one piece of data to get, return a tuple.</li>
<li><code>process</code> which manipulates the data, but does not save it.</li>
<li><code>render</code> transform the manipulated data into HTML.</li>
<li><code>__call__</code> the mighty function which ties it all together</li>
</ul>
<p>Each of these functions do one thing, and try to do it well and isolated. Because this is so isolated, testing becomes quite easy since you can test the output of every step and it does not have side effects of the other parts. You still need to run __call__ at least once to check if it is all nicely tied together.</p>
<h2>Testing</h2>
<p>Testing a part of this view is simple:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> SimpleviewTest<span style="color: black;">&#40;</span>TestCase<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> test_simpleview_process_increment<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        view = mysite.<span style="color: black;">view</span>.<span style="color: black;">simple_view</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        poll = Poll<span style="color: black;">&#40;</span>question=<span style="color: #483d8b;">&quot;sample&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
        poll = view.<span style="color: black;">process</span><span style="color: black;">&#40;</span>poll<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">assertEquals</span><span style="color: black;">&#40;</span>poll.<span style="color: black;">access_counter</span>, <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Create an instance of the view, create a poll object and feed it to the function. Check afterwards if the value has increased. This is fast, there is no database interaction!</p>
<h2>Wiring it into urls.py</h2>
<p>I found a <a href="http://github.com/davedash/zamboni/blob/609ec5467dd6db6a6647f375e95abced5203a1b2/apps/api/urls.py#L9" onclick="pageTracker._trackPageview('/outgoing/github.com/davedash/zamboni/blob/609ec5467dd6db6a6647f375e95abced5203a1b2/apps/api/urls.py_L9?referer=');">little lambda helper</a> to call the class based view:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># this wraps a class based view in a lambda, so it is thread safe (and I do not need to use __new__)</span>
<span style="color: #808080; font-style: italic;"># yes this returns a lambda</span>
class_view = <span style="color: #ff7700;font-weight:bold;">lambda</span> x: <span style="color: #ff7700;font-weight:bold;">lambda</span> <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs: x<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#40;</span><span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
&nbsp;
urlpatterns = patterns<span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span>,
    <span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'showpoll'</span>, class_view<span style="color: black;">&#40;</span>mysite.<span style="color: black;">views</span>.<span style="color: black;">simple_view</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
<span style="color: black;">&#41;</span></pre></div></div>

<p>Just put the <code>class_view</code> function around the view reference.</p>
<p>This might seem quite a lot of code for this example, and it is, but this will give you some benefits when testing this way. Because this is a lot longer then before, you might not want to use it for every view, just for the more complicated ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://drakonen.com/2010/django-class-based-views-and-testing-them/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vim, python pep8 and pylint.</title>
		<link>http://drakonen.com/2010/vim-python-pep8-and-pylint/</link>
		<comments>http://drakonen.com/2010/vim-python-pep8-and-pylint/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 14:04:33 +0000</pubDate>
		<dc:creator>Drakonen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://drakonen.com/?p=128</guid>
		<description><![CDATA[When you are making your Python code pep8 conformant or want to have a good pylint score and you are using vim, there are a few ways to make it easier and faster. First you need to know a bit about the vim option -q. -q takes a filename as a argument, and vim then [...]]]></description>
			<content:encoded><![CDATA[<p>When you are making your Python code pep8 conformant or want to have a good pylint score and you are using vim, there are a few ways to make it easier and faster.</p>
<p>First you need to know a bit about the vim option -q. -q takes a filename as a argument, and vim then uses this file to jump to locations in files where the used tool has reported something. Vim expects a very simple format here.</p>
<p>Vim can take the output of the pep8 command:</p>
<p>﻿<code>pep8 --repeat --ignore=E501 *.py  &gt; ~/pep.txt</code></p>
<p>Then start vim with:</p>
<p><code>vim -q ~/pepepep.txt</code></p>
<p>Vim then opens with the first reported issue, to go to the next, use <code>:cn</code>.<br />
Or you can temporarily map <code>z</code> to that for this vim session:</p>
<p><code>:map z :cn&lt;cr&gt;</code></p>
<p>Like with pep8, you can do the same with pylint, but you need to use the <code>--format parseable</code> argument:</p>
<p>﻿<code>pylint views.py -f parseable &gt; ~/pep.txt</code></p>
<h3>Some regexps for common formatting issues</h3>
<p>Remove trailing whitespace all over the file:<br />
<span style="font-family: monospace;">:%s/\s\+$//</span></p>
<p>Remove whitespace in front of a ,<br />
<span style="font-family: monospace;">:s/\s*,/,/</span></p>
<p>Remove whitespace in front of an equal-sign, if any, add a space.<br />
<span style="font-family: monospace;">:s/\s*=/ =/</span></p>
]]></content:encoded>
			<wfw:commentRss>http://drakonen.com/2010/vim-python-pep8-and-pylint/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Configuring the Buffalo AP&#8217;s as a Bridge</title>
		<link>http://drakonen.com/2009/configuring-the-buffalo-aps-as-a-bridge/</link>
		<comments>http://drakonen.com/2009/configuring-the-buffalo-aps-as-a-bridge/#comments</comments>
		<pubDate>Tue, 05 May 2009 14:43:52 +0000</pubDate>
		<dc:creator>Drakonen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://drakonen.com/blog/?p=124</guid>
		<description><![CDATA[Configuring the Buffalo WHR-HP-54G as a bridge is quite easy, given that you can get Tomato firmware on there. The default Buffalo firmware doesn&#8217;t support bridging or, I couldn&#8217;t find it. only thing I found was WDS bridging which is not what I want. Install Tomato You need to install an alternative firmware, fortunately most [...]]]></description>
			<content:encoded><![CDATA[<p>Configuring the Buffalo WHR-HP-54G as a bridge is quite easy, given that you can get Tomato firmware on there. The default Buffalo firmware doesn&#8217;t support bridging or, I couldn&#8217;t find it. only thing I found was WDS bridging which is not what I want.</p>
<h2>Install Tomato</h2>
<p>You need to install an alternative firmware, fortunately most WRT derivatives are compatible, most notably <a href="http://www.polarcloud.com/tomato" onclick="pageTracker._trackPageview('/outgoing/www.polarcloud.com/tomato?referer=');">Tomato</a> and <a href="http://openwrt.org/" onclick="pageTracker._trackPageview('/outgoing/openwrt.org/?referer=');">openWRT</a>. I picked Tomato because it has a nice &#8220;out of the box&#8221; experience. It has an easy to use Web interface which is easy to use. OpenWRT is more powerful in the end, but harder to set up at first. I also assume we do not need the extra features that are possible.</p>
<p>Get Tomato from its website, its 7zipped so you might need a more recent <a href="http://wakaba.c3.cx/s/apps/unarchiver.html" onclick="pageTracker._trackPageview('/outgoing/wakaba.c3.cx/s/apps/unarchiver.html?referer=');">unarchiver</a>.</p>
<p>Flashing the AP is more trail and error then science, and it did not work for me, but did work for a colleague.</p>
<p><a href="http://en.wikibooks.org/wiki/Tomato_(firmware)#Installing_on_a_Buffalo_WHR-G54S.2FWHR-HP-G54S_in_OS_X.2C_Linux.2C_and_other_Unix-based_OS.27s" onclick="pageTracker._trackPageview('/outgoing/en.wikibooks.org/wiki/Tomato_firmware_Installing_on_a_Buffalo_WHR-G54S.2FWHR-HP-G54S_in_OS_X.2C_Linux.2C_and_other_Unix-based_OS.27s?referer=');">Here are the Tomato install instructions</a></p>
<h2>Configure a Bridge</h2>
<p><strong>TURN OFF IT&#8217;S DHCP SERVER</strong></p>
<p>Give it an IP address in an other subnet then you main one (this is for performance reasons).</p>
<p>Here are the settings you need to set to be able to bridge:</p>
<div id="attachment_125" class="wp-caption alignnone" style="width: 998px"><img class="size-full wp-image-125" title="wlansettings" src="http://drakonen.com/wp-content/uploads/2009/05/wlansettings.png" alt="Tomato WLAN settings" width="988" height="453" /><p class="wp-caption-text">Tomato WLAN settings</p></div>
<p>This is a nice addition:</p>
<div id="attachment_126" class="wp-caption alignnone" style="width: 475px"><img class="size-full wp-image-126" title="bridge-led" src="http://drakonen.com/wp-content/uploads/2009/05/bridge-led.png" alt="Bridge LED" width="465" height="391" /><p class="wp-caption-text">Bridge LED</p></div>
<p>And its done.</p>
]]></content:encoded>
			<wfw:commentRss>http://drakonen.com/2009/configuring-the-buffalo-aps-as-a-bridge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Suse LTSP with DHCP on another server</title>
		<link>http://drakonen.com/2009/setting-up-suse-ltsp-with-dhcp-on-another-server/</link>
		<comments>http://drakonen.com/2009/setting-up-suse-ltsp-with-dhcp-on-another-server/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 09:33:44 +0000</pubDate>
		<dc:creator>Drakonen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://drakonen.com/blog/?p=113</guid>
		<description><![CDATA[At work, I have been tasked with setting up a Linux terminal server to lighten the load of our exsisting Windows server. LTSP (Linux Terminal Server Project) is quite a nice piece of software. It makes good use of PXE netbooting, but it should also work with RDP. Get Suse Download the openSUSE-Edu-KIWI-LTSP-live-unstable.i686 iso from [...]]]></description>
			<content:encoded><![CDATA[<p>At work, I have been tasked with setting up a Linux terminal server to lighten the load of our exsisting Windows server.</p>
<p>LTSP (Linux Terminal Server Project) is quite a nice piece of software. It makes good use of PXE netbooting, but it should also work with RDP.</p>
<h2>Get Suse</h2>
<p>Download the openSUSE-Edu-KIWI-LTSP-live-unstable.i686 iso from http://download.opensuse.org/repositories/Education/images/iso/</p>
<p>Why Suse? It has good support for LTSP <em>and</em> RDP.</p>
<h2>Setting up RDP on Suse</h2>
<p><a title="Setting up RDP on suse" href="http://en.opensuse.org/Nomad#Installation" onclick="pageTracker._trackPageview('/outgoing/en.opensuse.org/Nomad_Installation?referer=');">Setting up RDP on Suse</a> was very easy (compared to Ubuntu LTSP):<br />
You can skip this if you installed from the live DVD.</p>
<p><code>zypper ar <a title="http://download.opensuse.org/repositories/home:/dreveman:/nomad/openSUSE 11.1" rel="nofollow" href="http://download.opensuse.org/repositories/home:/dreveman:/nomad/openSUSE_11.1" onclick="pageTracker._trackPageview('/outgoing/download.opensuse.org/repositories/home_/dreveman_/nomad/openSUSE_11.1?referer=');">http://download.opensuse.org/repositories/home:/dreveman:/nomad/openSUSE_11.1</a><br />
# nomad zypper in rdesktop xrdp xorg-x11-server-dmx xorg-x11-server-rdp<br />
</code></p>
<p>Now you need to edit /etc/sysconfig/kiwi-ltsp and add:</p>
<p>USE_NOMAD=&#8221;1&#8243;</p>
<p>Run to update the configuration:</p>
<p><code>kiwi-ltsp-setup -c</code></p>
<p>Now start the xrdp server with:</p>
<p><code>rcxrdp start</code></p>
<h2>PXE booting</h2>
<p>PXE booting is a nice feature of network cards. It allows the computer to pull the operating system over the network, and boot the pulled operating system. The user can start applications, but they are not run on the client, but on the server. This is done with several services.</p>
<p>DHCP to tell where to get the boot image from.<br />
TFTP this actually delivers the boot image, based on UDP.<br />
Xorg to display apps on the client side which are actually run on the server.<br />
SSH to provide a secure connection between the Xorg server on the client and Xorg on the server (using option -X)</p>
<p>This should work out of the box when this is the only server in your network, and you do not already have a DHCP server on your network.</p>
<h2>But we already have DHCP</h2>
<p>LTSP assumes that you do not have an DHCP server yet and it runs one for you. This is quite bad if you already have a DHCP server running, which we have. Turning the dhcp server on Suse off is done with this:<br />
<code><br />
insserv -r dhcpd &amp;&amp; rcdhcpd stop</code></p>
<p>To turn it off forever you can remove the dhcp-server package:</p>
<p><code>rpm -e dhcp-server --nodeps</code></p>
<p>This should work until the next time you run <code>kiwi-ltsp-setup</code>, so I&#8217;ve been told.</p>
<p>You need to configure your <em>original DHCP </em>server (<em>not</em> the ltsp) , by editing the dhcpd.conf:<br />
<code><br />
subnet 192.168.0.0 netmask 255.255.255.0 {<br />
option routers 192.168.0.1;<br />
range 192.168.0.1 192.168.0.254;<br />
#add this and replace with your own LTSP server ip:<br />
next-server 192.168.0.2;<br />
filename "pxelinux.0";<br />
}</code></p>
<p>If you try to PXE boot it now, it will fail somewhere at the startup. Press F2 to see the init messages.</p>
<p>You also need to edit /srv/tftpboot/pxelinux.cfg/default</p>
<p>The line (its under <code>LABEL kiwi-ltsp</code>):<br />
<code>append initrd=boot/initrd-ltsp vga=791 splash=silent showopts</code></p>
<p>should become:<br />
<code>append initrd=boot/initrd-ltsp vga=791 splash=silent showopts kiwiserver=192.168.1.231 kiwiservertype=tftp</code></p>
<p>Try booting it now, and it should work.</p>
]]></content:encoded>
			<wfw:commentRss>http://drakonen.com/2009/setting-up-suse-ltsp-with-dhcp-on-another-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>G1, the review after usage</title>
		<link>http://drakonen.com/2009/g1-the-review-after-usage/</link>
		<comments>http://drakonen.com/2009/g1-the-review-after-usage/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 18:07:54 +0000</pubDate>
		<dc:creator>Drakonen</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://drakonen.com/blog/2009/g1-the-review-after-usage/</guid>
		<description><![CDATA[So, i have been using the G1 for some time now, and thought it was time for a somewhat more in depth review. I&#8217;m writing this post on my G1 with postbot. Lets start with the keyboard. The keyboard is quite comfortable, and I can almost type blind on it. I can feel where the [...]]]></description>
			<content:encoded><![CDATA[<p>So, i have been using the G1 for some time now, and thought it was time for a somewhat more in depth review. I&#8217;m writing this post on my G1 with postbot.</p>
<p>Lets start with the keyboard. The keyboard is quite comfortable, and I can almost type blind on it. I can feel where the keys are because they are slightly elevated and there is a small empty space in between the keys. Typing for a longer time is quite doable, but of course not as comfortable or as fast as a normal keyboard.</p>
<p>The available applications on the android market is filled with most of my basic needs. The most important one is the ssh client, which the app connectbot does damn well. It remapped some of the keys of the keyboard to give some easy access to the ESC or ctrl key. It also has copy support but that a bit cumbersome but it works.</p>
<p>The email apps are doing their work quite good too. There is the gmail app, which can only read the email from your G1 associated account. It does the usual threading just like gmail. Then there is the normal email app with support for imap and pop. I don&#8217;t use pop, but I heard it pulls in all email, like all pop clients. Pop is also the only way to have your full email available offline. Imap support is good, and also works with your second gmail account. There is a very small cache for imap, everything else gets pulled in over the air. It would have been nice to have the option to save imap and to use 2 gmail accounts in the gmail app because the email app does not do threading.</p>
<p>Cell reception is good, and haven&#8217;t really had problems with that. Wifi reception is decent. In Cologne there is pretty decent 3g reception, and i have to admit, I&#8217;m quite amazed by 3g speeds and latency.</p>
<p>Media wise i haven&#8217;t really tried too much, the mp3 player was decent but the crappy ear plugs and the lack of a mini jack let it go unused. I need to order a converter cable to use my brand new headphones.</p>
<p>Overall the system is quite responsive, and quite stable. Ive had two spontaneous reboots, and a few crashing apps, but that&#8217;s way less than on my p900.</p>
<p>The only thing i dont like about the G1 is the battery life. At tops it has lasted me around one and a half day. Which is short for me. My previous phone (se p900) got almost one week. But i wouldnt trade my g1 for a p900.</p>
]]></content:encoded>
			<wfw:commentRss>http://drakonen.com/2009/g1-the-review-after-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The G1 Experience</title>
		<link>http://drakonen.com/2009/the-g1-experience/</link>
		<comments>http://drakonen.com/2009/the-g1-experience/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 20:09:10 +0000</pubDate>
		<dc:creator>Drakonen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://drakonen.com/blog/?p=104</guid>
		<description><![CDATA[Yesterday when I got home there was a nice present waiting for me. My G1 Phone arrived! I ripped open the packaging and found a phone that was smaller than I expected from the images from the internet. First tries Popping in the sim card and the battery was easy, turning it on was a [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday when I got home there was a nice present waiting for me. My G1 Phone arrived! I ripped open the packaging and found a phone that was smaller than I expected from the images from the internet.</p>
<h2>First tries</h2>
<p>Popping in the sim card and the battery was easy, turning it on was a bit harder&#8230; I did not have much light and didn&#8217;t see the on-sign on the hangup button. After some messing around it turned on and it was booting! Next thing it asks me is to unlock the phone, &#8220;Damn!&#8221; i bought a locked phone. Luckily I knew that it could be unlocked and that it was just a matter of going to a website, entering some details and your emei code, oh and you need to pay 20 bucks too. The rest of the evening I was waiting for the unlock code to arrive. It did not arrive before I had to go to bed. Darn&#8230;</p>
<p>The next morning I got up on my usual time and turned on my laptop. After some morning routine stuff, I checked my email and to great satisfaction I found the unlock code! I turned on the G1 again and entered the code, and my phone was unlocked!</p>
<h2>Sign in with your Google account please</h2>
<p>To be able to use the phone <em>at all</em> you need to log in to your Google account. I tried that but of course that was not working because GPRS/UMTS was not setup for my provider, FONIC. Yet an other &#8220;Damn!&#8221;. Off to work I went and on arrival I spent some time there researching on how to set it up for FONIC, to no avail, nobody had the same problem as me it seemed. But, I knew that my provider was the cheap-ass version of o2. I found the details for that on plenty of sites, but with that information in my G1 I could also not sign in, seemingly&#8230; Back to do some work!</p>
<h2>Later that day</h2>
<p>A few hours later I tried signing in again, and to my amazement it worked flawlessly! Off playing with it some more! (<span style="font-size: xx-small;">not too much Mr. boss!</span>). But the battery was dying.. seemingly the provided usb cable didn&#8217;t work for charging the battery, i pulled out an other usb cable and plugged it in, and charging commenced! I also moved the most important contacts from my old phone, the trusty p900, to the sim card, and mass imported them onto my phone without any problem. I hopped onto the company wifi and synchronized with my Google account so my contacts show up in gmail. This is an awesome feature, and in my opinion the <strong>killer feature</strong>. At my workplace the wifi signal was not good enough to hold a connection to the wifi network, so it switched a lot between wifi and GPRS. This has costed me a few dimes I&#8217;m afraid&#8230; I was able to call and send sms&#8217;s with ease. The search <em>button</em> works in a lot of the standard applications and it is a blessing.</p>
<p>When I arrived home serious play time commenced. I installed a few aplications from the android market. It contains tons and tons of apps, some good some bad. Locale is nice, but is lacking a lot of options that it could really improve it. And the battery wanted to be charged again&#8230; I also used the IM client, and it worked pretty damn well! So far I absolutely LOVE it. it is fast and responsive, didnt crash on me once (knock on wood) and it is easy to use after a short learning period.</p>
<p>I will write about my other experiences an other time.</p>
]]></content:encoded>
			<wfw:commentRss>http://drakonen.com/2009/the-g1-experience/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wichteln, aka, random christmas presents!</title>
		<link>http://drakonen.com/2008/wichteln-aka-random-christmas-presents/</link>
		<comments>http://drakonen.com/2008/wichteln-aka-random-christmas-presents/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 21:49:23 +0000</pubDate>
		<dc:creator>Drakonen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://drakonen.com/blog/?p=102</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://drakonen.com/wp-content/uploads/2008/12/key-one.jpg"><img class="alignnone size-medium wp-image-100" title="key-one" src="http://drakonen.com/wp-content/uploads/2008/12/key-one-300x231.jpg" alt="" width="300" height="231" /></a><a href="http://drakonen.com/wp-content/uploads/2008/12/key-two.jpg"><img class="alignnone size-medium wp-image-101" title="key-two" src="http://drakonen.com/wp-content/uploads/2008/12/key-two-300x183.jpg" alt="" width="300" height="183" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://drakonen.com/2008/wichteln-aka-random-christmas-presents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why i hate the apple mighty mouse</title>
		<link>http://drakonen.com/2008/why-i-hate-the-apple-mighty-mouse/</link>
		<comments>http://drakonen.com/2008/why-i-hate-the-apple-mighty-mouse/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 07:55:07 +0000</pubDate>
		<dc:creator>Drakonen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://drakonen.com/blog/?p=85</guid>
		<description><![CDATA[I&#8217;ve been explaining myself a lot lately for my deep hate for the apple mighty mouse, so here is are a few points on why i hate it. Scroll wheel gets dirty and is hard to clean I have never had a mouse with a scrollwheel before where the wheel needed cleaning. Apple doesnt give [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been explaining myself a lot lately for my deep hate for the apple mighty mouse, so here is are a few points on why i hate it.</p>
<ol>
<li><strong>Scroll wheel gets dirty and is hard to clean</strong><br />
I have never had a mouse with a scrollwheel before where the wheel needed cleaning. Apple doesnt give any better solution then to hold it upside down and scroll vigorously it with a moisty wet cloth.</li>
<li><strong>Accidental side scrolling</strong><br />
I want to scroll up and down, not sideways&#8230; this messes with Firefox when I&#8217;m holding alt or ctrl.</li>
<li><strong>Accidental scrolling when middle clicking</strong><br />
Makes pastes go wrong. It is also the hardest middle mouse button to press on any mouse I&#8217;ve had.</li>
<li><strong>Left click instead of right click and vice versa</strong><br />
Apple cannot make a mouse which actually registers the right side I am clicking on? I like to hold both fingers on my mouse while clicking, and the mighty mouse uses some weird way of detecting with side is pressed. I have never had this problem with ANY other mouse. How can you fuck up this most basic function?</li>
</ol>
<p>So, kill the mighty mouse, and use a normal fine working Logitech or Microsoft mouse.</p>
]]></content:encoded>
			<wfw:commentRss>http://drakonen.com/2008/why-i-hate-the-apple-mighty-mouse/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

