<?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>My two ¢&#039;s</title>
	<atom:link href="http://www.linuxaddicted.de/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxaddicted.de/blog</link>
	<description>A Gentoo addict, linux admin and developer</description>
	<lastBuildDate>Wed, 31 Mar 2010 12:12:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>puppetmasterd and passenger</title>
		<link>http://www.linuxaddicted.de/blog/2010/03/18/puppetmasterd-and-passenger/</link>
		<comments>http://www.linuxaddicted.de/blog/2010/03/18/puppetmasterd-and-passenger/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 17:30:16 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.linuxaddicted.de/blog/?p=317</guid>
		<description><![CDATA[<p>It seems like some people have trouble configuring/undestanding how to combine puppetmasterd and Passenger (aka mod_rails). Let&#8217;s get it on:</p> Install depencies <p>You need the following components on your puppetmaster server:</p> Phusion Passenger (http://modrails.com/) Rack (http://rubyforge.org/projects/rack) Configure puppetmaster <p>Your puppet package should contain a config.ru. I found mine in /usr/share/doc/puppet-0.25.4-r1/ext/rack/files/config.ru.bz2 (Gentoo).</p> <p></p> mkdir /etc/puppet/rack <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/2010/03/18/puppetmasterd-and-passenger/">puppetmasterd and passenger</a></span>]]></description>
			<content:encoded><![CDATA[<p>It seems like some people have trouble configuring/undestanding how to combine puppetmasterd and Passenger (aka mod_rails). Let&#8217;s get it on:</p>
<h2>Install depencies</h2>
<p>You need the following components on your puppetmaster server:</p>
<ul>
<li>Phusion Passenger (<a href="http://modrails.com/">http://modrails.com/</a>)</li>
<li>Rack (<a href="http://rubyforge.org/projects/rack">http://rubyforge.org/projects/rack</a>)</li>
</ul>
<h2>Configure puppetmaster</h2>
<p>Your puppet package should contain a config.ru. I found mine in /usr/share/doc/puppet-0.25.4-r1/ext/rack/files/config.ru.bz2 (Gentoo).</p>
<p><span id="more-317"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>rack
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>rack<span style="color: #000000; font-weight: bold;">/</span>public
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>YOUR_CONFIG.RU<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>rack
<span style="color: #c20cb9; font-weight: bold;">chown</span> puppet:root <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>rack<span style="color: #000000; font-weight: bold;">/</span>config.ru</pre></div></div>

<p>The final chown line is important! This way rack determines under which user to run the puppetmaster processes.</p>
<p>Add the following lines to your puppet.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>puppetmasterd<span style="color: #7a0874; font-weight: bold;">&#93;</span>
...
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY</pre></div></div>

<h2>Apache config</h2>
<p>You can keep your passenger config as is and modify it when required. Here&#8217;s a example vhost config:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Listen <span style="color: #000000;">8140</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">8140</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    ServerName puppet
    DocumentRoot <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>rack<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
    CustomLog <span style="color: #ff0000;">&quot;|/usr/sbin/rotatelogs /var/www/puppet/logs/access_log.%Y%m%d-%H%M 86400&quot;</span> common
    ErrorLog  <span style="color: #ff0000;">&quot;|/usr/sbin/rotatelogs /var/www/puppet/logs/error_log.%Y%m%d-%H%M 86400&quot;</span>
&nbsp;
    PassengerHighPerformance on
    PassengerMaxPoolSize <span style="color: #000000;">15</span>
    PassengerPoolIdleTime <span style="color: #000000;">300</span>
    PassengerUseGlobalQueue on
    PassengerStatThrottleRate <span style="color: #000000;">120</span>
    RackAutoDetect Off
    RailsAutoDetect Off
&nbsp;
    RackBaseURI <span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
    SSLEngine on
    SSLProtocol <span style="color: #660033;">-ALL</span> +SSLv3 +TLSv1
    SSLCipherSuite ALL:<span style="color: #000000; font-weight: bold;">!</span>ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP
    SSLCertificateFile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>XXXXXXXXXXXX.pem
    SSLCertificateKeyFile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private_keys<span style="color: #000000; font-weight: bold;">/</span>XXXXXXXXXXXX.pem
    SSLCertificateChainFile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>ca<span style="color: #000000; font-weight: bold;">/</span>ca_crt.pem
    SSLCACertificateFile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>ca<span style="color: #000000; font-weight: bold;">/</span>ca_crt.pem
    SSLCARevocationFile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>ca<span style="color: #000000; font-weight: bold;">/</span>ca_crl.pem
    SSLVerifyClient optional
    SSLVerifyDepth <span style="color: #000000;">1</span>
    SSLOptions +StdEnvVars
&nbsp;
    <span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #ff0000;">&quot;/etc/puppet/rack/public/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
        Options None
        AllowOverride None
&nbsp;
        Order allow,deny
        Allow from all
    <span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>Virtualhost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Restart apache and when clients connect are are triggered via puppetrun you may see something like this with passenger-status:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">passenger-status
<span style="color: #660033;">-----------</span> General information <span style="color: #660033;">-----------</span>
max      = <span style="color: #000000;">20</span>
count    = <span style="color: #000000;">9</span>
active   = <span style="color: #000000;">0</span>
inactive = <span style="color: #000000;">9</span>
Waiting on global queue: <span style="color: #000000;">0</span>
&nbsp;
<span style="color: #660033;">-----------</span> Domains <span style="color: #660033;">-----------</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>puppet<span style="color: #000000; font-weight: bold;">/</span>rack:
  PID: <span style="color: #000000;">19160</span>   Sessions: <span style="color: #000000;">0</span>    Processed: <span style="color: #000000;">39</span>      Uptime: 20s
  PID: <span style="color: #000000;">19202</span>   Sessions: <span style="color: #000000;">0</span>    Processed: <span style="color: #000000;">70</span>      Uptime: 17s
  PID: <span style="color: #000000;">18934</span>   Sessions: <span style="color: #000000;">0</span>    Processed: <span style="color: #000000;">95</span>      Uptime: 45s
  PID: <span style="color: #000000;">18977</span>   Sessions: <span style="color: #000000;">0</span>    Processed: <span style="color: #000000;">66</span>      Uptime: 42s
  PID: <span style="color: #000000;">19008</span>   Sessions: <span style="color: #000000;">0</span>    Processed: <span style="color: #000000;">63</span>      Uptime: 40s
  PID: <span style="color: #000000;">19184</span>   Sessions: <span style="color: #000000;">0</span>    Processed: <span style="color: #000000;">2</span>       Uptime: 19s
  PID: <span style="color: #000000;">19103</span>   Sessions: <span style="color: #000000;">0</span>    Processed: <span style="color: #000000;">8</span>       Uptime: 28s
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>puppet-dashboard<span style="color: #000000; font-weight: bold;">/</span>htdocs:
  PID: <span style="color: #000000;">19158</span>   Sessions: <span style="color: #000000;">0</span>    Processed: <span style="color: #000000;">6</span>       Uptime: 22s
  PID: <span style="color: #000000;">19236</span>   Sessions: <span style="color: #000000;">0</span>    Processed: <span style="color: #000000;">3</span>       Uptime: 10s</pre></div></div>

<p>Also refer to the offical puppet documentation on passenger <a href="http://docs.puppetlabs.com/guides/passenger.html">here</a>.</p>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/2010/03/18/puppetmasterd-and-passenger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVPN active/active cluster</title>
		<link>http://www.linuxaddicted.de/blog/2010/02/01/openvpn-activeactive-cluster/</link>
		<comments>http://www.linuxaddicted.de/blog/2010/02/01/openvpn-activeactive-cluster/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 18:49:10 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[keepalived]]></category>
		<category><![CDATA[OpenVPN]]></category>

		<guid isPermaLink="false">http://www.linuxaddicted.de/blog/?p=293</guid>
		<description><![CDATA[<p>Code snippets are for Gentoo systems but it should be easy to adapt this for other systems</p> <p>This is a small howto explaining how to run a active/active Cluster (keeplaived) setup with OpenVPN. The active/active reflects that both cluster nodes run the same OpenVPN instance. In server mode this setup leads to routing problems <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/2010/02/01/openvpn-activeactive-cluster/">OpenVPN active/active cluster</a></span>]]></description>
			<content:encoded><![CDATA[<p><em>Code snippets are for Gentoo systems but it should be easy to adapt this for other systems</em></p>
<p>This is a small howto explaining how to run a active/active Cluster (keeplaived) setup with OpenVPN. The active/active reflects that both cluster nodes run the same OpenVPN instance. In server mode this setup leads to routing problems as both nodes have the tunnel route added during startup (not after connect). This results in routing trouble as i needed the passive node to access the VPN tunnel via the active node. This is how i solved it:<br />
<span id="more-293"></span></p>
<h2>Routing setup</h2>
<p>Both firewall nodes have a static route which forwards tunnel traffic to one of the internal cluster IP&#8217;s. The metric for this route is 2 so a active tunnel is preferred over that static route.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">routes_eth2</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;192.168.44.0/24 via 192.168.20.254 metric 2&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>It doesn&#8217;t matter which node is active and gets the VPN connects as the other node has the right routing entries.</p>
<h2>OpenVPN configuration</h2>
<p>This setup requires the use of sudo or to run the OpenVPN daemon as root (sudo, sudo, sudo!!!). First we disable to automatically adding of routes and specify scripts for client-connect and client-disconnect. Dont forget to set script security.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">route-noexec
client-connect <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span>cluster_routing.sh
client-disconnect <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>openvpn<span style="color: #000000; font-weight: bold;">/</span>cluster_routing.sh
script-security <span style="color: #000000;">3</span></pre></div></div>

<h2>cluster_routing.sh</h2>
<p>This is a simple version of the script but it should be sufficient to work in most scenarios.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## This is useful for debugging and to get the available env vars</span>
<span style="color: #666666; font-style: italic;">##exec &amp;gt; /tmp/ovpn.debug.$$ 2&amp;gt;&amp;amp;1; set -x</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${script_type}</span>&quot;</span> == <span style="color: #ff0000;">&quot;client-connect&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>route add <span style="color: #660033;">-net</span> <span style="color: #800000;">${route_network_1}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> gw <span style="color: #800000;">${route_vpn_gateway}</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>route del <span style="color: #660033;">-net</span> <span style="color: #800000;">${route_network_1}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> gw <span style="color: #800000;">${route_vpn_gateway}</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

<p>This script adds and removes the needed route to get a operational tunnel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/2010/02/01/openvpn-activeactive-cluster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Short review: Puppet for Gentoo servers</title>
		<link>http://www.linuxaddicted.de/blog/2009/12/18/short-review-puppet-for-gentoo-servers/</link>
		<comments>http://www.linuxaddicted.de/blog/2009/12/18/short-review-puppet-for-gentoo-servers/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 10:51:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.linuxaddicted.de/blog/?p=246</guid>
		<description><![CDATA[<p>I recently started to integrate Puppet with my company&#8217;s OS installer to build custom Gentoo servers in almost no time. The install/build system reached a stable state and i want to share some information&#8217;s on what i did to get it working. The Gentoo support of puppet is not perfect but sufficient for my <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/2009/12/18/short-review-puppet-for-gentoo-servers/">Short review: Puppet for Gentoo servers</a></span>]]></description>
			<content:encoded><![CDATA[<p>I recently started to integrate <a href="http://reductivelabs.com/trac/puppet/" target="_blank">Puppet</a> with my company&#8217;s OS installer to build custom Gentoo servers in almost no time. The install/build system reached a stable state and i want to share some information&#8217;s on what i did to get it working. The Gentoo support of puppet is not perfect but sufficient for my use case. There are still some issues to solve:</p>
<ul>
<li>Slots don&#8217;t work (I&#8217;m working on a patch for the portage provider to address this issue)</li>
<li>No nice way to manage /etc/conf.d/net</li>
<li>Only the runlevel &#8220;default&#8221; can be managed (This is sufficient for most cases)</li>
<li>No built in USE flag support (i use a binhost so this doesn&#8217;t really affect my setup). Check this <a href="http://log.onthebrink.de/2008/05/using-puppet-on-gentoo.html" target="_blank">site</a> for a possible solution</li>
</ul>
<p>The missing slots integration is especially important when it comes to Tomcat. Tomcat requires sun-jdk-1.5 and sun-jdk-1.6. I solved this by adding sun-jdk-1.5 to our install image. Apart from this problems it works very well.<span id="more-246"></span></p>
<h2>Binhost setup</h2>
<p>The easiest way to ensure that all systems run the same software (version, use flags) is to setup a portage binhost and force all clients to use this server as only package source. There are a lot of howto&#8217;s out there on creating a binhost so i won&#8217;t explain it detail. To force all clients to use only binary packages set the following statements in make.conf (Puppet distribution!):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">PORTAGE_BINHOST</span>=<span style="color: #ff0000;">&quot;http://192.168.1.1/x86_64&quot;</span>
<span style="color: #007800;">EMERGE_DEFAULT_OPTS</span>=<span style="color: #ff0000;">&quot;--getbinpkgonly --usepkgonly&quot;</span></pre></div></div>

<p>The parameter EMERGE_DEFAULT_OPTS is important because Puppet will run the command &#8220;emerge xxx/yyy&#8221; so you can&#8217;t specify extra parameters. This parameter setup ensures that the package cannot be installed when the binary package is missing on the binhost.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/2009/12/18/short-review-puppet-for-gentoo-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New helper script: SVN updater using Growl notifications</title>
		<link>http://www.linuxaddicted.de/blog/2009/05/27/new-helper-script-svn-updater-using-growl-notifications/</link>
		<comments>http://www.linuxaddicted.de/blog/2009/05/27/new-helper-script-svn-updater-using-growl-notifications/#comments</comments>
		<pubDate>Wed, 27 May 2009 10:16:27 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.linuxaddicted.de/blog/?p=218</guid>
		<description><![CDATA[<p>This small helper script should be added to cron and checks your local working copies against the online repository. It can automatically update your working copies if a newer revision is available. The user will be informed using Growl popups. As Growl is only available for Mac users it&#8217;s a Mac only tool by <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/2009/05/27/new-helper-script-svn-updater-using-growl-notifications/">New helper script: SVN updater using Growl notifications</a></span>]]></description>
			<content:encoded><![CDATA[<p>This small helper script should be added to cron and checks your local working copies against the online repository. It can automatically update your working copies if a newer revision is available. The user will be informed using <a href="http://www.growl.info/"><strong>Growl</strong></a> popups. As Growl is only available for Mac users it&#8217;s a Mac only tool by now.</p>
<p>The script currently registers with Growl using the classes from Python bindings. This is not necessary and would also be done by growlnotify. I was just interested in how this whole Growl stuff works. Feel free to remove this parts. <span id="more-218"></span></p>
<p>When i started i was willing to do the whole Growl stuff manually which has worked very well from the command line but not from cron. Seems like the context or something else get&#8217;s lost and no notifications pop up anymore. To be able to run via cron i switched to growlnotify.</p>
<h2>Depencies</h2>
<ul>
<li><a href="http://www.growl.info/files/Growl-1.1.4-SDK.dmg">Growl SDK (Python bindings)</a></li>
<li><a href="http://growl.info/files/Growl-1.1.4.dmg">growlnotify from Growl distribution</a></li>
<li><a href="http://www.python.org">Python &gt;= 2.5</a></li>
</ul>
<h2>Screenshots</h2>
<p><img class="aligncenter size-full wp-image-223" title="svn_growl_screen_1" src="http://www.linuxaddicted.de/blog/wp-content/uploads/2009/05/picture-4.png" alt="svn_growl_screen_1" width="337" height="180" /></p>
<h2>Download</h2>
<p>Download: <strong><center><a href="http://www.linuxaddicted.de/blog/downloads/svn_growl_updater-0.3.tar"><img src="http://www.linuxaddicted.de/blog/wp-content/plugins/download-monitor/img/download.gif" /></a><br />svn_growl_updater / version 0.3 / size 60 kB / dlcount 58</center></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/2009/05/27/new-helper-script-svn-updater-using-growl-notifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Project: Django-powered Nagios configuration</title>
		<link>http://www.linuxaddicted.de/blog/2009/03/05/new-project-django-powered-nagios-configuration/</link>
		<comments>http://www.linuxaddicted.de/blog/2009/03/05/new-project-django-powered-nagios-configuration/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 14:11:32 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.linuxaddicted.de/blog/?p=211</guid>
		<description><![CDATA[<p>It&#8217;s time for a new private project: The Django-powered Nagios configuration.</p> <p>The idea resulted in reading the book &#8220;Python Web Development with Django&#8221;. One of the authors describes one of his projects for internal use: a Nagios config manager and i think it&#8217;s a great idea. I just played around with the idea but <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/2009/03/05/new-project-django-powered-nagios-configuration/">New Project: Django-powered Nagios configuration</a></span>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time for a new private project: The Django-powered Nagios configuration.</p>
<p>The idea resulted in reading the book &#8220;Python Web Development with Django&#8221;. One of the authors describes one of his projects for internal use: a Nagios config manager and i think it&#8217;s a great idea. I just played around with the idea but it got pretty usable so far. It&#8217;s not in a production ready state but as soon as it may be usable to you i will release it. Here&#8217;s a development screenshot:</p>
<p><span id="more-211"></span></p>
<p style="text-align: center;">
<div id="attachment_212" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.linuxaddicted.de/blog/wp-content/uploads/2009/03/picture-6.png"><img class="size-medium wp-image-212" title="nagios_host_add" src="http://www.linuxaddicted.de/blog/wp-content/uploads/2009/03/picture-6-300x152.png" alt="Modify monitored host" width="300" height="152" /></a><p class="wp-caption-text">Modify monitored host</p></div>
<p>More informations to come&#8230; Stay tuned</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/2009/03/05/new-project-django-powered-nagios-configuration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Django with Komodo IDE</title>
		<link>http://www.linuxaddicted.de/blog/2009/02/10/using-django-with-komodo-ide/</link>
		<comments>http://www.linuxaddicted.de/blog/2009/02/10/using-django-with-komodo-ide/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 20:44:58 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[Komodo]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.linuxaddicted.de/blog/?p=194</guid>
		<description><![CDATA[<p style="text-align: left;">I recently started to work on a new Django project and tried use my default IDE: Komodo IDE. Unfortunately it didn&#8217;t work out the way i wanted. Code cpmpletion didn&#8217;t work just as the import of my app. Here&#8217;s how i solved it:</p> <p></p> Add a new Python import directory: Preferences -&#62; <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/2009/02/10/using-django-with-komodo-ide/">Using Django with Komodo IDE</a></span>]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">I recently started to work on a new <a title="Django" href="http://www.djangoproject.org/" target="_blank">Django</a> project and tried use my default IDE: Komodo IDE. Unfortunately it didn&#8217;t work out the way i wanted. Code cpmpletion didn&#8217;t work just as the import of my app. Here&#8217;s how i solved it:</p>
<p><span id="more-194"></span></p>
<ol style="text-align: left;">
<li>Add a new Python import directory: <strong>Preferences -&gt; Languages -&gt; Python<br />
</strong><br />
My Django resides in /Library/Python/2.5/site-packages. Your installation may be in a different location.</p>
<p style="text-align: left;">
<p style="text-align: center;"><img class="size-full wp-image-196 aligncenter" title="komodo_prefs" src="http://www.linuxaddicted.de/blog/wp-content/uploads/2009/02/komodo_prefs.png" alt="komodo_prefs" width="447" height="307" /></p>
</li>
<li>Create a Komodo project for your new Django project and edit it&#8217;s properties: <strong>Properties -&gt; Languages -&gt; Python </strong>My project resides in /Users/dkerwin/development/django/stag_party with several application inside.</li>
<p style="text-align: center;"><img class="size-full wp-image-198 aligncenter" title="project_import" src="http://www.linuxaddicted.de/blog/wp-content/uploads/2009/02/project_import.png" alt="project_import" width="414" height="207" /></p>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/2009/02/10/using-django-with-komodo-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing iPython under MacOS X</title>
		<link>http://www.linuxaddicted.de/blog/2009/02/02/installing-ipython-under-macos-x/</link>
		<comments>http://www.linuxaddicted.de/blog/2009/02/02/installing-ipython-under-macos-x/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 12:54:14 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.linuxaddicted.de/blog/?p=188</guid>
		<description><![CDATA[<p>If you don&#8217;t know iPython by now:  check it out</p> <p>It&#8217;s a pretty nice tool if you work with python from the terminal. Especially the easy way to get information about modules and functions. The easiest way to install (especially in a Mac environment) is to use the &#8220;alldeps&#8221; tarball.</p> <p></p> deathstar-mac ~ $ <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/2009/02/02/installing-ipython-under-macos-x/">Installing iPython under MacOS X</a></span>]]></description>
			<content:encoded><![CDATA[<p>If you don&#8217;t know iPython by now:  <a href="http://ipython.scipy.org/moin/">check it out</a></p>
<p>It&#8217;s a pretty nice tool if you work with python from the terminal. Especially the easy way to get information about modules and functions. The easiest way to install (especially in a Mac environment) is to use the &#8220;alldeps&#8221; tarball.</p>
<p><span id="more-188"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">deathstar-mac ~ $ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>ipython.scipy.org<span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/</span>alldeps<span style="color: #000000; font-weight: bold;">/</span>ipython-alldeps-0.9.1.tar
deathstar-mac ~ $ <span style="color: #c20cb9; font-weight: bold;">tar</span> xvf ipython-alldeps-0.9.1.tar
deathstar-mac ~ $ <span style="color: #7a0874; font-weight: bold;">cd</span> ipython-alldeps-0.9.1.tar
deathstar-mac ~ $ <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>The default install location is ~/usr/local. You may change this by modifying the install scripts but for now use the default. Now it&#8217;s time to make some modifications to your profile. Add the following lines:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">deathstar-mac ~ $ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$PATH</span>:/Users/YOUR_USERNAME/usr/local/bin&quot;</span>
deathstar-mac ~ $ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PYTHONPATH</span>=<span style="color: #007800;">$PYTHONPATH</span>:<span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>YOUR_USERNAME<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>python2.5<span style="color: #000000; font-weight: bold;">/</span>site-packages</pre></div></div>

<p>Let&#8217;s complete the installation process:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">deathstar-mac ~ $ iptest
deathstar-mac ~ $ <span style="color: #7a0874; font-weight: bold;">cd</span> ipython-alldeps-0.9.1<span style="color: #000000; font-weight: bold;">/</span>ipython-0.9.1
deathstar-mac ~ $ python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--prefix</span>=~<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
&nbsp;
deathstar-mac ~ $ ipython
Leopard libedit detected.
Python 2.5.1 <span style="color: #7a0874; font-weight: bold;">&#40;</span>r251:<span style="color: #000000;">54863</span>, Apr <span style="color: #000000;">15</span> <span style="color: #000000;">2008</span>, <span style="color: #000000;">22</span>:<span style="color: #000000;">57</span>:<span style="color: #000000;">26</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> 
Type <span style="color: #ff0000;">&quot;copyright&quot;</span>, <span style="color: #ff0000;">&quot;credits&quot;</span> or <span style="color: #ff0000;">&quot;license&quot;</span> <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">more</span> information.
&nbsp;
IPython 0.9.1 <span style="color: #660033;">--</span> An enhanced Interactive Python.
?         -<span style="color: #000000; font-weight: bold;">&gt;</span> Introduction and overview of IPython<span style="color: #ff0000;">'s features.
%quickref -&gt; Quick reference.
help      -&gt; Python'</span>s own <span style="color: #7a0874; font-weight: bold;">help</span> system.
object?   -<span style="color: #000000; font-weight: bold;">&gt;</span> Details about <span style="color: #ff0000;">'object'</span>. ?object also works, ?? prints more.
&nbsp;
In <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>:</pre></div></div>

<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/2009/02/02/installing-ipython-under-macos-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inbound Traffic Shaping made (pretty) easy</title>
		<link>http://www.linuxaddicted.de/blog/2009/01/28/inbound-traffic-shaping-made-pretty-easy/</link>
		<comments>http://www.linuxaddicted.de/blog/2009/01/28/inbound-traffic-shaping-made-pretty-easy/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 17:50:40 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[QoS]]></category>

		<guid isPermaLink="false">http://www.linuxaddicted.de/blog/?p=186</guid>
		<description><![CDATA[<p>It&#8217;s not that easy to get trafic shaping done with Linux especially when it comes to inbound traffic. After some serious research i found this howto which is a excellent starting point. The supplied script can be easily customized and works pretty good. If there&#8217;s interest i can post my version for incoming traffic <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/2009/01/28/inbound-traffic-shaping-made-pretty-easy/">Inbound Traffic Shaping made (pretty) easy</a></span>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not that easy to get trafic shaping done with Linux especially when it comes to inbound traffic. After some serious research i found this <a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/ADSL-Bandwidth-Management-HOWTO.html">howto</a> which is a excellent starting point. The supplied script can be easily customized and works pretty good. If there&#8217;s interest i can post my version for incoming traffic only.</p>
<p>You have to apply the IMQ patch (can be found <a href="http://www.linuximq.net/patches.html">here</a>) to your kernel to get this working. IMQ is necessary because Linux can only limit outgoing traffic with builtin kernel settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/2009/01/28/inbound-traffic-shaping-made-pretty-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zattoo: Watch (free) TV on your PC</title>
		<link>http://www.linuxaddicted.de/blog/2008/12/11/zattoo-watch-free-tv-on-your-pc/</link>
		<comments>http://www.linuxaddicted.de/blog/2008/12/11/zattoo-watch-free-tv-on-your-pc/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 23:59:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.linuxaddicted.de/blog/?p=184</guid>
		<description><![CDATA[<p>Always been looking for a good, reliable, fast and free solution to watch TV on your PC? Take a look at Zattoo. There are binaries for Mac, M$ and Linux. Give it a try!</p> ]]></description>
			<content:encoded><![CDATA[<p>Always been looking for a good, reliable, fast and free solution to watch TV on your PC? Take a look at <a href="http://zattoo.com/">Zattoo</a>. There are binaries for Mac, M$ and Linux. Give it a try!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/2008/12/11/zattoo-watch-free-tv-on-your-pc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Perl: Use of &#8220;flock&#8221;</title>
		<link>http://www.linuxaddicted.de/blog/2008/12/10/perl-use-of-flock/</link>
		<comments>http://www.linuxaddicted.de/blog/2008/12/10/perl-use-of-flock/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 21:31:39 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.linuxaddicted.de/blog/?p=180</guid>
		<description><![CDATA[<p>This is a small example on flock. It may help you to prevent multiple running instances of the same script. Assume you run the script via cron and it may not be finished when cron attempts to start it again. This few lines of code solve this issue.</p> <p></p> if &#40; ! open&#40; LOCK, <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/2008/12/10/perl-use-of-flock/">Perl: Use of &#8220;flock&#8221;</a></span>]]></description>
			<content:encoded><![CDATA[<p>This is a small example on flock. It may help you to prevent multiple running instances of the same script. Assume you run the script via cron and it may not be finished when cron attempts to start it again. This few lines of code solve this issue.</p>
<p><span id="more-180"></span></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span> LOCK<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;/var/run/my_app.lock&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Failed to open lock file: $!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">## Create exclusive, non blocking lock: LOCK_EX(2) + LOCK_NB(4)</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000066;">flock</span><span style="color: #009900;">&#40;</span> LOCK<span style="color: #339933;">,</span> <span style="color: #cc66cc;">6</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span> LOCK <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span> PID<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&lt;/var/run/my_app.pid&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Failed to read PID file: $!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$pid</span> <span style="color: #339933;">=</span> <span style="color: #009999;">&lt;PID&gt;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span> PID <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Failed to accquire lock. Another instance (PID $pid) running!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span> PID<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;/var/run/my_app.pid&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Failed to open pid file: $!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066;">print</span> PID <span style="color: #0000ff;">$$</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span> PID <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Failed to write PID file: $!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/2008/12/10/perl-use-of-flock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
