<?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>PMA Media Group&#187; IT</title>
	<atom:link href="http://www.pmamediagroup.com/category/it/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pmamediagroup.com</link>
	<description>Unique Marketing Techniques and Strategies with Guaranteed Results!</description>
	<lastBuildDate>Thu, 29 Jul 2010 15:34:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Database syncronization woes</title>
		<link>http://www.pmamediagroup.com/2009/11/database-syncronization-woes/</link>
		<comments>http://www.pmamediagroup.com/2009/11/database-syncronization-woes/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 00:00:50 +0000</pubDate>
		<dc:creator>Narshlob</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[database replication]]></category>
		<category><![CDATA[database syncronization]]></category>
		<category><![CDATA[mysql replication]]></category>
		<category><![CDATA[mysql sync]]></category>

		<guid isPermaLink="false">http://www.pmamediagroup.com/?p=978</guid>
		<description><![CDATA[Database resyncronization depends on what went wrong but the steps below will most likely solve most issues.
Run these commands on the slave database

STOP SLAVE; # stop the Slave I/O threads
RESET SLAVE; # forget about all the relay log files

Then go to the master database and run these

RESET MASTER; # reset the bin log counter and [...]]]></description>
			<content:encoded><![CDATA[<p>Database resyncronization depends on what went wrong but the steps below will most likely solve most issues.<br />
Run these commands on the slave database</p>
<ol>
<li>STOP SLAVE; # stop the Slave I/O threads</li>
<li>RESET SLAVE; # forget about all the relay log files</li>
</ol>
<p>Then go to the master database and run these</p>
<ol>
<li>RESET MASTER; # reset the bin log counter and wipe out bin log files
<li>FLUSH TABLES WITH READ LOCK; # flush buffers and LOCK tables
<li>show master status\G
</ol>
<p>Note what the show master status command returns. You&#8217;ll need to know the file name and the position.<br />
You can do one of two things here, make a dump of the entire master database (in which case I suggest you follow <a href="http://blog.gurudelleccelsopicco.org/2009/09/howto-mysql-master-slave-resync/">this</a>)<br />
or you can just update the tables.<br />
Usually we just need to update the tables so release the lock on the master database tables (UNLOCK TABLES;) and then run this command on the slave database (download maatkit tools <a href="http://code.google.com/p/maatkit/downloads/list">here</a>),</p>
<ul>
<li>cd ~/maatkit-5014/bin &#038;&#038; sudo ./mk-table-sync &#8211;[print][execute] u=[user],p=[pass],h=[master_host_name] &#8211;databases [database_name(s)] localhost</li>
</ul>
<p>I suggest you run &#8211;print before you run &#8211;execute. If you run &#8211;execute first, you have no idea what just happened. &#8211;print will let you know what it&#8217;ll do without actually doing anything.<br />
Back to the slave database mysql client, issue these commands,</p>
<ol>
<li>CHANGE MASTER TO MASTER_LOG_FILE=&#8217;[file name from show master status command]&#8216;, MASTER_LOG_POS=[pos];</p>
<li>SLAVE START;</ol>
<p>Run this command,</p>
<ul>
<li>show slave status\G</li>
</ul>
<p>And check that these aren&#8217;t NO or NULL,</p>
<p>Slave_IO_Running: Yes<br />
Slave_SQL_Running: Yes<br />
&#8230;.<br />
Seconds_Behind_Master: 1634</p>
<p>If things aren&#8217;t back to normal, follow the instructions on <a href="http://blog.gurudelleccelsopicco.org/2009/09/howto-mysql-master-slave-resync/">this website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pmamediagroup.com/2009/11/database-syncronization-woes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with Git</title>
		<link>http://www.pmamediagroup.com/2009/06/working-with-git/</link>
		<comments>http://www.pmamediagroup.com/2009/06/working-with-git/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 23:34:48 +0000</pubDate>
		<dc:creator>Narshlob</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git branch]]></category>
		<category><![CDATA[git rebase]]></category>
		<category><![CDATA[git tutorial]]></category>
		<category><![CDATA[manage repo]]></category>
		<category><![CDATA[repository]]></category>

		<guid isPermaLink="false">http://www.pmamediagroup.com/?p=904</guid>
		<description><![CDATA[Use Git to keep track of your project and to share it between all members of your team/company.]]></description>
			<content:encoded><![CDATA[<p>This tutorial covers all the commands (hopefully) we&#8217;ll need for the projects we build here at PMA. If there&#8217;s anything that needs to be added to it, feel free to comment.</p>
<p>Starting with the basics, we&#8217;ll first cover retrieving a project:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git clone <span style="color: #7a0874; font-weight: bold;">&#91;</span>repository<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>This will get the currently active branch from the repository</p>
<p>Obviously you&#8217;ll want to do something with this newly retrieved working copy of the project. Let&#8217;s first create a branch for the new features/bug fixes we&#8217;ll be coding.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git checkout <span style="color: #660033;">-b</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>newbranchname<span style="color: #7a0874; font-weight: bold;">&#93;</span> origin</pre></div></div>

<p>Ok, so we got a new branch. While we&#8217;re coding, it&#8217;s a good idea to commit tons of times to preserve the changes we&#8217;ve just made. Don&#8217;t worry about the log, we&#8217;ll make it pretty later. Just commit often.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git add <span style="color: #7a0874; font-weight: bold;">&#91;</span>filename<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
git commit</pre></div></div>

<p>If it&#8217;s a small change that doesn&#8217;t require much explanation, you can use these commands</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git add <span style="color: #000000; font-weight: bold;">*</span>
git commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;The commit message&quot;</span></pre></div></div>

<p>Or, even shorter</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git commit <span style="color: #660033;">-a</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;The commit message&quot;</span></pre></div></div>

<p>You finished that feature so now it&#8217;s time to merge that branch with the master branch (or some other branch depending on what VCS (Version Control System) paradigm you/your team chose). First, you should make those hard-to-read commits less hard-to-read. Let&#8217;s rebase!<br />
Please note that if you rebase after pushing to the repository, you will create problems for those pulling from that repository. Rebase changes the history of the project. Your teammates merges will not be fast-forward[able]. It won&#8217;t be pretty, trust me.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git rebase <span style="color: #660033;">-i</span> HEAD~<span style="color: #7a0874; font-weight: bold;">&#91;</span>number of commits back<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>You&#8217;ll now be looking at something similar to this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pick ce86448 A random commit
pick a8564a9 Another random commit</pre></div></div>

<p>How you order things in this editor will affect the order of the commits. Note that merge commits are not shown here. They aren&#8217;t editable.<br />
Replacing &#8220;pick&#8221; with &#8220;edit&#8221; will allow you to edit the changes you made as well as the commit message.<br />
After you&#8217;ve edited the files you wanted to edit, you can now</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git add <span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>then</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git commit <span style="color: #660033;">--amend</span></pre></div></div>

<p>and move on.</p>
<p>As I mentioned before, you have the opportunity to clean up the mess you made with all those many commits using the rebase option. Here&#8217;s how:</p>
<ol>
<li>Run the

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git rebase <span style="color: #660033;">-i</span> HEAD~<span style="color: #7a0874; font-weight: bold;">&#91;</span>x<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p> command from earlier</li>
<li>Replace &#8220;pick&#8221; with &#8220;squash&#8221; on the commit you want to be combined with one exactly previous to it.
<pre>pick ace72dd I squashed these commits. I'm cool.
squash e99fd59 This commit will be sqaushed with the one above it
pick d0770e8 commited again
pick af845d0 I'm really committed
</pre>
</li>
</ol>
<p>Pretty straight forward and easy. Everyone loves rebasing<br />
If you want to know more about git-rebase, I recommend checking it out <a href="http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html">here</a>.</p>
<p>Now, you&#8217;ve made all these changes and everything looks great. What are you gonna call this pretty new feature? Are you gonna tag it? I would..</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git tag <span style="color: #660033;">-a</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>fancy_feature<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;A fancy message for a fancy feature&quot;</span></pre></div></div>

<p>If you happen to leave out the -m, git will open an editor and you&#8217;ll be able to add your fancy message there, just like with commit!<br />
Read more about tags <a href="http://www.kernel.org/pub/software/scm/git/docs/git-tag.html">here</a>.<br />
One scenario for using tags could be that, within a project, one wants to keep track of versions. Each commit could be tagged with a version number like with bug fixes in some VCSs. If something goes wrong, it&#8217;s really simple to go back to a previous version using git rebase, as we&#8217;ve already shown.</p>
<p>You&#8217;ve squashed those ugly commits, changed the commit message(s), and tagged everything. Time to merge. Switch to the master branch (or whatever branch you&#8217;re wanting to merge with) and type this command which will merge [branchname] with the current branch:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git merge <span style="color: #7a0874; font-weight: bold;">&#91;</span>branchname<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>You&#8217;ll probably want to fix any conflicts and continue with the merge.<br />
It&#8217;s now safe to delete [branchname] because all the changes from that branch are now on the current one.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git branch <span style="color: #660033;">-d</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>branchname<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>This next feature is pretty neat. Say you&#8217;ve done a bunch of changes that haven&#8217;t been committed yet and you realize you aren&#8217;t on a feature branch. Here&#8217;s what you do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git stash
git stash branch <span style="color: #7a0874; font-weight: bold;">&#91;</span>newbranchname<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>This will stash away all uncommitted changes, create a new branch and check it out, then unstash all your stashed changes into that new branch. Awesome</p>
<p>Stash is also useful in scenarios where you don&#8217;t want to commit yet but you need to switch to a different branch and do something. You could stash the current changes using the above git stash command, do the needed changes, then switch back to the branch you were working on and use this command to unstash the changes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git stash apply</pre></div></div>

<p>It&#8217;s a good idea to check out the other things offered by git stash (<a href="http://www.kernel.org/pub/software/scm/git/docs/git-stash.html">git-stash</a>)</p>
<p>To get this new branch into the origin repository, do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git push origin <span style="color: #7a0874; font-weight: bold;">&#91;</span>branchname<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>To delete a branch from the origin repository, do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git push origin :<span style="color: #7a0874; font-weight: bold;">&#91;</span>branchname<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Don&#8217;t forget the colon!</p>
<p>Another scenario; your co-worker does some work on a feature and gets stuck. You don&#8217;t want to type on their computer cause yours is set up just the way you want it. Is there a solution to this quandary? Yeah. There is&#8230;<br />
Tell them to push their changes then do this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git fetch origin <span style="color: #7a0874; font-weight: bold;">&#91;</span>remotebranchname<span style="color: #7a0874; font-weight: bold;">&#93;</span>:<span style="color: #7a0874; font-weight: bold;">&#91;</span>localbranchname<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>You now have the branch they were working on locally and can modify to your hearts content.</p>
<hr width="75%" />
<h2>Noteworthy Notes</h2>
<p>There&#8217;s a difference between</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git pull</pre></div></div>

<p>and</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git fetch</pre></div></div>

<p>The difference is that &#8220;git pull&#8221; will run a &#8220;git fetch&#8221; then a &#8220;git merge&#8221; to merge the retrieved head into the current branch.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git log <span style="color: #660033;">-p</span> path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>file.rb</pre></div></div>

<p>This command will show the history of a specific file;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git blame path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>file.rb</pre></div></div>

<p>will go line by line in a file and give a short description + the name of the person that changed the line last (brilliant, actually)</p>
<hr width="75%" />
<h2>From the Git manual</h2>
<p><a href="http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#fast-forwards">check it out</a><br />
A few configuration variables (see git-config(1)) can make it easy to push both branches to your public tree. (See the section called “Setting up a public repository”.)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; .git<span style="color: #000000; font-weight: bold;">/</span>config <span style="color: #000000; font-weight: bold;">&amp;</span>lt;
      <span style="color: #7a0874; font-weight: bold;">&#91;</span>remote <span style="color: #ff0000;">&quot;mytree&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
           url =  master.kernel.org:<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>scm<span style="color: #000000; font-weight: bold;">/</span>linux<span style="color: #000000; font-weight: bold;">/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>git<span style="color: #000000; font-weight: bold;">/</span>aegl<span style="color: #000000; font-weight: bold;">/</span>linux-2.6.git
           push = release
           push = <span style="color: #7a0874; font-weight: bold;">test</span>
EOF</pre></div></div>

<p>Then you can push both the test and release trees using git-push(1):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git push mytree</pre></div></div>

<p>or push just one of the test and release branches using:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git push mytree <span style="color: #7a0874; font-weight: bold;">test</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git push mytree release</pre></div></div>

<p>To rebase your current working tree to obtain the changes from the master tree,<br />
Suppose that you create a branch &#8220;mywork&#8221; on a remote-tracking branch &#8220;origin&#8221;, and create some commits on top of it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git checkout <span style="color: #660033;">-b</span> mywork origin
<span style="color: #007800;">$vi</span> file.txt
$ git commit
$ <span style="color: #c20cb9; font-weight: bold;">vi</span> otherfile.txt
$ git commit</pre></div></div>

<p>&#8230;<br />
You have performed no merges into mywork, so it is just a simple linear sequence of patches on top of &#8220;origin&#8221;:<br />
o&#8211;o&#8211;o <-- origin<br />
\<br />
o--o--o <-- mywork<br />
Some more interesting work has been done in the upstream project, and "origin" has advanced:<br />
o--o--O--o--o--o <-- origin<br />
\<br />
a--b--c <-- mywork<br />
At this point, you could use "pull" to merge your changes back in; the result would create a new merge commit, like this:<br />
o--o--O--o--o--o <-- origin<br />
\        \<br />
a--b--c--m <-- mywork<br />
However, if you prefer to keep the history in mywork a simple series of commits without any merges, you may instead choose to use git-rebase(1):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ git checkout mywork
$ git rebase origin</pre></div></div>

<p>This will remove each of your commits from mywork, temporarily saving them as patches (in a directory named &#8220;.git/rebase-apply&#8221;), update mywork to point at the latest version of origin, then apply each of the saved patches to the new mywork. The result will look like:<br />
o&#8211;o&#8211;O&#8211;o&#8211;o&#8211;o <-- origin<br />
\<br />
a'--b'--c' <-- mywork<br />
In the process, it may discover conflicts. In that case it will stop and allow you to fix the conflicts; after fixing conflicts, use git add to update the index with those contents, and then, instead of running git commit, just run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ git rebase <span style="color: #660033;">--continue</span></pre></div></div>

<p>and git will continue applying the rest of the patches.<br />
At any point you may use the —abort option to abort this process and return mywork to the state it had before you started the rebase:</p>
<pre lang="bash>
$ git rebase --abort
</pre>
<hr width="75%" />
<h2>The commands</h2>
<p>Here&#8217;s a list of all commands covered in this tutorial:<br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-clone.html">git-clone</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html">git-checkout</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-add.html">git-add</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-commit.html">git-commit</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html">git-rebase</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-tag.html">git-tag</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-merge.html">git-merge</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-branch.html">git-branch</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-stash.html">git-stash</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-push.html">git-push</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-pull.html">git-pull</a><br />
<a href="http://www.kernel.org/pub/software/scm/git/docs/git-fetch.html">git-fetch</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pmamediagroup.com/2009/06/working-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced Routing Wireless To Your LAN With Cisco WRT400N</title>
		<link>http://www.pmamediagroup.com/2009/06/advanced-routing-wireless-to-your-lan-with-cisco-wrt400n/</link>
		<comments>http://www.pmamediagroup.com/2009/06/advanced-routing-wireless-to-your-lan-with-cisco-wrt400n/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 23:16:28 +0000</pubDate>
		<dc:creator>Aaron Murphy</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Linksys]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www2.pmamediagroup.com/?p=20</guid>
		<description><![CDATA[Advanced routing wireless to LAN with the Cisco WRT400N router is simple, once you know how. Just do the basic setup on the router as usual, only disable the DHCP server. Then go to the Advaned Routing page and disable NAT and enable Dynamic Routing. Now you can connect a local network to one of [...]]]></description>
			<content:encoded><![CDATA[<p>Advanced routing wireless to LAN with the <a href="http://www.linksysbycisco.com/US/en/products/WRT400N">Cisco WRT400N</a> router is simple, once you know how. Just do the basic setup on the router as usual, only disable the DHCP server. Then go to the Advaned Routing page and disable NAT and enable Dynamic Routing. Now you can connect a local network to one of the four LAN ports. Don&#8217;t use the WAN port as the Internet connection will go through your main LAN.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pmamediagroup.com/2009/06/advanced-routing-wireless-to-your-lan-with-cisco-wrt400n/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting PowerDNS To Ignore Records For Downed Web Sites</title>
		<link>http://www.pmamediagroup.com/2009/06/setting-powerdns-to-ignore-records-for-downed-web-sites/</link>
		<comments>http://www.pmamediagroup.com/2009/06/setting-powerdns-to-ignore-records-for-downed-web-sites/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 23:15:03 +0000</pubDate>
		<dc:creator>Aaron Murphy</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Daemon]]></category>
		<category><![CDATA[gmysql]]></category>
		<category><![CDATA[Powerdns]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.pmamediagroup.com/?p=591</guid>
		<description><![CDATA[If you are using PowerDNS for round robin on multiple websites, you can set it up so that it will return only the records for sites that are up. I set up a Ruby daemon to monitor sites and connect to the PowerDNS MySQL table used by PowerDNS on Rails. You can use any language [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using <a href="http://www.powerdns.com/">PowerDNS</a> for round robin on multiple websites, you can set it up so that it will return only the records for sites that are up. I set up a Ruby daemon to monitor sites and connect to the PowerDNS <a href="http://www.mysql.com/">MySQL</a> table used by <a href="http://kennethkalmer.github.com/powerdns-on-rails/">PowerDNS on Rails</a>. You can use any language or system you like. It just needs to be able to access your PowerDNS database.<span id="more-591"></span></p>
<p>First add the following line to /etc/powerdns/pdns.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"> gmysql<span style="color: #000000;">-</span>any<span style="color: #000000;">-</span>query=select content,ttl,prio,<span style="color: #25BB4D;">type</span>,domain_id,name from records where name=<span style="color: #C5A22D;">'%s'</span> and <span style="color: #000000;">&#40;</span>prio<span style="color: #000000;">&lt;&gt;-</span><span style="color: #000000; font-weight:bold;">1</span> or prio is null<span style="color: #000000;">&#41;</span></pre></div></div>

<p>Thats the trickiest part. If you mess up on the sql query, PowerDNS may not return any results for your domain.<br />
Then restart pdns. I use CentOS so I type</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">service pdns restart</pre></div></div>

<p>Now you just need a daemon to monitor your websites. Something like the following might work for you:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'net/http'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'activerecord'</span>
&nbsp;
SITE_ADDRESSES = <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span> www.<span style="color:#9900CC;">yourdomain</span>.<span style="color:#9900CC;">com</span> www.<span style="color:#9900CC;">example</span>.<span style="color:#9900CC;">com</span> <span style="color:#006600; font-weight:bold;">&#41;</span>
SITE_THAT_IS_ALWAYS_UP = <span style="color:#996600;">&quot;&quot;</span> <span style="color:#008000; font-style:italic;"># some well known site that is always up</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> Record <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">establish_connection</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:adapter</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;mysql&quot;</span>,
    <span style="color:#ff3333; font-weight:bold;">:encoding</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;utf8&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:database</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;powerdns_production&quot;</span>,
    <span style="color:#ff3333; font-weight:bold;">:username</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;your_mysql_username&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:password</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;your_secret_password_here&quot;</span>,
    <span style="color:#ff3333; font-weight:bold;">:host</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;ns1.your_isp.com&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  set_inheritance_column <span style="color:#ff3333; font-weight:bold;">:ruby_type</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#ff6633; font-weight:bold;">$running</span> = <span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> signal_trap_exit<span style="color:#006600; font-weight:bold;">&#40;</span>signal_name<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{Time.now} received #{signal_name} signal&quot;</span>
  <span style="color:#ff6633; font-weight:bold;">$running</span> = <span style="color:#0000FF; font-weight:bold;">false</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
our_exit_signals = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;TERM&quot;</span>, <span style="color:#996600;">&quot;INT&quot;</span>, <span style="color:#996600;">&quot;KILL&quot;</span>, <span style="color:#996600;">&quot;HUP&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#9966CC; font-weight:bold;">for</span> exit_signal_name <span style="color:#9966CC; font-weight:bold;">in</span> our_exit_signals
  <span style="color:#CC00FF; font-weight:bold;">Signal</span>.<span style="color:#CC0066; font-weight:bold;">trap</span><span style="color:#006600; font-weight:bold;">&#40;</span>exit_signal_name, <span style="color:#996600;">&quot;signal_trap_exit('#{exit_signal_name}')&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> check_internet
  <span style="color:#9966CC; font-weight:bold;">begin</span>
    Timeout::timeout<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">5</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      <span style="color:#6666ff; font-weight:bold;">Net::HTTP</span>.<span style="color:#9900CC;">get_response</span><span style="color:#006600; font-weight:bold;">&#40;</span>SITE_THAT_IS_ALWAYS_UP, <span style="color:#996600;">&quot;/&quot;</span>, <span style="color:#006666;">80</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>response<span style="color:#006600; font-weight:bold;">|</span>
        <span style="color:#0000FF; font-weight:bold;">return</span> response.<span style="color:#9900CC;">code</span>.<span style="color:#9900CC;">match</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">|</span><span style="color:#006666;">3</span>\d<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> e
    <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{Time.now} Error connecting to internet: #{e}&quot;</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> get_site_ip_addresses
  <span style="color:#9966CC; font-weight:bold;">begin</span>
    Record.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:all</span>, <span style="color:#ff3333; font-weight:bold;">:conditions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;type = ? and name in (?)&quot;</span>, <span style="color:#996600;">&quot;A&quot;</span>, SITE_ADDRESSES<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> e
    <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{Time.now} Error finding all records: #{e}&quot;</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> make_inactive<span style="color:#006600; font-weight:bold;">&#40;</span>ip_record<span style="color:#006600; font-weight:bold;">&#41;</span>
  Record.<span style="color:#9900CC;">update_all</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;prio=-1&quot;</span>, <span style="color:#996600;">&quot;name='#{ip_record.name}' and content='#{ip_record.content}'&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> make_active<span style="color:#006600; font-weight:bold;">&#40;</span>ip_record<span style="color:#006600; font-weight:bold;">&#41;</span>
  Record.<span style="color:#9900CC;">update_all</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;prio=1&quot;</span>, <span style="color:#996600;">&quot;name='#{ip_record.name}' and content='#{ip_record.content}'&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span>$running<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  get_site_ip_addresses.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>ip_address<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#9966CC; font-weight:bold;">begin</span>
      Timeout::timeout<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">5</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#6666ff; font-weight:bold;">Net::HTTP</span>.<span style="color:#9900CC;">get_response</span><span style="color:#006600; font-weight:bold;">&#40;</span>ip_address.<span style="color:#9900CC;">content</span>.<span style="color:#9900CC;">to_s</span>, <span style="color:#996600;">&quot;/&quot;</span>, <span style="color:#006666;">80</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>response<span style="color:#006600; font-weight:bold;">|</span>
          <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{Time.now} Response code for #{ip_address.content.to_s}: #{response.code}&quot;</span>
          make_active<span style="color:#006600; font-weight:bold;">&#40;</span>ip_address<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> ip_address.<span style="color:#9900CC;">prio</span> == <span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> e
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{Time.now} Error connecting to #{ip_address.content.to_s}: #{e}&quot;</span>
      <span style="color:#9966CC; font-weight:bold;">if</span> check_internet
        make_inactive<span style="color:#006600; font-weight:bold;">&#40;</span>ip_address<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> ip_address.<span style="color:#9900CC;">prio</span> == <span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#CC0066; font-weight:bold;">sleep</span> <span style="color:#006666;">15</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#ff6633; font-weight:bold;">$running</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.pmamediagroup.com/2009/06/setting-powerdns-to-ignore-records-for-downed-web-sites/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to do Benchmarking with Ruby</title>
		<link>http://www.pmamediagroup.com/2009/05/ruby-benchmark-howto/</link>
		<comments>http://www.pmamediagroup.com/2009/05/ruby-benchmark-howto/#comments</comments>
		<pubDate>Thu, 21 May 2009 16:09:01 +0000</pubDate>
		<dc:creator>Alan Carl Mitchell</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Benchmarking]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.pmamediagroup.com/?p=782</guid>
		<description><![CDATA[Benchmarking with Ruby is super easy. There is already a built in class&#8211;Benchmark&#8211;that will do all of the heavy lifting for you.
If you want to do basic benchmarking, Benchmark.bm is the easiest way to go. Take a look below. Here we are going to test three ways to do looping in Ruby and see which [...]]]></description>
			<content:encoded><![CDATA[<p>Benchmarking with Ruby is super easy. There is already a built in class&#8211;<a href="http://www.ruby-doc.org/stdlib/libdoc/benchmark/rdoc/classes/Benchmark.html"><em>Benchmark</em></a>&#8211;that will do all of the heavy lifting for you.</p>
<p>If you want to do basic benchmarking, <em>Benchmark</em>.bm is the easiest way to go. Take a look below. Here we are going to test three ways to do looping in Ruby and see which one we like best.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'benchmark'</span>
&nbsp;
n = <span style="color:#006666;">5000000</span>
&nbsp;
<span style="color:#CC00FF; font-weight:bold;">Benchmark</span>.<span style="color:#9900CC;">bm</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span>
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;for loop:&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>   <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#9966CC; font-weight:bold;">for</span> i <span style="color:#9966CC; font-weight:bold;">in</span> 1..<span style="color:#9900CC;">n</span>; a = <span style="color:#996600;">&quot;1&quot;</span>; <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;times:&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>      <span style="color:#006600; font-weight:bold;">&#123;</span> n.<span style="color:#9900CC;">times</span> <span style="color:#9966CC; font-weight:bold;">do</span>   ; a = <span style="color:#996600;">&quot;1&quot;</span>; <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;upto:&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>       <span style="color:#006600; font-weight:bold;">&#123;</span> 1.<span style="color:#9900CC;">upto</span><span style="color:#006600; font-weight:bold;">&#40;</span>n<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> ; a = <span style="color:#996600;">&quot;1&quot;</span>; <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>This will produce output something like this:</p>
<pre>
               user     system      total        real
for loop:  0.727000   0.000000   0.727000 (  0.727030)
times:     0.571000   0.000000   0.571000 (  0.571588)
upto:      0.523000   0.000000   0.523000 (  0.522947)
</pre>
<p>If we use <em>Benchmark</em>.bmbm, then it will do a &#8216;rehearsal&#8217; run first in order to better equalize the garbage collection environment of the code inside the block so that hopefully we get more realistic timings.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'benchmark'</span>
&nbsp;
n = <span style="color:#006666;">5000000</span>
&nbsp;
<span style="color:#CC00FF; font-weight:bold;">Benchmark</span>.<span style="color:#9900CC;">bmbm</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span>
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;for loop:&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>   <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#9966CC; font-weight:bold;">for</span> i <span style="color:#9966CC; font-weight:bold;">in</span> 1..<span style="color:#9900CC;">n</span>; a = <span style="color:#996600;">&quot;1&quot;</span>; <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;times:&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>      <span style="color:#006600; font-weight:bold;">&#123;</span> n.<span style="color:#9900CC;">times</span> <span style="color:#9966CC; font-weight:bold;">do</span>   ; a = <span style="color:#996600;">&quot;1&quot;</span>; <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
  x.<span style="color:#9900CC;">report</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;upto:&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>       <span style="color:#006600; font-weight:bold;">&#123;</span> 1.<span style="color:#9900CC;">upto</span><span style="color:#006600; font-weight:bold;">&#40;</span>n<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> ; a = <span style="color:#996600;">&quot;1&quot;</span>; <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>This will produce output something like this:</p>
<pre>
Rehearsal ---------------------------------------------
for loop:   0.756000   0.000000   0.756000 (  0.756298)
times:      0.477000   0.000000   0.477000 (  0.476855)
upto:       0.527000   0.000000   0.527000 (  0.526522)
------------------------------------ total: 1.760000sec

                user     system      total        real
for loop:   0.751000   0.000000   0.751000 (  0.751067)
times:      0.516000   0.000000   0.516000 (  0.515874)
upto:       0.581000   0.000000   0.581000 (  0.581254)
</pre>
<p>Alternately, you can use the <em>Benchmark</em>.realtime method like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;for loop: #{Benchmark.realtime {for i in 1..n ; a = &quot;</span><span style="color:#006666;">1</span><span style="color:#996600;">&quot; ; end}}&quot;</span></pre></div></div>

<p>and get something like this:</p>
<pre>
for loop: 0.682438850402832
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.pmamediagroup.com/2009/05/ruby-benchmark-howto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Fundamental Rule of Computing</title>
		<link>http://www.pmamediagroup.com/2009/04/the-fundamental-rule-of-computing/</link>
		<comments>http://www.pmamediagroup.com/2009/04/the-fundamental-rule-of-computing/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 20:04:14 +0000</pubDate>
		<dc:creator>jaredd</dc:creator>
				<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">http://www.pmamediagroup.com/?p=651</guid>
		<description><![CDATA[I have created my own fundamental rule of computing.  And I call it &#8220;The Fundamental Rule of Computing&#8221;
And it consists of three parts:

Backup everything.
Backup everything to an offsite location.
Backup everything to another offsite location.

]]></description>
			<content:encoded><![CDATA[<p>I have created my own fundamental rule of computing.  And I call it &#8220;The Fundamental Rule of Computing&#8221;<br />
And it consists of three parts:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Backup everything.
Backup everything to an offsite location.
Backup everything to another offsite location.</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.pmamediagroup.com/2009/04/the-fundamental-rule-of-computing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PowerDNS With Empty CNAME = Fail!</title>
		<link>http://www.pmamediagroup.com/2009/04/powerdns-with-empty-cname-fail/</link>
		<comments>http://www.pmamediagroup.com/2009/04/powerdns-with-empty-cname-fail/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 20:58:26 +0000</pubDate>
		<dc:creator>Aaron Murphy</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[CNAME]]></category>
		<category><![CDATA[Powerdns]]></category>

		<guid isPermaLink="false">http://www.pmamediagroup.com/?p=474</guid>
		<description><![CDATA[Just used up my morning trying to resolve an MX record problem. We were not getting our email through our new Google Apps account. I tried to send from Gmail to myself and it worked. I tried to send to someone else in our domain, and got a &#8220;550 550 Unrouteable address (state 14)&#8221; error.

I [...]]]></description>
			<content:encoded><![CDATA[<p>Just used up my morning trying to resolve an MX record problem. We were not getting our email through our new <a href="http://www.google.com/apps/intl/en/business/index.html">Google Apps</a> account. I tried to send from Gmail to myself and it worked. I tried to send to someone else in our domain, and got a &#8220;550 550 Unrouteable address (state 14)&#8221; error.</p>
<p><span id="more-474"></span></p>
<p>I tried to dig for our domain. It didn&#8217;t report our correct MX record. We use <a href="http://kennethkalmer.github.com/powerdns-on-rails/">PowerDNS on Rails</a>. This makes it easy to administer <a href="http://www.powerdns.com/">PowerDNS</a>. The settings for the Google MX records were right.</p>
<p>It turns out that earlier we had changed our domain to a new <a href="http://en.wikipedia.org/wiki/Cloud_Computing">cloud system</a>. We had to setup <a href="http://en.wikipedia.org/wiki/CNAME_record">CNAME</a> records in our DNS so that users would get routed properly. Luckily, we use <a href="http://www.dnsstuff.com/">DNS Stuff</a> to help us out. They report &#8220;RFC1912 2.4 and RFC2181 10.3 state that there should be no CNAMEs if an NS (or any other) record is present.&#8221;</p>
<p>So I removed the CNAME record and everything works now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pmamediagroup.com/2009/04/powerdns-with-empty-cname-fail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/


Served from: www.pmamediagroup.com @ 2010-07-31 10:41:20 -->