<?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>Takaitra.com &#187; Takaitra</title>
	<atom:link href="http://www.takaitra.com/posts/author/admin/feed" rel="self" type="application/rss+xml" />
	<link>http://www.takaitra.com</link>
	<description>life, ruminations, how-to's</description>
	<lastBuildDate>Mon, 18 Jul 2011 22:09:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Backup to AWS EBS via Rsync and Boto</title>
		<link>http://www.takaitra.com/posts/384</link>
		<comments>http://www.takaitra.com/posts/384#comments</comments>
		<pubDate>Mon, 18 Jul 2011 16:09:32 +0000</pubDate>
		<dc:creator>Takaitra</dc:creator>
				<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Linux Administration]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[boto]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[EBS]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.takaitra.com/?p=384</guid>
		<description><![CDATA[Amazon Web Services Elastic Block Storage provides cheap, reliable storage—perfect for backups. The idea is to temporarily spin up an EC2 instance, attach your EBS volume to it and upload your files. Transferring the data via rsync allows for incremental backups which is very fast and reduces costs. Once the backup is complete, the EC2 [...]]]></description>
			<content:encoded><![CDATA[<p>Amazon Web Services <a href="http://aws.amazon.com/ebs/">Elastic Block Storage</a> provides cheap, reliable storage—perfect for backups. The idea is to temporarily spin up an <a href="http://aws.amazon.com/ec2/">EC2</a> instance, attach your EBS volume to it and upload your files. Transferring the data via rsync allows for incremental backups which is very fast and reduces costs. Once the backup is complete, the EC2 instance is shutdown. The whole process can be repeated as often as needed by attaching a new EC2 instance to the same EBS volume. I backup 8 GB from my own server weekly using this method. The backup takes about 3 minutes and my monthly bill from Amazon is less than $1.</p>
<h3>Setup</h3>
<ol>
<li>If you don&#8217;t already have one, <a href="https://aws-portal.amazon.com/gp/aws/developer/registration/index.html">create an account with AWS</a>.</li>
<li>Take note of your <a href="https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&amp;action=access-key">access key</a>. You will need to place it in the script in order to connect to the AWS EC2 API.</li>
<li>Create an <a href="http://docs.amazonwebservices.com/AWSSecurityCredentials/1.0/AboutAWSCredentials.html#">Amazon EC2 key pair</a>. You need this to launch and connect to your EC2 instance. Download the private key and store in on your system. In my example, I have the private key stored at /home/takaitra/.ec2/takaitra-aws-key.pem</li>
<li>Create an EBS volume in your preferred zone (location). Make sure it is large enough to store your backups.</li>
<li>Create a security group called &#8220;rsync&#8221; that allows connections on two inbound TCP ports: 22 (for SSH) and 873 (for rsync).</li>
<li>Ensure a recent version of Python and <a href="http://code.google.com/p/boto/">Boto</a> are installed on your system. In Debian, this is accomplished by running the command &#8216;apt-get install python-boto&#8217;</li>
</ol>
<h3>The Script</h3>
<p>The below script automates the entire backup process via boto (A Python interface to AWS). Make sure to configure the VOLUME_ID, ZONE and BACKUP_DIRS variables with your own values. Also update SSH_OPTS to point to the private key of your EC2 key pair. &lt;aws access key&gt; and &lt;aws secret key&gt; need to be filled in on line 19.</p>
<pre class="brush: python; title: ; notranslate">#!/usr/bin/env python

import os
from boto.ec2.connection import EC2Connection
import time

IMAGE           = 'ami-8e1fece7' # Basic 64-bit Amazon Linux AMI
KEY_NAME        = 'takaitra-key'
INSTANCE_TYPE   = 't1.micro'
VOLUME_ID       = 'vol-########'
ZONE            = 'us-east-1a' # Availability zone must match the volume's
SECURITY_GROUPS = ['rsync'] # Security group allows SSH
SSH_OPTS        = '-o StrictHostKeyChecking=no -i /home/takaitra/.ec2/takaitra-aws-key.pem'
BACKUP_DIRS     = ['/etc', '/opt/', '/root', '/home', '/usr/local', '/var/www']
DEVICE          = '/dev/sdh'

# Create the EC2 instance
print 'Starting an EC2 instance of type {0} with image {1}'.format(INSTANCE_TYPE, IMAGE)
conn = EC2Connection('&lt;aws access key&gt;', '&lt;aws secret key&gt;')
reservation = conn.run_instances(IMAGE, instance_type=INSTANCE_TYPE, key_name=KEY_NAME, placement=ZONE, security_groups=SECURITY_GROUPS)
instance = reservation.instances[0]
time.sleep(10) # Sleep so Amazon recognizes the new instance
while not instance.update() == 'running':
    time.sleep(3) # Let the instance start up
time.sleep(10) # Still feeling sleepy
print 'Started the instance: {0}'.format(instance.dns_name)

# Attach and mount the backup volume
print 'Attaching volume {0} to device {1}'.format(VOLUME_ID, DEVICE)
volume = conn.get_all_volumes(volume_ids=[VOLUME_ID])[0]
volumestatus = volume.attach(instance.id, DEVICE)
while not volume.status == 'in-use':
    time.sleep(3) # Wait for the volume to attach
    volume.update()
time.sleep(10) # Still feeling sleepy
print 'Volume is attached'
os.system(&quot;ssh -t {0} ec2-user@{1} \&quot;sudo mkdir /mnt/data-store &amp;&amp; sudo mount {2} /mnt/data-store\&quot;&quot;.format(SSH_OPTS, instance.dns_name, DEVICE))

# Rsync
print 'Beginning rsync'
for backup_dir in BACKUP_DIRS:
    os.system(&quot;sudo rsync -e \&quot;ssh {0}\&quot; -avz --delete {2} ec2-user@{1}:/mnt/data-store{2}&quot;.format(SSH_OPTS, instance.dns_name, backup_dir))
print 'Rsync complete'

# Unmount and detach the volume, terminate the instance
print 'Unmounting and detaching volume'
os.system(&quot;ssh -t {0} ec2-user@{1} \&quot;sudo umount /mnt/data-store\&quot;&quot;.format(SSH_OPTS, instance.dns_name))
volume.detach()
while not volume.status == 'available':
    time.sleep(3) # Wait for the volume to detatch
    volume.update()
print 'Volume is detatched'
print 'Stopping instance'
instance.stop()</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.takaitra.com/posts/384/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VelocityEmail &#8211; Easy E-mail for Java using Templates</title>
		<link>http://www.takaitra.com/posts/345</link>
		<comments>http://www.takaitra.com/posts/345#comments</comments>
		<pubDate>Thu, 03 Mar 2011 15:49:54 +0000</pubDate>
		<dc:creator>Takaitra</dc:creator>
				<category><![CDATA[How-To's]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[Velocity]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[web forms]]></category>

		<guid isPermaLink="false">http://www.takaitra.com/?p=345</guid>
		<description><![CDATA[A common requirement for a Java web application is that it be able to send e-mail in response to certain events. A couple simple examples of this requirement are a web form that sends a confirmation e-mail to the user and sending automated messages when exceptions occur. These e-mails must often incorporate dynamic content. In [...]]]></description>
			<content:encoded><![CDATA[<p>A common requirement for a Java web application is that it be able to send e-mail in response to certain events. A couple simple examples of this requirement are a web form that sends a confirmation e-mail to the user and sending automated messages when exceptions occur. These e-mails must often incorporate dynamic content. In the web form example, content from the form submission could be included in the confirmation e-mail.</p>
<p>VelocityEmail extends the Email class from <a href="http://commons.apache.org/email/">Commons Email</a> to provide an elegant solution to this problem. The simplicity of Commons Email makes constructing and sending the e-mail a breeze while <a href="http://velocity.apache.org/">Velocity</a> templates allow the content to be completely flexible and dynamic. The most important benefit of this approach is that it allows separation of the e-mail content from the project code, greatly increasing maintainability.</p>
<h3>Download</h3>
<p>The latest release is VelocityEmail 1.0</p>
<p><a href="http://www.takaitra.com/files/velocity-email-1.0.jar" onClick="javascript: _gaq.push(['_trackPageview', '/downloads/velocity-email-1.0']);">Binary</a><br />
<a href="http://www.takaitra.com/files/velocity-email-1.0-sources.jar" onClick="javascript: _gaq.push(['_trackPageview', '/downloads/velocity-email-1.0-sources']);">Source</a><br />
<a href="http://www.takaitra.com/files/velocity-email-api/" onClick="javascript: _gaq.push(['_trackPageview', '/downloads/velocity-email-api']);">Javadoc</a></p>
<h3>How to Use VelocityEmail</h3>
<ol>
<li>Create HTML and/or plaintext Velocity templates for your email. By<br />
default, you can reference any fields of your soon-to-be merged javabean<br />
like $bean.fieldName. Place the templates in your project&#8217;s source folder or<br />
wherever they&#8217;ll be available on the classpath.</li>
<li>Create an instance of VelocityEmail, passing the the template filename to<br />
the constructor and initialize it as you would normally initialize an<br />
HtmlEmail.&nbsp;</p>
<pre> VelocityEmail email = new VelocityEmail(templateName);
 email.setHostName(smtphost);
 email.setFrom(fromAddress);
 email.setTo(toAddress);</pre>
</li>
<li>Merge the javabean with the template by using the appropriate<br />
setHtmlMsg() and setTextMsg() methods.&nbsp;</p>
<pre> email.setHtmlMsg(javabean)</pre>
<p>OR, if you have multiple javabeans, you may create your own VelocityContext and pass that in instead.</p>
<pre> VecocityContext context = new VelocityContext();
 context.put("bean1", javabean1);
 context.put("bean2", javabean2);
 email.setHtmlMsg(context);</pre>
</li>
<li>Send the email.
<pre> email.send();</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.takaitra.com/posts/345/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List Authors Version 2.0 Released</title>
		<link>http://www.takaitra.com/posts/316</link>
		<comments>http://www.takaitra.com/posts/316#comments</comments>
		<pubDate>Mon, 06 Sep 2010 00:01:09 +0000</pubDate>
		<dc:creator>Takaitra</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[List Authors]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_list_authors]]></category>

		<guid isPermaLink="false">http://www.takaitra.com/?p=316</guid>
		<description><![CDATA[Today I released version 2.0 of the List Authors WordPress widget. The underlying code has in fact existed for quite some time in the form of a patch submitted to WordPress to enhance the abilities of the wp_list_authors template tag. My hope was that the patch would make it into version 3.0 of WP after [...]]]></description>
			<content:encoded><![CDATA[<p>Today I released version 2.0 of the <a href="http://www.takaitra.com/projects/list-authors">List Authors WordPress widget</a>. The underlying code has in fact existed for quite some time in the form of a <a href="http://core.trac.wordpress.org/ticket/10329">patch submitted to WordPress</a> to enhance the abilities of the wp_list_authors template tag. My hope was that the patch would make it into version 3.0 of WP after which I could update my widget to use it. That never happened so I have instead added a custom version of the wp_list_authors function to List Authors plugin.</p>
<p>After several months of tweaking and re-tweaking my patch in response to comments from various WP devs, I was confident that the patch was production-ready. The feature request has been open for over a year with a working patch for six months&#8211;at this point, I doubt it will ever be released. Maybe there are legitimate performance concerns with the patch (there aren&#8217;t any problems I&#8217;m aware of), or maybe the features are just too low in priority. The patch was my attempt at contributing back to an open-source project. After this experience, I have to say I&#8217;m a bit disappointed in the whole process. Maybe I&#8217;ll try my hand at it again, but it will be with a project other than WordPress.</p>
<p>In the meantime, I hope those using my List Authors widget enjoy the new features of version 2.0.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.takaitra.com/posts/316/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPhotoNotes</title>
		<link>http://www.takaitra.com/posts/304</link>
		<comments>http://www.takaitra.com/posts/304#comments</comments>
		<pubDate>Sun, 28 Mar 2010 20:51:46 +0000</pubDate>
		<dc:creator>Takaitra</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PhotoNotes]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.takaitra.com/?p=304</guid>
		<description><![CDATA[My plan to create a PHP/MySQL implementation of my PhotoNotes script was completed sooner than expected thanks to the requests and encouragement I&#8217;ve received on the project page. This was the perfect opportunity for me to teach myself some AJAX: creating, updating, and deleting notes all happens without a page reload. Better error handling is [...]]]></description>
			<content:encoded><![CDATA[<p>My plan to create a PHP/MySQL implementation of my PhotoNotes script was completed sooner than expected thanks to the requests and encouragement I&#8217;ve received on <a href="http://www.takaitra.com/projects/photonotes/">the project page</a>. This was the perfect opportunity for me to teach myself some AJAX: creating, updating, and deleting notes all happens without a page reload.</p>
<p>Better error handling is something I will work on in a future release. Right now, the user will not see any errors occurring from the PHP script. This is an area that needs to mature for AJAX in general. I skipped through a couple AJAX books at the book store and one didn&#8217;t even have the word &#8220;error&#8221; or &#8220;exception&#8221; in the table of contents!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.takaitra.com/posts/304/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Life Changes: Engagement and New Job</title>
		<link>http://www.takaitra.com/posts/297</link>
		<comments>http://www.takaitra.com/posts/297#comments</comments>
		<pubDate>Fri, 12 Mar 2010 16:58:44 +0000</pubDate>
		<dc:creator>Takaitra</dc:creator>
				<category><![CDATA[Daily Journal]]></category>
		<category><![CDATA[Cargill]]></category>
		<category><![CDATA[engagement]]></category>
		<category><![CDATA[St. Thomas]]></category>
		<category><![CDATA[Talisha]]></category>
		<category><![CDATA[wedding]]></category>

		<guid isPermaLink="false">http://www.takaitra.com/?p=297</guid>
		<description><![CDATA[It has been an exciting and hectic month to say the least. Talisha and I had our 3 year anniversary dinner on February 3 at La Belle Vie. I&#8217;ve known for some time that she is the perfect girl for me&#8211;Talisha truly understands me, has a great sense of humor (because it&#8217;s like mine) , [...]]]></description>
			<content:encoded><![CDATA[<p>It has been an exciting and hectic month to say the least. Talisha and I had our 3 year anniversary dinner on February 3 at <a href="http://www.labellevie.us/">La Belle Vie</a>. I&#8217;ve known for some time that she is the perfect girl for me&#8211;Talisha truly understands me, has a great sense of humor (because it&#8217;s like mine) <img src='http://www.takaitra.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> , is a loving and caring person, and is in every way gorgeous to boot. My proposal to her was long overdue but I wanted to make sure it was special and memorable! In my head, this meant a romantic moment during a trip somewhere exotic but, with our vacations being few and far between of late, I had to make do. On our anniversary night at a fancy restaurant, however, &#8220;make do&#8221; is the wrong term to use.</p>
<p>I did my best to not act nervous during dinner. There was no doubt that I was popping the question that night because I had planned ahead of time to have the waiter bring out the engagement ring with the dessert. When the moment came, I was a little too eager to drop down on my knee&#8211;Tally hadn&#8217;t even had time to notice the ring on the dessert plate! I did achieve my goal of completely surprising her, however.</p>
<p>Now, the fun of wedding planning begins. What&#8217;s the date, budget, where, who to invite, what food and beverages, what kind of invites, etc, etc, etc? It&#8217;s so overwhelming that I&#8217;m almost avoiding thinking about it until I finish planning our road trip (more to come on that) and begin my job at St. Thomas in a couple of weeks.</p>
<p>That&#8217;s right, after almost four years at Cargill I am moving on. It has truly been an awesome and valuable experience at my current company and I am sorry to be leaving. I will especially miss my coworkers but hope to stay in touch with them. A few weeks ago, I interviewed with the University of St. Thomas for a web developer position. Those who know me will also know that web development is a passion of mine that I&#8217;ve had at least since high school. Although I have kept current through side projects like developing <a href="http://www.takaitra.com/projects/list-authors">a WordPress plugin</a>, the range of web technologies that I could learn about and work with has been limited for the last couple of years. When I was offered the UST position, I couldn&#8217;t pass up the opportunity  to get back into the field. Another huge consideration was the generous tuition remission for myself and Talisha because getting back into school is very important to both of us. My final day at Cargill is next Friday and I will start my new job the following Monday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.takaitra.com/posts/297/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PhotoNotes</title>
		<link>http://www.takaitra.com/posts/275</link>
		<comments>http://www.takaitra.com/posts/275#comments</comments>
		<pubDate>Mon, 18 Jan 2010 03:44:56 +0000</pubDate>
		<dc:creator>Takaitra</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PhotoNotes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.takaitra.com/?p=275</guid>
		<description><![CDATA[My next coding side-project is another WordPress plugin. After posting some photos of my breadboard, I decided it would be nice to have a way to add notes to those photos. The current solution is Mbedr which I&#8217;m not happy with because it requires that the photos be hosted on Flickr and makes a call [...]]]></description>
			<content:encoded><![CDATA[<p>My next coding side-project is another WordPress plugin. After posting some <a href="http://www.takaitra.com/posts/210">photos of my breadboard</a>, I decided it would be nice to have a way to add notes to those photos. The current solution is Mbedr which I&#8217;m not happy with because it requires that the photos be hosted on Flickr and makes a call to Mbedr&#8217;s web server.</p>
<p>Take a look at the <a href="http://www.takaitra.com/projects/photonotes">PhotoNotes project page</a> to see my progress so far. It&#8217;s not yet saving any changes to the database but having some working display code means that I&#8217;m half way there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.takaitra.com/posts/275/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enhance WordPress wp_list_authors Template Tag</title>
		<link>http://www.takaitra.com/posts/234</link>
		<comments>http://www.takaitra.com/posts/234#comments</comments>
		<pubDate>Sat, 02 Jan 2010 18:46:51 +0000</pubDate>
		<dc:creator>Takaitra</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[List Authors]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_list_authors]]></category>

		<guid isPermaLink="false">http://www.takaitra.com/?p=234</guid>
		<description><![CDATA[As can be seen by some of the comments left on the site, a couple of frequently requested features cannot be added to the List Authors widget because they are not supported by the underlying wp_list_authors template tag. The WordPress code for wp_list_authors needs to be changed to enable these new features. Feature 1: Allow [...]]]></description>
			<content:encoded><![CDATA[<p>As can be seen by some of the comments left on the site, a couple of frequently requested features cannot be added to the <a href="http://www.takaitra.com/projects/list-authors">List Authors widget</a> because they are not supported by the <a href="http://codex.wordpress.org/Template_Tags/wp_list_authors">underlying wp_list_authors template tag</a>. The WordPress code for wp_list_authors needs to be changed to enable these new features.</p>
<p><strong>Feature 1:</strong> Allow an upper limit to the number of authors listed. Some WordPress sites have hundreds or even thousands of contributors. wp_list_authors currently would list all of them and, worse, execute an SQL statement for each author. The proposed fix could be a non-negative integer option named &#8220;count_limit.&#8221;</p>
<p><strong>Feature 2:</strong> Allow sorting of the author list. This could be an option named &#8220;sort_by&#8221; with the values &#8220;name&#8221; and &#8220;post_count.&#8221;</p>
<p>Today I <a href="http://core.trac.wordpress.org/ticket/10329">submitted a patch to WordPress Trac</a> including both of the above features. It also changes the code to use a JOIN statement to get the author post count instead of running an SQL statement for every author. This was a necessity to prevent inconsistencies when applying the LIMIT and ORDER BY. One of the core developers is reviewing it now and, if I&#8217;m lucky, the change will be included in the next major release (version 3.0). If that happens, you can be sure I will be updating the List Authors widget to make use of the new options.</p>
<p>A less frequent request but one I&#8217;ve seen is for an &#8220;exclude&#8221; option with the ability to filter out certain categories of authors. There is <a href="http://core.trac.wordpress.org/ticket/9902">a separate ticket</a> for this and I might consider submitting a patch for this next.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.takaitra.com/posts/234/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Breadboarding an Alarm Clock</title>
		<link>http://www.takaitra.com/posts/210</link>
		<comments>http://www.takaitra.com/posts/210#comments</comments>
		<pubDate>Thu, 03 Dec 2009 05:40:25 +0000</pubDate>
		<dc:creator>Takaitra</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[alarm clock]]></category>
		<category><![CDATA[atmel]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[embedded]]></category>

		<guid isPermaLink="false">http://www.takaitra.com/?p=210</guid>
		<description><![CDATA[I actually started this a couple of months back, but now that I have something working to the point where I&#8217;m pretty excited about it, I&#8217;m ready to share my pet project. Back in college, one of my favorite classes was my small electronics class. Learning about half-adders and resistors was okay but the really [...]]]></description>
			<content:encoded><![CDATA[<p><object data="http://www.elsewhere.org/mbedr/?p=4148765777&#038;s=1.25&#038;v" type="text/html" height="266.4" width="400"><a href="http://www.flickr.com/photos/45138042@N07/4148765777/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.flickr.com');" title="LCD Clock on Breadboard by Takaitra, on Flickr" target="_blank"><img src="http://farm3.static.flickr.com/2542/4148765777_878f8db220.jpg" width="400" height="266.4" alt="LCD Clock on Breadboard"/></a></object><br />
I actually started this a couple of months back, but now that I have something working to the point where I&#8217;m pretty excited about it, I&#8217;m ready to share my pet project. Back in college, one of my favorite classes was my small electronics class. Learning about half-adders and resistors was okay but the really fun part was using embedded programming to interface a micro-controller to the outside world. Ever since then, I&#8217;ve wanted to build some sort of embedded project of my own. I finally motivated myself to build something I&#8217;ve always wanted&#8211;an alarm clock that works the way I want it to.</p>
<p>Here are the features of my ideal alarm clock:</p>
<ul>
<li>Accurate to within a minute per month. Even better would be to synchronize to some time source.</li>
<li>Shows date, time and day of the week (so after a rough night, I know for sure if it&#8217;s a workday or not =D )</li>
<li>Easily visible during the day and at night.</li>
<li>Time adjustment allows adding <em>or subtracting</em> hours and minutes. I hate missing the correct minute on my current alarm clock and having to hit the set button <em>59 more times</em>.</li>
<li>Alarm can be enabled/disabled according to the day of the week. Do I need an alarm on weekends? No. Am I so lazy that I don&#8217;t want to turn the alarm on and off every weekend? Yes.</li>
</ul>
<p>Here are the items needed for breadboarding. This will be slightly different than the final bill of materials for the finished clock due to the breadboard power supply.</p>
<ul>
<li>An AVR ISP (In System Programmer) I built the <a href="http://www.ladyada.net/make/usbtinyisp/">USBtinyISP</a>. SparkFun <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9231">sells a slick version</a> except that it doesn&#8217;t work well in Linux.</li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=112">Breadboard</a></li>
<li>A reliable 5V power supply such as the <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=114">5V/3.3V breadboard power supply</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=7957">Atmel ATMega168</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=540">32.768kHz crystal oscillator</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8571">2x 22pF ceramic capacitor</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8375">2x 0.1uF ceramic capacitor</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=7950">Buzzer</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=97">3x Momentary push button switch</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8374">2x 10k Ohm resistor</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9088">Photocell</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=522">PNP transistor</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=116">Break away male headers</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=709">HD47780 compatible 16&#215;2 character LCD display</a> (see note!)</li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9140">Jumper wires</a> (also available from <a href="http://www.pololu.com/catalog/category/67">Pololu</a>)</li>
</ul>
<p><strong>Note on LCD display:</strong> I purchased my display off of Ebay for $5 and it works great. If you decide to use SparkFun&#8217;s display, keep in mind that it requires a resistor in series when you supply power to the backlight. The resistor is not included in my schematic because my display has the resistor built in.</p>
<p><object data="http://www.elsewhere.org/mbedr/?p=4148374085&#038;s=1.25&#038;v" type="text/html" height="400" width="266.4"><a href="http://www.flickr.com/photos/45138042@N07/4148374085/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.flickr.com');" title="LCD Clock Breadboard by Takaitra, on Flickr" target="_blank"><img src="http://farm3.static.flickr.com/2205/4148374085_89fbfc770b.jpg" width="266.4" height="400" alt="LCD Clock Breadboard"/></a></object></p>
<p>The notes on the image should give you an idea of what the components look like and what they are for. You will need to study the schematic to hook everything up correctly. If you are feeling lost at this point, read through the first two <a href="http://www.sparkfun.com/commerce/tutorials.php">SparkFun tutorials</a> then stop back. They will walk you through setting up the breadboard&#8217;s power supply and loading code onto an ATmega168.</p>
<p><div id="attachment_218" class="wp-caption alignnone" style="width: 310px"><a href="http://www.takaitra.com/wp-content/uploads/2009/12/LCD_Clock_v1_0.png"><img src="http://www.takaitra.com/wp-content/uploads/2009/12/LCD_Clock_v1_0-300x223.png" alt="LCD Clock Schematic" title="LCD_Clock_v1_0" width="300" height="223" class="size-medium wp-image-218" /></a><p class="wp-caption-text">LCD Clock Schematic</p></div></p>
<p>If you&#8217;ve gotten this far, you&#8217;re probably interested in the code behind the alarm clock. It is <a href="http://github.com/Takaitra/LCD-Clock/archives/master">available here</a>. Keep in mind this is not a finished product yet so there are still some features missing. The RTC (real time clock) code is fairly solid though.</p>
<p>I already have a PCB layout ready in Eagle which I&#8217;m going to send out to get printed. I&#8217;m really looking forward to migrating from the breadboard to the finished product. I&#8217;ll make sure to post the result!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.takaitra.com/posts/210/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Happy First Birthday Natalie!</title>
		<link>http://www.takaitra.com/posts/201</link>
		<comments>http://www.takaitra.com/posts/201#comments</comments>
		<pubDate>Sun, 11 Oct 2009 00:51:49 +0000</pubDate>
		<dc:creator>Takaitra</dc:creator>
				<category><![CDATA[Daily Journal]]></category>
		<category><![CDATA[Natalie]]></category>

		<guid isPermaLink="false">http://www.takaitra.com/?p=201</guid>
		<description><![CDATA[Happy birthday Natalie! I can&#8217;t believe our little person is already one year old.]]></description>
			<content:encoded><![CDATA[<p>Happy birthday Natalie! I can&#8217;t believe our little person is already one year old.</p>
<p><a rel="lightbox-plogger" title="Happy First Birthday!" href="http://plogger.takaitra.com/thumbs/lrg-215-img_1638.jpg"><img id="thumb-215" src="http://plogger.takaitra.com/thumbs/215-img_1638.jpg" title="Happy First Birthday!" alt="Happy First Birthday!" /></a> <a rel="lightbox-plogger" title="Cake" href="http://plogger.takaitra.com/thumbs/lrg-208-img_1643.jpg"><img id="thumb-208" src="http://plogger.takaitra.com/thumbs/208-img_1643.jpg" title="Cake" alt="Cake" /></a> <a rel="lightbox-plogger" title="Natalie\'s Family" href="http://plogger.takaitra.com/thumbs/lrg-220-img_1672.jpg"><img id="thumb-220" src="http://plogger.takaitra.com/thumbs/220-img_1672.jpg" title="Natalie\'s Family" alt="Natalie\'s Family" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.takaitra.com/posts/201/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Computer, 2001-2009</title>
		<link>http://www.takaitra.com/posts/188</link>
		<comments>http://www.takaitra.com/posts/188#comments</comments>
		<pubDate>Thu, 09 Jul 2009 02:41:58 +0000</pubDate>
		<dc:creator>Takaitra</dc:creator>
				<category><![CDATA[Daily Journal]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[recycling]]></category>

		<guid isPermaLink="false">http://www.takaitra.com/posts/188</guid>
		<description><![CDATA[I finally got around to recycling some of the old electronics sitting in my closet by bringing them to the Hennepin County recycling center. I thought I was going to cry when they threw (literally, I&#8217;ve never seen a desktop computer fly so far) my old computer to the back of the huge container of [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to recycling some of the old electronics sitting in my closet by bringing them to the Hennepin County recycling center. I thought I was going to cry when they threw (literally, I&#8217;ve never seen a desktop computer fly so far) my old computer to the back of the huge container of TVs, stereos, and monitors. It was utterly worthless but I had a lot of memories attached to that aluminum box&#8211;namely LAN parties and college dorm life.</p>
<p>It gave me a lot of grief with 3 blown mobos and 1 dead powersupply over its lifespan. It was built during the height of the &#8220;modding&#8221; craze if you remember that. I made sure my box was rocking with a side window complete with a custom fan grill and blue cathode lights. No one could top my built-in car cigarette lighter, proudly installed in the spare 5.5&#8243; bay. This is the one piece I kept. Maybe someday it will see new life in a desktop of mine.</p>
<p>Goodbye computer. If I had space in my closet, you wouldn&#8217;t be shredded and melted for scrap metal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.takaitra.com/posts/188/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

