<?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/"
	>

<channel>
	<title>dmarkey.com</title>
	<atom:link href="http://dmarkey.com/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://dmarkey.com/wordpress</link>
	<description>Always remember you're unique, just like everyone else.</description>
	<pubDate>Sat, 15 Oct 2011 23:56:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Python zipfile speedup tips</title>
		<link>http://dmarkey.com/wordpress/2011/10/15/python-zipfile-speedup-tips/</link>
		<comments>http://dmarkey.com/wordpress/2011/10/15/python-zipfile-speedup-tips/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 23:56:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://dmarkey.com/wordpress/?p=127</guid>
		<description><![CDATA[            
I have been working on a django project that requires large zip files to be unzipped.
At first I was just Popen&#8217;ing unzip. but its hard to track the progress of extraction, in the case of large files.
So I decided to use pythons zipfile [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://dmarkey.com/wordpress/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPython.js"></script>
<p>I have been working on a django project that requires large zip files to be unzipped.</p>
<p>At first I was just Popen&#8217;ing unzip. but its hard to track the progress of extraction, in the case of large files.</p>
<p>So I decided to use pythons zipfile module, and override extractall with a progress callback.</p>
<p>However I was very disappointed with the performance. A major slowdown compared to unzip binary.</p>
<p>Here was unzip performance:<br />
<em>time unzip -q /mnt/files/test.zip</p>
<p>real    0m8.880s<br />
user    0m1.560s<br />
sys     0m0.570s<br />
</em></p>
<p>8 seconds, not bad</p>
<p>This was my test script:</p>
<p><pre class="brush: python">from zipfile import ZipFile
zf = ZipFile(&quot;/mnt/files/test.zip&quot;)
zf.extractall()
</pre></p>
<p><em>time python test.py</p>
<p>real    6m50.938s<br />
user    0m2.990s<br />
sys     0m1.010s<br />
</em></p>
<p>7 minutes!! what is going on&#8230; I scratched my head.. trying different things..<br />
So I tried an strace.. And it was all clear.</p>
<p>If you pass a filename to ZipFile.. it doesnt open the file in the constructor.. oh no.</p>
<p>It actually saves the filename and on each extract operation, it opens the file, then closes.. for each file in the archive.</p>
<p>Now, on a local filesystem, this isn&#8217;t a big problem. However with a remote cifs filesystem opening a file is a lot more expensive, hence the slowdown.</p>
<p>So, an easy optimisation is to open the file and pass ZipFile a file descriptor.</p>
<p><pre class="brush: python">from zipfile import ZipFile
zf = ZipFile(open(&quot;/mnt/files/test.zip&quot;,&quot;r&quot;))
zf.extractall()
</pre></p>
<p><em>time python test.py</p>
<p>real    0m10.071s<br />
user    0m2.550s<br />
sys     0m0.690s</em></p>
<p>Bingo, just ~10% slower than unzip.</p>
<p>If you are using python 2.6, and easy optimisation is to use unzip.py from python 2.7, it has many optimisations with regard to large files in the archive.</p>
]]></content:encoded>
			<wfw:commentRss>http://dmarkey.com/wordpress/2011/10/15/python-zipfile-speedup-tips/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SafeZipFile module</title>
		<link>http://dmarkey.com/wordpress/2011/10/11/safezipfile-module/</link>
		<comments>http://dmarkey.com/wordpress/2011/10/11/safezipfile-module/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 22:25:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://dmarkey.com/wordpress/?p=122</guid>
		<description><![CDATA[            
This checks each file extracted for &#8220;..&#8221; in the path, and dont go over a file size limit that you set in the constructor.
from zipfile import ZipFile, ZipInfo
import os

class NotSafeFileException(Exception):
    pass


class SafeZipFile(ZipFile):
    def __init__(self, *args, **kwargs):
  [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://dmarkey.com/wordpress/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPython.js"></script>
<p>This checks each file extracted for &#8220;..&#8221; in the path, and dont go over a file size limit that you set in the constructor.</p>
<p><pre class="brush: python">from zipfile import ZipFile, ZipInfo
import os

class NotSafeFileException(Exception):
    pass


class SafeZipFile(ZipFile):
    def __init__(self, *args, **kwargs):
        self.max_size = kwargs.pop('max_size', None)
        ZipFile.__init__(self, *args, **kwargs)

    def extract(self, member, path=None, pwd=None):
        if not isinstance(member, ZipInfo):
            member = self.getinfo(member)
        if path is None:
            path = os.getcwd()
        self.safety_check(member)
        return self._extract_member(member, path, pwd)

    def safety_check(self, zipinfo):
        &quot;&quot;&quot;Make sure that the file/dir:
            * Doesn't start with a slash in the path
            * Doesnt have &quot;..&quot; in the path
            * If max_size is passed, make sure the file isnt bigger than that threshhold
        &quot;&quot;&quot;
        if zipinfo.filename.startswith(&quot;/&quot;): raise NotSafeFileException(&quot;%s starts with a slash&quot; % tarinfo.path)
        if &quot;..&quot; in zipinfo.filename: raise NotSafeFileException(&quot;%s contains '..'&quot; % zipfile.filename)
        if self.max_size and self.max_size &lt; zipinfo.file_size: raise NotSafeFileException(&quot;%s is too big&quot; % zipinfo.filename)
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://dmarkey.com/wordpress/2011/10/11/safezipfile-module/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SafeTarFile Module</title>
		<link>http://dmarkey.com/wordpress/2011/10/11/safe-tarfile-module/</link>
		<comments>http://dmarkey.com/wordpress/2011/10/11/safe-tarfile-module/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 20:13:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://dmarkey.com/wordpress/?p=118</guid>
		<description><![CDATA[            
This TarFile module is a drop-in replacement for TarFile which makes sure that files in a tarfile, is safe using the following criteria:
* Doesn&#8217;t start with a slash in the path
* Doesnt have &#8220;..&#8221; in the path
* Is either a normal file or [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://dmarkey.com/wordpress/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPython.js"></script>
<p>This TarFile module is a drop-in replacement for TarFile which makes sure that files in a tarfile, is safe using the following criteria:</p>
<p>* Doesn&#8217;t start with a slash in the path<br />
* Doesnt have &#8220;..&#8221; in the path<br />
* Is either a normal file or directory(no fifos,  symlinks)<br />
* If max_size is passed, make sure the file isnt bigger than that threshhold</p>
<p>Tested on 2.7</p>
<p><pre class="brush: python">from tarfile import TarFile, ExtractError
import copy
import operator
import os.path

class NotSafeFileException(Exception):
    pass

class SafeTarFile(TarFile):
    def __init__(self, *args, **kwargs):
        self.max_size = kwargs.pop('max_size', None)
        super(SafeTarFile,self).__init__(*args, **kwargs)

    def safety_check(self, tarinfo, max_size=None):
        &quot;&quot;&quot;Make sure that the file/dir:
            * Doesn't start with a slash in the path
            * Doesnt have &quot;..&quot; in the path
            * Is either a normal file or directory(no fifos,  symlinks)
            * If max_size is passed, make sure the file isnt bigger than that threshhold
        &quot;&quot;&quot;

        if tarinfo.path.startswith(&quot;/&quot;): raise NotSafeFileException(&quot;%s starts with a slash&quot; % tarinfo.path)
        if &quot;..&quot; in tarinfo.path: raise NotSafeFileException(&quot;%s contains '..'&quot; % tarinfo.path)
        if not tarinfo.isfile() and not tarinfo.isdir(): raise NotSafeFileException(&quot;%s is a strange filetype&quot; % tarinfo.name)
        if self.max_size and self.max_size &lt; tarinfo.size: raise NotSafeFileException(&quot;%s is too big&quot; % tarinfo.name)

    def extract(self, member, path=&quot;&quot;):
        self._check(&quot;r&quot;)

        if isinstance(member, basestring):
            tarinfo = self.getmember(member)
        else:
            tarinfo = member
        self.safety_check(tarinfo)
        super(SafeTarFile, self).extract(tarinfo, path)

</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://dmarkey.com/wordpress/2011/10/11/safe-tarfile-module/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Killing child processes of Celery tasks, on a timeout</title>
		<link>http://dmarkey.com/wordpress/2011/09/07/killing-child-processes-of-celery-tasks-on-a-timeout/</link>
		<comments>http://dmarkey.com/wordpress/2011/09/07/killing-child-processes-of-celery-tasks-on-a-timeout/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 10:06:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Add new tag]]></category>

		<category><![CDATA[celery django python]]></category>

		<guid isPermaLink="false">http://dmarkey.com/wordpress/?p=108</guid>
		<description><![CDATA[            
This is a quick Monkeypatch to make sure that all child processes are killed when a worker is killed.
from celery.worker import state
import celery.worker.job
from celery import exceptions

def kill_child_processes(parent_pid, sig=signal.SIGTERM, top=True):
        ps_command = subprocess.Popen(&#34;ps -o pid --ppid %d [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://dmarkey.com/wordpress/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPython.js"></script>
<p>This is a quick Monkeypatch to make sure that all child processes are killed when a worker is killed.</p>
<p><pre class="brush: python">from celery.worker import state
import celery.worker.job
from celery import exceptions

def kill_child_processes(parent_pid, sig=signal.SIGTERM, top=True):
        ps_command = subprocess.Popen(&quot;ps -o pid --ppid %d --noheaders&quot; % parent_pid, shell=True, stdout=subprocess.PIPE)
        ps_output = ps_command.stdout.read()
        retcode = ps_command.wait()
        if retcode != 0: return
        for pid_str in ps_output.split(&quot;n&quot;)[:-1]:
            try:
                kill_child_processes(int(pid_str), sig, top=False)

                if not top: os.kill(int(pid_str), sig)
            except OSError: pass


def on_timeout(self, soft, timeout):
    &quot;&quot;&quot;Handler called if the task times out.&quot;&quot;&quot;
    state.task_ready(self)
    if soft:
        self.logger.warning(&quot;Soft time limit (%ss) exceeded for %s[%s]&quot; % (
            timeout, self.task_name, self.task_id))
        exc = exceptions.SoftTimeLimitExceeded(timeout)
    else:
        kill_child_processes(self.worker_pid)
        self.logger.error(&quot;Hard time limit (%ss) exceeded for %s[%s]&quot; % (
            timeout, self.task_name, self.task_id))
        exc = exceptions.TimeLimitExceeded(timeout)

    if self._store_errors:
        self.task.backend.mark_as_failure(self.task_id, exc)


celery.worker.job.TaskRequest.on_timeout = on_timeout
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://dmarkey.com/wordpress/2011/09/07/killing-child-processes-of-celery-tasks-on-a-timeout/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Citrix Xenoscope</title>
		<link>http://dmarkey.com/wordpress/2011/04/19/citrix-xenoscope/</link>
		<comments>http://dmarkey.com/wordpress/2011/04/19/citrix-xenoscope/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 20:09:30 +0000</pubDate>
		<dc:creator>dmarkey</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Xen]]></category>

		<category><![CDATA[XenServer]]></category>

		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://dmarkey.com/wordpress/?p=100</guid>
		<description><![CDATA[            
Hi All
Just a quick note that if you&#8217;re at Citrix synergy, you&#8217;ll get a chance to get a preview of a piece of software me and my team have been developing here in Dublin.
Basically it&#8217;s a tool that should help troubleshoot problems with [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://dmarkey.com/wordpress/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPython.js"></script>
<p>Hi All</p>
<p>Just a quick note that if you&#8217;re at Citrix synergy, you&#8217;ll get a chance to get a preview of a piece of software me and my team have been developing here in Dublin.</p>
<p>Basically it&#8217;s a tool that should help troubleshoot problems with XenServer installations.</p>
<p>Ian will be giving a workshop in Synergy San Francisco.</p>
<p>It&#8217;s a really fun and useful product and I hope you like it!</p>
<p style="text-align: center;"><img class="aligncenter" src="http://community.citrix.com/download/attachments/165217695/XenoScope%20(copy).png" alt="Logo..." width="300" height="78" /></p>
]]></content:encoded>
			<wfw:commentRss>http://dmarkey.com/wordpress/2011/04/19/citrix-xenoscope/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How I deployed My django app on IIS 7</title>
		<link>http://dmarkey.com/wordpress/2011/04/02/how-i-deployed-my-django-app-on-iis-7/</link>
		<comments>http://dmarkey.com/wordpress/2011/04/02/how-i-deployed-my-django-app-on-iis-7/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 20:36:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dmarkey.com/wordpress/?p=95</guid>
		<description><![CDATA[            
So in work(Citrix),
We&#8217;ve been working on a django based application to analyse debug data from XenServer..
I was asked to deploy the application internally in such a way that availed of AD Single sign on in our intranet..  This would mean that I&#8217;d have [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://dmarkey.com/wordpress/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPython.js"></script>
<p>So in work(Citrix),</p>
<p>We&#8217;ve been working on a django based application to analyse debug data from XenServer..</p>
<p>I was asked to deploy the application internally in such a way that availed of AD Single sign on in our intranet..  This would mean that I&#8217;d have to run it on a windows box and avail of Kerberos or NTLM authentication..</p>
<p>This posed a problem for me.. My application depends a lot on some standard Linux commands(grep, busybox etc)</p>
<p>So I decided to keep the application running on a Linux machine, and try to use some protocol to proxy the requests from IIS, which would be doing the authentication.. I would use the REMOTE_USER header to identify the user authenticated.</p>
<p>I tried apache with fastcgi and mod_auth_sspi.. but the authentication was flaky, sometimes worked, sometimes didn&#8217;t..</p>
<p>I decided that I needed to use IIS if I was to get stable authentication&#8230; But its fastcgi implementation didnt support sending the request to another box.</p>
<p>I was running out of ideas.. then I seen that there was a AJP connector for IIS which comes from the apache tomcat project in the form of isapi_redirect. So I gave it a go..</p>
<p>I used flups ajp implementation on the django side.. everything was going great, I could authenticate using IIS and the request was passwd back to the django box..</p>
<p>Except for one thing.. My application requires a large file upload(~100mb).. and it took hours.. i.e. 20kb/s. I first thought it was IIS.. but no. Flups AJP implementation is very very slow.</p>
<p>I seen that flups author also had a C based project, ajp-wsgi, I tried it out and it was much better very reliable.. there was a small hick-up at the start but allen patched that up.. Thanks..</p>
<p>So in essence, If you need windows authentication, and you need your django app to run on Linux.. use IIS, isapi_redirect, and ajp-wsgi..</p>
]]></content:encoded>
			<wfw:commentRss>http://dmarkey.com/wordpress/2011/04/02/how-i-deployed-my-django-app-on-iis-7/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why I got rid of my IPhone&#8230;</title>
		<link>http://dmarkey.com/wordpress/2011/04/02/why-i-got-rid-of-my-iphone/</link>
		<comments>http://dmarkey.com/wordpress/2011/04/02/why-i-got-rid-of-my-iphone/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 19:52:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dmarkey.com/wordpress/?p=89</guid>
		<description><![CDATA[            
The IPhone is a great device&#8230;
Great operating system&#8230;
Readily hackable&#8230;
Great app store&#8230;
But.. IT DOESN&#8217;T HAVE AN FM RADIO
I tried getting my radio via 3G.. but I always forgot to turn it off and my credit would be all gone.
So I decided to get rid [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://dmarkey.com/wordpress/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPython.js"></script>
<p>The IPhone is a great device&#8230;</p>
<p>Great operating system&#8230;</p>
<p>Readily hackable&#8230;</p>
<p>Great app store&#8230;</p>
<p>But.. <strong>IT DOESN&#8217;T HAVE AN FM RADIO</strong></p>
<p>I tried getting my radio via 3G.. but I always forgot to turn it off and my credit would be all gone.</p>
<p>So I decided to get rid of it.. and I got myself a ZTE Blade(Orange san francisco). It&#8217;s such a luxury having an FM radio now.. I don&#8217;t think i&#8217;ll move off android..</p>
<p><img src="http://2.bp.blogspot.com/_iJpQ5U0_rLE/S4KGA3r8vlI/AAAAAAAAGmQ/UjMXiunMIOE/s400/zte-blade-live-01.jpg" alt="ZTE Blade" width="312" height="400" /></p>
<p>A message for Steve Jobs: Dont be stupid, i&#8217;m not going to buy a 400 euro device and it not have an FM radio.. it will cost you like 5 cent to put an FM radio in the device..</p>
<p>The ZTE blade cost me 99 pounds sterling.. it&#8217;s not as good in the IPhone in some respects.. but it has the most important feature I need&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://dmarkey.com/wordpress/2011/04/02/why-i-got-rid-of-my-iphone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenWRT eircom settings</title>
		<link>http://dmarkey.com/wordpress/2011/01/15/openwrt-eircom-settings/</link>
		<comments>http://dmarkey.com/wordpress/2011/01/15/openwrt-eircom-settings/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 20:41:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dmarkey.com/wordpress/?p=85</guid>
		<description><![CDATA[            
Because I&#8217;ve been on a OpenWRT buzz, I wanted to use an old D-Link DSL/Router for OpenWRT.
I was ripping my hair out trying to figure out why I couldnt get DSL to sync. It turns out that I was using a variable voltage [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://dmarkey.com/wordpress/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPython.js"></script>
<p>Because I&#8217;ve been on a OpenWRT buzz, I wanted to use an old D-Link DSL/Router for OpenWRT.</p>
<p>I was ripping my hair out trying to figure out why I couldnt get DSL to sync. It turns out that I was using a variable voltage adaptor and I should have been giving 12V but i was only giving 6V! Anyway once i upped the voltage DSL started to sync.</p>
<p>For anyone else that wants to use OpenWRT with eircom use the following settings in /etc/config/network:</p>
<pre>

config 'interface' 'loopback'
	option 'ifname' 'lo'
	option 'proto' 'static'
	option 'ipaddr' '127.0.0.1'
	option 'netmask' '255.0.0.0'

config 'interface' 'lan'
	option 'type' 'bridge'
	option 'ifname' 'eth0'
	option 'proto' 'static'
	option 'ipaddr' '192.168.2.1'
	option 'netmask' '255.255.255.0'
	option 'nat' '1'

config 'atm-bridge'
	option 'unit' '0'
	option 'encaps' 'llc'
	option 'vpi' '8'
	option 'vci' '35'
#	option 'payload' 'routed'

config 'interface' 'wan'
	option 'ifname' 'nas0'
	option 'proto' 'pppoe'
	option 'encaps' 'llc'
	option 'vpi' '8'
	option 'vci' '35'
	option 'keepalive' '5,20'
	option 'username' 'eircom@eircom.net'
	option 'password' 'broadband1'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://dmarkey.com/wordpress/2011/01/15/openwrt-eircom-settings/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New ubuntu and arch xen install initrds</title>
		<link>http://dmarkey.com/wordpress/2010/01/05/new-ubuntu-and-arch-xen-install-initrds/</link>
		<comments>http://dmarkey.com/wordpress/2010/01/05/new-ubuntu-and-arch-xen-install-initrds/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 06:34:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Xen]]></category>

		<category><![CDATA[xen linux ubuntu arch]]></category>

		<guid isPermaLink="false">http://dmarkey.com/wordpress/2010/01/05/new-ubuntu-and-arch-xen-install-initrds/</guid>
		<description><![CDATA[            
New Xen install initrds.
Over the past week i&#8217;ve been working on Ubuntu 9.10 and Arch linux install initrds for Xen PVM.
The arch one has been straight forward but the ubuntu one is a bit on the tricky side(grub2 mainly).
Will post them up when [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://dmarkey.com/wordpress/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPython.js"></script>
<p>New Xen install initrds.</p>
<p>Over the past week i&#8217;ve been working on Ubuntu 9.10 and Arch linux install initrds for Xen PVM.</p>
<p>The arch one has been straight forward but the ubuntu one is a bit on the tricky side(grub2 mainly).</p>
<p>Will post them up when i have them tested a bit.</p>
]]></content:encoded>
			<wfw:commentRss>http://dmarkey.com/wordpress/2010/01/05/new-ubuntu-and-arch-xen-install-initrds/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Easy NAT</title>
		<link>http://dmarkey.com/wordpress/2009/12/15/easy-nat/</link>
		<comments>http://dmarkey.com/wordpress/2009/12/15/easy-nat/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 11:09:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[nat linux iptables]]></category>

		<guid isPermaLink="false">http://dmarkey.com/wordpress/2009/12/15/easy-nat/</guid>
		<description><![CDATA[            
This is the easy way to give virtual machines access to an external network using iptables.
Warning this is very open and probably shouldnt be used in a production environment.
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING  -j MASQUERADE
]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://dmarkey.com/wordpress/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPython.js"></script>
<p>This is the easy way to give virtual machines access to an external network using iptables.</p>
<p>Warning this is very open and probably shouldnt be used in a production environment.</p>
<p>echo 1 > /proc/sys/net/ipv4/ip_forward</p>
<p>iptables -t nat -A POSTROUTING  -j MASQUERADE</p>
]]></content:encoded>
			<wfw:commentRss>http://dmarkey.com/wordpress/2009/12/15/easy-nat/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

