<?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>Thoughts from Mads Sülau Jørgensen &#187; Work</title> <atom:link href="http://madssj.com/blog/category/work/feed/" rel="self" type="application/rss+xml" /><link>http://madssj.com/blog</link> <description>Various articles about programming and systems administration.</description> <lastBuildDate>Mon, 27 Jun 2011 08:54:43 +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>Converting a south 0.7 migration back to 0.6</title><link>http://madssj.com/blog/2010/09/27/converting-a-south-0-7-migration-back-to-0-6/</link> <comments>http://madssj.com/blog/2010/09/27/converting-a-south-0-7-migration-back-to-0-6/#comments</comments> <pubDate>Mon, 27 Sep 2010 13:16:23 +0000</pubDate> <dc:creator>Mads Sülau Jørgensen</dc:creator> <category><![CDATA[Django]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Work]]></category> <category><![CDATA[0.6]]></category> <category><![CDATA[0.7]]></category> <category><![CDATA[convert]]></category> <category><![CDATA[south]]></category> <guid
isPermaLink="false">http://swag.dk/blog/?p=230</guid> <description><![CDATA[I had a minor fight with south earlier today, where someone had created a migration with south 0.7, and I needed it to work with south 0.6. Needless to say that it would be a pain to manually convert it &#8230; <a
href="http://madssj.com/blog/2010/09/27/converting-a-south-0-7-migration-back-to-0-6/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I had a minor fight with <a
href="http://south.aeracode.org/">south</a> earlier today, where someone had created a migration with south 0.7, and I needed it to work with south 0.6.</p><p>Needless to say that it would be a pain to manually convert it from the better 0.7 format back into 0.6, so I wrote a fairly small python script, that does the job.</p><p><span
id="more-230"></span> Don&#8217;t blame me if the script causes your data to be erased or tables to be dropped. It&#8217;s ment as a guideline, although it worked for me out of the box.</p><p>YMMV.</p><p>Usage: python &lt;south_07to06.py> &lt;path/to/migration.py></p><div
class="wp_syntax"><div
class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
&nbsp;
create_table_re = <span style="color: #dc143c;">re</span>.<span style="color: #008000;">compile</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;db.create_table('([^']+)',&quot;</span><span style="color: black;">&#41;</span>
field_name_re = <span style="color: #dc143c;">re</span>.<span style="color: #008000;">compile</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;^(s*)('([^']+)', self.gf&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
cur_model = <span style="color: #008000;">None</span>
&nbsp;
<span style="color: #008000;">input</span> = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">input</span>.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    line = line.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    match = create_table_re.<span style="color: black;">search</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> line.<span style="color: black;">startswith</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;class Migration&quot;</span><span style="color: black;">&#41;</span>:
        line = <span style="color: #483d8b;">&quot;class Migration():&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">elif</span> line.<span style="color: black;">startswith</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;from south.v2&quot;</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">continue</span>
    <span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #483d8b;">'Meta'</span> <span style="color: #ff7700;font-weight:bold;">in</span> line <span style="color: #ff7700;font-weight:bold;">and</span> <span style="color: #483d8b;">'object_name'</span> <span style="color: #ff7700;font-weight:bold;">in</span> line:
        line = <span style="color: #dc143c;">re</span>.<span style="color: black;">sub</span><span style="color: black;">&#40;</span>r<span style="color: #483d8b;">&quot;(?:, )?'object_name': '[^']+'&quot;</span>, <span style="color: #483d8b;">&quot;&quot;</span>, line<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> cur_model <span style="color: #ff7700;font-weight:bold;">and</span> match:
        cur_model = match.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">elif</span> cur_model <span style="color: #ff7700;font-weight:bold;">and</span> line.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">'))'</span>:
        cur_model = <span style="color: #008000;">None</span>
    <span style="color: #ff7700;font-weight:bold;">elif</span> cur_model:
        field_match = field_name_re.<span style="color: black;">search</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">if</span> field_match:
            spaces = field_match.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
            field_name = field_match.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
            line = <span style="color: #483d8b;">&quot;%s('%s', orm['%s:%s']), &quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>spaces, field_name, cur_model.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;_&quot;</span>, <span style="color: #483d8b;">&quot;.&quot;</span><span style="color: black;">&#41;</span>, field_name<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">print</span> line</pre></div></div> ]]></content:encoded> <wfw:commentRss>http://madssj.com/blog/2010/09/27/converting-a-south-0-7-migration-back-to-0-6/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to resize ext3 partition on LVM</title><link>http://madssj.com/blog/2010/07/05/how-to-resize-ext3-partition-on-lvm/</link> <comments>http://madssj.com/blog/2010/07/05/how-to-resize-ext3-partition-on-lvm/#comments</comments> <pubDate>Mon, 05 Jul 2010 15:13:06 +0000</pubDate> <dc:creator>Mads Sülau Jørgensen</dc:creator> <category><![CDATA[Work]]></category> <category><![CDATA[ext3]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[lvm]]></category> <category><![CDATA[xen]]></category> <guid
isPermaLink="false">http://swag.dk/blog/?p=210</guid> <description><![CDATA[From time to time I have to resize the file systems on various systems which are primarily using ext3 on top of LVM. Resizing such an ext3 file system is not a complex task at all. For starters, make sure &#8230; <a
href="http://madssj.com/blog/2010/07/05/how-to-resize-ext3-partition-on-lvm/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>From time to time I have to resize the file systems on various systems which are primarily using ext3 on top of LVM.</p><p>Resizing such an ext3 file system is not a complex task at all. For starters, make sure you shut the domU down (or unmount the file system &#8211; unless you feel brave enough to do an online resize, in which case you should not be reading this).</p><p><span
id="more-210"></span> After unmounting the file system, the LVM volume can be resized with <code>lvresize</code>:<pre>
$ sudo lvresize -L +2G /dev/vg00/foo.example.com-disk
  Extending logical volume foo.example.com-disk to 8,00 GB
  Logical volume foo.example.com-disk successfully resized
</pre></p><p>Then, you&#8217;re ready to tell the file system that it has been resized:<pre>
$ sudo resize2fs /dev/foo.example.com-disk
resize2fs 1.40-WIP (14-Nov-2006)
Resizing the filesystem on /dev/vg00/foo.example.com-disk to 2097152 (4k) blocks.
The filesystem on /dev/vg00/petitepeople01.koho.dk-disk is now 2097152 blocks long.
</pre></p><p>And there you have it, a file system resized and ready for use.</p><p>P.S.
I&#8217;ve read numorus times that you have to run <code>fsck -f</code> and turn off journaling to use <code>resize2fs</code> but can&#8217;t really find any good reason to do so. If you want to, the commands are:</p><p>Turn off journal: <code>tune2fs -O ^has_journal <dev><dev></code></p><p>Force check of file system: <code>fsck -f <dev></code></p><p>Turn on journal: <code>tune2fs -j <dev></code></p> ]]></content:encoded> <wfw:commentRss>http://madssj.com/blog/2010/07/05/how-to-resize-ext3-partition-on-lvm/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Managing multiple AWS identities</title><link>http://madssj.com/blog/2009/07/22/managing-multiple-aws-identities/</link> <comments>http://madssj.com/blog/2009/07/22/managing-multiple-aws-identities/#comments</comments> <pubDate>Wed, 22 Jul 2009 14:50:12 +0000</pubDate> <dc:creator>Mads Sülau Jørgensen</dc:creator> <category><![CDATA[Python]]></category> <category><![CDATA[Work]]></category> <guid
isPermaLink="false">http://swag.dk/blog/?p=167</guid> <description><![CDATA[I&#8217;m running multiple different project on AWS which was so much of a pain to use, as I often find myself having to use the identity of project-a together with the official amazon ec2 tools. To help myself manage the &#8230; <a
href="http://madssj.com/blog/2009/07/22/managing-multiple-aws-identities/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;m running multiple different project on <a
href="http://aws.amazon.com/">AWS</a> which was so much of a pain to use, as I often find myself having to use the identity of project-a together with the official amazon ec2 tools.</p><p>To help myself manage the multiple identities, I wote a set of bash functions, called:</p><ul><li><code>aws_load &lt;config-name&gt;</code> &#8211; loads configuration from config-name</li><li><code>ec2ssh &lt;instance-number-in-ec2din-list&gt;</code> &#8211; ssh&#8217;s into a given instance, with the root key</li><li><code>ec2scp</code> &#8211; a shorthand for scp -i &lt;keyfile&gt;</li></ul><p><span
id="more-167"></span> I keep the configuration files in the directory <code>~/amazon/conf/name.sh</code> and keypairs in <code>~/amazon/keypairs/</code> but that should be obvious to change.</p><p>To change or load an identity, one simply calls the function from a shell prompt like so:</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">mads<span style="color: #000000; font-weight: bold;">@</span>workmads ~ <span style="color: #000000; font-weight: bold;">%</span> aws_load some-identity
loaded certificate ...
loaded <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>mads<span style="color: #000000; font-weight: bold;">/</span>amazon<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>some-identity.sh <span style="color: #7a0874; font-weight: bold;">&#40;</span>...<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div><p>I hope someone finds this as useful as I do.</p><p>Functions (could be placed in <code>.bashrc</code> or <code>.zshrc</code>).</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> aws_load <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #007800;">ec2_configurations</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/amazon/conf&quot;</span>
		<span style="color: #007800;">ec2_keys</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/amazon/keypairs&quot;</span>
		<span style="color: #007800;">conf</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$ec2_configurations</span>/$1.sh&quot;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$conf</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #7a0874; font-weight: bold;">unset</span> AMAZON_ID AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_CERT EC2_PRIVATE_KEY EC2_CERT AWS_KEYPAIR_NAME
&nbsp;
			<span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #007800;">$conf</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$AWS_KEYPAIR_NAME</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
				<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_SSH_KEY</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$ec2_keys</span>/id_rsa_<span style="color: #007800;">${AWS_KEYPAIR_NAME}</span>-keypair&quot;</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;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$AWS_CERT</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
				<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EC2_PRIVATE_KEY</span>=~<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>pk-<span style="color: #007800;">$AWS_CERT</span>.pem
				<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EC2_CERT</span>=~<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>cert-<span style="color: #007800;">$AWS_CERT</span>.pem
&nbsp;
				<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;loaded certificate <span style="color: #007800;">$AWS_CERT</span>&quot;</span>
			<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;loaded <span style="color: #007800;">$conf</span> (<span style="color: #007800;">$AMAZON_ID</span>)&quot;</span>
		<span style="color: #000000; font-weight: bold;">else</span>
			<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;configuration <span style="color: #007800;">$conf</span> not found (or not executable)&quot;</span>
		<span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;usage: aws_load &lt;configuration name&gt;&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> ec2ssh <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">HOST</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`ec2din | awk '/i-/ {print $4}' | tail +$1 | head -n 1`</span>&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$AWS_SSH_KEY</span> <span style="color: #660033;">-l</span> root <span style="color: #800000;">${HOST}</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Please write a number&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> ec2scp <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #c20cb9; font-weight: bold;">scp</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$AWS_SSH_KEY</span> $<span style="color: #000000; font-weight: bold;">@</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div><p>Configuration &#8220;file&#8221; template to be placed in <code>~/amazon/conf/&lt;config-name&gt;.sh</code>:</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>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AMAZON_ID</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_ACCESS_KEY_ID</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_SECRET_ACCESS_KEY</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_CERT</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_KEYPAIR_NAME</span>=<span style="color: #ff0000;">&quot;&quot;</span></pre></div></div><p>Happy identity switching.</p> ]]></content:encoded> <wfw:commentRss>http://madssj.com/blog/2009/07/22/managing-multiple-aws-identities/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Detaching a running process on *nix (or how to make a process continue to run after logging out)</title><link>http://madssj.com/blog/2009/07/16/detaching-a-process-on-nix/</link> <comments>http://madssj.com/blog/2009/07/16/detaching-a-process-on-nix/#comments</comments> <pubDate>Thu, 16 Jul 2009 12:31:12 +0000</pubDate> <dc:creator>Mads Sülau Jørgensen</dc:creator> <category><![CDATA[Work]]></category> <guid
isPermaLink="false">http://swag.dk/blog/?p=156</guid> <description><![CDATA[Today, I had to copy 70 GiB of data from a ext3 filesystem to a XFS filesystem. This involved a lot of small files. After a couple of hours of waiting, I thought it&#8217;d be best to just leave it &#8230; <a
href="http://madssj.com/blog/2009/07/16/detaching-a-process-on-nix/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Today, I had to copy 70 GiB of data from a ext3 filesystem to a XFS filesystem. This involved a lot of small files. After a couple of hours of waiting, I thought it&#8217;d be best to just leave it running, and resume my activities the day after. But <a
href="http://www.youtube.com/watch?v=rks-Cr3Fr_k">oh nooo</a>, I forgot to run it in a <a
href="http://www.gnu.org/software/screen/">screen</a>.</p><p><span
id="more-156"></span> Detaching a running process from your shell, proved to be very easy in deed, using a shell command called <a
href="http://www.google.com/search?q=disown+linux">disown</a>.</p><p>To disown a running process, start by suspending the process by pressing <code>^Z</code>, then send it to the background with the command <code>bg</code> <em>then</em> you can make it run until it&#8217;s done by using the <code>disown</code> command. To access the processes you&#8217;ve got suspended, you can use the <code>%</code> prefix (<code>%1</code> for the first, <code>%2</code> for the second etc.). To get a list of running processes you can use the <code>jobs</code> command.</p><p>Example:</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">mads<span style="color: #000000; font-weight: bold;">@</span>workmads ~ <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">120</span>
^Z
<span style="color: #c20cb9; font-weight: bold;">zsh</span>: suspended  <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">120</span>
mads<span style="color: #000000; font-weight: bold;">@</span>workmads ~ <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">bg</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>  + continued  <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">120</span>
mads<span style="color: #000000; font-weight: bold;">@</span>workmads ~ <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">disown</span> <span style="color: #000000; font-weight: bold;">%</span>1
&nbsp;
mads<span style="color: #000000; font-weight: bold;">@</span>workmads ~ <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">ps</span> xawu<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #c20cb9; font-weight: bold;">sleep</span>
mads     <span style="color: #000000;">31725</span>   <span style="color: #000000;">0.0</span>  <span style="color: #000000;">0.0</span>    <span style="color: #000000;">75332</span>    <span style="color: #000000;">304</span> s003  S     <span style="color: #000000;">2</span>:25PM   <span style="color: #000000;">0</span>:<span style="color: #000000;">00.00</span> <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">120</span></pre></div></div><p>If you accedently didn&#8217;t background your process, you can tell it to resume by sending it a <code>SIGCONT</code> signal with <code>kill -SIGCONT &lt;pid&gt;</code>.</p><p>Of course, this is no replacement for <code>nohup</code> or <code>screen</code>, but I think it is a great supplement.</p> ]]></content:encoded> <wfw:commentRss>http://madssj.com/blog/2009/07/16/detaching-a-process-on-nix/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Poormans cloudfront with EC2 and varnish</title><link>http://madssj.com/blog/2009/06/30/poormans-cloudfront-with-ec2-and-varnish/</link> <comments>http://madssj.com/blog/2009/06/30/poormans-cloudfront-with-ec2-and-varnish/#comments</comments> <pubDate>Tue, 30 Jun 2009 08:51:33 +0000</pubDate> <dc:creator>Mads Sülau Jørgensen</dc:creator> <category><![CDATA[Work]]></category> <category><![CDATA[amazon aws]]></category> <category><![CDATA[cache]]></category> <category><![CDATA[cloudfront]]></category> <category><![CDATA[varnish]]></category> <guid
isPermaLink="false">http://swag.dk/blog/?p=152</guid> <description><![CDATA[Recently (10-20 minutes ago), amazon couldfront (a cdn) stopped sending dns replies in europe: % dig -t ns cloudfront.net ; DiG 9.4.3-P1 -t ns cloudfront.net ;; global options: printcmd ;; connection timed out; no servers could be reached I was &#8230; <a
href="http://madssj.com/blog/2009/06/30/poormans-cloudfront-with-ec2-and-varnish/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Recently (10-20 minutes ago), amazon couldfront (a cdn) stopped sending dns replies in europe:</p><pre>
% dig -t ns cloudfront.net
; <<>> DiG 9.4.3-P1 <<>> -t ns cloudfront.net
;; global options:  printcmd
;; connection timed out; no servers could be reached
</pre><p>I was going to do a guide to set up a varnish to replace cloudfront temporarily (and did actually set up the instance, and software &#8211; I might do the guide and ami anyway) when I realized, that I (as well as most other people) can just change the relevant url to point to the S3 bucket. Problem solved. That will, however, not be as fast as either cloudfront itself, or a varnish cached backend.</p><p>Should anyone be interested in how varnish is setup to handle failures from cloudfront, I&#8217;ll happily do an ami.</p> ]]></content:encoded> <wfw:commentRss>http://madssj.com/blog/2009/06/30/poormans-cloudfront-with-ec2-and-varnish/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Django &#8211; sharing a memcached instance</title><link>http://madssj.com/blog/2009/06/23/django-sharing-a-memcached-instance/</link> <comments>http://madssj.com/blog/2009/06/23/django-sharing-a-memcached-instance/#comments</comments> <pubDate>Tue, 23 Jun 2009 11:23:00 +0000</pubDate> <dc:creator>Mads Sülau Jørgensen</dc:creator> <category><![CDATA[Django]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Work]]></category> <category><![CDATA[cache]]></category> <category><![CDATA[memcached]]></category> <category><![CDATA[prefix]]></category> <guid
isPermaLink="false">http://swag.dk/blog/?p=135</guid> <description><![CDATA[Update: Some Curious User brought to my attention, that a ticket has been opened which, when implemented, will add a setting for a cache prefix. It will also allow other cache key manipulations. Django has implemented KEY_PREFIX in the development &#8230; <a
href="http://madssj.com/blog/2009/06/23/django-sharing-a-memcached-instance/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><strong>Update:</strong> <del
datetime="2011-01-04T13:22:30+00:00">Some <a
href="http://swag.dk/blog/2009/06/23/django-sharing-a-memcached-instance/comment-page-1/#comment-812">Curious User</a> brought to my attention, that <a
href="http://code.djangoproject.com/ticket/13795">a ticket</a> has been opened which, when implemented, will add a setting for a cache prefix. It will also allow other cache key manipulations.</del> <del
datetime="2011-03-23T13:04:02+00:00">Django has <a
href="http://docs.djangoproject.com/en/dev/topics/cache/#cache-key-prefixing">implemented</a> <code>KEY_PREFIX</code> in the development version, which currently means, that it will be out in 1.4 iirc.</del> Django 1.3 has <a
href="http://docs.djangoproject.com/en/1.3/topics/cache/#cache-key-prefixing">implemented</a> <code>KEY&#95;PREFIX</code> which solves the problem <i>once and for all</i>.</p><p>Until recently I&#8217;ve been using the <code>file://</code> django cache, but that has a &#8220;problem&#8221; when multiple users needs to manipulate the cache (think uid 80 writes a key, that uid 1000 wants to delete).</p><p>My problem with the <code>memcached://</code> django cache provider has been, that it cannot handle being used on a shared memcached instance, because of the danger of key collissions.</p><p><span
id="more-135"></span> If project A and project B would share a memcached instance, they basiclly share the same global namespace. So if they both write a key called <code>actor</code> there is no telling what will happen.</p><p>So I wrote a little cache backend for django, that uses the current <code>memcached</code> backend, but adds a pre-defined prefix to all keys.</p><p><strong>Usage:</strong> Put the code somewhere inside your project in a file called <code>memcached<em>key</em>prefix.py</code>, and set your <code>CACHE&#95;BACKEND</code> to something like: <code>path.to.memcached&#95;key&#95;prefix:///127.0.0.1:11211/?key<em>prefix=sewc</em>&amp;foo=bar&amp;timeout=3600</code></p><div
class="wp_syntax"><div
class="code"><pre class="python" style="font-family:monospace;"><span style="color: #483d8b;">&quot;Memcached cache backend with key prefixing&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">core</span>.<span style="color: black;">cache</span>.<span style="color: black;">backends</span>.<span style="color: black;">base</span> <span style="color: #ff7700;font-weight:bold;">import</span> InvalidCacheBackendError
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">core</span>.<span style="color: black;">cache</span>.<span style="color: black;">backends</span>.<span style="color: black;">memcached</span> <span style="color: #ff7700;font-weight:bold;">import</span> CacheClass <span style="color: #ff7700;font-weight:bold;">as</span> MemcachedCacheClass
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">utils</span>.<span style="color: black;">encoding</span> <span style="color: #ff7700;font-weight:bold;">import</span> smart_unicode, smart_str
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> CacheClass<span style="color: black;">&#40;</span>MemcachedCacheClass<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, server, params<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            <span style="color: #008000;">self</span>._key_prefix = smart_str<span style="color: black;">&#40;</span>params<span style="color: black;">&#91;</span><span style="color: #483d8b;">'key_prefix'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">KeyError</span>:
            <span style="color: #ff7700;font-weight:bold;">raise</span> InvalidCacheBackendError<span style="color: black;">&#40;</span><span style="color: #483d8b;">'key_prefix not specified'</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>CacheClass, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span>server, params<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> _get_key<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, key<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>._key_prefix + smart_str<span style="color: black;">&#40;</span>key<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> add<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, key, value, timeout=<span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>CacheClass, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">add</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._get_key<span style="color: black;">&#40;</span>key<span style="color: black;">&#41;</span>, value, timeout<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> get<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, key, default=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>CacheClass, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._get_key<span style="color: black;">&#40;</span>key<span style="color: black;">&#41;</span>, default<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, key, value, timeout=<span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>CacheClass, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._get_key<span style="color: black;">&#40;</span>key<span style="color: black;">&#41;</span>, value, timeout<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> delete<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, key<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>CacheClass, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">delete</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._get_key<span style="color: black;">&#40;</span>key<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> get_many<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, keys<span style="color: black;">&#41;</span>:
        keys = <span style="color: black;">&#91;</span><span style="color: #008000;">self</span>._get_key<span style="color: black;">&#40;</span>key<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> key <span style="color: #ff7700;font-weight:bold;">in</span> keys<span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>CacheClass, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">get_many</span><span style="color: black;">&#40;</span>keys<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> incr<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, key, delta=<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>CacheClass, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">incr</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._get_key<span style="color: black;">&#40;</span>key<span style="color: black;">&#41;</span>, delta<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> decr<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, key, delta=<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>CacheClass, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">decr</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>._get_key<span style="color: black;">&#40;</span>key<span style="color: black;">&#41;</span>, delta<span style="color: black;">&#41;</span></pre></div></div> ]]></content:encoded> <wfw:commentRss>http://madssj.com/blog/2009/06/23/django-sharing-a-memcached-instance/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Django compatible PyAMF test client</title><link>http://madssj.com/blog/2009/04/21/django-compatible-pyamf-test-client/</link> <comments>http://madssj.com/blog/2009/04/21/django-compatible-pyamf-test-client/#comments</comments> <pubDate>Tue, 21 Apr 2009 13:18:19 +0000</pubDate> <dc:creator>Mads Sülau Jørgensen</dc:creator> <category><![CDATA[Django]]></category> <category><![CDATA[flash]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Work]]></category> <category><![CDATA[Client]]></category> <category><![CDATA[PyAMF]]></category> <category><![CDATA[Test]]></category> <guid
isPermaLink="false">http://swag.dk/blog/?p=92</guid> <description><![CDATA[While working on a project using PyAMF today, i was about to write a unittest of a service method, when I realized that it would be harder than necessary to make unittests of the service. The cause of this is, &#8230; <a
href="http://madssj.com/blog/2009/04/21/django-compatible-pyamf-test-client/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>While working on a project using <a
href="http://pyamf.org/">PyAMF</a> today, i was about to write a unittest of a service method, when I realized that it would be harder than necessary to make unittests of the service. The cause of this is, that there was no test client wrapper for the django test client for pyamf, which means, that to do a unittest of the gateway, you&#8217;ll have to start a django server, and run a unittest elsewhere.</p><p>Seeing as how there are a lot of benefits to using djangos own test suite (fixtures and automatic database generation to name a few), i set out to write a little test client for PyAMF to utilize django&#8217;s test client, so it would be possible to write a proper test suite.</p><p>This turned out great, and is now <a
href="http://pyamf.org/ticket/508">ticket 508</a> over at PyAMFs trac. Look at the <a
href="http://pyamf.org/attachment/ticket/508/client.py">client.py</a> for the code. At some point, it will be integrated into PyAMF mainline as <code>p.r.c.django.TestClient</code> (or something like that).</p> ]]></content:encoded> <wfw:commentRss>http://madssj.com/blog/2009/04/21/django-compatible-pyamf-test-client/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Using mercurial with eclipse to edit actionscript files on os x</title><link>http://madssj.com/blog/2009/03/11/using-mercurial-with-eclipse-to-edit-actionscript-files-on-os-x/</link> <comments>http://madssj.com/blog/2009/03/11/using-mercurial-with-eclipse-to-edit-actionscript-files-on-os-x/#comments</comments> <pubDate>Wed, 11 Mar 2009 09:38:33 +0000</pubDate> <dc:creator>Mads Sülau Jørgensen</dc:creator> <category><![CDATA[Actionscript]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Work]]></category> <category><![CDATA[Mercurial]]></category> <guid
isPermaLink="false">http://swag.dk/blog/2009/03/11/using-mercurial-with-eclipse-to-edit-actionscript-files-on-os-x/</guid> <description><![CDATA[We have recently switched to use mercurial as our DVCS. We&#8217;re hosting our many repositories on bitbucket. I love it. When it comes to actionscript files, flash has always had odd newlines. For some reason, it has always used r &#8230; <a
href="http://madssj.com/blog/2009/03/11/using-mercurial-with-eclipse-to-edit-actionscript-files-on-os-x/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><a
href="http://www.konstellation.dk/">We</a> have recently switched to use <a
href="http://www.selenic.com/mercurial/wiki/">mercurial</a> as our DVCS. We&#8217;re hosting our many repositories on <a
href="http://bitbucket.org/">bitbucket</a>.</p><p>I love it.</p><p>When it comes to actionscript files, flash has always had odd newlines. For some reason, it has always used <code>r</code> as it&#8217;s newline. Mercurial, beeing a unix tool, likes it&#8217;s newlines to be <code>n</code>. So what better to do, than to make mercurial encode/decode the files for us.</p><p>To do that, we can simply add the following to our <code>.hgrc</code> file:</p><pre>
[encode]
*.as = perl -pe 's/r/n/g'
[decode]
*.as = perl -pe 's/r/n/g'
</pre><p>I don&#8217;t really know wether the decode part is necessary, but I like to keep it around (if someone should commit poison).</p> ]]></content:encoded> <wfw:commentRss>http://madssj.com/blog/2009/03/11/using-mercurial-with-eclipse-to-edit-actionscript-files-on-os-x/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>DNS management done right (and without the crappy attitude)</title><link>http://madssj.com/blog/2009/03/06/dns-management-done-right-and-without-the-crappy-attitude/</link> <comments>http://madssj.com/blog/2009/03/06/dns-management-done-right-and-without-the-crappy-attitude/#comments</comments> <pubDate>Fri, 06 Mar 2009 07:24:44 +0000</pubDate> <dc:creator>Mads Sülau Jørgensen</dc:creator> <category><![CDATA[Insanity]]></category> <category><![CDATA[Ramblings]]></category> <category><![CDATA[Rants]]></category> <category><![CDATA[Work]]></category> <guid
isPermaLink="false">http://swag.dk/blog/?p=67</guid> <description><![CDATA[I&#8217;ve been using GratisDNS A free danish dns provider to manage my dns for a long time. Using their management interface is no walk in the park. It also has a bat habit of sending the username and password as &#8230; <a
href="http://madssj.com/blog/2009/03/06/dns-management-done-right-and-without-the-crappy-attitude/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been using <a
href="http://www.gratisdns.dk/">GratisDNS A free danish dns provider</a> to manage my dns for a long time. Using their management interface is no walk in the park. It also has a bat habit of sending the username and password as a hidden form variable for every page request, in cleartext mind you. Nothing like examining the source of a page (for instance, if you wanted to make an <a
href="http://code.google.com/p/python-gratisdns/">python api</a>) and seeing your password in cleartext.</p><p>As far as their interface goes, I can deal with that. It works, and it seems to do what it&#8217;s supposed to do fairly easy. A thing that has pushed me over the top, is the admins inability to <a
href="http://forum.gratisdns.dk/gratisdns-support/forventet-tid-til-axfr-for-hidden-primary/">help diagnostic</a> a technical issue related to using their system as a secondary dns in front of a hidden primary.</p><p>Yesterday a <a
href="http://www.technobabble.dk/">good friend</a> of mine told me that there was a new player in the dns game, one started by some people that seem to care about usability, exciting features (multiple dns templates per domain) and external api&#8217;s (goodbuy <a
href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a>). It&#8217;s called <a
href="http://www.quickdns.dk/">QuickDNS</a>.</p><p>So I rushed to their site, created myself a user and started tinkering around. Let&#8217;s just say, the it was actually a pleasant experience to do, things just worked<sup>tm</sup>. So I setup a few templates and now have transfered a handful of my domains over there. Seems to work very well, just as expected.</p><p>So a very big congratulations to the whole QuickDNS team, you&#8217;ve done an excellent job, and made me a happy customer.</p><p>I seem to have agreed to give them a case of cola once they start implementing the axfr / hidden primary feature, and another one on completion. Can&#8217;t wait!</p> ]]></content:encoded> <wfw:commentRss>http://madssj.com/blog/2009/03/06/dns-management-done-right-and-without-the-crappy-attitude/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Mercurial trac commit hook</title><link>http://madssj.com/blog/2008/10/13/mercurial-trac-commit-hook/</link> <comments>http://madssj.com/blog/2008/10/13/mercurial-trac-commit-hook/#comments</comments> <pubDate>Mon, 13 Oct 2008 15:03:50 +0000</pubDate> <dc:creator>Mads Sülau Jørgensen</dc:creator> <category><![CDATA[Python]]></category> <category><![CDATA[Ramblings]]></category> <category><![CDATA[Work]]></category> <guid
isPermaLink="false">http://swag.dk/blog/?p=56</guid> <description><![CDATA[Having searched a lot around google, it does not seem that anyone has published their trac commit hooks for mercurial. Since I had to use just that, I&#8217;ve cooked up a little hook which is based on the hook from &#8230; <a
href="http://madssj.com/blog/2008/10/13/mercurial-trac-commit-hook/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Having searched a lot around google, it does not seem that anyone has published their <a
href="http://trac.edgewall.org/">trac</a> commit hooks for <a
href="http://www.selenic.com/mercurial/">mercurial</a>. Since I had to use just that, I&#8217;ve cooked up a little hook which is based on the hook from the <code>timingandestimationplugin</code>. I&#8217;ve created it as a changegroup hook, and it&#8217;s probably filled with bugs, but it seems to work and it catches the <code>fixes #42</code> and such.</p><p>To use the hook you must place it somewhere inside your <code>PYTHONPATH</code> and tell mercurial to use it (I placed it in a module called trachook &#8212; don&#8217;t call your module trac):</p><pre linenumbers="1">
[hooks]
changegroup = python:trachook.hook
</pre><p>And tell the hook where to find your trac installation:</p><pre linenumbers="1">
[trac-hook]
root = /path/to/trac
url = http://url/to/trac
</pre><p>Grab your own copy of the <a
href="http://www.bitbucket.org/madssj/mercurial-trac-hook/src/">source</a>, and happy coding. And a big thank you to <a
href="http://noehr.org/">Jesper Nøhr</a>.</p><p>Also, if you need a place to host your mercurial repository but don&#8217;t wan&#8217;t to set it up yourself, check out <a
href="http://www.bitbucket.org/">bitbucket</a>.</p> ]]></content:encoded> <wfw:commentRss>http://madssj.com/blog/2008/10/13/mercurial-trac-commit-hook/feed/</wfw:commentRss> <slash:comments>13</slash:comments> </item> </channel> </rss>
