<?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>Shlrm.org Blag &#187; David Kowis</title>
	<atom:link href="http://shlrm.org/wordpress/author/dkowis/feed/" rel="self" type="application/rss+xml" />
	<link>http://shlrm.org/wordpress</link>
	<description>Linux, Java, Ruby, and Politics.</description>
	<lastBuildDate>Tue, 07 Sep 2010 13:38:15 +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>UPS failure graphs</title>
		<link>http://shlrm.org/wordpress/2010/07/26/ups-failure-graphs/</link>
		<comments>http://shlrm.org/wordpress/2010/07/26/ups-failure-graphs/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 04:08:00 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[NUT]]></category>
		<category><![CDATA[UPS]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=386</guid>
		<description><![CDATA[There was a lightning storm recently and the silly Arc Fault Circuit Interrupters in my house tripped off the power in most all the bedrooms, except the room my desktop was in. And so the UPS tanked, because the batteries are old and lose their charge very quickly. The graphs are logged using Cacti, and [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><a href="http://shlrm.org/wordpress/wp-content/uploads/2010/07/UPS-Failure.png"><img class="size-medium wp-image-387 alignleft" title="UPS Failure" src="http://shlrm.org/wordpress/wp-content/uploads/2010/07/UPS-Failure-300x125.png" alt="" width="300" height="125" /></a>There was a lightning storm recently and the silly <a href="http://en.wikipedia.org/wiki/Arc-fault_circuit_interrupter">Arc Fault Circuit Interrupter</a>s in my house tripped off the power in most all the bedrooms, except the room my desktop was in. And so the UPS tanked, because the batteries are old and lose their charge very quickly. The graphs are logged using <a href="http://www.cacti.net/">Cacti</a>, and using a template/polling logic that I built using the <a href="http://code.google.com/p/mysql-cacti-templates/">mysql-cacti-templates project</a>.</p>
<p style="text-align: left;">I really should replace the batteries in <a href="http://www.amazon.com/Cyberpower-CPS1500AVR-1500VA-6-Outlet-Serial/dp/B00006HVLP">this guy</a> (freaking sweet UPS by the way, highly recommended) so he&#8217;ll last more than a few minutes.</p>
<p style="text-align: left;">A friend of mine did a bit more controlled test of his UPS and <a href="https://www.icanttype.org/blog/upstest/">here&#8217;s his blog post with graphs</a> also.</p>
<p style="text-align: left;">I have zoomed the graph a bit more to get more detail on the last 20 minutes of my servers uptime.</p>
<p style="text-align: left;"><a href="https://shlrm.org/wordpress/wp-content/uploads/2010/07/UPS-Failure-close.png"><img class="alignleft size-medium wp-image-388" title="UPS Failure - Zoomed" src="https://shlrm.org/wordpress/wp-content/uploads/2010/07/UPS-Failure-close-300x135.png" alt="" width="300" height="135" /></a>I find it interesting that the UPS temperature actually dropped when the thing was on batteries. I remember reading somewhere that the fan only runs when the inverter is actually active, so I guess that would make sense. I also find it interesting that the input frequency never changed, perhaps the UPS only records that value once every now and then, and doesn&#8217;t update it. I would think that with 0 input voltage I wouldn&#8217;t have any measurable frequency either.</p>
<p style="text-align: left;">I wonder if I could/should get those AFCI breakers replaced. They tend to not keep my computers on when there&#8217;s a lightning storm, and the only way to turn them back on is to go into the garage and flip it by hand.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2010/07/26/ups-failure-graphs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A refreshing new perspective on init systems</title>
		<link>http://shlrm.org/wordpress/2010/06/23/a-refreshing-new-perspective-on-init-systems/</link>
		<comments>http://shlrm.org/wordpress/2010/06/23/a-refreshing-new-perspective-on-init-systems/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 20:43:13 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=380</guid>
		<description><![CDATA[A dangerously nerdy joygasm about a linux init system. You can probably skip this one if you're not a linux ubergeek.]]></description>
			<content:encoded><![CDATA[<p>I used to think that <a href="http://upstart.ubuntu.com/">Upstart</a> was the wave of the future regarding new init systems.</p>
<p><a href="http://0pointer.de/blog/projects/systemd.html">Boy, was I wrong</a>. Not that upstart is &#8220;bad.&#8221; Just that there&#8217;s something much better.</p>
<p>This actually makes things better instead of just providing the ability to make things better. It involves less shell, and more configuration. Dependencies are automatic, instead of manually specified. The author of the previously linked post goes into great detail regarding the reasoning behind the decisions made. It&#8217;s quite a good, albeit long, post.</p>
<p>I think I will have to get this working on my linux box that I intend to build. Possibly even on my laptop, as the features for enabling and disabling bluetooth would be quite advantageous. Also for the wifi and such. It&#8217;d be great if when I fired up the bluetooth, it were to start various things, like trying to connect to my mouse, or enabling the obex ftp thing.</p>
<p>As for a server, it&#8217;d be really nice to have if I can ever get my fibre channel setup to work. The Xen VMs won&#8217;t start until the Fibre Channel drives are available, and then they&#8217;ll all start up. Events could be fired depending on when the UPS was online or on battery.</p>
<p>I&#8217;m very impressed with it in concept, I&#8217;ll have to see how it goes in practice. Oh, and it&#8217;s going to be in Fedora 14. Woot.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2010/06/23/a-refreshing-new-perspective-on-init-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building ruby 1.9 on Fedora 13</title>
		<link>http://shlrm.org/wordpress/2010/06/19/building-ruby-1-9-on-fedora-13/</link>
		<comments>http://shlrm.org/wordpress/2010/06/19/building-ruby-1-9-on-fedora-13/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 18:19:23 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[fedora]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=378</guid>
		<description><![CDATA[Was harder than it should&#8217;ve been. I got annoyed. You need to install openssl-devel, zlib-devel, bison, gcc, make, patch, tar, and maybe gcc-c++ (although I don&#8217;t think this one is needed). Go get the latest ruby 1.9 source, as of this writing 1.9-p378, and extract it somewhere. Then go get the patches on this bug, [...]]]></description>
			<content:encoded><![CDATA[<p>Was harder than it should&#8217;ve been. I got annoyed.</p>
<p>You need to install openssl-devel, zlib-devel, bison, gcc, make, patch, tar, and maybe gcc-c++ (although I don&#8217;t think this one is needed).</p>
<p>Go get the <a href="ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.1-p378.tar.gz">latest ruby 1.9 source</a>, as of this writing 1.9-p378, and extract it somewhere. Then go get the patches on <a href="http://redmine.ruby-lang.org/issues/show/2022#note-11">this bug, at the specific comment</a>. You will need to apply at least the openssl-build-fix patch, since fedora uses openssl 1.0 and it&#8217;s not yet into ruby 1.9. Then follow your typical ./cofnigure, make, and make install stuff. I installed mine into a prefix of /opt/ruby so that it wouldn&#8217;t affect any fedora ruby stuff that it might want. I then added ruby&#8217;s path to the end of my user&#8217;s PATH variable.</p>
<p>That&#8217;ll get you a working ruby 1.9 in Fedora.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2010/06/19/building-ruby-1-9-on-fedora-13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVSwitch</title>
		<link>http://shlrm.org/wordpress/2010/05/20/openvswitch/</link>
		<comments>http://shlrm.org/wordpress/2010/05/20/openvswitch/#comments</comments>
		<pubDate>Thu, 20 May 2010 17:00:31 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=373</guid>
		<description><![CDATA[This is some interesting technology. Apparently it allows me to emulate a switch on my server such that I can get netflow information, and other such managed switch information, from my virtual machines on my xen box. I will have to build and implement this on my test xen box to see how difficult it&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://openvswitch.org/">This is some interesting technology</a>. Apparently it allows me to emulate a switch on my server such that I can get netflow information, and other such managed switch information, from my virtual machines on my xen box. I will have to build and implement this on my test xen box to see how difficult it&#8217;ll be to get it to behave.</p>
<p>I also like that it claims it can distribute across multiple hosts (&#8216;claims&#8217; because I haven&#8217;t verified it yet.) I wonder how difficult it will be to set up a switch that extends to my router, so I can just emulate my entire network&#8217;s switch in OpenVswitch. It&#8217;s certainly got some interesting potential.</p>
<p>There&#8217;s potential to get better information on the traffic happening in my network thanks to the netflows provided by this. Maybe it will be enough information to figure out why my traffic shaping doesn&#8217;t work well, and how I can improve it.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2010/05/20/openvswitch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vim syntax hilighting for ruby/rails</title>
		<link>http://shlrm.org/wordpress/2010/05/18/vim-syntax-hilighting-for-rubyrails/</link>
		<comments>http://shlrm.org/wordpress/2010/05/18/vim-syntax-hilighting-for-rubyrails/#comments</comments>
		<pubDate>Wed, 19 May 2010 02:10:13 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[W00t!]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=369</guid>
		<description><![CDATA[http://www.vim.org/scripts/script.php?script_id=1567 Woot. EDIT: Man, this guy has all sorts of good stuff: http://www.vim.org/account/profile.php?user_id=9012 cucumber, rails, ruby, git-vim integration. VIM FTW!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vim.org/scripts/script.php?script_id=1567">http://www.vim.org/scripts/script.php?script_id=1567</a></p>
<p>Woot.</p>
<p>EDIT:</p>
<p>Man, this guy has all sorts of good stuff: <a href="http://www.vim.org/account/profile.php?user_id=9012">http://www.vim.org/account/profile.php?user_id=9012</a></p>
<p>cucumber, rails, ruby, git-vim integration. VIM FTW!</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2010/05/18/vim-syntax-hilighting-for-rubyrails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WRT FAIL</title>
		<link>http://shlrm.org/wordpress/2010/05/12/wrt-fail/</link>
		<comments>http://shlrm.org/wordpress/2010/05/12/wrt-fail/#comments</comments>
		<pubDate>Thu, 13 May 2010 03:40:21 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Source Mage]]></category>
		<category><![CDATA[openwrt]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=366</guid>
		<description><![CDATA[I had posted previously about setting up a WRT54G-TM running OpenWRT to be the router for my network. I thought it would be the perfect router, low power consumption, low heat, no moving parts, and wifi included. Unfortunately it did not work well at all. My advanced traffic shaping configuration killed the poor thing. 200MHz [...]]]></description>
			<content:encoded><![CDATA[<p>I had <a href="http://shlrm.org/wordpress/2010/05/07/wrt54g-tm-hacking/">posted previously</a> about setting up a WRT54G-TM running <a href="http://www.openwrt.org">OpenWRT</a> to be the router for my network. I thought it would be the perfect router, low power consumption, low heat, no moving parts, and wifi included. Unfortunately it did not work well at all. My <a href="http://www.shorewall.net/traffic_shaping.htm">advanced traffic shaping configuration</a> killed the poor thing. 200MHz is apparently insufficient hurtz to handle the large  number of interrupts for packet processing and marking. I was told it might be a driver issue, but I wasn&#8217;t aware of any other drivers that I could have loaded to offload those interrupts. So the system spent &gt; 70% of it&#8217;s CPU time in System IRQ handling. When it was under heavy packet load, something the original router setup would&#8217;ve handled without batting an eye, it would drop connections and eventually die. It wouldn&#8217;t respond to pings, nor would it forward traffic adequately. NAT + Traffic shaping + bittorrents = DEATH. Not to mention that <a href="https://dev.openwrt.org/ticket/7318">syslogd eventually threw the thing into a kernel panic</a>. Oh, and the <a href="https://dev.openwrt.org/ticket/7308">b43 driver also panicked the kernel</a> soon after turning on the wifi.</p>
<p>So I&#8217;m back to the original setup, with an old (1998) left-over 2GB hard-drive, and a modified Source Mage install. It&#8217;s in good shape, with some tmpfs stuff for things that write to the disk in order to hopefully prolong the life of the disk. I took a clonezilla snapshot of it as well, so when the drive dies, I can throw in a new (also old, I have several 2 to 4 GB drives that are in the closet that still work) one, and the router will be back up in a few moments.</p>
<p>Whilst it was unfortunate that the router wasn&#8217;t a good fit for my particular use, perhaps I&#8217;ll find another use for it. Since there are two Serial ports trivially accessible on the device, perhaps I&#8217;ll get a GPS module and set it up in the car as a mobile automatic war-driving toy. I&#8217;ve found instructions to hook up an SD card to it as well, that would give it plenty of easy to replace storage.</p>
<p>It was an interesting experiment, and I&#8217;m somewhat sad it didn&#8217;t work out.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2010/05/12/wrt-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WRT54G-TM Hacking</title>
		<link>http://shlrm.org/wordpress/2010/05/07/wrt54g-tm-hacking/</link>
		<comments>http://shlrm.org/wordpress/2010/05/07/wrt54g-tm-hacking/#comments</comments>
		<pubDate>Fri, 07 May 2010 15:06:54 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[openwrt]]></category>
		<category><![CDATA[wrt54g-tm]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=363</guid>
		<description><![CDATA[A while ago, I purchased some WRT54G-TM routers from the TMoblie store near by. Apparently they were part of a push by TMobile to further their UMA stuff. People could purchase a router with wifi at the same time as purchasing their phone, if they didn&#8217;t already have one. I guess sales didn&#8217;t turn out [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I purchased some <a href="http://en.wikipedia.org/wiki/WRT54G-TM#WRT54G-TM">WRT54G-TM</a> routers from the TMoblie store near by. Apparently they were part of a push by TMobile to further their <a href="http://en.wikipedia.org/wiki/Unlicensed_Mobile_Access">UMA stuff</a>. People could purchase a router with wifi at the same time as purchasing their phone, if they didn&#8217;t already have one. I guess sales didn&#8217;t turn out so well, because TMobile was selling them for $20 each and trying to get rid of them all. I bought two.</p>
<p>Turns out these things are really just <a href="http://en.wikipedia.org/wiki/WRT54GL#WRT54GL">WRT54GL</a>&#8216;s, the Linux one that they sell for like $70 that they have not screwed with so you can hack them and run any of the (not all)Linux <a href="http://en.wikipedia.org/wiki/List_of_wireless_router_firmware_projects">wrt distros out there</a>. Except it&#8217;s even better, because it&#8217;s got 32MB of ram and 8mb of flash, instead of half that like the standard WRT54GL. It requires <a href="http://www.dd-wrt.com/wiki/index.php/WRT54G-TM#Flashing_WRT54G-TM">a bit more voodoo to unlock</a> (and after flashing dd-wrt, you can flash openwrt, or anything else,) but not at all difficult.</p>
<p>With the recent <a href="https://dev.openwrt.org/milestone/Backfire%2010.03">release of BackFire</a> from OpenWRT, which coincided with my old <a href="http://www.sourcemage.org">SMGL</a> router&#8217;s hard drive failure, I have set up that router on my network. It worked well for a few weeks, but recently has started flaking out and completely disappearing from my network. A gateway that refuses to respond to anything on the network is not particularly useful. So, to the internets I went. I discovered how trivial it would be to hook up one of the serial ports on the thing to my computer. A bit of soldering later, and I have a log of everything that comes out of the console of that box on my server. Hopefully, the next time it flakes out, I&#8217;ll have a logged kernel panic that I can submit it in a bug report. I might even be able to figure out the solution and post it along with the bug.</p>
<p>Additionally, as a solution to keep the network alive right now, I have set up a <a href="http://www.nagios.org/">Nagios</a> event handler to tell the UPS the router is attached to, to restart. This successfully power cycles the two gateway devices: ATT&#8217;s 2-wire thingy, and my OpenWRT router. So, my network has a limited self-healing ability now, which is, of course, a band-aid. However, until I can figure out what&#8217;s wrong with the router, it&#8217;s the best option that I&#8217;ve got to keep things functional. Especially when I&#8217;m not at home, and it dies (which seems to be the only time it dies&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2010/05/07/wrt54g-tm-hacking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>xm pause testing</title>
		<link>http://shlrm.org/wordpress/2010/05/01/xm-pause-testing/</link>
		<comments>http://shlrm.org/wordpress/2010/05/01/xm-pause-testing/#comments</comments>
		<pubDate>Sun, 02 May 2010 00:05:31 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[pvops]]></category>
		<category><![CDATA[suspend]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=358</guid>
		<description><![CDATA[When I got xm pause working, I was quite excited. However, it doesn&#8217;t work in all cases. I&#8217;ve done some testing to figure out what combination of things cause it to fail. All of this is using xen 4.0 hypervisor, the kernel from here, and a pvops domU kernel built by hand. Using blktap2 backed [...]]]></description>
			<content:encoded><![CDATA[<p>When I got xm pause working, I was quite excited. However, it doesn&#8217;t work in all cases. I&#8217;ve done some testing to figure out what combination of things cause it to fail.</p>
<p>All of this is using xen 4.0 hypervisor, the kernel from <a href="http://fedorapeople.org/~myoung/dom0/">here</a>, and a <a href="http://git.kernel.org/?p=linux/kernel/git/jeremy/xen.git">pvops domU kernel</a> built by hand.</p>
<ul>
<li>Using <a href="http://lxr.xensource.com/lxr/source/tools/blktap2/README">blktap2</a> backed disks in the vhd format (vhd-util create -n name -s 1024) xm pause fails. The user-space disk devices are never released, and only a hard reboot will get it to function again.</li>
<li>Using a different driver for the blktap2, tap:tapdisk:aio, also fails to pause.</li>
<li>Using phy:/ backed disks, say through LVM works fine. The domU will pause, and resume nicely.</li>
</ul>
<p>It would seem that there is something not quite ready to be used regarding the blktap2 backend, so I wouldn&#8217;t reccomend using it.</p>
<p>I also tried to use the original tap:aio drivers, but I cannot as they don&#8217;t seem to exist. I guess I&#8217;ll be using the plain old phy:/ drivers for now. That&#8217;s not a big deal as I don&#8217;t have any second xen machine to do anything fancy that the tap:aio drivers would provide. I guess I should poke on a mailing list or something.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2010/05/01/xm-pause-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xen pv_ops domU</title>
		<link>http://shlrm.org/wordpress/2010/05/01/xen-pv_ops-domu/</link>
		<comments>http://shlrm.org/wordpress/2010/05/01/xen-pv_ops-domu/#comments</comments>
		<pubDate>Sat, 01 May 2010 23:30:19 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Source Mage]]></category>
		<category><![CDATA[W00t!]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[pvops]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=354</guid>
		<description><![CDATA[&#8230;means I can finally pause/suspend a domU vm again! Finding this information should&#8217;ve been obvious, but for some reason it wasn&#8217;t. Maybe I had some silly mental block or something. Anyways, get the kernel source from here. Then build it for your architecture. If you want to build a 32-bit kernel for some 32-bit domUs, [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;means I can finally pause/suspend a domU vm again!</p>
<p>Finding this information should&#8217;ve been obvious, but for some reason it wasn&#8217;t. Maybe I had some silly mental block or something. Anyways, get the kernel source from <a href="http://git.kernel.org/?p=linux/kernel/git/jeremy/xen.git">here</a>. Then build it for your architecture. If you want to build a 32-bit kernel for some 32-bit domUs, and you&#8217;re running on 64-bit, it&#8217;s as easy as make ARCH=i386 &lt;target&gt;. This does work and I&#8217;ve verified it. Had to fool a Fedora domU into beleiving that it really was a 32-bit system.</p>
<p>I&#8217;ve found make tarbz2-pkg to be quite handy in packaging up the kernel to be deployed.</p>
<p>I have verified that this works in Xen 3.4.2 on a patched 2.6.29.6 kernel.</p>
<p>On my Xen 4.0 test box, it fails to suspend. I&#8217;m using the blktap2 stuff, and perhaps that doesn&#8217;t pause well. As far as I understand it, that blktap2 should not affect suspending, but I&#8217;m going to test it with some logical volume based vms. I usually use the lvm backed disks anyway, but the blktap2 stuff offers some interesting features, if it were to work. Not being able to pause stuff probably isn&#8217;t good, but again, I&#8217;m not sure what&#8217;s causing it.</p>
<p>Apparently, that is what&#8217;s causing it. The domU will pause and unpause just fine when using an lvm backed disk, rather than the blktap2 ones. I should test a couple of other combinations to see if things like tap:aio will behave, as that&#8217;s needed for nifty things like remus.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2010/05/01/xen-pv_ops-domu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Broke my database</title>
		<link>http://shlrm.org/wordpress/2010/04/26/broke-my-database/</link>
		<comments>http://shlrm.org/wordpress/2010/04/26/broke-my-database/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 13:05:43 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=349</guid>
		<description><![CDATA[Last Friday, whilst I was fiddling with innodb performance settings, I apparently managed to totally hose any innodb tables. My blag and my dspam signatures were, thankfully, the only ones that ate it. Of course, I didn&#8217;t have backups, so that kinda sucked. I restored the blag from the most recent backup I had (February [...]]]></description>
			<content:encoded><![CDATA[<p>Last Friday, whilst I was fiddling with <a href="http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/">innodb performance settings</a>, I apparently managed to totally hose any innodb tables. My blag and my dspam signatures were, thankfully, the only ones that ate it. Of course, I didn&#8217;t have backups, so that kinda sucked. I restored the blag from the most recent backup I had (February 12th) and then recreated manually the few posts I knew were ahead of that.</p>
<p>I hacked up some backup scripts in ruby, I probably could have done it in pure bash, but I felt that this was cleaner.</p>
<p><span id="more-349"></span><br />
I&#8217;ve got two scripts, one for <a href="#mysql">mysql</a>, and one for the <a href="#postgresql">postgresql</a> database. They&#8217;re almost exactly the same, except for the differences in how to talk to the database, and the interfacing objects. They create one .sql file for each database, and that will automatically adapt when you add more databases. It will keep around 7 copies of each file, so if you run it daily, you&#8217;ll have a week&#8217;s worth of database backups. They&#8217;re bzip2 &#8211;best&#8217;d so that it doesn&#8217;t waste too much space.</p>
<p><a name="mysql">MySQL</a>:</p>
<pre class="brush:ruby">#!/usr/bin/ruby

require "mysql"
require "fileutils"

# designed to be run daily, will keep #{files} number of files around

backupDir = "/srv/database/backup/mysql"
username = "SOMEUSER"
password = "PASSNERD"
host = "localhost"
files = 7

FileUtils.mkdir_p backupDir

currentDir = FileUtils.pwd()
FileUtils.cd(backupDir)
begin
        dbh = Mysql.real_connect(host, username, password)
        result = dbh.query("show databases;")
        while row = result.fetch_row do
                begin
                        dbname = row[0]
                        # do file rotation stuffs
                        FileUtils.rm("#{dbname}.#{files}.sql.bz2", :force =&gt; true) # never will complain
                        (1..(files-1)).each do |a|
                                n = files -a
                                FileUtils.mv("#{dbname}.#{n}.sql.bz2", "#{dbname}.#{n+1}.sql.bz2", :force =&gt; true) #no errors
                        end
                        # move the one without a number to 1.sql.bz2
                        FileUtils.mv("#{dbname}.sql.bz2", "#{dbname}.1.sql.bz2", :force =&gt; true)

                        #dump the sql!
                        command = "mysqldump -u #{username} -p'#{password}' -h #{host} #{dbname} | bzip2 --best &gt; #{dbname}.sql.bz2"
                        `#{command}`
                rescue Mysql::Error =&gt; err
                        # note it and continue with the next database
                        p "Database: #{dbname}\n\terr"
                end
        end
        result.free
rescue Mysql::Error =&gt; e
        puts "Error code: #{e.errno}"
        puts "Error message: #{e.error}"
        puts "Error SQLSTATE: #{e.sqlstate}" if e.respond_to?("sqlstate")
ensure
        dbh.close if dbh
        FileUtils.cd(currentDir)
end
</pre>
<p><a name="postgresql">Postgresql</a>:</p>
<pre class="brush:ruby">#!/usr/bin/ruby

require "pg"
require "fileutils"

# designed to be run daily, will keep #{files} number of files around

backupDir = "/srv/database/backup/postgres"
username = "SOMEUSER"
password = "PASSNERD"
host = "localhost"
files = 7

FileUtils.mkdir_p backupDir

currentDir = FileUtils.pwd()
FileUtils.cd(backupDir)
begin
        conn = PGconn.new(:user =&gt; username, :password=&gt; password, :host=&gt;host)
        result = conn.exec("select datname from pg_database")
        result.each do |row|
                begin
                        dbname = row['datname']
                        if !( /template.*/ =~ dbname)
                                # do file rotation stuffs
                                FileUtils.rm("#{dbname}.#{files}.sql.bz2", :force =&gt; true) # never will complain
                                (1..(files-1)).each do |a|
                                        n = files - a
                                        FileUtils.mv("#{dbname}.#{n}.sql.bz2", "#{dbname}.#{n+1}.sql.bz2", :force =&gt; true) #no errors
                                end
                                # move the one without a number to 1.sql.bz2
                                FileUtils.mv("#{dbname}.sql.bz2", "#{dbname}.1.sql.bz2", :force =&gt; true)

                                #dump the sql!
                                command = "PGPASSWORD='#{password}' pg_dump -U #{username} -h #{host} #{dbname} | bzip2 --best &gt; #{dbname}.sql.bz2"
                                `#{command}`
                        end
                rescue PGError =&gt; err
                        # note it and continue with the next database
                        p "Database: #{dbname}\n\terr"
                end
        end
        result.clear
rescue PGError =&gt; e
        p e
ensure
        conn.close if conn
        FileUtils.cd(currentDir)
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2010/04/26/broke-my-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
