<?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>BigSmoke &#187; halfgaar</title>
	<atom:link href="http://blog.bigsmoke.us/author/halfgaar/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.bigsmoke.us</link>
	<description>Smokes your problems, coughs fresh air.</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:03:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Setting max memory of a Xen Dom0</title>
		<link>http://blog.bigsmoke.us/2011/09/07/setting-max-memory-of-a-xen-dom0</link>
		<comments>http://blog.bigsmoke.us/2011/09/07/setting-max-memory-of-a-xen-dom0#comments</comments>
		<pubDate>Wed, 07 Sep 2011 08:10:41 +0000</pubDate>
		<dc:creator>halfgaar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1985</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had some issues with Xen crashing when I wanted to create a DomU for which the Dom0 had to shrink (see <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640500">bug report</a>). Therefore, it&#8217;s better to force a memory limit on the dom0. That is done with a kernel param.</p>
<p>Add this to /etc/default/grub:</p>
<p><pre class="php"><span style="color: #808080; font-style: italic;"># Start dom0 with less RAM</span>
GRUB_CMDLINE_XEN_DEFAULT=<span style="color: #ff0000;">&quot;dom0_mem=512M&quot;</span></pre></p>
<p>Then run update-grub2 and reboot.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2011/09/07/setting-max-memory-of-a-xen-dom0/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing a broken Xen DomU after upgrading to Ubuntu 11.4 (Natty)</title>
		<link>http://blog.bigsmoke.us/2011/09/02/fixing-a-broken-xen-domu-after-upgrading-to-ubuntu-11.4-natty</link>
		<comments>http://blog.bigsmoke.us/2011/09/02/fixing-a-broken-xen-domu-after-upgrading-to-ubuntu-11.4-natty#comments</comments>
		<pubDate>Fri, 02 Sep 2011 10:31:49 +0000</pubDate>
		<dc:creator>halfgaar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[natty]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1981</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>My Xen DomU&#8217;s that I upgraded to 11.4 no longer booted, because the xen-blkfront module is missing from the initramfs. To fix, do this when you get the initramfs prompt:</p>
<p><pre class="php">modprobe xen-blkfront
<a href="http://www.php.net/exit"><span style="color: #000066;">exit</span></a></pre></p>
<p>Then after it&#8217;s booted:</p>
<p><pre class="php">root@ubuntu:~<span style="color: #808080; font-style: italic;"># echo &quot;xen-blkfront&quot; &gt;&gt; /etc/initramfs-tools/modules</span>
root@ubuntu:~<span style="color: #808080; font-style: italic;"># update-initramfs -u </span></pre></p>
<p><a href="http://www.mmacleod.ca/blog/2011/05/ubuntu-natty-narwhal-and-xen/">Source</a>.</p>
<p>Also look at <a href="http://blog.bigsmoke.us/2011/09/02/fixing-a-xen-domus-grub-config">this</a> post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2011/09/02/fixing-a-broken-xen-domu-after-upgrading-to-ubuntu-11.4-natty/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing a Xen DomU&#8217;s grub config</title>
		<link>http://blog.bigsmoke.us/2011/09/02/fixing-a-xen-domus-grub-config</link>
		<comments>http://blog.bigsmoke.us/2011/09/02/fixing-a-xen-domus-grub-config#comments</comments>
		<pubDate>Fri, 02 Sep 2011 10:30:36 +0000</pubDate>
		<dc:creator>halfgaar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[GRUB]]></category>
		<category><![CDATA[pygrub]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1982</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>When you use xen-create-image to bootstrap an ubuntu, it sets up a grub config file menu.lst. However, this boot config is not kept up-to-date with newer ubuntu&#8217;s because they use grub2 (which uses grub.cfg and not menu.lst). And Xen&#8217;s pygrub first looks at menu.lst, so if you have a stale file, it will always boot an old kernel.</p>
<p>I &#8216;Fixed&#8217; it like this (a real fix I have yet to devise, but this works. Actually, I think it is a bug):</p>
<p>The grub hooks in Debian and Ubuntu don&#8217;t take the fact into account that the machine might be running as paravirtualized VM. Therefore, it can&#8217;t find /dev/xvda to install grub on, which it shouldn&#8217;t try. Bug reports exist about this, but it is not deemed important, it seems. The result is that the menu.lst that was created by xen-create-image is never updated and updates to the kernel are never booted.</p>
<p>Pygrub considers menu.lst over grub.cfg (which would give problems with upgrading to grub2). But you can also use it to your advantage. You can edit /etc/kernel-img.conf to look like this (do_symlinks = yes and no hooks):</p>
<p><pre class="php">do_symlinks = yes
relative_links = yes
do_bootloader = no
do_bootfloppy = no
do_initrd = yes
link_in_boot = no
postinst_hook =
postrm_hook   =</pre></p>
<p>And then make /boot/grub/menu.lst with this:</p>
<p><pre class="php"><span style="color: #000000; font-weight: bold;">default</span>         <span style="color: #cc66cc;">0</span>
timeout         <span style="color: #cc66cc;">2</span>
&nbsp;
title           Marauder
root            <span style="color: #66cc66;">&#40;</span>hd0,<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
kernel          /vmlinuz root=/dev/xvda2 ro
initrd          /initrd.img</pre></p>
<p>Then uninstall grub. This way, you always boot the new kernel.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2011/09/02/fixing-a-xen-domus-grub-config/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CUPS printer driver for my HP4050</title>
		<link>http://blog.bigsmoke.us/2011/08/17/cups-printer-driver-for-my-hp4050</link>
		<comments>http://blog.bigsmoke.us/2011/08/17/cups-printer-driver-for-my-hp4050#comments</comments>
		<pubDate>Wed, 17 Aug 2011 21:13:23 +0000</pubDate>
		<dc:creator>halfgaar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[4050]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[HP]]></category>
		<category><![CDATA[hp4050]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1972</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>My HP4050 has a million different drivers to choose from. Some don&#8217;t have the maximum DPI, some don&#8217;t have other options, like selecting paper output. The one that works the best seems to be &#8220;HP LaserJet 4050 Series Postscript (recommended) (grayscale, 2-sided printing)&#8221;. However, I have no idea anymore if that came from hplip, foomatic, gutenprint, or whatever.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2011/08/17/cups-printer-driver-for-my-hp4050/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting a MySQL database from latin1 to utf8</title>
		<link>http://blog.bigsmoke.us/2011/08/16/converting-a-mysql-database-from-latin1-to-utf8</link>
		<comments>http://blog.bigsmoke.us/2011/08/16/converting-a-mysql-database-from-latin1-to-utf8#comments</comments>
		<pubDate>Tue, 16 Aug 2011 13:49:49 +0000</pubDate>
		<dc:creator>halfgaar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1969</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><pre class="php">mysqldump dbname &gt; dbname_bak_before_messing_with_it.sql
mysqldump --default-character-set=latin1 --skip-set-charset dbname &gt; dump.sql
sed -r <span style="color: #ff0000;">'s/latin1/utf8/g'</span> dump.sql &gt; dump_utf.sql
<a href="http://www.php.net/mysql"><span style="color: #000066;">mysql</span></a> --execute=<span style="color: #ff0000;">&quot;DROP DATABASE dbname; CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;&quot;</span> 
<a href="http://www.php.net/mysql"><span style="color: #000066;">mysql</span></a> --default-character-set=utf8 dbname &lt; dump_utf.sql</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2011/08/16/converting-a-mysql-database-from-latin1-to-utf8/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a postfix fallback MX</title>
		<link>http://blog.bigsmoke.us/2011/05/22/setting-up-a-postfix-fallback-mx</link>
		<comments>http://blog.bigsmoke.us/2011/05/22/setting-up-a-postfix-fallback-mx#comments</comments>
		<pubDate>Sun, 22 May 2011 07:51:48 +0000</pubDate>
		<dc:creator>halfgaar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[mx]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1957</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>These are some short stepts and pointers to setup a postfix fallback MX. It does not describe postfix basics, nor how to install Mailscanner (a necessisity, because spammers like sending spam to fallback MX&#8217;s because they&#8217;re usually not as well protected).</p>
<p>First, postfix has a special transport, called &#8216;relay&#8217;, which is the same as SMTP, except that it doesn&#8217;t send to the backup MX. In this case, that means it doesn&#8217;t send to itself, avoiding loops. The relay transport is the default for all the domains you specify in the relay_domains parameter. </p>
<p>Should the machine have a relayhost defined, you need to disable that for each of the domains you&#8217;re a backup MX for. You can do that with transport_maps. In my case, the transport_maps is hash:/etc/postfix/transport_maps. That is a key-value file on which you run &#8216;postmap&#8217; after you&#8217;ve edited it. In it, specify this (the comments explain it):</p>
<p><pre class="php"><span style="color: #808080; font-style: italic;"># When you specify a transport without nexthop, it resets the relay to the</span>
<span style="color: #808080; font-style: italic;"># recipient domain (see man 5 transport). And, when the transport is relay,</span>
<span style="color: #808080; font-style: italic;"># postfix will not relay to the backup MX, to prevent loops back to itself. So,</span>
<span style="color: #808080; font-style: italic;"># because this host has a default relayhost, use the folowwing when you want to</span>
<span style="color: #808080; font-style: italic;"># specify a domain for which we are backup MX: </span>
<span style="color: #808080; font-style: italic;"># example.com            relay </span></pre></p>
<p>The next step you want to do is take measures to prevent mails to non-existent users piling up in the queue. Because spam is sent to the backup MX all the time, it will relay it to the primary, which rejects it. Your backup host will then bounce all kinds of spam mails&#8230;</p>
<p>To fix that, we instruct postfix to use <a href="http://www.postfix.org/ADDRESS_VERIFICATION_README.html">recipient address verification</a>. This causes it to probe the primary host to check the address exists (and caches that info) before relaying.</p>
<p>To enable it, do this:</p>
<p><pre class="php">smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, reject_unknown_recipient_domain, reject_unverified_recipient
unverified_recipient_reject_reason = Address lookup failed
<span style="color: #808080; font-style: italic;"># Prevent caching non-existent users, to prevent delivery failures when new users are unknown still.</span>
address_verify_negative_cache = no
<span style="color: #808080; font-style: italic;"># Setting to 550 to make a reject a fatal error, not a defer.</span>
unverified_recipient_reject_code = <span style="color: #cc66cc;">550</span>
<span style="color: #808080; font-style: italic;"># The point of a backup MX is to accept mail when the primary is down, so setting this prevents incoming mail being deferred when the address probe cannot be done.</span>
<span style="color: #808080; font-style: italic;"># TODO: find out how to actually implement it, because it doesn't work; permit it not a valid option here.</span>
<span style="color: #808080; font-style: italic;">#unverified_recipient_tempfail_action = permit </span></pre></p>
<p>The reject_unknown_recipient_domain  prevents probes to domains that don&#8217;t exist.</p>
<p>Some extra options, not strictly related to being a backup MX:</p>
<p><pre class="php">smtpd_sender_restrictions = reject_unknown_sender_domain, reject_unknown_helo_hostname
unknown_address_reject_code = <span style="color: #cc66cc;">550</span>
<span style="color: #808080; font-style: italic;"># Override the default of 5 days, because the point of a backup MX is to keep it around for a while.</span>
maximal_queue_lifetime = 21d</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2011/05/22/setting-up-a-postfix-fallback-mx/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Postfix queue: sender and recipient address</title>
		<link>http://blog.bigsmoke.us/2011/05/04/postfix-queue-sender-and-recipient-address</link>
		<comments>http://blog.bigsmoke.us/2011/05/04/postfix-queue-sender-and-recipient-address#comments</comments>
		<pubDate>Wed, 04 May 2011 09:34:08 +0000</pubDate>
		<dc:creator>halfgaar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[mailq]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1954</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>I always seem to forget this, and the mailq command is not clear, so here it is:</p>
<p>when you type mailq on a postfix server, the first address listed is the sender, the second the recipient.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2011/05/04/postfix-queue-sender-and-recipient-address/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding SPF support to Postfix</title>
		<link>http://blog.bigsmoke.us/2011/04/28/adding-spf-support-to-postfix</link>
		<comments>http://blog.bigsmoke.us/2011/04/28/adding-spf-support-to-postfix#comments</comments>
		<pubDate>Thu, 28 Apr 2011 13:36:54 +0000</pubDate>
		<dc:creator>halfgaar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[spf]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1948</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>(Hmm, <a href="http://www.openspf.org/Software">this</a> suggests the python version might be better).</p>
<p><a href="http://www.howtoforge.com/postfix_spf">Source</a>.</p>
<p><pre class="php">aptitude -P install postfix-policyd-spf-perl</pre></p>
<p>Add this to master.cf (but perhaps change the path to the script):</p>
<p><pre class="php">policy  unix  -       n       n       -       -       spawn
        user=nobody argv=/usr/bin/perl /usr/lib/postfix/policyd-spf-perl</pre></p>
<p>Add this to main.cf, directly below/after reject_unauth_destination (if you do it before, you are an open relay):</p>
<p><pre class="php">check_policy_service unix:private/policy</pre></p>
<p>So:</p>
<p><pre class="php">smtpd_recipient_restrictions = permit_mynetworks,
  permit_sasl_authenticated,
  reject_unauth_destination,
  check_policy_service unix:private/policy
  reject_unauth_pipelining,
  reject_non_fqdn_recipient</pre></p>
<p>The source article has stuff about testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2011/04/28/adding-spf-support-to-postfix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking Xen domU&#8217;s with munin</title>
		<link>http://blog.bigsmoke.us/2011/04/21/tracking-xen-domus-with-munin</link>
		<comments>http://blog.bigsmoke.us/2011/04/21/tracking-xen-domus-with-munin#comments</comments>
		<pubDate>Thu, 21 Apr 2011 08:30:10 +0000</pubDate>
		<dc:creator>halfgaar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[munin]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1940</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>To view statistics of your xen server with Munin (<a href="http://wiki.kartbuilding.net/index.php/Munin_Statistics#Munin_Monitoring_of_Xen_CPU_and_Network_Traffic">source</a>):</p>
<blockquote><p>cd /usr/local/share/<br />
mkdir -p munin/plugins<br />
cd munin/plugins<br />
wget http://wiki.kartbuilding.net/xen_traffic_all<br />
wget http://wiki.kartbuilding.net/xen_cpu_percent<br />
chmod 755 xen_traffic_all xen_cpu_percent<br />
ln -s /usr/local/share/munin/plugins/xen_traffic_all /etc/munin/plugins/<br />
ln -s /usr/local/share/munin/plugins/xen_cpu_percent /etc/munin/plugins/<br />
vim /etc/munin/plugin-conf.d/munin-node</p>
<p>#add the following:<br />
[xen_traffic_all]<br />
user root<br />
[xen_cpu_percent]<br />
user root</p>
<p>/etc/init.d/munin-node restart
</p></blockquote>
<p>Original links:</p>
<ul>
<li><a href="http://munin.projects.linpro.no/attachment/wiki/PluginCat/xen_traffic_all">http://munin.projects.linpro.no/attachment/wiki/PluginCat/xen_traffic_all</a></li>
<li><a href="http://www.skullkrusher.net/linux/scripts/xen_percent">http://www.skullkrusher.net/linux/scripts/xen_percent</a></li>
<li><a href="http://lists.xensource.com/archives/html/xen-users/2006-01/msg00323.html">http://lists.xensource.com/archives/html/xen-users/2006-01/msg00323.html</a></li>
</ul>
<p>I wanted to attach the scripts, but because of upload problems, I can&#8217;t&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2011/04/21/tracking-xen-domus-with-munin/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting a better MySQL prompt</title>
		<link>http://blog.bigsmoke.us/2011/04/18/getting-a-better-mysql-prompt</link>
		<comments>http://blog.bigsmoke.us/2011/04/18/getting-a-better-mysql-prompt#comments</comments>
		<pubDate>Mon, 18 Apr 2011 08:56:59 +0000</pubDate>
		<dc:creator>halfgaar</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[prompt]]></category>

		<guid isPermaLink="false">http://blog.bigsmoke.us/?p=1937</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>When you want to see which user you are and which database you&#8217;re working with, put this in .my.cnf:</p>
<p><pre class="php">prompt=<span style="color: #66cc66;">&#40;</span>\\u@\\h<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#91;</span>\\d<span style="color: #66cc66;">&#93;</span>&gt;\\<a href="http://www.php.net/_"><span style="color: #000066;">_</span></a></pre></p>
<p>Too bad mysql doesn&#8217;t support color. You can make it work with rlwrap, but that&#8217;s kind of clumsy.</p>
<p>edit: hmm, this destroys mysqldump&#8230; argh.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bigsmoke.us/2011/04/18/getting-a-better-mysql-prompt/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

