<?xml version="1.0"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:dcterms="http://purl.org/dc/terms/" >
<channel>
<title>meta - Justin&#x27;s Ramblings</title>
<link>http://bouncybouncy.net//ramblings/tags/meta/</link>
<description>BB.Net</description>
<item>
	
	<title>dynamic ikiwiki pages</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/dynamic_ikiwiki_pages/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/dynamic_ikiwiki_pages/</link>
	
	
	<category>tags/ikiwiki</category>
	
	<category>tags/meta</category>
	
	<category>tags/pylons</category>
	
	<category>tags/python</category>
	
	<category>tags/tech</category>
	
	
	<pubDate>Fri, 15 Feb 2008 20:57:58 -0500</pubDate>
	<dcterms:modified>2008-02-16T18:36:26Z</dcterms:modified>
	
	<description><![CDATA[<p>The static pages that <a href="http://ikiwiki.info">ikiwiki</a>
generates are great, but I want to have some dynamic content here
as well.</p>
<p>If this works, this page should include the servers uptime.</p>
<!--# include virtual="/dyn/demo/uptime" -->
<p>yay <img src="http://bouncybouncy.net//ramblings/tags/meta/../../../smileys/smile.png" alt=":-)" /></p>
<p>So how does that work?</p>
<p>first configure nginx as follows</p>
<div class="syntax">
<pre>
server {
    listen       80;
    server_name  bouncybouncy.net  *.bouncybouncy.net web;

    location / {
        root   /home/justin/bbdotnet/static/;
        index  index.html index.htm;
        ssi on;
    }
    location /dyn {
        # All POST requests go to pylons directly
        include /usr/local/nginx/conf/proxy.conf;
        proxy_redirect  default; 
        if ($request_method = POST) {
            proxy_pass  http://127.0.0.1:5000;
            break;
        }
        default_type text/html; 

        set $memcached_key "$uri";
        memcached_pass localhost:11211;

        proxy_intercept_errors  on;

        # If no info would be found in memcache or memecache would be dead, go to real dynamic location
        error_page 404 502 = @dynamic_request;
    }
    location @dynamic_request{
        # This means, that we can't get to this location from outside - only by internal redirect
        internal;

        include /usr/local/nginx/conf/proxy.conf;
        proxy_redirect  default; 
        proxy_pass  http://127.0.0.1:5000;
    }

}

</pre></div>
<p>Pylons is setup to run on port 5000 as usual, nothing fancy
there.</p>
<p>Then anywhere we want some dynamic content we can simply do</p>
<div class="syntax">
<pre>
&lt;!--# include virtual="/dyn/demo/uptime" --&gt;

</pre></div>
<p>For now, you have to disable the htmlscrubber plugin for this to
work. There is probably a better solution. I think this would
simply involve a plugin that could run after htmlscrubber to insert
the include, then you would only need to have something like
[[include virtual="/dyn/demo/uptime"]] in your pages.</p>
<p>If you did not mind requring javscript, you could use <a href=
"http://www.mnot.net/javascript/hinclude/">HInclude</a> instead of
SSI.</p>
<p>To keep things running fast, we enable to caching on the pylons
controller. using a modified version of the beaker<em>cache
decorator. The following lines are inserted at the end of the
create</em>func method, which causes the page result to be cached
in memcache as well as in beaker.</p>
<div class="syntax">
<pre>
url = pylons.request.path_info
<span class="synStatement">if</span> pylons.request.params:
    url += "<span class=
"synConstant">?</span>" + pylons.request.environ['<span class=
"synConstant">QUERY_STRING</span>']

mc = memcache.Client(['<span class=
"synConstant">localhost</span>'])
mc.set(url, result, cache_expire)

</pre></div>
<p>The only remaining problem I see is a small race condition. If
the cache expires, and 20 concurrent requests all come in for the
page, most of them will end up hitting python instead of waiting
for the memcache key to appear. This might actually work better
using varnish or apache2 with <code>mod_disk_cache</code>, but the
last time I tried I could not get varnish to work at all, and
apache2 (I think) still does not support PURGE.</p>

]]></description>
	
</item>
<item>
	
	<title>ikiwiki problem solved</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/ikiwiki_problem_solved/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/ikiwiki_problem_solved/</link>
	
	
	<category>tags/ikiwiki</category>
	
	<category>tags/meta</category>
	
	<category>tags/tech</category>
	
	
	<pubDate>Thu, 14 Feb 2008 21:36:03 -0500</pubDate>
	<dcterms:modified>2008-02-16T18:32:18Z</dcterms:modified>
	
	<description><![CDATA[<p>I figured out the problem I was having with linking. I had to
move <code>ramblings/index.mdwm</code> to
<code>ramblings.mdwn</code> and change the pagespecs around a bit,
but now everything seems to work</p>

]]></description>
	
</item>
<item>
	
	<title>testing syntax</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/testing_syntax/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/testing_syntax/</link>
	
	
	<category>tags/ikiwiki</category>
	
	<category>tags/meta</category>
	
	<category>tags/tech</category>
	
	
	<pubDate>Thu, 14 Feb 2008 20:48:51 -0500</pubDate>
	<dcterms:modified>2008-02-16T18:32:18Z</dcterms:modified>
	
	<description><![CDATA[<p>I installed the <a href=
"http://ikiwiki.info/plugins/contrib/syntax/">syntax plugin</a></p>
<p>lets see if it works</p>
<div class="syntax">
<pre>

<span class="synStatement">def</span> <span class=
"synIdentifier">hello</span>():
    <span class="synStatement">for</span> x <span class=
"synStatement">in</span> list(set(xrange(10))):
        <span class="synStatement">yield</span> "<span class=
"synConstant">Hello, World!</span>"

</pre></div>
<p>I added the following to my <a href="http://bouncybouncy.net//ramblings/tags/meta/../../../local.css">local.css</a> for it to work.</p>
<div class="syntax">
<pre>
<span class="synSpecial">.</span>syntax <span class=
"synIdentifier">{</span>
        <span class="synType">background-color</span>: <span class=
"synConstant">#dde</span>;
        <span class="synType">padding</span>: <span class=
"synConstant">0.5em</span>;
        <span class="synType">border</span>: <span class=
"synConstant">1px</span> <span class=
"synType">solid</span> <span class="synConstant">#ccd</span>;
<span class="synIdentifier">}</span>
<span class="synStatement">span</span><span class=
"synSpecial">.</span>synStatement <span class=
"synIdentifier">{</span>
        <span class="synType">color</span>: <span class=
"synConstant">green</span>;
<span class="synIdentifier">}</span>
<span class="synStatement">span</span><span class=
"synSpecial">.</span>synIdentifier, <span class=
"synStatement">span</span><span class=
"synSpecial">.</span>synType <span class="synIdentifier">{</span>
        <span class="synType">font-weight</span>: <span class=
"synType">bold</span>;
<span class="synIdentifier">}</span>
<span class="synStatement">span</span><span class=
"synSpecial">.</span>synConstant <span class=
"synIdentifier">{</span>
        <span class="synType">color</span>: <span class=
"synConstant">blue</span>;
<span class="synIdentifier">}</span>

</pre></div>

]]></description>
	
</item>
<item>
	
	<title>yay ikiwiki</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/yay_ikiwiki/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/yay_ikiwiki/</link>
	
	
	<category>tags/ikiwiki</category>
	
	<category>tags/meta</category>
	
	<category>tags/tech</category>
	
	
	<pubDate>Thu, 14 Feb 2008 19:25:21 -0500</pubDate>
	<dcterms:modified>2008-02-16T18:32:18Z</dcterms:modified>
	
	<description><![CDATA[<p>I've setup ikiwiki again. I am liking it much better than the
last time I looked at it. There are much more plugins now.</p>
<p>However, I still have a few issues to work out.</p>
<h3>Page titles</h3>
<p>You can change the title of a page using [[meta title="New title
here"]] <em>but</em>, any subpages of that link show the plain
filename in the header</p>
<h3>Usedir setting</h3>
<p>I turned on the userdir setting. This is what seemed to give me
the most trouble the last time around. Some things seem to still be
broken though, like some of the back links in the header</p>

]]></description>
	
</item>
<item>
	
	<title>testing joeyh&#39;s blog script</title>
	
	<guid>http://bouncybouncy.net//ramblings/posts/testing_joeyh__39__s_blog_script/</guid>
	<link>http://bouncybouncy.net//ramblings/posts/testing_joeyh__39__s_blog_script/</link>
	
	
	<category>tags/ikiwiki</category>
	
	<category>tags/meta</category>
	
	<category>tags/tech</category>
	
	
	<pubDate>Thu, 14 Feb 2008 19:17:24 -0500</pubDate>
	<dcterms:modified>2008-02-16T18:32:18Z</dcterms:modified>
	
	<description><![CDATA[<p>If this works, it means the script i found at
http://git.kitenet.net/?p=joey/home;a=blob_plain;f=bin/blog works
<img src="http://bouncybouncy.net//ramblings/tags/meta/../../../smileys/smile.png" alt=":)" /></p>

]]></description>
	
</item>

</channel>
</rss>

