<?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>Hacking Life - Coding</title>
    <link>http://www.kungfu-hackers.net/</link>
    <description>Random Thoughts</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.2 - http://www.s9y.org/</generator>
    <pubDate>Fri, 04 May 2007 09:25:25 GMT</pubDate>

    <image>
        <url>http://www.kungfu-hackers.net/templates/competition/img/s9y_banner_small.png</url>
        <title>RSS: Hacking Life - Coding - Random Thoughts</title>
        <link>http://www.kungfu-hackers.net/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Code Talker</title>
    <link>http://www.kungfu-hackers.net/index.php?/archives/85-Code-Talker.html</link>
            <category>Coding</category>
            <category>Fun</category>
    
    <comments>http://www.kungfu-hackers.net/index.php?/archives/85-Code-Talker.html#comments</comments>
    <wfw:comment>http://www.kungfu-hackers.net/wfwcomment.php?cid=85</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.kungfu-hackers.net/rss.php?version=2.0&amp;type=comments&amp;cid=85</wfw:commentRss>
    

    <author>nospam@example.com (Stefan Kraatz)</author>
    <content:encoded>
    &lt;a href=&quot;http://xkcd.com/c257.html&quot;  title=&quot;XKCD Friday Comic&quot;&gt;&lt;img src=&quot;http://imgs.xkcd.com/comics/code_talkers.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
via &lt;a href=&quot;http://www.xkcd.com/&quot; &gt;XKCD&lt;/a&gt; 
    </content:encoded>

    <pubDate>Fri, 04 May 2007 11:25:25 +0200</pubDate>
    <guid isPermaLink="false">http://www.kungfu-hackers.net/index.php?/archives/85-guid.html</guid>
    
</item>
<item>
    <title>If Being A Programmer Were Like Being An Air Traffic Controller</title>
    <link>http://www.kungfu-hackers.net/index.php?/archives/74-If-Being-A-Programmer-Were-Like-Being-An-Air-Traffic-Controller.html</link>
            <category>Coding</category>
    
    <comments>http://www.kungfu-hackers.net/index.php?/archives/74-If-Being-A-Programmer-Were-Like-Being-An-Air-Traffic-Controller.html#comments</comments>
    <wfw:comment>http://www.kungfu-hackers.net/wfwcomment.php?cid=74</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.kungfu-hackers.net/rss.php?version=2.0&amp;type=comments&amp;cid=74</wfw:commentRss>
    

    <author>nospam@example.com (Stefan Kraatz)</author>
    <content:encoded>
    &lt;u&gt;&lt;a href=&quot;http://codist.biit.com/fiche/thecodist/article/if-being-a-programmer-were-like-being-an-air-traffic-controller&quot; &gt;This&lt;/a&gt;&lt;/u&gt; is a bit like, if your car was built by Microsoft. 
    </content:encoded>

    <pubDate>Fri, 16 Mar 2007 13:18:43 +0100</pubDate>
    <guid isPermaLink="false">http://www.kungfu-hackers.net/index.php?/archives/74-guid.html</guid>
    
</item>
<item>
    <title>How long does it take you in your coding language?</title>
    <link>http://www.kungfu-hackers.net/index.php?/archives/63-How-long-does-it-take-you-in-your-coding-language.html</link>
            <category>Coding</category>
    
    <comments>http://www.kungfu-hackers.net/index.php?/archives/63-How-long-does-it-take-you-in-your-coding-language.html#comments</comments>
    <wfw:comment>http://www.kungfu-hackers.net/wfwcomment.php?cid=63</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.kungfu-hackers.net/rss.php?version=2.0&amp;type=comments&amp;cid=63</wfw:commentRss>
    

    <author>nospam@example.com (Stefan Kraatz)</author>
    <content:encoded>
    Not that I am a great programmer, but I managed to get it done in less than five minutes, including reminding myself how the modulo operation works in python.&lt;br /&gt;
This is from my perspective quite an interesting example on how to filter out dazzlers from a set of self proclaimed coders applying for a programming job.&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
Found &lt;a href=&quot;http://tickletux.wordpress.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/&quot; &gt;here&lt;/a&gt; 
    </content:encoded>

    <pubDate>Wed, 28 Feb 2007 15:32:16 +0100</pubDate>
    <guid isPermaLink="false">http://www.kungfu-hackers.net/index.php?/archives/63-guid.html</guid>
    
</item>
<item>
    <title>Search &amp; Destroy</title>
    <link>http://www.kungfu-hackers.net/index.php?/archives/61-Search-Destroy.html</link>
            <category>Coding</category>
            <category>Unix</category>
            <category>Work</category>
    
    <comments>http://www.kungfu-hackers.net/index.php?/archives/61-Search-Destroy.html#comments</comments>
    <wfw:comment>http://www.kungfu-hackers.net/wfwcomment.php?cid=61</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.kungfu-hackers.net/rss.php?version=2.0&amp;type=comments&amp;cid=61</wfw:commentRss>
    

    <author>nospam@example.com (Stefan Kraatz)</author>
    <content:encoded>
    I found a nice little tool in the &lt;a href=&quot;http://aspn.activestate.com/ASPN/Cookbook/Python&quot; &gt;Python Cookbook&lt;/a&gt; section of the &lt;a href=&quot;www.activestate.com/&quot; &gt;Activestate website&lt;/a&gt;. It is pretty quick and helps to eliminate duplicate files by traversing the folder you run it on, comparing size and hashes for all the files and finally deleting them. &lt;br /&gt;
&lt;br /&gt;
Comment of the author:&lt;br /&gt;
&lt;blockquote&gt;It ran against a 3.5 gigabyte set of files composed of about 120,000 files, of which there were about 50,000 duplicates, most of which were over 1 megabyte. The total run took about 2 minutes on a 1.33ghz G4 powerbook. Fast enough for me and fast enough without actually optimizing anything beyond the obvious.&lt;/blockquote&gt;&lt;br /&gt;
&lt;a href=&quot;http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362459&quot; &gt;Link to Python Recipe&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Comments from my side:&lt;br /&gt;
&lt;br /&gt;
- you will need python installed to use it, but you should have it anyway ;)&lt;br /&gt;
- as far as I can see, it works on every platform supporting python&lt;br /&gt;
- it doesn&#039;t replace the brain ;), it will simply delete everything duplicate&lt;br /&gt;
- The ASPN website is pretty slow and frequently unreachable. Contact me, if you like to have this script and can&#039;t get it from the page. 
    </content:encoded>

    <pubDate>Mon, 26 Feb 2007 13:42:45 +0100</pubDate>
    <guid isPermaLink="false">http://www.kungfu-hackers.net/index.php?/archives/61-guid.html</guid>
    
</item>
<item>
    <title>This seems so real !</title>
    <link>http://www.kungfu-hackers.net/index.php?/archives/43-This-seems-so-real-!.html</link>
            <category>Coding</category>
    
    <comments>http://www.kungfu-hackers.net/index.php?/archives/43-This-seems-so-real-!.html#comments</comments>
    <wfw:comment>http://www.kungfu-hackers.net/wfwcomment.php?cid=43</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.kungfu-hackers.net/rss.php?version=2.0&amp;type=comments&amp;cid=43</wfw:commentRss>
    

    <author>nospam@example.com (Stefan Kraatz)</author>
    <content:encoded>
    &lt;a href=&quot;http://thedailywtf.com/Articles/The_Intentional_Slowdown.aspx&quot; &gt;http://thedailywtf.com/Articles/The_Intentional_Slowdown.aspx&lt;/a&gt; 
    </content:encoded>

    <pubDate>Thu, 08 Feb 2007 12:50:55 +0100</pubDate>
    <guid isPermaLink="false">http://www.kungfu-hackers.net/index.php?/archives/43-guid.html</guid>
    
</item>
<item>
    <title>Introducing the aycdie shell</title>
    <link>http://www.kungfu-hackers.net/index.php?/archives/39-Introducing-the-aycdie-shell.html</link>
            <category>Coding</category>
            <category>Unix</category>
    
    <comments>http://www.kungfu-hackers.net/index.php?/archives/39-Introducing-the-aycdie-shell.html#comments</comments>
    <wfw:comment>http://www.kungfu-hackers.net/wfwcomment.php?cid=39</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.kungfu-hackers.net/rss.php?version=2.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    

    <author>nospam@example.com (Stefan Kraatz)</author>
    <content:encoded>
    During the research for my &lt;u&gt;&lt;a href=&quot;http://www.kungfu-hackers.net/index.php?/articles/ssh.html&quot;  title=&quot;ssh article&quot;&gt;ssh gateway&lt;/a&gt;&lt;/u&gt; project, I came across the issue, that I didn&#039;t want the ssh users to execute any commands on the gateway itself. They would still need the ability to login, since I needed the ssh connection for tunneling traffic into the private network. Discussions with a friend of mine, brought us to the idea, to replace the standard shell with something else, that stays alive, as long as the user doesn&#039;t type something specific. Afterwards it would just terminate and the ssh session will be closed.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Please welcome the &quot;All You Can Do Is Exit&quot; Shell.&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
A little bit of python did the job for me. Obviously this is depending on python being installed on your computer and there are various other ways to do this.&lt;br /&gt;
&lt;em&gt;&lt;blockquote&gt;&lt;br /&gt;
&lt;pre&gt;
# cat /aycdiesh
#! /usr/local/bin/python2.4
while True:
    try:
        x = &quot;&quot;
        while x !=&quot;exit&quot;:
            x = raw_input(&quot;Type &#039;exit&#039;: &quot;);
            if x != &quot;exit&quot;:
                print &quot;Only &#039;exit&#039; is allowed !!&quot;;
        break;
    except KeyboardInterrupt:
        break;
&lt;/pre&gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;/em&gt;&lt;br /&gt;
Assigning the aycdiesh as a shell to the user &quot;test&quot;, will lead to the required results.&lt;br /&gt;
&lt;em&gt;&lt;blockquote&gt;&lt;br /&gt;
# userinfo test&lt;br /&gt;
login   test&lt;br /&gt;
passwd  *&lt;br /&gt;
uid     1003&lt;br /&gt;
groups  test&lt;br /&gt;
change  NEVER&lt;br /&gt;
class&lt;br /&gt;
gecos   test&lt;br /&gt;
dir     /home/test&lt;br /&gt;
shell   /aycdiesh&lt;br /&gt;
expire  NEVER&lt;br /&gt;
&lt;/blockquote&gt;&lt;/em&gt;&lt;br /&gt;
Testing the login:&lt;br /&gt;
&lt;em&gt;&lt;blockquote&gt;&lt;br /&gt;
&gt;ssh -l test ssh_gateway&lt;br /&gt;
test@ssh_gateway&#039;s password:&lt;br /&gt;
Last login: Wed Feb  7 11:16:40 2007 from 10.169.20.58&lt;br /&gt;
OpenBSD 4.0 (GENERIC) #625: Sun Sep 17 23:46:46 MDT 2006&lt;br /&gt;
&lt;br /&gt;
Welcome to the ssh access gateway.&lt;br /&gt;
&lt;br /&gt;
Type &#039;exit&#039;: dsr08tg245t243&lt;br /&gt;
only &#039;exit&#039; is allowed !!&lt;br /&gt;
Type &#039;exit&#039;: exit&lt;br /&gt;
OK&lt;br /&gt;
Connection to ssh_gateway closed.&lt;br /&gt;
&lt;br /&gt;
&gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;/em&gt;&lt;br /&gt;
&lt;hr /&gt;&lt;br /&gt;
As always, I welcome comments to this entry, since I don&#039;t think I am a genius. Let me know, if something is wrong, or if you come up with different approaches or a better solution at all. 
    </content:encoded>

    <pubDate>Wed, 07 Feb 2007 11:15:51 +0100</pubDate>
    <guid isPermaLink="false">http://www.kungfu-hackers.net/index.php?/archives/39-guid.html</guid>
    
</item>
<item>
    <title>python notes</title>
    <link>http://www.kungfu-hackers.net/index.php?/archives/34-python-notes.html</link>
            <category>Coding</category>
    
    <comments>http://www.kungfu-hackers.net/index.php?/archives/34-python-notes.html#comments</comments>
    <wfw:comment>http://www.kungfu-hackers.net/wfwcomment.php?cid=34</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.kungfu-hackers.net/rss.php?version=2.0&amp;type=comments&amp;cid=34</wfw:commentRss>
    

    <author>nospam@example.com (Stefan Kraatz)</author>
    <content:encoded>
    &lt;strong&gt;various&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Arguments, passed to the script on the cmdline can be read with &lt;strong&gt;sys.argv[x]&lt;/strong&gt;. &lt;strong&gt;argv[0]&lt;/strong&gt; is the name of the script itself &lt;strong&gt;argv[1]&lt;/strong&gt; the first argument and so on. Reading arguments, that have not been passed lead to an exception.&lt;br /&gt;
&lt;blockquote&gt;&lt;em&gt;&lt;br /&gt;
import sys&lt;br /&gt;
print &#039;argument passed has been: &#039; + sys.argv[1]&lt;br /&gt;
&lt;/em&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;strong&gt;file operations&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Files will be opened with &lt;strong&gt;open(filename, mode)&lt;/strong&gt; for read and write access, while &lt;strong&gt;mode&lt;/strong&gt; determines read or write.&lt;br /&gt;
&lt;blockquote&gt;&lt;em&gt;&lt;br /&gt;
filename=&quot;textdatei.txt&quot;&lt;br /&gt;
op_mode=&quot;w&quot;&lt;br /&gt;
f=open(filename, op_mode)&lt;br /&gt;
&lt;/em&gt;&lt;/blockquote&gt;&lt;br /&gt;
The name of the file and the read/write mode can be obtained from the constants &lt;strong&gt;name &lt;/strong&gt;and &lt;strong&gt;mode&lt;/strong&gt;.&lt;br /&gt;
&lt;blockquote&gt;&lt;em&gt;&lt;br /&gt;
print f.name&lt;br /&gt;
print f.mode&lt;br /&gt;
&lt;/em&gt;&lt;/blockquote&gt;&lt;br /&gt;
The file will be closed with &lt;strong&gt;close&lt;/strong&gt;.&lt;br /&gt;
&lt;blockquote&gt;&lt;em&gt;&lt;br /&gt;
f.close&lt;br /&gt;
&lt;/em&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;strong&gt; os operations&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;os.name&lt;/strong&gt; contains the python system name. BSD returns &quot;posix&quot;&lt;br /&gt;
&lt;blockquote&gt;&lt;em&gt;&lt;br /&gt;
import os&lt;br /&gt;
print &#039;this is a &#039; + os.name + &#039; system&#039;&lt;br /&gt;
&lt;/em&gt;&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Mon, 29 Jan 2007 11:54:44 +0100</pubDate>
    <guid isPermaLink="false">http://www.kungfu-hackers.net/index.php?/archives/34-guid.html</guid>
    
</item>

</channel>
</rss>