<?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>andr3w.net &#187; commandline</title>
	<atom:link href="http://andr3w.net/tag/commandline/feed/" rel="self" type="application/rss+xml" />
	<link>http://andr3w.net</link>
	<description>amateur web development...</description>
	<lastBuildDate>Fri, 20 Aug 2010 21:08:03 +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>One-way MySQL DB Syncing for Dummies</title>
		<link>http://andr3w.net/2009/06/one-way-mysql-db-syncing/</link>
		<comments>http://andr3w.net/2009/06/one-way-mysql-db-syncing/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 00:05:06 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[system]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[syncing]]></category>

		<guid isPermaLink="false">http://andr3w.net/?p=161</guid>
		<description><![CDATA[To ease my development while on the move, I have local development copies of my websites running on my MacBook Pro. This has always worked pretty well for me, as content for my websites was created, predominantly, by myself, and when new content was created at a single site I could sync that database manually and get an up to date local content set.

With my recent efforts into lifestreaming, this is no longer the case. My content now comes in whenever I post content on any website. I'm a fairly frequent user of the internet services that feed my lifestream (twitter, delicious, flickr, etc), and keeping the content on my local version up to date was turned into a troublesome task, forcing manual, tedious syncing each time I went to work.

Without further explanation, here are the steps I took to make a one line MySQL database syncing command.]]></description>
			<content:encoded><![CDATA[<p>To ease my development while on the move, I have local development copies of my websites running on my MacBook Pro. This has always worked pretty well for me, as content for my websites was created, predominantly, by myself, and when new content was created at a single site I could sync that database manually and get an up to date local content set.</p>
<p>With my recent efforts into <a href="http://amdavidson.me">lifestreaming</a>, this is no longer the case. My content now comes in whenever I post content on <em>any</em> website. I&#8217;m a fairly frequent user of the internet services that feed my lifestream (<a href="http://twitter.com/amdavidson">Twitter</a>, <a href="http://delicious.com/amdavidson">Delicious</a>, <a href="http://flickr.com/photos/amdavidson">Flickr</a>, etc), and keeping the content on my local version up to date was turned into a troublesome task, forcing manual, tedious syncing each time I went to work.</p>
<p>Without further explanation, here are the steps I took to make a one line MySQL database syncing command. There may be better ways to do this and if you know them, please comment.</p>
<p>1. Setup a MySQL &#8220;dump&#8221; user. Mine is cleverly named &#8220;dump&#8221; and is passwordless, although if you are more security conscious than I am, you can add a password of your choosing. On the server, log into mysql and issue this GRANT statement from a user with the proper permissions.</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">SELECT</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">LOCK</span> <span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #ff0000;">`dbname_remote`</span><span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'dump'</span>@<span style="color: #ff0000;">'localhost'</span>;</div></td></tr></tbody></table></div>
<p>2. Create a bash alias<br />
~/.bashrc :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ALIAS <span style="color: #007800;">clone_lifestream</span>=<span style="color: #ff0000;">'ssh -q -t hostname &quot;mysqldump -u dump dbname_remote&quot; | mysql -u root dbname_local'</span></div></td></tr></tbody></table></div>
<p><strong>Notes:</strong> For this example, you need to replace a few things.</p>
<ol>
<li>dbname = the remote database name</li>
<li>hostname = the remote hostname</li>
<li>dbname_local = the local database name</li>
<li>clone_lifestream = the name of the alias, can be anything.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://andr3w.net/2009/06/one-way-mysql-db-syncing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Length Errors in Apache Bench</title>
		<link>http://andr3w.net/2009/05/length-errors-in-apache-bench/</link>
		<comments>http://andr3w.net/2009/05/length-errors-in-apache-bench/#comments</comments>
		<pubDate>Mon, 04 May 2009 22:42:02 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[system]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://andr3w.net/?p=126</guid>
		<description><![CDATA[Are you seeing errors for content length in your Apache Bench tests of your webserver? I had a hell of a time wondering what was going wrong with my webserver under load and finally found the answer here. Turns out that Apache Bench takes the first pulled request and compares the length to all subsequent [...]]]></description>
			<content:encoded><![CDATA[<p>Are you seeing errors for content length in your <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">Apache Bench</a> tests of your webserver?</p>
<p>I had a hell of a time wondering what was going wrong with my webserver under load and finally found the answer <a href="http://markmail.org/message/6zsvfw67rjy7hu4x#query:apachebench%20requests%20fail%20length+page:1+mid:b7wzpg43n3eiicu5+state:results">here</a>.</p>
<p>Turns out that Apache Bench takes the first pulled request and compares the length to all subsequent requests. Makes sense for a purely static page, but when you have a random image cropping up, you&#8217;re sure to see at least a couple bits difference in length.</p>
<p>So if you&#8217;re serving straight, hand coded HTML, enjoy the feeling of knowing that you&#8217;re getting the same length content each and every time&#8230; but if you&#8217;re like the rest of us (and anyone who would actually be using Apache Bench) feel free to rage that there&#8217;s no <a href="http://httpd.apache.org/docs/2.0/programs/ab.html#options">command line switch</a> to turn off that silly notification.</p>
]]></content:encoded>
			<wfw:commentRss>http://andr3w.net/2009/05/length-errors-in-apache-bench/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
