<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>David's Blog</title>
	<atom:link href="http://david415.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://david415.wordpress.com</link>
	<description>An Operation-Engineer's Blog</description>
	<lastBuildDate>Sat, 21 Nov 2009 19:49:33 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='david415.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/51b93626a8e4a3a05b646d7e2365d420?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>David's Blog</title>
		<link>http://david415.wordpress.com</link>
	</image>
			<item>
		<title>running linux with no swap</title>
		<link>http://david415.wordpress.com/2009/11/21/running-linux-with-no-swap/</link>
		<comments>http://david415.wordpress.com/2009/11/21/running-linux-with-no-swap/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 20:22:48 +0000</pubDate>
		<dc:creator>david415</dc:creator>
				<category><![CDATA[Systems Engineering / Unix Systems Operations]]></category>

		<guid isPermaLink="false">http://david415.wordpress.com/?p=418</guid>
		<description><![CDATA[I do not ever want my laptop or any of the servers I maintain to swap.
For all my applications it is never a good idea to swap. RAM is cheap.
It is true that I don&#8217;t want the OOM killer to kill the wrong process&#8230; But I don&#8217;t worry about
that because I know how to use [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=418&subd=david415&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I do not ever want my laptop or any of the servers I maintain to swap.<br />
For all my applications it is never a good idea to swap. RAM is cheap.<br />
It is true that I don&#8217;t want the OOM killer to <a href="http://lwn.net/Articles/104185/">kill the wrong process</a>&#8230; But I don&#8217;t worry about<br />
that because I know how to <a href="http://lwn.net/Articles/317814/">use the oom_adj</a> to prevent Mysql or sshd from getting killed.</p>
<p>According to a knowledgeable Linux kernel developer I spoke with if you are going to disable swap (as in swapoff -a) it is beneficial to recompile with the kernel config option <strong>SWAP=n</strong>. This avoids a performance problem; it&#8217;s been reported that kswapd will otherwise use lots of CPU. While your configuring your new kernel you should also disable <strong>tmpfs</strong>&#8230;</p>
<p>Dear Linux,<br />
Please do not swap ever again!<br />
kthx bye</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/david415.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/david415.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/david415.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/david415.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/david415.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/david415.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/david415.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/david415.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/david415.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/david415.wordpress.com/418/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=418&subd=david415&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://david415.wordpress.com/2009/11/21/running-linux-with-no-swap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c9380641256af855d659dce5ba9a41e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">david415</media:title>
		</media:content>
	</item>
		<item>
		<title>Mysql Innodb Hotcopy in Python</title>
		<link>http://david415.wordpress.com/2009/02/01/mysql-innodb-hotcopy/</link>
		<comments>http://david415.wordpress.com/2009/02/01/mysql-innodb-hotcopy/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 22:24:20 +0000</pubDate>
		<dc:creator>david415</dc:creator>
				<category><![CDATA[Systems Engineering / Unix Systems Operations]]></category>
		<category><![CDATA[crash recovery]]></category>
		<category><![CDATA[distributed mysql]]></category>
		<category><![CDATA[hotcopy]]></category>
		<category><![CDATA[hotcopy rollback]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[innodb hotcopy]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql hotcopy]]></category>
		<category><![CDATA[mysql replica recovery]]></category>
		<category><![CDATA[nullary]]></category>
		<category><![CDATA[nullary function]]></category>
		<category><![CDATA[partitioning scheme]]></category>
		<category><![CDATA[python closure]]></category>
		<category><![CDATA[python lambda]]></category>
		<category><![CDATA[python mysql innodb hotcopy]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[state queue]]></category>
		<category><![CDATA[undo]]></category>

		<guid isPermaLink="false">http://david415.wordpress.com/?p=315</guid>
		<description><![CDATA[Lately for Spinn3r I&#8217;ve been writing programs in Python to automate database operations. This hotcopy script utilizes LVM. Previously we didn&#8217;t use LVM and so this script used to do an Innodb Freeze. The simple idea here is to restore a mysql shard replica&#8217;s data from another replica&#8230;
Look at the code here:
mysql cluster tools @ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=315&subd=david415&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Lately for <a href="http://www.spinn3r.com/">Spinn3r</a> I&#8217;ve been writing programs in Python to automate database operations. This hotcopy script utilizes LVM. Previously we didn&#8217;t use LVM and so this script used to do an <a href="http://david415.wordpress.com/2008/10/07/mysql-if_idle-patch/">Innodb Freeze</a>. The simple idea here is to restore a mysql shard replica&#8217;s data from another replica&#8230;</p>
<p>Look at the code here:<br />
<a href="http://bitbucket.org/david415/mysql-cluster-tools/">mysql cluster tools @ bitbucket.org</A></p>
<p>The cool feature this hotcopy script has is an undo/restore mechanism that<br />
kicks in when an exception is caught. Basically I&#8217;ve implemented a nullary function queue.<br />
With each state change, I push the reverse (or undo/restore operation) onto the queue. When an exception is caught the rollback() method repeatedly pops and executes the last nullary off the queue until there are none left.</p>
<p>What I&#8217;m calling a nullary function is merely a function call wrapped in a closure (although maybe that&#8217;s not correct because they say Python doesn&#8217;t have true closures) in the form of a lambda with zero arguments.</p>
<p>Python&#8217;s excellent exception handling makes this rollback() feature really useful because there are lots of moving parts at work that could break and throw an exception. The hotcopy process causes several state changes on the source replica such as : set single user mode, stop replication (if the source is a slave), take LVM snapshot, mount snapshot etc&#8230;</p>
<p>I don&#8217;t like LVM snapshots laying around so we can COW forever! Nor would I want a database server to remain in &#8220;single user mode&#8221;&#8230;</p>
<p><strong>Three ways to extend this project:</p>
<li>Patch MySQL for faster InnoDB crash recovery.</li>
<li>A distributed/highly available persistent storage mechanism for the restore queue to allow a rollback even after the server running the hotcopy program, crashes.</li>
<li>A mechanism to invoke this program/API to fully automate crash recovery. A centralized design involving a voting protocol&#8230;</li>
<p></strong></p>
<p>I&#8217;m sure many like <a href="http://www.spinn3r.com/">Spinn3r</a> have similar infrastructure goals. The above InnoDB modification is one of several <a href="http://feedblog.org/2008/12/02/desirable-innodb-features/">Desirable Innodb Features</a> that <a href="http://www.spinn3r.com/">Spinn3r</a> will probably throw down cash for&#8230; </p>
<p>Check it out at bitbucket.org, my <A href="http://bitbucket.org/david415/mysql-cluster-tools/">Mysql Innodb Hotcopy</A> program.<br />
This is not even a release candidate&#8230; but if anyone wants to look at the code&#8230; feel free.</p>
<p>Please leave your thoughts and comments.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/david415.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/david415.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/david415.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/david415.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/david415.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/david415.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/david415.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/david415.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/david415.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/david415.wordpress.com/315/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=315&subd=david415&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://david415.wordpress.com/2009/02/01/mysql-innodb-hotcopy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c9380641256af855d659dce5ba9a41e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">david415</media:title>
		</media:content>
	</item>
		<item>
		<title>Ganglia rules!</title>
		<link>http://david415.wordpress.com/2009/02/01/ganglia-is-excellent/</link>
		<comments>http://david415.wordpress.com/2009/02/01/ganglia-is-excellent/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 18:51:49 +0000</pubDate>
		<dc:creator>david415</dc:creator>
				<category><![CDATA[Systems Engineering / Unix Systems Operations]]></category>
		<category><![CDATA[ganglia]]></category>
		<category><![CDATA[ganglia metric]]></category>
		<category><![CDATA[ganglia monitor]]></category>
		<category><![CDATA[ganglia mysql metric]]></category>
		<category><![CDATA[gmetric daemon]]></category>
		<category><![CDATA[gmetric script]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql metric]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://david415.wordpress.com/?p=318</guid>
		<description><![CDATA[Ganglia is an excellent tool. Ganglia makes me happy.
It seems to have an excellently efficient and reliable/highly available design.
Ganglia seems to be mostly self configuring&#8230; except for a few modules out there that need configuration parameters. If I need to use these modules I&#8217;ll modify them to be self configuring like I did with multidisk.py&#8230; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=318&subd=david415&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://ganglia.info/">Ganglia</a> is an excellent tool. Ganglia makes me happy.<br />
It seems to have an excellently efficient and reliable/highly available design.</p>
<p>Ganglia seems to be mostly self configuring&#8230; except for a few modules out there that need configuration parameters. If I need to use these modules I&#8217;ll modify them to be self configuring like I did with multidisk.py&#8230; Anyone who maintains a fair sized cluster knows with a little code it pays to be lazy.</p>
<p>Ganglia seems to be way better than Cacti and the rest. Initially I was disappointed with the standard set of modules which didn&#8217;t allow me to monitor the throughput on two different ethernet interfaces. Perhaps the ganglia-developers don&#8217;t run multi-homed servers. Or maybe they just don&#8217;t care about how much throughput they use. I wrote a python module to graph usage for an internal and external interface because this will help us project how much we&#8217;d be paying a different data-center facility to host our cluster.</p>
<p>Gilad Raphaelli wrote a really cool embedded python module for <a href="http://g.raphaelli.com/2009/1/5/ganglia-mysql-metrics">monitoring mysql metrics</a>&#8230; It monitors 100 metrics including various Innodb buffers. Perfect! It also comes with one custom report for queries :</p>
<p><a href="http://david415.files.wordpress.com/2009/02/mysql-bg.png"><br />
<img src="http://david415.files.wordpress.com/2009/02/mysql-sm.png" alt="mysql query report" /></a><br />
<img src="http://david415.files.wordpress.com/2009/02/innodbtx-sm.png" alt="innodb transactionsl" /><br />
<img src="http://david415.files.wordpress.com/2009/02/mysqlthreads-sm.png" alt="mysql threads" /></p>
<p>I haven&#8217;t had time to look at it yet but Silvan Mühlemann wrote<br />
<a href="http://techblog.tilllate.com/2007/11/11/squid-and-mysql-metric-scripts-for-ganglia/">a custom report php script for mysql</a></p>
<p>Admittedly I don&#8217;t know how best to use gmond&#8217;s python module interface even though I&#8217;ve written several modules already&#8230; I think its supposed to make it easy to write metric monitors with some embedded python code. But I like using gmetric more. It seems to be less code to produce the equivalent monitoring of metrics than the embedded python interface.</p>
<p>Also I&#8217;ve noticed people trying to use the python interface in interesting ways&#8230; e.g. spawning metric collector threads that populate a cache etc. I was hoping to be able to write ganglia metric modules without having to think about threads, cache and race conditions. Couldn&#8217;t a module harness take care of these details?</p>
<p>I&#8217;m working on gmetric-daemon which is a simple python forking daemon with a modular interface that calls gmetric (via system() or popen())&#8230; It&#8217;s not very memory efficient.<br />
Perhaps using gmetric in this way is a silly approach&#8230; But right now I think I like it.</p>
<p>Here&#8217;s the gitHub repository for the work in progress I call <a href="http://github.com/david415/gmetric-daemon/tree/master">gmetric-daemon</A></p>
<p>I&#8217;m going to try and make available (e.g. opensource via apache software license)<br />
lots more code that I write extending Ganglia.</p>
<p>I might even write modules that send a &#8220;passive&#8221; Nagios alerts about metrics exceeding thresholds.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/david415.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/david415.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/david415.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/david415.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/david415.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/david415.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/david415.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/david415.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/david415.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/david415.wordpress.com/318/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=318&subd=david415&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://david415.wordpress.com/2009/02/01/ganglia-is-excellent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c9380641256af855d659dce5ba9a41e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">david415</media:title>
		</media:content>

		<media:content url="http://david415.files.wordpress.com/2009/02/mysql-sm.png" medium="image">
			<media:title type="html">mysql query report</media:title>
		</media:content>

		<media:content url="http://david415.files.wordpress.com/2009/02/innodbtx-sm.png" medium="image">
			<media:title type="html">innodb transactionsl</media:title>
		</media:content>

		<media:content url="http://david415.files.wordpress.com/2009/02/mysqlthreads-sm.png" medium="image">
			<media:title type="html">mysql threads</media:title>
		</media:content>
	</item>
		<item>
		<title>Bugzilla Postfix e-mail integration</title>
		<link>http://david415.wordpress.com/2008/11/25/bugzilla-postfix-e-mail-integration/</link>
		<comments>http://david415.wordpress.com/2008/11/25/bugzilla-postfix-e-mail-integration/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 22:35:52 +0000</pubDate>
		<dc:creator>david415</dc:creator>
				<category><![CDATA[Systems Engineering / Unix Systems Operations]]></category>
		<category><![CDATA[email bugzilla]]></category>
		<category><![CDATA[email_in.pl]]></category>
		<category><![CDATA[postfix bugzilla]]></category>

		<guid isPermaLink="false">http://david415.wordpress.com/?p=294</guid>
		<description><![CDATA[I got Postfix e-mail submissions to Bugzilla (3.0.5) working properly.
Perhaps these notes of mine could save someone some trouble when attempting this.
Certainly postfix could accomplish e-mail submissions via a custom transport using a pipe.
I however decided to use a pipe in the /etc/aliases file; mine contains this important line :

bug-submit:     "&#124;/var/www/bugz/email_in.pl [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=294&subd=david415&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I got Postfix e-mail submissions to Bugzilla (3.0.5) working properly.<br />
Perhaps these notes of mine could save someone some trouble when attempting this.</p>
<p>Certainly postfix could accomplish e-mail submissions via a custom transport using a pipe.<br />
I however decided to use a pipe in the /etc/aliases file; mine contains this important line :<br />
<code><br />
bug-submit:     "|/var/www/bugz/email_in.pl -vvv 2&gt;/tmp/emailin.log"<br />
</code></p>
<p>Note that for troubleshooting I can take a look at email_in.pl&#8217;s STDERR in /tmp/emailin.log;</p>
<p>Log in via the Bugzilla admin account and go to the Email section of the Parameters page.<br />
Change the mailfrom to match the above e-mail alias so that Bugzilla users can add a comment to a bug by replying to Bugzilla&#8217;s e-mails.<br />
<BR><br />
I&#8217;m using SPF to verify sender e-mail addresses.<br />
Here&#8217;s part of my /etc/postfix/main.cf containing some configuration for SPF :<br />
<code><br />
alias_maps = hash:/etc/aliases</code></p>
<p>smtpd_recipient_restrictions =<br />
permit_mynetworks<br />
reject_unauth_destination<br />
check_policy_service unix:private/policy-spf</p>
<p>policyd-spf_time_limit = 3600</p>
<p>and part of my /etc/postfix/master.cf :<br />
<code><br />
policy-spf  unix  -       n       n       -       -       spawn<br />
user=nobody argv=/usr/bin/policyd-spf<br />
</code></p>
<p>Next I got DomainKeys working.<br />
SPF and DomainKeys are especially important for this setup because<br />
Bugzilla will not be doing and e-mail spam filtering.<br />
All a spammer would have to do to submit annoying bugs into our Bugzilla<br />
system would be to forge an e-mail from a Bugzilla user&#8217;s e-mail address<br />
and send it to bug-submit@xxx.xxx&#8230; This is why I want SPF and DomainKeys fully<br />
operational&#8230; that way many forgery attempts will be rejected.</p>
<p>The DKIM filters for inbound and outbound mail are started like this :</p>
<pre>

/usr/local/dkimproxy/bin/dkimproxy.in --listen=127.0.0.1:10025 --relay=127.0.0.1:10026 \

--user=dkim --group=dkim --daemonize --pidfile=/var/run/dkimproxy.in

/usr/local/dkimproxy/bin/dkimproxy.out --listen=127.0.0.1:10027 --relay=127.0.0.1:10028 \

--keyfile=/usr/local/dkimproxy/etc/private.key --selector=selector1 --domain=bugzilla.spinn3r.com \

--user=dkim --group=dkim --signature=dkim --daemonize --pidfile=/var/run/dkimproxy.out</pre>
<p>For filtering inbound mail via DKIM edit the master.cf with something like this :<br />
<code><br />
# Before-filter SMTP server. Receive mail from the network and<br />
# pass it to the content filter on localhost port 10025.<br />
#<br />
smtp      inet  n       -       n       -       -       smtpd<br />
-o smtpd_proxy_filter=127.0.0.1:10025<br />
-o smtpd_client_connection_count_limit=10<br />
# DKIM<br />
# After-filter SMTP server. Receive mail from the content filter on<br />
# localhost port 10026.<br />
127.0.0.1:10026 inet n  -       n       -        -      smtpd<br />
-o smtpd_authorized_xforward_hosts=127.0.0.0/8<br />
-o smtpd_client_restrictions=<br />
-o smtpd_helo_restrictions=<br />
-o smtpd_sender_restrictions=<br />
-o smtpd_recipient_restrictions=permit_mynetworks,reject<br />
-o smtpd_data_restrictions=<br />
-o mynetworks=127.0.0.0/8<br />
-o receive_override_options=no_unknown_recipient_checks<br />
</code></p>
<p>for outgoing DKIM edit the master.cf like this:</p>
<p><code><br />
## outgoing dkim<br />
submission  inet  n     -       n       -       -       smtpd<br />
-o smtpd_etrn_restrictions=reject<br />
-o content_filter=dksign:[127.0.0.1]:10027<br />
-o receive_override_options=no_address_mappings<br />
-o smtpd_recipient_restrictions=permit_mynetworks,reject<br />
dksign    unix  -       -       n       -       10      smtp<br />
-o smtp_send_xforward_command=yes<br />
-o smtp_discard_ehlo_keywords=8bitmime<br />
127.0.0.1:10028 inet  n  -      n       -       10      smtpd<br />
-o content_filter=<br />
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks<br />
-o smtpd_helo_restrictions=<br />
-o smtpd_client_restrictions=<br />
-o smtpd_sender_restrictions=<br />
-o smtpd_recipient_restrictions=permit_mynetworks,reject<br />
-o mynetworks=127.0.0.0/8<br />
-o smtpd_authorized_xforward_hosts=127.0.0.0/8<br />
</code></p>
<p>Do a <strong>postfix reload</strong></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/david415.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/david415.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/david415.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/david415.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/david415.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/david415.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/david415.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/david415.wordpress.com/294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/david415.wordpress.com/294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/david415.wordpress.com/294/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=294&subd=david415&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://david415.wordpress.com/2008/11/25/bugzilla-postfix-e-mail-integration/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c9380641256af855d659dce5ba9a41e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">david415</media:title>
		</media:content>
	</item>
		<item>
		<title>Chinese Herbal Plaster heals bruises</title>
		<link>http://david415.wordpress.com/2008/11/19/chinese-herbal-plaster-heals-bruises/</link>
		<comments>http://david415.wordpress.com/2008/11/19/chinese-herbal-plaster-heals-bruises/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 06:50:59 +0000</pubDate>
		<dc:creator>david415</dc:creator>
				<category><![CDATA[health]]></category>
		<category><![CDATA[bruise medicine]]></category>
		<category><![CDATA[dog skin patch]]></category>
		<category><![CDATA[emergency chinese medicine]]></category>
		<category><![CDATA[kou pi gou]]></category>
		<category><![CDATA[kou pi plaster]]></category>

		<guid isPermaLink="false">http://david415.wordpress.com/?p=280</guid>
		<description><![CDATA[Now this here is a highly effect treatment for painful and debilitating traumatic bruises from bicycle accidents etc&#8230;. I&#8217;ve also used it to treat a bruised and swollen knuckle I got during a partner sword training exercise&#8230;
Kou Pi Plaster (kou pi gou) &#8211; aka dog skin patch is a leather patch folded in half with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=280&subd=david415&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Now this here is a highly effect treatment for painful and debilitating traumatic bruises from bicycle accidents etc&#8230;. I&#8217;ve also used it to treat a bruised and swollen knuckle I got during a partner sword training exercise&#8230;</p>
<p>Kou Pi Plaster (kou pi gou) &#8211; aka dog skin patch is a leather patch folded in half with some medicine herbal gum on the inside. At room temperature the gum is hard. The patch is heated briefly in the oven to liquify the gum. This gum is very sticky so be careful to shave affected fur/hair before applying. Also be careful not to burn yourself by applying the patch when it is too hot.</p>
<p><a href="http://farm4.static.flickr.com/3239/3042454992_f4b787112c.jpg?v=0"><a href="http://www.flickr.com/photos/26545571@N04/with/3042455402/"><img class="aligncenter" title="plastered-leg" src="http://farm4.static.flickr.com/3239/3042454992_f4b787112c.jpg?v=0" alt="" width="375" height="500" /></a><br />
</a></p>
<p>In this case I cut a small section of the patch for my smallish minor bicycle accident bruise. I wrapped the area with some bandage tape to hold it to the wound. I don&#8217;t want the patch falling off when I ride my bicycle to and from work or practicing martial arts.</p>
<p>I keep two Kou Pi Plasters in my first aid kit at home. However I&#8217;ll say that my first treatment choice for severe traumas would be to see the Chinese doctor here in San Francisco, who specializes in tramatic/sport injuries. I haven&#8217;t tried his treatment; just heard about it from other martial arts practitioners.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/david415.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/david415.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/david415.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/david415.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/david415.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/david415.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/david415.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/david415.wordpress.com/280/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/david415.wordpress.com/280/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/david415.wordpress.com/280/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=280&subd=david415&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://david415.wordpress.com/2008/11/19/chinese-herbal-plaster-heals-bruises/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c9380641256af855d659dce5ba9a41e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">david415</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3239/3042454992_f4b787112c.jpg?v=0" medium="image">
			<media:title type="html">plastered-leg</media:title>
		</media:content>
	</item>
		<item>
		<title>Mysql IF_IDLE patch</title>
		<link>http://david415.wordpress.com/2008/10/07/mysql-if_idle-patch/</link>
		<comments>http://david415.wordpress.com/2008/10/07/mysql-if_idle-patch/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 19:19:30 +0000</pubDate>
		<dc:creator>david415</dc:creator>
				<category><![CDATA[Systems Engineering / Unix Systems Operations]]></category>
		<category><![CDATA[google v2 patch]]></category>
		<category><![CDATA[highperf]]></category>
		<category><![CDATA[if_idle]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[percona]]></category>

		<guid isPermaLink="false">http://david415.wordpress.com/?p=249</guid>
		<description><![CDATA[I isolated Google&#8217;s IF_IDLE feature from SqlChanges; part of the Google V2 patch.
I diffed this IF_IDLE patch for mysql-5.0.68-percona-highperf but it&#8217;ll patch mysql-5.0.67 as well.
This simple and brilliant change allows us to
attempt to kill idle mysql processes while avoiding race conditions.
KILL IF_IDLE &#60;id&#62;

mysql&#62; SHOW PROCESSLIST;
+----+-------------+-----------+-----------+---------+------+----------------------------------+
&#124; Id &#124; User        [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=249&subd=david415&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I isolated Google&#8217;s IF_IDLE feature from <A HREF="http://code.google.com/p/google-mysql-tools/wiki/SqlChanges">SqlChanges</A>; part of the <A HREF="http://code.google.com/p/google-mysql-tools/wiki/Mysql5Patches">Google V2 patch</A>.<br />
I <B>diff</B>ed this <A HREF="http://mysql-lbpool.googlecode.com/files/mysql-5.0.68-percona-highperf-ifidle.patch">IF_IDLE patch</A> for <A HREF="http://www.percona.com/mysql/5.0.68/source/mysql-5.0.68-percona-highperf-3-src.tar.gz">mysql-5.0.68-percona-highperf</A> but it&#8217;ll patch mysql-5.0.67 as well.<br />
<BR>This simple and brilliant change allows us to<br />
attempt to kill idle mysql processes while avoiding race conditions.</p>
<p><B>KILL IF_IDLE &lt;id&gt;</B><BR></p>
<pre>
mysql&gt; SHOW PROCESSLIST;
+----+-------------+-----------+-----------+---------+------+----------------------------------+
| Id | User        | Host      | db        | Command | Time | State                            | Info
+----+-------------+-----------+-----------+---------+------+----------------------------------+
|  2 | system user |           | NULL      | Connect | 2192 | Waiting for master to send event | NULL
| 13 | root        | localhost | NULL      | Query   |    0 | NULL                             | show processlist
| 30 | root        | localhost | NULL      | Sleep   |    2 |                                  | NULL
+----+-------------+-----------+-----------+---------+------+----------------------------------+
4 rows in set (0.00 sec)
mysql&gt; KILL IF_IDLE 30;
Query OK, 0 rows affected (0.00 sec)
mysql&gt; SHOW PROCESSLIST;
+----+-------------+-----------+-----------+---------+------+----------------------------------+
| Id | User        | Host      | db        | Command | Time | State                            | Info
+----+-------------+-----------+-----------+---------+------+----------------------------------+
|  2 | system user |           | NULL      | Connect | 2357 | Waiting for master to send event | NULL
| 13 | root        | localhost | NULL      | Query   |    0 | NULL                             | show processlist
+----+-------------+-----------+-----------+---------+------+----------------------------------+
3 rows in set (0.00 sec)
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/david415.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/david415.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/david415.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/david415.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/david415.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/david415.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/david415.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/david415.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/david415.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/david415.wordpress.com/249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=249&subd=david415&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://david415.wordpress.com/2008/10/07/mysql-if_idle-patch/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c9380641256af855d659dce5ba9a41e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">david415</media:title>
		</media:content>
	</item>
		<item>
		<title>Innodb Freeze patch</title>
		<link>http://david415.wordpress.com/2008/10/02/innodb-freeze-patch/</link>
		<comments>http://david415.wordpress.com/2008/10/02/innodb-freeze-patch/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 06:19:39 +0000</pubDate>
		<dc:creator>david415</dc:creator>
				<category><![CDATA[Systems Engineering / Unix Systems Operations]]></category>
		<category><![CDATA[freeze]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[googlecode]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[spinn3r]]></category>

		<guid isPermaLink="false">http://david415.wordpress.com/?p=176</guid>
		<description><![CDATA[We needed a Mysql Innodb Freeze mechanism for Spinn3r&#8217;s database operations, so we decided to isolate Google&#8217;s Innodb Freeze feature from Google&#8217;s V2 patch. The Innodb Freeze can be toggled on and off like so :
set global innodb_disallow_writes=ON
set global innodb_disallow_writes=OFF

Isolating this patch was easy since its a very small code change.
I simply patched Mysql with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=176&subd=david415&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We needed a Mysql <a href="http://feedblog.org/2008/09/07/innodb-freeze/">Innodb Freeze mechanism</a> for <a href="http://spinn3r.com/">Spinn3r&#8217;s</a> database operations, so we decided to isolate <a href="http://code.google.com/p/google-mysql-tools/wiki/InnodbFreeze">Google&#8217;s Innodb Freeze feature</a> from <a href="http://code.google.com/p/google-mysql-tools/wiki/Mysql5Patches">Google&#8217;s V2 patch</a>. The Innodb Freeze can be toggled on and off like so :</p>
<pre>set global innodb_disallow_writes=ON
set global innodb_disallow_writes=OFF</pre>
<p><BR><br />
Isolating this patch was easy since its a very small code change.<br />
I simply patched Mysql with the Google V2 patch.<br />
Then I started up Cscope and searched for the string: &#8220;innodb_disallow_writes&#8221;<br />
From there I was able to trace the various C/C++ symbols; finding all the code for this feature&#8230;<br />
I then edited an unpatched Mysql; manually pasting in the Innodb Freeze code changes.<br />
Finally I <strong>diff</strong>ed this manually edited Mysql against the unpatched Mysql producing<br />
this <a href="http://mysql-lbpool.googlecode.com/files/innodbfreeze-mysql-5.0.37.patch">Innodb Freeze patch for Mysql 5.0.37</a>; it&#8217;s 323 lines small and only modifies 7 files of the Mysql source.</p>
<p>I have re-targeted the patch for Mysql 5.0.67 which will also patch <A HREF="http://www.percona.com/percona-lab.html">Percona&#8217;s</A> <A HREF="http://www.percona.com/mysql/5.0.68/source/mysql-5.0.68-percona-highperf-3-src.tar.gz">High Performance Mysql 5.0.68</A>:  <A HREF="http://mysql-lbpool.googlecode.com/files/innodbfreeze-mysql-5.0.67.patch">Innodb Freeze patch for Mysql 5.0.67</A></p>
<p>I&#8217;ve briefly tested the patch and verified via <A HREF="http://en.wikipedia.org/wiki/Md5sum">md5sum</A> that after setting global innodb_disallow_writes to OFF;  data on disk does not change and all writes via the Innodb storage engine are blocked. However if you have set innodb_flush_log_at_trx_commit=0 in the my.cnf then updating an existing row will succeed. However the change will only exist in memory and will not be written to disk until you unfreeze (set global innodb_disallow_writes=OFF).</p>
<p>This is a small step towards Spinn3r&#8217;s upgrade to Mysql 5.0.x. I&#8217;ll probably end up extracting another feature from the Google V2 patch; and then eventually re-target these for <A HREF="http://www.percona.com/percona-lab.html">Percona&#8217;s</A> <A HREF="http://www.percona.com/mysql/5.0.68/source/mysql-5.0.68-percona-highperf-3-src.tar.gz">High Performance patch Mysql 5.0.68</A>.<br />
<BR></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/david415.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/david415.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/david415.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/david415.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/david415.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/david415.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/david415.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/david415.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/david415.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/david415.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=176&subd=david415&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://david415.wordpress.com/2008/10/02/innodb-freeze-patch/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c9380641256af855d659dce5ba9a41e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">david415</media:title>
		</media:content>
	</item>
		<item>
		<title>Build A Custom Debian Package Of The Latest OpenSSH</title>
		<link>http://david415.wordpress.com/2008/09/10/customdebianopensshpackagebuild/</link>
		<comments>http://david415.wordpress.com/2008/09/10/customdebianopensshpackagebuild/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 00:31:16 +0000</pubDate>
		<dc:creator>david415</dc:creator>
				<category><![CDATA[Systems Engineering / Unix Systems Operations]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dpkg]]></category>
		<category><![CDATA[openssh]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://david415.wordpress.com/?p=84</guid>
		<description><![CDATA[I needed the latest OpenSSH installed on a large cluster of Debian servers running Debian stable Etch. Since Debian isn&#8217;t going to ship a package with the latest OpenSSH for Debian stable Etch I decided to build this package myself.
This is my recipe to build a Debian package of the latest OpenSSH which installs in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=84&subd=david415&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I needed the latest <strong>OpenSSH</strong> installed on a large cluster of Debian servers running Debian stable <strong>Etch</strong>. Since Debian isn&#8217;t going to ship a package with the latest OpenSSH for Debian stable Etch I decided to build this package myself.</p>
<p><strong>This is my recipe to build a Debian package of the latest OpenSSH which installs in prefix=/usr/local.</strong> I decided not to repackage Debian&#8217;s patched OpenSSH because I didn&#8217;t want to deal with all the dependencies. The Debian OpenSSH patch adds a lot of code that I don&#8217;t need for my production environment. Also my package is named differently than the Debian one&#8230; so it can be installed without removing the old Debian openssh package. For my situation I don&#8217;t need a post install script as part of the Debian package&#8230; because I&#8217;m performing a custom cluster-wide software deploy&#8230;.<br />
<BR><br />
<strong>Find a mirror and then download the OpenSSH sourcecode :</strong></p>
<pre><a href="http://www.openssh.org/portable.html">http://www.openssh.org/portable.html</a>
wget ftp://ftp5.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.1p1.tar.gz</pre>
<p><BR><br />
<strong>Cryptographically verify the OpenSSH tarball :</strong></p>
<pre><strong>wget ftp://ftp3.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.1p1.tar.gz.asc
wget ftp://ftp3.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/DJM-GPG-KEY.asc
gpg --import DJM-GPG-KEY.asc
gpg --fingerprint
gpg --verify openssh-5.1p1.tar.gz.asc  openssh-5.1p1.tar.gz
gpg --delete-keys "Damien Miller (Personal Key) "
</strong></pre>
<p><BR><br />
<strong>Prepare the build :</strong></p>
<pre><strong>tar xzf openssh-5.1p1.tar.gz
mv openssh-5.1p1 openssh-5.1p1-spinn3r-r1
cd openssh-5.1p1-spinn3r-r1
dh_make --email david@spinn3r.com --single --native --packagename openssh-5.1p1-spinn3r-r1
cd debian/
</strong></pre>
<p><BR><br />
<strong>Edit the &#8216;control&#8217; file :</strong></p>
<p>vi control:</p>
<pre>Source: openssh-5.1p1-spinn3r-r1
Section: unknown
Priority: extra
Maintainer: root
Build-Depends: debhelper (&gt;= 5), autotools-dev
Standards-Version: 3.7.2

Package: openssh-5.1p1-spinn3r-r1
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: David's attempt at a custom Spinn3r OpenSSH deb package
</pre>
<p><BR><br />
<strong>Edit the &#8216;rules&#8217; file (e.g. vi rules) :</strong><br />
edited this section to make the install prefix set to /usr/local/ :</p>
<pre>config.status: configure
        dh_testdir
        # Add here commands to configure the package.
        ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr/local --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \
CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"</pre>
<p>later on in this file there seems to be this section that seemed like a good idea to edit with the correct prefix :</p>
<pre>        $(MAKE) prefix=$(CURDIR)/debian/openssh-5.1p1-spinn3r-r1/usr/local install
</pre>
<p><BR><br />
<strong>Change to parent directory and edit Makefile.in</strong><br />
<strong>cd ..</strong></p>
<p>Edit the <strong>Makefile.in</strong> (so autoconf generates the Makefile that way we want it). We need to edit the &#8216;install&#8217; target to NOT generate ssh keys otherwise build process will create a set of keys and the .deb package will be distributed with those keys.<br />
change this:</p>
<pre>install: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files install-sysconf <strong>host-key</strong> check-config</pre>
<p>to this :</p>
<pre>install: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files install-sysconf check-config
</pre>
<p><BR><br />
<strong>Build the custom debian package:</strong><br />
<strong>dpkg-buildpackage -rfakeroot -uc -b</strong></p>
<pre>       -us, -uc
              Do not sign the source package or the .changes file, respectively.

         -b indicates that no source files  are  to  be
              built  and/or  distributed</pre>
<p>the above command outputs out a bunch of stuff and then ends with this :</p>
<pre>dh_md5sums
dh_builddeb
dpkg-deb: building package `openssh-5.1p1-spinn3r-r1' in `../openssh-5.1p1-spinn3r-r1_5.1p1-spinn3r-r1_amd64.deb'.
 dpkg-genchanges -b
dpkg-genchanges: binary-only upload - not including any source code
dpkg-buildpackage: binary only upload (no source included)
root@fu:~/builds/openssh-5.1p1-spinn3r-r1#</pre>
<p><strong>The .deb file should have been written to the parent directory.</strong></p>
<p><strong>Enjoy&#8230;</strong></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/david415.wordpress.com/84/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/david415.wordpress.com/84/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/david415.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/david415.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/david415.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/david415.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/david415.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/david415.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/david415.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/david415.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/david415.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/david415.wordpress.com/84/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=84&subd=david415&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://david415.wordpress.com/2008/09/10/customdebianopensshpackagebuild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c9380641256af855d659dce5ba9a41e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">david415</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom Debian Kernel Build without &#8220;make menuconfig&#8221;</title>
		<link>http://david415.wordpress.com/2008/08/09/custom-debian-kernel-build-without-make-menuconfig/</link>
		<comments>http://david415.wordpress.com/2008/08/09/custom-debian-kernel-build-without-make-menuconfig/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 18:12:53 +0000</pubDate>
		<dc:creator>david415</dc:creator>
				<category><![CDATA[Systems Engineering / Unix Systems Operations]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[make-kpkg]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[split-lru]]></category>
		<category><![CDATA[swap]]></category>

		<guid isPermaLink="false">http://david415.wordpress.com/?p=54</guid>
		<description><![CDATA[I maintain a cluster of MySQL servers. I mentioned below that Linux has some memory management issues which cause our MySQL servers to swap when they really should not. So my idea was to upgrade the kernel to the Debian Etch Testing 2.6.25 kernel&#8230; but patched with Rik van Riel&#8217;s Split LRU patch (check it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=54&subd=david415&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I maintain a cluster of MySQL servers. I mentioned below that Linux has some memory management issues which cause our MySQL servers to swap when they really should not. So my idea was to upgrade the kernel to the Debian Etch Testing 2.6.25 kernel&#8230; but patched with Rik van Riel&#8217;s Split LRU patch (check it out: <a href="http://www.surriel.com/node/6">http://www.surriel.com/node/6</A>).<br />
Also&#8230; I don&#8217;t feel any need to compile a super efficient static kernel with only the modules we use. I&#8217;m OK with the Debian default initrd module loading kernel.</p>
<p>So what I ended up doing was first installing Debian&#8217;s kernel :<br />
<code><br />
apt-get install linux-image-2.6.25-2-amd64<br />
</code></p>
<p>Then I grab the Debian kernel source (Linux kernel patched by Debian) :<br />
<code><br />
apt-get source linux-image-2.6.25-2-amd64<br />
</code></p>
<p>which creates these files in the currect directory :</p>
<pre>
linux-2.6-2.6.25
linux-2.6_2.6.25-7.diff.gz
linux-2.6_2.6.25-7.dsc
linux-2.6_2.6.25.orig.tar.gz
</pre>
<p>Patch the kernel with the split-LRU patch :<br />
<CODE><br />
cd linux-2.6-2.6.25<br />
patch -p1 &lt; ../linux-2.6.25-splitlru.patch<br />
</CODE></p>
<p>I move the changelog so that make-kpkg doesn&#8217;t complain and quit :<br />
<code><br />
cd debian<br />
mv changelog changelog.fu<br />
cd ..<br />
</code></p>
<p>Here&#8217;s the secret sauce&#8230; I&#8217;m lazy and don&#8217;t want to do a &#8220;make menuconfig&#8221;<br />
because I&#8217;m happy enough with the way Debian configures the kernel + initrd module loading.<br />
So I copy the Debian config from the Kernel we just installed :<br />
<CODE><br />
cp /boot/config-2.6.25-2-amd64 .config<br />
</code></p>
<p>Edit the Makefile and put unique id in EXTRAVERSION; this'll show up in a 'uname -a' :<br />
e.g.<br />
<code><br />
EXTRAVERSION = spinn3r.r1<br />
</code></p>
<p>I was building on a dual core machine so I set the CONCURRENCY_LEVEL<br />
to tell the Debian make-kpkg to spawn instances of the compiler for building.<br />
However if I was doing this often I'd use DistCC (<a href="http://code.google.com/p/distcc/">http://code.google.com/p/distcc/</A>).<br />
<CODE><br />
export CONCURRENCY_LEVEL=2<br />
</code></p>
<p>Build the kernel, create debian package with a custom name :</p>
<pre>
fakeroot make-kpkg --initrd --us --uc --revision=spinn3r kernel_image
</pre>
<p>After some period of time that'll create a .deb file in the kernel directory's parent directory<br />
which you can installed via a <strong>dpkg -i file.deb</strong></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/david415.wordpress.com/54/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/david415.wordpress.com/54/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/david415.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/david415.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/david415.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/david415.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/david415.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/david415.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/david415.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/david415.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/david415.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/david415.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=54&subd=david415&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://david415.wordpress.com/2008/08/09/custom-debian-kernel-build-without-make-menuconfig/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c9380641256af855d659dce5ba9a41e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">david415</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Swap Issue</title>
		<link>http://david415.wordpress.com/2008/08/06/linux-swap-issue/</link>
		<comments>http://david415.wordpress.com/2008/08/06/linux-swap-issue/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 20:14:48 +0000</pubDate>
		<dc:creator>david415</dc:creator>
				<category><![CDATA[Systems Engineering / Unix Systems Operations]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[oom]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[split-lru]]></category>
		<category><![CDATA[swapoff]]></category>
		<category><![CDATA[swapon]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://david415.wordpress.com/?p=51</guid>
		<description><![CDATA[I no longer have to use this workaround&#8230; since we patched our kernel.
The current 2.6 Linux Kernels seem to have some swap issues.
The Linux Kernel really likes to swap MySQL out to disk.
If for example you do a :

cat /proc/swaps

Often times on MySQL servers, with a data-set which can easily fit within memory,
swap is reported [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=51&subd=david415&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I no longer have to use this workaround&#8230; since we <A HREF="http://david415.wordpress.com/2008/08/09/custom-debian-kernel-build-without-make-menuconfig/">patched our kernel</A>.<br />
The current 2.6 Linux Kernels seem to have some swap issues.<br />
The Linux Kernel really likes to swap MySQL out to disk.</p>
<p>If for example you do a :</p>
<p><code><br />
<strong>cat /proc/swaps</strong><br />
</code></p>
<p>Often times on MySQL servers, with a data-set which can easily fit within memory,<br />
swap is reported to be in use even though it should not.<br />
Additionally sometimes too much swap space is reported used.</p>
<p>Here&#8217;s some related links on the subject :</p>
<ul>
<li>
<a href="http://www.ussg.iu.edu/hypermail/linux/kernel/0805.0/2261.html">Re: Ability to limit or disable page caching?</a>
</li>
<li><A HREF="http://feedblog.org/2007/09/29/using-o_direct-on-linux-and-innodb-to-fix-swap-insanity/">Using O_DIRECT on Linux and INNODB to Fix Swap Insanity</A><br />
</LI></p>
<li><a href="http://blogs.smugmug.com/don/2008/05/01/mysql-and-the-linux-swap-problem/">MySQL and the Linux swap problem</a></li>
<li><a href="http://www.mysqlperformanceblog.com/2008/04/06/should-you-have-your-swap-file-enabled-while-running-mysql/">Should you have your swap file enabled while running MySQL ?</a></li>
</ul>
<p><BR><br />
Here&#8217;s my work-around for this situation :</p>
<p>I create two swap files :</p>
<p><code><br />
<strong>dd if=/dev/zero of=/swap01 bs=1MB count=34000<br />
dd if=/dev/zero of=/swap02 bs=1MB count=34000<br />
mkswap /swap01<br />
mkswap /swap02</strong><br />
</code></p>
<p>Now I can run my Perl script to rotate the active swap filesystem between /swap01 and /swap02.<br />
If /swap01 is active, then Perl script does this :</p>
<p><code><br />
<strong>swapon /swap02<br />
swapoff /swap01</strong><br />
</code></p>
<p>This causes the pages written to swap to be reloaded into memory and ensures I&#8217;m not using swap. MySQL shouldn&#8217;t get swapped in the first place but I feel this is a pretty good workaround. I run this little Perl script from cron every half hour. Notice the locking&#8230; :</p>
<pre class="brush: python;">
#!/usr/bin/perl
use strict;
use warnings;

use LockFile::Simple qw(lock trylock unlock);

# set to 1 to turn verbosity off
my $verbose = 0;
my $lock = '/var/lock/rotate_swap.lock';

Main();

sub rs_lock
{
  die &quot;already locked\n&quot; unless trylock($lock);
  $verbose == 1 || print &quot;acquired lock\n&quot;;
}

sub rs_unlock
{
  unlock($lock);
  $verbose == 1 || print &quot;released lock\n&quot;;
}

sub err
{
    my $msg = shift;
    print &quot;$msg\n&quot;;
# remove lock
    rs_unlock();
    exit -1;
}

sub Main
{
    my %swap;
    $swap{'/swap01'} = '/swap02';
    $swap{'/swap02'} = '/swap01';

# verify that valid swap files exist

    my $freecmd_output = `free`;
    my $totalmem;
    if($freecmd_output =~ m/Mem:\s+([^\s]+)/)
    {
	$totalmem = $1;
    }
    else
    {
	err(&quot;'free' cannot determine available memory&quot;);
    }

    my @stat_field;
    my $swap_size;
    foreach(keys %swap)
    {
	@stat_field = stat($_);
	$swap_size = $stat_field[7];
	$swap_size = $swap_size / 1024;

	if($swap_size &amp;gt; $totalmem)
	{
	    if($verbose == 0)
	    {
		print &quot;swap file: $_ size: $swap_size is greater than free mem size: $totalmem\n&quot;;
	    }
	}
	else
	{
	    err(&quot;swap file: $_ size: $swap_size is not greater than free mem: $totalmem&quot;);
	}
    }

    eval
    {
# grab a mutex for this swap /var/lock/rotate_swap.lock
	rs_lock();

# make sure at least ONE swap partition is up and running...

	my $status = `cat /proc/swaps`;
	unless($status =~ /Priority\n.+/)
	{
	    err(&quot;No swap units available!&quot;);
	}

# determine the TARGET swap partition.
	my $target_swap;
	my @line;
	@line = split(/\n/,$status);

	my @field = split(/\s+/,$line[1]);
	my $current_swap = $field[0];

	if(!defined($swap{$current_swap}))
	{
	    $target_swap = '/swap01';
	}
	else
	{
	    $target_swap = $swap{$current_swap};
	}

	$verbose == 1 || print &quot;currently swap $current_swap\n&quot;;

# attempt to mount it

	unless(system(&quot;swapon $target_swap&quot;) == 0)
	{
	    err(&quot;swapon failed for : $target_swap&quot;);
	}

	$verbose == 1 || print &quot;enabled swap $target_swap\n&quot;;

# attempt to umount the stable swap partition

	unless(system(&quot;swapoff $current_swap&quot;) == 0)
	{
	    err(&quot;swapoff failed for : $current_swap&quot;);
	}

	$verbose == 1 || print &quot;disabled swap $current_swap\n&quot;;

    }; # end eval {...

    # unlock
    rs_unlock();

    if ($@)
    {
        ### catch block
        die &quot;caught unexpected error: $!\n&quot;;
    }
}

__END__
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/david415.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/david415.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/david415.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/david415.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/david415.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/david415.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/david415.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/david415.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/david415.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/david415.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/david415.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/david415.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=david415.wordpress.com&blog=4401438&post=51&subd=david415&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://david415.wordpress.com/2008/08/06/linux-swap-issue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c9380641256af855d659dce5ba9a41e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">david415</media:title>
		</media:content>
	</item>
	</channel>
</rss>