
<?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>Bryce McDonnell &#124;&#124; Freelance Web Application Developer &#187; Stuff I&#8217;m Working On</title>
	<atom:link href="http://www.brycemcdonnell.com/topics/stuff-im-working-on/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brycemcdonnell.com</link>
	<description>bryce mcdonnell is a freelance web application developer specializing in PHP, Ruby on Rails and MySQL</description>
	<lastBuildDate>Fri, 26 Feb 2010 18:18:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Custom Routes with Shoulda</title>
		<link>http://www.brycemcdonnell.com/2010/02/custom-routes-with-shoulda/</link>
		<comments>http://www.brycemcdonnell.com/2010/02/custom-routes-with-shoulda/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 20:07:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Stuff I'm Working On]]></category>
		<category><![CDATA[Rspec]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[shoulda]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.brycemcdonnell.com/?p=234</guid>
		<description><![CDATA[I&#8217;ve recently been using Shoulda as my testing framework of choice to speed up my Rspec test writing. One common pattern kept recurring which was totally vexing: I wasn&#8217;t able to test my custom routes. Just recently, I was writing a reviews controller that is mostly controlled by an admin user of the site. It&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been using <a title="thoughtbot's shoulda framwork" href="http://thoughtbot.com/community/" target="_blank">Shoulda</a> as my testing framework of choice to speed up my <a title="Rspec, a great ruby on rails testing framework" href="http://rspec.info/" target="_blank">Rspec</a> test writing. One common pattern kept recurring which was totally vexing: I wasn&#8217;t able to test my custom routes. Just recently, I was writing a reviews controller that is mostly controlled by an admin user of the site. It&#8217;s logical to route the index request of the reviews controller to /admin.</p>
<p>I kept trying to force the request with the following failing code:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#don't use this, it's bad</span>
<span style="color:#008000; font-style:italic;"># I want to reroute /reviews to /admin</span>
get <span style="color:#996600;">&quot;/admin&quot;</span></pre></div></div>

<p>That was clearly wrong, but nothing immediately jumped out at me as to how to fix it. After much googling around, I finally found the quick and easy solution:<br />
<a title="ruby code as a gist" href="http://gist.github.com/309123" target="_blank">ruby code on github here</a></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">describe <span style="color:#996600;">&quot;/admin&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    before<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:each</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span>
      get <span style="color:#ff3333; font-weight:bold;">:index</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
    it <span style="color:#006600; font-weight:bold;">&#123;</span> should route<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:get</span>, <span style="color:#996600;">&quot;/admin&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:controller</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#ff3333; font-weight:bold;">:reviews</span>, <span style="color:#ff3333; font-weight:bold;">:action</span> =<span style="color:#006600; font-weight:bold;">&amp;</span>gt; <span style="color:#ff3333; font-weight:bold;">:index</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
    it <span style="color:#006600; font-weight:bold;">&#123;</span> should respond_with<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:success</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Hope this saves someone else some time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brycemcdonnell.com/2010/02/custom-routes-with-shoulda/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I made it in to Inc Magazine</title>
		<link>http://www.brycemcdonnell.com/2009/12/i-made-it-in-to-inc-magazine-now-hosting-fat-free-crm/</link>
		<comments>http://www.brycemcdonnell.com/2009/12/i-made-it-in-to-inc-magazine-now-hosting-fat-free-crm/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 06:27:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Stuff I'm Working On]]></category>
		<category><![CDATA[business/entrepreneurship]]></category>
		<category><![CDATA[Fat Free CRM]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Inc Magazine]]></category>

		<guid isPermaLink="false">http://www.brycemcdonnell.com/?p=226</guid>
		<description><![CDATA[Inc Magazine is easily my favorite. I love reading about entrepreneurship and have faithfully read this magazine cover to cover for the last several years.
Well, this month I&#8217;m fortunate enough to have a small cameo in &#8220;The Goods&#8221; section on page 54 (see the crm review online). In it, I talk about the merits of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.inc.com" target="_blank">Inc Magazine</a> is easily my favorite. I love reading about entrepreneurship and have faithfully read this magazine cover to cover for the last several years.</p>
<p>Well, this month I&#8217;m fortunate enough to have a small cameo in &#8220;The Goods&#8221; section on page 54 (<a href="http://www.inc.com/magazine/20091201/how-one-ceo-uses-open-source-crm.html" target="_blank">see the crm review online</a>). In it, I talk about the merits of <a href="http://www.fatfreecrm.com">Fat Free CRM</a> over a few other customer relationship managers tools I&#8217;ve used in the past.</p>
<p>Thanks to Inc for the interview. Given this exposure, I&#8217;ve expedited a plan that was in the works to go live in the 1st quarter of 2010. BME now provides <a href="http://www.hostedffcrm.com" target="_blank">hosting services for Fat Free CRM</a>. To learn more, see the hosting fat free crm website or <a href="/contact" target="_self">contact me</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brycemcdonnell.com/2009/12/i-made-it-in-to-inc-magazine-now-hosting-fat-free-crm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress / Fat Free CRM Lead Form Published!</title>
		<link>http://www.brycemcdonnell.com/2009/07/fat-free-crm-lead-form/</link>
		<comments>http://www.brycemcdonnell.com/2009/07/fat-free-crm-lead-form/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 19:06:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Stuff I'm Working On]]></category>
		<category><![CDATA[business/entrepreneurship]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[web service consumption]]></category>
		<category><![CDATA[web service creation]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.brycemcdonnell.com/?p=214</guid>
		<description><![CDATA[I&#8217;ve had a bit of time to finally pursue some open source initiatives that I&#8217;ve had cooking in the back of my mind. I&#8217;m really excited to release this project I&#8217;ve been working on because it showcases work in both PHP and Ruby on Rails. I&#8217;ve created a plugin written in PHP that integrates into [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had a bit of time to finally pursue some open source initiatives that I&#8217;ve had cooking in the back of my mind. I&#8217;m really excited to release this project I&#8217;ve been working on because it showcases work in both PHP and Ruby on Rails. I&#8217;ve created a plugin written in PHP that integrates into any Wordpress site. I&#8217;ve also updated and modified a Ruby on Rails project called Fat Free CRM.</p>
<p>I really hope this adds a ton of value to new or established businesses looking for more efficiencies in their web-contact-to-deal-close processes.</p>
<p><span id="more-214"></span></p>
<p>The plugin installs just like any other Wordpress plugin. It should be pretty intuitive to anyone that has even limited experience administrating a Wordpress site. The plugin can be downloaded from Wordpress or at <a href="http://github.com/brycem/WordPress-Lead-Form-Plugin-For-Fat-Free-CRM/tree/master" target="_blank">my repo on github</a>.</p>
<p><a href="http://www.fatfreecrm.com/" target="_blank">Fat Free CRM</a> is a great customer relationship manager (CRM) I&#8217;ve been using for a little while now instead of <a href="http://www.highrisehq.com" target="_blank">Highrise</a>. I used Highrise for a little while before I grew frustrated by its hosting costs and lack of features. The guys at <a href="http://www.37signals.com" target="_blank">37signals</a> don&#8217;t seem to update it very often either.</p>
<p>For the rails project, I <a href="http://github.com/michaeldv/fat_free_crm/tree" target="_blank">forked the repository</a> and made a few minor changes like adding access via an API key. I also added a few usability options in the view codes to make integration with the plugin seamless.</p>
<p>For new businesses that are just implementing a CRM solution, I&#8217;d be happy to host the CRM application on my servers for a nominal cost. <a href="http://www.brycemcdonnell.com/contact/">Feel free to contact me</a> for more details. (hint, the contact form is an example of the plugin in action <img src='http://www.brycemcdonnell.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>To use the plugin and CRM together, just follow these simple instructions:</p>
<ol>
<li>Download or clone the CRM from my github repo. Install on my servers (contact me for pricing) or on your own</li>
<li>Download and install the fat-free-crm-lead plugin either from Wordpress or my github repo</li>
<li>Configure the plugin with the URL of your CRM and an API token (details are provided in the admin interface of the plugin)</li>
<li>Watch the leads come rolling in and enjoy not having to copy and paste from emails any longer</li>
</ol>
<p>Hopefully, this is really easy. If you run into any problems or have feature requests, please feel free to <a href="http://www.brycemcdonnell.com/contacts/">contact me</a>.</p>
<p>====UPDATE====</p>
<p>The plugin has been accepted into the WP plugin directory. Take a look at the <a href="http://wordpress.org/extend/plugins/fat-free-crm-lead-form/" target="_blank">fat-free-crm-lead-form at Wordpress</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brycemcdonnell.com/2009/07/fat-free-crm-lead-form/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Samba Server Integration</title>
		<link>http://www.brycemcdonnell.com/2009/07/samba-server-integration/</link>
		<comments>http://www.brycemcdonnell.com/2009/07/samba-server-integration/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 23:46:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Stuff I'm Working On]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[charity]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MS]]></category>
		<category><![CDATA[samba]]></category>

		<guid isPermaLink="false">http://blog.thedevranch.net/?p=142</guid>
		<description><![CDATA[I recently returned from a trip to Beirut, Lebanon where I had been doing some humanitarian and mission work. One of my responsibilities was to create a file sharing server for a humanitarian organization.
Given the budget of next to nothing and the relatively small size of the office, I decided it was best to proceed [...]]]></description>
			<content:encoded><![CDATA[<p>I recently returned from a trip to <a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Beirut,+Lebanon&amp;sll=45.517682,-122.90135&amp;sspn=0.009683,0.017445&amp;ie=UTF8&amp;ll=33.870416,35.507813&amp;spn=23.406692,35.727539&amp;t=h&amp;z=5&amp;iwloc=A" target="_blank">Beirut, Lebanon</a> where I had been doing some humanitarian and mission work. One of my responsibilities was to create a file sharing server for a humanitarian organization.</p>
<p>Given the budget of next to nothing and the relatively small size of the office, I decided it was best to proceed with a Linux based Samba server. Although their office is 100% Microsoft (a mix of XP and Vista machines), Linux would be a great light weight solution. The added benefit was we re-purposed an ancient workstation (circa 1996) to run the Samba server so no new hardware was purchased and we prevented another machine from polluting a land fill.</p>
<p><span id="more-142"></span></p>
<p>We created three shared drives for the business.</p>
<ol>
<li>A share <strong>everyone</strong> in the office could access</li>
<li>A share <strong>o</strong><strong>nly the executive</strong> could access</li>
<li>A share for the exclusive purpose of <strong>backing up</strong> everyone&#8217;s workstation</li>
</ol>
<p>I simply installed <a href="http://www.centos.org/" target="_blank">Centos 5.2</a> distribution on the old workstation, created three distinct user accounts and group permissions, enabled the samba service, and locked down access through <strong>iptables </strong>firewall.</p>
<p>Creating a secure, readable, smb.conf file was really important to me. Not only for readability but also because I won&#8217;t be supporting this server after installation. Any other administrator should be able to walk into the office and quickly &amp; clearly see how to make edits for upgrades or changes.</p>
<p>The smb.conf file:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">#smb.conf
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>global<span style="">&#93;</span></span>
	#set up what the end user would see on their desktop
	<span style="color: #000099;">workgroup</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> H4LSharedFiles</span>
	server string <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> common files for H4L</span>
&nbsp;
	#general user perms
	<span style="color: #000099;">security</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> user</span>
	passdb backend <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> tdbsam</span>
&nbsp;
	#printing support
	load printers <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> no</span>
        <span style="color: #000099;">printing</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> bsd</span>
        printcap name <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> /dev/null</span>
        show add printer wizard <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> no</span>
        disable spools <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> yes</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>AllSharedFiles<span style="">&#93;</span></span>
	<span style="color: #000099;">comment</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> Files for everyone to share</span>
	<span style="color: #000099;">path</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> /sambashares/allAccess</span>
	<span style="color: #000099;">writeable</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> yes</span>
	<span style="color: #000099;">browseable</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> yes</span>
	guest ok <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> yes</span>
	write list <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> +allemployees</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>Backup<span style="">&#93;</span></span>
	<span style="color: #000099;">comment</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> Files to back up everyone's computer</span>
	<span style="color: #000099;">path</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> /sambashares/backups</span>
	<span style="color: #000099;">writeable</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> yes</span>
	<span style="color: #000099;">browseable</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> yes</span>
	guest ok <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> yes</span>
	write list <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> +allemployees</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>AdminOnly<span style="">&#93;</span></span>
	<span style="color: #000099;">comment</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> Access for sensitive files</span>
	<span style="color: #000099;">path</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> /sambashares/admins</span>
	<span style="color: #000099;">writeable</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> yes</span>
	<span style="color: #000099;">browseable</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> yes</span>
	guest ok <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> no</span>
	write list <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> +administrators</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.brycemcdonnell.com/2009/07/samba-server-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php exception handling on iis 7</title>
		<link>http://www.brycemcdonnell.com/2009/06/php-exception-handling-on-iis-7/</link>
		<comments>http://www.brycemcdonnell.com/2009/06/php-exception-handling-on-iis-7/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 21:34:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Stuff I'm Working On]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.brycemcdonnell.com/?p=84</guid>
		<description><![CDATA[I was recently deploying a PHP site to a client hosting their content with IIS 7. In my code, I typically raise and handle exceptions. My philosophy is simply that exceptions are logical operators like &#8220;if&#8221;, &#8220;then&#8221; and &#8220;while&#8221;. At any rate, when I deployed this code to the production environment, IIS would raise an [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently deploying a PHP site to a client hosting their content with IIS 7. In my code, I typically raise and handle exceptions. My philosophy is simply that exceptions are logical operators like &#8220;if&#8221;, &#8220;then&#8221; and &#8220;while&#8221;. At any rate, when I deployed this code to the production environment, IIS would raise an HTTP 500 exception. This is not ideal.</p>
<p>After hours of desperate searching, I finally found the solution to <a href="http://blogs.iis.net/stjacobs/archive/2008/10/11/php-and-iis-a-deeper-dive.aspx" target="_blank">appropriate exception handling with php on IIS on the iis blog</a>. The solution was more of a footnote about halfway down the page in the php.ini section. The trick is to set fastcgi logging to false. Not the most ideal solution, but I was finally able to handle exceptions the way php code should.</p>
<p>From iis blog: &#8220;FastCGI logging should be disabled on IIS. If it is left enabled, then any messages of any class are treated by FastCGI as error conditions which will cause IIS to generate an HTTP 500 exception.&#8221;</p>
<p><strong> php.ini </strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">fastcgi<span style="color: #339933;">.</span>logging <span style="color: #339933;">=</span> 0 <span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.brycemcdonnell.com/2009/06/php-exception-handling-on-iis-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improved Content Slider In MooTools</title>
		<link>http://www.brycemcdonnell.com/2009/05/improved-content-slider-in-mootools/</link>
		<comments>http://www.brycemcdonnell.com/2009/05/improved-content-slider-in-mootools/#comments</comments>
		<pubDate>Wed, 27 May 2009 20:00:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Stuff I'm Working On]]></category>
		<category><![CDATA[content slider]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://blog.brycemcdonnell.com/?p=83</guid>
		<description><![CDATA[<a href=http://www.brycemcdonnell.com/2009/05/improved-content-slider-in-mootools/><img src=http://blog.thedevranch.net/wp-content/uploads/2009/05/BME-logo-small.jpg class=imgtfe hspace=5 align=left width=100  border=0></a>A little while ago, I posted some javascript for a mootools content slider. I&#8217;ve used it a lot in my own Ruby on Rails and PHP development work and my work with jv2 I have been itching to just drop it into my code like Squeezebox or Swfobject.
So, here it is, a fairly beta version [...]]]></description>
			<content:encoded><![CDATA[<p>A little while ago, I posted some javascript for a <a title="content slider in mootools" href="/mootools-content-slider-javascript/" target="_self">mootools content slider</a>. I&#8217;ve used it a lot in my own <a title="PHP and Ruby on Rails Developer" href="http://www.brycemcdonnell.com" target="_blank">Ruby on Rails and PHP development work</a> and my work with <a title="jv2 interactive and creative" href="http://www.jv2.com" target="_blank">jv2</a> I have been itching to just drop it into my code like <a title="mootools squeezebox" href="http://digitarald.de/project/squeezebox/" target="_blank">Squeezebox</a> or <a title="swfobject" href="http://blog.deconcept.com/swfobject/" target="_blank">Swfobject</a>.</p>
<p>So, here it is, a fairly beta version of a horizontal content slider written with the <a title="mootools" href="http://www.mootools.net/">Mootools</a> 1.2 framework. Simply <a title="download content slider class" onclick="pageTracker._trackEvent('downloads' , 'contentSlider')" href="/downloads/ContentSlider.js">download</a> (or copy and paste) the ContentSlider class into your page and then instantiate with the required arguments.</p>
<p><span id="more-83"></span></p>
<h2><strong>Usage Example:</strong></h2>
<p>the ContentSlider class</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/**
 * Content Slider - A Useable Horizontal Scroller
 *
 *  Requires a parent element with hidden overflow and child elements floated inside the parent.
 *  Take any two elements as previous and next buttons and scolls the child elements through the parent element
 *
 * Dependencies: MooTools 1.2 (and probably 1.1.x but not tested)
 *
 * adapted from Antonio Lupetti's original blog post at
 *    http://woork.blogspot.com/2009/01/elegant-animated-weekly-timeline-for.html
 *
 * @version		0.9
 *
 * @license		MIT-style license
 * @author		Bryce McDonnell bryce {at} bridgetownint {dot} com   www.brycemcdonnell.com
 * @copyright	Bryce McDonnell
 */</span>
<span style="color: #003366; font-weight: bold;">var</span> ContentSlider <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Class</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
		totIncrement<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
		increment<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
		maxRightIncrement<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
		container<span style="color: #339933;">:</span> $empty<span style="color: #339933;">,</span>
		slidingEl<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span>
		slideAtATime<span style="color: #339933;">:</span> 1<span style="color: #339933;">,</span>
		previous_btn<span style="color: #339933;">:</span> $empty<span style="color: #339933;">,</span>
		next_btn<span style="color: #339933;">:</span> $empty<span style="color: #339933;">,</span>
		duration<span style="color: #339933;">:</span> 1000<span style="color: #339933;">,</span>
		transition<span style="color: #339933;">:</span> Fx.<span style="color: #660066;">Transitions</span>.<span style="color: #000066;">Back</span>.<span style="color: #660066;">easeInOut</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
	initialize<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span> <span style="color: #339933;">=</span> $merge<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span><span style="color: #339933;">,</span> config<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">maxRightIncrement</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">increment</span> <span style="color: #339933;">*</span> <span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> $$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">slidingEl</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">/</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">slideAtATime</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> 1 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">previous_btn</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">next_btn</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">activateMoveBtns</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
	move<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">fx</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Fx.<span style="color: #660066;">Tween</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">container</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
		property<span style="color: #339933;">:</span> <span style="color: #3366CC;">'margin-left'</span><span style="color: #339933;">,</span>
		duration<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">duration</span><span style="color: #339933;">,</span>
		transition<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">transition</span><span style="color: #339933;">,</span>
&nbsp;
		onStart<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">previous_btn</span>.<span style="color: #660066;">removeEvents</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">next_btn</span>.<span style="color: #660066;">removeEvents</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
&nbsp;
		onComplete<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">activateMoveBtns</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
	activateMoveBtns<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">//Next Button</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">next_btn</span>.<span style="color: #660066;">addEvents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #3366CC;">'click'</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">totIncrement</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">totIncrement</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span>this.<span style="color: #660066;">config</span>.<span style="color: #660066;">maxRightIncrement</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">totIncrement</span> <span style="color: #339933;">-</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">increment</span> <span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
				event.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">move</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">fx</span>.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">totIncrement</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	 		<span style="color: #009900;">&#125;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>
&nbsp;
		 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #006600; font-style: italic;">//Previous Button</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">previous_btn</span>.<span style="color: #660066;">addEvents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #3366CC;">'click'</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">move</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				event.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">totIncrement</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">totIncrement</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> 0<span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">totIncrement</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">increment</span> <span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">maxRightIncrement</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">fx</span>.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">config</span>.<span style="color: #660066;">totIncrement</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
ContentSlider.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> Fx.<span style="color: #660066;">Tween</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>html markup</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;/lib/js/homeslider.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:0--&gt;&lt;/script&gt;
&lt;div id=&quot;worksamples&quot; class=&quot;slide-box&quot;&gt;
	&lt;a id=&quot;slide-left&quot; class=&quot;slider-arrows&quot;&gt; previous &lt;/a&gt;
	&lt;a id=&quot;slide-right&quot; class=&quot;slider-arrows&quot;&gt;next&lt;/a&gt;
&lt;div id=&quot;workimgs&quot;&gt;
&lt;ul id=&quot;slider-list&quot;&gt;
	&lt;li&gt;&lt;img class=&quot;aligncenter size-full wp-image-168&quot; title=&quot;BME logo small&quot; src=&quot;http://blog.thedevranch.net/wp-content/uploads/2009/05/BME-logo-small.jpg&quot; alt=&quot;BME logo small&quot; width=&quot;300&quot; height=&quot;405&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src=&quot;/lib/img/slide/img.jpg&quot; alt=&quot;meth&quot; width=&quot;292&quot; height=&quot;184&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src=&quot;/lib/img/slide/img.jpg&quot; alt=&quot;nuskin&quot; width=&quot;292&quot; height=&quot;184&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src=&quot;/lib/img/slide/img.jpg&quot; alt=&quot;choice&quot; width=&quot;292&quot; height=&quot;184&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src=&quot;/lib/img/slide/img.jpg&quot; alt=&quot;meth&quot; width=&quot;292&quot; height=&quot;184&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src=&quot;/lib/img/slide/img.jpg&quot; alt=&quot;nuskin&quot; width=&quot;292&quot; height=&quot;184&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src=&quot;/lib/img/slide/img.jpg&quot; alt=&quot;choice&quot; width=&quot;292&quot; height=&quot;184&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<p>the javascript</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">new</span> ContentSlider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		increment<span style="color: #339933;">:</span> <span style="color: #CC0000;">904</span><span style="color: #339933;">,</span>
		container<span style="color: #339933;">:</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slider-list&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		slidingEl<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;#slider-list li&quot;</span><span style="color: #339933;">,</span>
		slideAtATime<span style="color: #339933;">:</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">,</span>
		next_btn<span style="color: #339933;">:</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slide-right&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		previous_btn<span style="color: #339933;">:</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slide-left&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>the css markup:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">  <span style="color: #808080; font-style: italic;">/***  SLIDER   ***/</span>
<span style="color: #cc00cc;">#worksamples</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">960px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#workimgs</span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">900px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span>0 <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#slider-list</span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">20000px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#slider-list</span> li<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">292px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.slider-arrows</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">42px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span><span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">74px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#slide-</span><span style="color: #000000; font-weight: bold;">left</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">../img/left-arrow.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> !important<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">../img/left-arrow.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#slide-</span><span style="color: #000000; font-weight: bold;">right</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">../img/right-arrow.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> !important<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">../img/right-arrow.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
&nbsp;
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h2>Explanation:</h2>
<p>This serves as a pretty rudimentary example. The markup is simply a list with containing images that need scrolling. For the next and previous buttons, I got creative and got rid of the text and set an image for the background. That provides a good looking UI to the user.</p>
<p>Usage requires two basic elements: a container and child elements to scroll through. The parent should hide all overflow and the child elements should float so as to be one long horizontal array of scrolling elements. Simply include the class on any page and then instantiate the class passing in the required arguments.</p>
<h2>Arguments:</h2>
<p><strong>increment</strong> : the number of pixels the container should scoll. You could call $(&#8221;inner-el&#8221;).width here if you want to just scroll one element. I&#8217;m working on eliminating this requirement and instead just calculating it using the other arguments passed in.</p>
<p><strong>container</strong>: A reference to the parent element with hidden overflow</p>
<p><strong>slidingEl</strong>: collection of elements to scroll horizontally. Can be a css selector object</p>
<p><strong>slideAtATime</strong>: an integer passed in to indicate how many child elements to scroll at when either the previous or next buttons are pushed. defaults to 1</p>
<p><strong>next_btn</strong>: a reference to the element to scroll to the right. A click event is added to this element when the class is instantiated</p>
<p><strong>previous_btn</strong>: a reference to the element to scroll to the right. A click event is added to this element when the class is instantiated</p>
<h2>Closing:</h2>
<p>Happy MooTool&#8217;ing ! Be sure to post a comment if you see something wrong or would like to add to this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brycemcdonnell.com/2009/05/improved-content-slider-in-mootools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mootools content slider &#8211; javascript</title>
		<link>http://www.brycemcdonnell.com/2009/03/mootools-content-slider-javascript/</link>
		<comments>http://www.brycemcdonnell.com/2009/03/mootools-content-slider-javascript/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 00:32:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Stuff I'm Working On]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[content slider]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://blog.brycemcdonnell.com/?p=77</guid>
		<description><![CDATA[
This is an old version of an improved Mootools Content Slider

I recently implemented a javascript based slider using MooTools. I&#8217;m increasingly becoming a huge fan of Mootools. Their documentation is great and the code I write just seems to be much cleaner. I don&#8217;t feel like it&#8217;s as fragile as js I&#8217;ve written in prototype/scriptaculous.
The [...]]]></description>
			<content:encoded><![CDATA[<div style="padding:20px; margin:10px; border:3px solid #FF0; background-color: #CCC">
<h2><span style="color: #000000;">This is an old version of an improved <a title="improved mootools content slider" href="http://blog.brycemcdonnell.com/improved-content-slider-in-mootools/">Mootools Content Slider</a></span></h2>
</div>
<p>I recently implemented a javascript based slider using <a href="http://mootools.net">MooTools</a>. I&#8217;m increasingly becoming a huge fan of <a href="http://mootools.net">Mootools</a>. Their <a href="http://mootools.net/docs">documentation</a> is great and the code I write just seems to be much cleaner. I don&#8217;t feel like it&#8217;s as fragile as js I&#8217;ve written in prototype/scriptaculous.</p>
<p>The content slider, which I pretty much implemented verbatim using <a href="http://woork.blogspot.com/2009/01/elegant-animated-weekly-timeline-for.html"><strong>Antonio Lupetti&#8217;s</strong></a> great tutorial at <a href="http://woork.blogspot.com/2009/01/elegant-animated-weekly-timeline-for.html">http://woork.blogspot.com/2009/01/elegant-animated-weekly-timeline-for.html</a>.</p>
<p>Antonio&#8217;s tutorial is really great. It is missing two elements which I think improve the code base:<span id="more-77"></span></p>
<p>1) you have to set the number of elements to scroll explicitly</p>
<p>2) it does not handle some crazy user clicking like mad on either the left or right buttons</p>
<p>To solve both those pains, I&#8217;ve updated the code a bit to work with MooTools 1.2 and made a couple of enhancements seen below.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> totIncrement <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> increment <span style="color: #339933;">=</span> <span style="color: #CC0000;">387</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> totalIncrements <span style="color: #339933;">=</span> $$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#sliderList li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">-</span> 1
<span style="color: #003366; font-weight: bold;">var</span> maxRightIncrement <span style="color: #339933;">=</span> increment<span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span> totalIncrements<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> fx <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Fx.<span style="color: #660066;">Tween</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sliderList'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
   property<span style="color: #339933;">:</span> <span style="color: #3366CC;">'margin-left'</span><span style="color: #339933;">,</span>
   duration<span style="color: #339933;">:</span> 1000<span style="color: #339933;">,</span>
   transition<span style="color: #339933;">:</span> Fx.<span style="color: #660066;">Transitions</span>.<span style="color: #000066;">Back</span>.<span style="color: #660066;">easeInOut</span><span style="color: #339933;">,</span>
   onStart<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slide-left&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeEvents</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slide-right&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeEvents</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
   onComplete<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      appEvent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> appEvent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #006600; font-style: italic;">// Previous Button</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slide-left'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #3366CC;">'click'</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>totIncrement<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>0<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            event.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            totIncrement <span style="color: #339933;">=</span> totIncrement <span style="color: #339933;">+</span> increment<span style="color: #339933;">;</span>
            fx.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span>totIncrement<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #006600; font-style: italic;">// Next Button</span>
   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slide-right'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #3366CC;">'click'</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>totIncrement<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span>maxRightIncrement<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            event.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            totIncrement <span style="color: #339933;">=</span> totIncrement <span style="color: #339933;">-</span> increment<span style="color: #339933;">;</span>
            fx.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span>totIncrement<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
appEvent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>By encapsulating the right and left click events into its own function, I can easily turn on and off the events to prevent the end user from invoking the slide event in the middle of an event that may already be going on. A shorter way to say that is users can&#8217;t double click.</p>
<p>Secondly, creating the totalIncrements variable allows someone (like me) to add another list element into the markup at a later date without having to remember to update the javascript code.</p>
<p>These are just a couple of tweaks to an otherwise great tutorial. Thanks a lot Antonio and keep up the good work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brycemcdonnell.com/2009/03/mootools-content-slider-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing Up Data To Git Securely: Part-1 &#8211; Create the Database User</title>
		<link>http://www.brycemcdonnell.com/2008/12/backing-up-data-to-git-securely-part-1-create-the-database-user/</link>
		<comments>http://www.brycemcdonnell.com/2008/12/backing-up-data-to-git-securely-part-1-create-the-database-user/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 23:54:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Stuff I'm Working On]]></category>
		<category><![CDATA[backing up to git]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://blog.brycemcdonnell.com/?p=70</guid>
		<description><![CDATA[In my backup script I previously posted, we begin by dumping the entire contents of the database to a file. This is not necessarily a good idea and there may be better ways to backup your data. However, the total size of my database is only a few MBs so it isn&#8217;t worth the hassle [...]]]></description>
			<content:encoded><![CDATA[<p>In my backup script I previously posted, we begin by dumping the entire contents of the database to a file. This is not necessarily a good idea and there may be better ways to backup your data. However, the total size of my database is only a few MBs so it isn&#8217;t worth the hassle of creating a master-slave setup.</p>
<p>The goal is to dump the database to the filesystem, add it to the tar file, encrypt it and then delete the clear text version of the file.</p>
<p>Security considerations abound. In a nutshell however, it is important not to publish any unencrypted database dump anywhere. Dump files can be searched on easily by Google and if you house even a morsel of private user data, you&#8217;ll be in trouble very quickly if it&#8217;s not encrypted.</p>
<p>Getting started, the MySQL command to dump a database is:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"> mysqldump <span style="color: #66cc66;">-</span>u user <span style="color: #66cc66;">-</span>psupersecret <span style="color: #808080; font-style: italic;">--all-databases &amp;gt; /some/dir/backupsql.sql</span></pre></div></div>

<p>-p will prompt for a password</p>
<p>-all-databases will dump every database you have running on the mysql instance. If you want a specific database, replace &#8211;all-databases with your_db_name</p>
<p>This command pushes the output of the mysqldump command to a file on the filesystem.</p>
<p>Since I don&#8217;t want my cron job to be prompted for a user&#8217;s password when dumping the db, I have created a special backup user with only enough permissions to read the tables, and write their contents to a file. You can create such a user by running the following command inside a mysql prompt:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><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: #66cc66;">*.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'backup'</span>@<span style="color: #ff0000;">'localhost'</span>
<span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'supersecret'</span></pre></div></div>

<p>Make sure to flush privileges after creating users. There&#8217;s not much more frusterating than trying to figure out why that script didn&#8217;t work.</p>
<p>One security consideration is that if you were to run the ps command while the dump script is running, it will expose the username and password of the backup user potentially allowing other users of the system to make select statements to databases they otherwise shouldn&#8217;t be on.</p>
<p>By limiting the backup user access only from the localhost, this eliminates the possibility of someone else dumping your database from some other host; the user must be logged into the box the database resides on.</p>
<p>At the conclusion of this script, we will have all the database data and structure backed up to a file on the filesystem. In the next post, I&#8217;ll explain how to add this data to a tar archive and then encrypt the whole mess.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brycemcdonnell.com/2008/12/backing-up-data-to-git-securely-part-1-create-the-database-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: Securely Backup Your Data Offsite Using Git, OpenSSL and Basic Linux Commands</title>
		<link>http://www.brycemcdonnell.com/2008/12/howto-securely-backup-your-data-offsite-using-git-openssl-and-basic-linux-commands/</link>
		<comments>http://www.brycemcdonnell.com/2008/12/howto-securely-backup-your-data-offsite-using-git-openssl-and-basic-linux-commands/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 07:15:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Stuff I'm Working On]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://blog.brycemcdonnell.com/?p=69</guid>
		<description><![CDATA[I am becoming a better systems administrator every day secondary to my work  as a ruby on rails and PHP developer. As a very small development shop I have very limited resources to perform the backup and recovery policies bigger shops and huge enterprises employ.
However, after just a morning of futzing with a few [...]]]></description>
			<content:encoded><![CDATA[<p>I am becoming a better systems administrator every day secondary to<a href="http://www.brycemcdonnell.com"> my work </a> as a <a href="http://www.rubyonrails.org">ruby on rails</a> and <a href="http://www.php.net">PHP</a> developer. As a very small development shop I have very limited resources to perform the backup and recovery policies bigger shops and huge enterprises employ.</p>
<p>However, after just a morning of futzing with a few key linux commands and better utilizing a service I already back up my source code to (<a href="http://www.github.com">www.github.com</a>) I have a found a robust and secure way to handle automated, off-site, redundant backups in a way that will let me compete with some bigger shops. I&#8217;ve posted the code below so I hope you will find it useful. Over the next few posts, I&#8217;ll unpack what I&#8217;ve written and the philosophy behind it.</p>
<p>A few things bothered me in the way I was doing traditional backups:</p>
<ol>
<li>I knew I had to get them off-site, but actually finding time to get off-site (to a secure location) wasn&#8217;t happening.</li>
<li>The backup had to be absolutely secure. My clients&#8217; source code is too precious and leakage too damaging to make even one mistake with security breach</li>
<li>Had to be simple and automated. I usually have 10 other things I need to do at the same time. I didn&#8217;t want backups to be number 11.</li>
<li>Small file size. Again, being a small dev shop, I didn&#8217;t want to put a lot of cost into storage of incremental backups</li>
<li>Incremental backups were key since I don&#8217;t want to go to all this trouble only to restore a copy of the bad data I was trying to replace. If I a problem isn&#8217;t made known until after the next set of backups are made, I&#8217;d be overwriting bad data with bad data; better to restore to the point before the problem happened.</li>
</ol>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">#!/usr/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#backupdb</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;======================================&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;backing up database&quot;</span>
mysqldump <span style="color: #660033;">-u</span> backup <span style="color: #660033;">--all-databases</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>alldatabases.sql
&nbsp;
<span style="color: #666666; font-style: italic;">#tar and compress the directories really hacky and should either make a file for exclusions or just get rid of the crap</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-czvvf</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>bkp<span style="color: #000000; font-weight: bold;">/</span>websqlbkp.tar.gz <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>alldatabases.sql <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/*</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#encrypt that mug and then remove the decrypted file</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;encrypting backup&quot;</span>
openssl des3 <span style="color: #660033;">-salt</span> <span style="color: #660033;">-k</span> supersecret \
        <span style="color: #660033;">-in</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>bkp<span style="color: #000000; font-weight: bold;">/</span>websqlbkp.tar.gz \
        <span style="color: #660033;">-out</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>bkp<span style="color: #000000; font-weight: bold;">/</span>websqlbkpencrypted.tar.gz
&nbsp;
<span style="color: #666666; font-style: italic;">#cleanup files I don't want people to see</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;cleaning up files&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>bkp<span style="color: #000000; font-weight: bold;">/</span>websqlbkp.tar.gz
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>alldatabasesl.sql
&nbsp;
<span style="color: #666666; font-style: italic;">#update the git repo</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;committing to git <span style="color: #780078;">`date`</span> &quot;</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>bkp<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;adding to git&quot;</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>git add .
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;commiting git&quot;</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>git commit <span style="color: #660033;">-a</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;commiting backup on <span style="color: #780078;">`date`</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;pushing to github&quot;</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>git push origin production</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.brycemcdonnell.com/2008/12/howto-securely-backup-your-data-offsite-using-git-openssl-and-basic-linux-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
