<?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>LlamaByte</title>
	<atom:link href="http://www.llamabyte.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.llamabyte.com</link>
	<description>Ramblings of a man named Bill</description>
	<lastBuildDate>Mon, 06 Feb 2012 15:32:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Windows 7 access denied</title>
		<link>http://www.llamabyte.com/2012/windows-7-access-denied/</link>
		<comments>http://www.llamabyte.com/2012/windows-7-access-denied/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 19:25:15 +0000</pubDate>
		<dc:creator>Howler</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.llamabyte.com/?p=283</guid>
		<description><![CDATA[Access denied to my own files Recently, I recieved an access denied message while trying to access some of my own files. I was using an administrator account, so this confused me greatly. I was trying to clean up some files on my Windows 7 drive, when I came across a directory with a &#8216;lock symbol. [...]]]></description>
			<content:encoded><![CDATA[<h1>Access denied to my own files</h1>
<p>Recently, I recieved an access denied message while trying to access some of my own files. I was using an administrator account, so this confused me greatly.</p>
<p>I<span style="text-align: center;"> was trying to clean up some files on my Windows 7 drive, when I came across a directory with a &#8216;lock symbol.</span></p>
<p style="text-align: center;"><a href="http://www.llamabyte.com/wp-content/uploads/2012/02/LockedDirectory.png"><img class="size-full wp-image-284 aligncenter" title="LockedDirectory" src="http://www.llamabyte.com/wp-content/uploads/2012/02/LockedDirectory.png" alt="Directory with a lock symbol" width="248" height="46" /></a></p>
<p>It was a randomly generated name, so I assumed it was an update directory that I no longer needed. Not thinking anything of it, I went to browse the directory.</p>
<p>When I tried to go into the &#8216;update&#8217; sub directory, I received a &#8220;You don&#8217;t currently have permission to access this folder. Click Continue to permanently get access to this folder.&#8221; message.</p>
<p><span id="more-283"></span></p>
<p><a href="http://www.llamabyte.com/wp-content/uploads/2012/02/beenDeniedAccess.png"><img class="alignright  wp-image-289" title="beenDeniedAccess" src="http://www.llamabyte.com/wp-content/uploads/2012/02/beenDeniedAccess-300x143.png" alt="Access denied to folder" width="240" height="114" /></a>&#8220;Sure&#8221;, I thought, &#8220;Must be &#8216;owned&#8217; by windows update.&#8221; But, when I clicked on continue, <a href="http://www.llamabyte.com/wp-content/uploads/2012/02/dontHavePermission.png"><img class="alignleft  wp-image-285" title="dontHavePermission" src="http://www.llamabyte.com/wp-content/uploads/2012/02/dontHavePermission-300x156.png" alt="You don't currently have permission" width="240" height="125" /></a>I received a new error message saying that &#8220;You have been denied permission to access this folder. To gain access to this folder you will need to use the security tab.&#8221;</p>
<p>And, no matter what I did in the security tab, I couldn&#8217;t get access to the folder.</p>
<h2>Why was my access denied?</h2>
<p>Eventually, I figured out that the reason my account (which was an administrator) had no access to the files, was because these files were from a different install of windows. So, I guess my administrator account can not over ride the administrator of a different windows 7 installation.</p>
<h2>Resolution: takeown</h2>
<p>Eventually, I found reference to the <a title="Takeown" href="http://technet.microsoft.com/en-us/library/cc753024(WS.10).aspx" target="_blank">takeown </a>command that is bundled with Windows. This command is what allowed my administrator account to take ownership of the directory.</p>
<pre id="ctl00_MTCS_main_ctl01_code">takeown [/s &lt;Computer&gt; [/u [&lt;Domain&gt;\]&lt;User name&gt; [/p [&lt;Password&gt;]]]] /f &lt;File name&gt; [/a] [/r [/d {Y|N}]]</pre>
<p id="ctl00_MTCS_main_ctl01_code">In order to take ownership of the directory and all sub directories, all I had to do was add the recursive flag to the command. Here is the command that worked for this instance:</p>
<pre>takeown /F "C:\25448af8c552a3235e50949acecc" /R /A /D "Y"</pre>
<p>Flags used:</p>
<p>/R : Recursive. Take ownership of all files in current directory and all sub directories.</p>
<p>/A : Assign ownership to local administrator group instead of my user. This allows any admin on my computer to have access</p>
<p>/D &#8220;Y&#8221; : Supress prompts about my user not having list access to the directory(ies), and just give me full control.</p>
<h3>Almost there!</h3>
<p>After takeown, I could at least look at all the files in the directory. However, I was still unable to delete them. It said that I needed permission from the Administrators group. So, this was still an access denied, but this one I can take care of easily. All I had to do now, is go into the security tab, and give administrators full access (which I can do now since the admin group owns the files).<a href="http://www.llamabyte.com/wp-content/uploads/2012/02/SecurityTab.png"><img class="aligncenter size-medium wp-image-304" title="SecurityTab" src="http://www.llamabyte.com/wp-content/uploads/2012/02/SecurityTab-231x300.png" alt="Security tab to give full control" width="231" height="300" /></a></p>
<p>After I had full control, I could delete them to my heart&#8217;s content!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.llamabyte.com/2012/windows-7-access-denied/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Indy GiveCamp 2011</title>
		<link>http://www.llamabyte.com/2011/indy-givecamp-2011/</link>
		<comments>http://www.llamabyte.com/2011/indy-givecamp-2011/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 04:02:18 +0000</pubDate>
		<dc:creator>Howler</dc:creator>
				<category><![CDATA[GiveCamp]]></category>
		<category><![CDATA[Indy GiveCamp]]></category>

		<guid isPermaLink="false">http://www.llamabyte.com/?p=227</guid>
		<description><![CDATA[This past weekend, I participated in Indy GiveCamp. I wanted to share some of my experiences over the weekend, and how everything turned out. What is Indy GiveCamp? GiveCamp is an event where web designers, developers and database administrators get together donate their time to provide software or web sites for charities. This allows charities [...]]]></description>
			<content:encoded><![CDATA[<p>This past weekend, I participated in <a title="Indy GiveCamp" href="http://indygivecamp.org/" target="_blank">Indy GiveCamp</a>. I wanted to share some of my experiences over the weekend, and how everything turned out.</p>
<h2>What is Indy GiveCamp?</h2>
<p>GiveCamp is an event where web designers, developers and database administrators get together donate their time to provide software or web sites for charities. This allows charities to not have to worry about getting their website updated or trying to figure out how to pay someone to do it.</p>
<p>Indy GiveCamp contained around 40 volunteers. We were able to help 7 different charities.</p>
<ul>
<li><a href="http://childadvocates.net">Child Advocates</a></li>
<li><a href="http://heartineducation.org">Heart in Education Teacher Outreach</a></li>
<li><a href="http://lilliandavisfndn.org">Lillian Davis Foundation</a></li>
<li><a href="http://www.mysistersplace-indy.org">My Sister’s Place</a></li>
<li><a href="http://richrecovery.org">Rich Recovery Services</a></li>
<li><a href="http://vsai.org">VSA Indiana</a></li>
<li><a href="http://wifsindy.org">Women in Insurance and Financial Services</a></li>
</ul>
<div>We were assigned to our teams around 8pm on Friday. The goal was to have a brand new website ready to &#8220;hand over the keys&#8221; by 2pm Sunday.</div>
<p><span id="more-227"></span></p>
<h2>My Team</h2>
<p>My team consisted of 4 members. Our Team Lead was Joel (who happened to be one of the event organizers). Joshua was our designer. Matt and myself were developers. This is the first time any of us had met each other.  There was a little time spent getting to know each other before we started to dig into the site itself.</p>
<p>Once we started working together, the team really started to mesh very well. No one had an ego that would clash with others. We all talked together. If there was an issue, we all came together to find a solution. Everyone had input to how everything should be laid out, and implemented.</p>
<h2>Charity</h2>
<p>We were assigned to <a href="http://vsai.org">VSA Indiana</a>. After speaking with Amy Bear, the charity representative, we found out that they were unhappy with their current website because it didn&#8217;t really present the organization in a very flattering manner. They also felt that their call to actions were not as bold as they could be; they wanted people to easily know how they could get involved and help. Also, the navigation and layout of the site really needed to be modernized.</p>
<p>Since the focus of VSA is helping people with disabilities express themselves through art, we knew that we had to design the website in such a way that it would not limit people with disabilities from viewing it. With that in mind, we made several design decisions that affected the site. We made sure that every single image on the site had an alt tag, so even if it couldn&#8217;t be seen, the viewer had an idea of what the picture conveyed. We configured the layout of the site in such a way that if a screen reader were used on the site, the same story would be told as it would be visually. We also had an emphasis on large fonts that were easy to read, and colors that stood out.</p>
<h2>Environment</h2>
<p>The facility was donated by <a title="MID Technologies" href="http://midtechnologies.net" target="_blank">MID Technologies</a>. The facility was excellent. There was plenty of room for everyone, and they even had a room with wall to wall whiteboards to hash out designs if required. The doors to the facility were open all weekend, so that the teams could work non-stop.</p>
<p>All the teams worked in one large room, with each team having their own table on which to work. Every member of the team brought their own computer (mainly laptops), and we connected to a wireless network.</p>
<p>As members of the team got tired, some of them went home for a couple hours, while others simply grabbed a sleeping bag or blanket and headed off to one of the side rooms for a few winks. However almost every team had someone there at all times throughout the weekend.</p>
<h2>Development</h2>
<p>The overall feel of the development was akin to Agile Scrum development. With a small team, a team leader, developers, and a business person. The team contained within it everything that was needed to complete the project.</p>
<p>Jay Harris, one of the organizers, took on the role of scrum master for all of the teams. Every 3-4 hours, he would yell “STAND UP!” This was the cue for everyone in the building to move to the “Stand up area”, this included all members of every team and the charity representatives. At that time, the scrum master would go through the list of charities, one by one. He would ask someone from each charity three questions: What did you do since the last stand up? What will you do before the next one? Do you have any blocking impediments?</p>

<a href="http://www.llamabyte.com/wp-content/gallery/indy-givecamp/img_6299.jpg" title="" class="shutterset_singlepic174" >
	<img class="ngg-singlepic ngg-left" src="http://www.llamabyte.com/wp-content/gallery/cache/174__320x240_img_6299.jpg" alt="img_6299" title="img_6299" />
</a>

<p>Even though there were 7 teams, and over 40 people at these standups, they would last less than 5 minutes. For any impediments, the Scrum master would ask if anyone knew how to solve them that person should talk to that team after the meeting.</p>
<p>The standups were a great way to see how each team was coming along, and if you had any issues, they were solved quickly by someone else with knowledge in that particular area.</p>
<p>Having the representative from our charity sitting with us was awesome, because any business questions we had were answered immediately. While updating content, we could get feedback on wording, questions on who the audience was, and even if the site was going in the right direction. She would comment on how she did or did not like a certain concept, as we were working on it. This let us change the things she did not like without spending much time going down that wrong path.</p>
<p>Some of the charities did not have a representative there for most of the weekend. I feel as if those teams had to do a lot of guessing, and they may or may not have created a site that satisfies the charity completely.</p>
<h2>Result</h2>
<p>After we spent the whole weekend working on the site, we ended up with something that I, and our whole team was proud of, and represented the charity well.</p>
<p>Original site:</p>

<a href="http://www.llamabyte.com/wp-content/gallery/indy-givecamp/originalsitescreen.png" title="screen shot of the original VSAI website" class="shutterset_singlepic200" >
	<img class="ngg-singlepic" src="http://www.llamabyte.com/wp-content/gallery/cache/200__320x240_originalsitescreen.png" alt="VSAI Original Homepage" title="VSAI Original Homepage" />
</a>

<p>New Site:</p>

<a href="http://www.llamabyte.com/wp-content/gallery/indy-givecamp/newsitescreen.png" title="Screen shot of the new VSAI homepage" class="shutterset_singlepic199" >
	<img class="ngg-singlepic" src="http://www.llamabyte.com/wp-content/gallery/cache/199__320x240_newsitescreen.png" alt="New VSAI Homepage" title="New VSAI Homepage" />
</a>

<p>By Sunday at 2pm, we were able to have the new website live. Each team gave a brief demo of their new site and how it compared to the charity&#8217;s old site.
<a href="http://www.llamabyte.com/wp-content/gallery/indy-givecamp/img_6318.jpg" title="Presentation of the new site." class="shutterset_singlepic193" >
	<img class="ngg-singlepic ngg-right" src="http://www.llamabyte.com/wp-content/gallery/cache/193__320x240_img_6318.jpg" alt="New site demo" title="New site demo" />
</a>
</p>
<p>I believe that the charity as a whole is very happy with the site. In fact, Amy forwarded an email to us from one of their board members. This is his initial reaction to the site:</p>
<blockquote><p>&#8220;So, is it OK for a grown man to cry happy tears! Amazing. The timing couldn&#8217;t be better for our Friends campaign. People love to support and stick with the winners &#8211; this site makes us look like winners. GREAT JOB!. I&#8217;m going back on the site now to see more <img src='http://www.llamabyte.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> &#8221;</p></blockquote>
<h2>Cost Saving</h2>
<p>From 8pm Friday when we started talking to our charities to 2pm Sunday when we turned the keys over, there was 42 hours. Our team of 4 ended up working 132 hours to get the site completed.</p>
<p>The organizers went around and gathered the hours that all the teams worked over the weekend. They estimated that everyone donated $131,000 worth of services to these 7 charities. Once I saw that number in black and white, it really amazed me. How much money we were able to save these charities so that they didn&#8217;t have to worry about finding the funds for a new website.</p>
<p>Also, <a title="Applied Innovations" href="http://appliedi.net" target="_blank">Applied Innovations</a> donated free web hosting for life for any charity that participated in Indy GiveCamp. So, not only were we able to save them money on site design, we were able to save VSA Indiana over $700 a year on web hosting.</p>
<h2>Unexpected</h2>
<p>
<a href="http://www.llamabyte.com/wp-content/gallery/indy-givecamp/img_6321.jpg" title="Card and student art given to me by a VSAI representative" class="shutterset_singlepic196" >
	<img class="ngg-singlepic ngg-right" src="http://www.llamabyte.com/wp-content/gallery/cache/196__320x240_img_6321.jpg" alt="card and student art" title="card and student art" />
</a>
As the teams were giving their demos, Amy turned into a ninja and before I knew it there was a bag next to me (which I didn&#8217;t even notice until she mentioned it). In that bag was a card and a piece of art from one of their students. That particular student happens to be on one of the photos on the homepage (by some strange coincidence also the picture in the screen shot of the new site above). This was unexpected, unnecessary, and incredibly thoughtful. This made the weekend more memorable. The artwork is hanging proudly in my home.</p>
<h2>Indy GiveCamp 2012?</h2>
<p>Overall, I thought the experience was fantastic.  It was great to meet so many people gathering together to donate the skills they have in order to help others. It amazed me how much we were able to get done in such a short amount of time.</p>
<p>I definitely plan on volunteering for Indy GiveCamp next year!</p>
<h3>Other Posts about Indy GiveCamp 2011</h3>
<p><a href="http://aurigroup.wordpress.com/2011/10/17/indy-give-camp-2011-was-a-success-free-web-sites-for-charities-from-tech-gurus/">http://aurigroup.wordpress.com/2011/10/17/indy-give-camp-2011-was-a-success-free-web-sites-for-charities-from-tech-gurus/</a></p>
<p><a href="http://davefancher.com/2011/10/18/i-survived-my-first-givecamp/">http://davefancher.com/2011/10/18/i-survived-my-first-givecamp/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.llamabyte.com/2011/indy-givecamp-2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upgrading to Gitolite from Gitosis</title>
		<link>http://www.llamabyte.com/2011/upgrading-to-gitolite-from-gitosis/</link>
		<comments>http://www.llamabyte.com/2011/upgrading-to-gitolite-from-gitosis/#comments</comments>
		<pubDate>Fri, 20 May 2011 19:35:50 +0000</pubDate>
		<dc:creator>Howler</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[gitolite]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.llamabyte.com/?p=166</guid>
		<description><![CDATA[Git I have been using git as source control for all of my projects for a little while now. Now that I am getting used to git, I like it a lot. It&#8217;s a bit of a different style than other source control management systems, but it seems to work well. I am starting to [...]]]></description>
			<content:encoded><![CDATA[<h2>Git</h2>
<p>I have been using <a title="Git" href="http://git-scm.com" target="_blank">git</a> as source control for all of my projects for a little while now. Now that I am getting used to git, I like it a lot. It&#8217;s a bit of a different style than other source control management systems, but it seems to work well. I am starting to store lots of things in source control. Not only my programming projects, but also my random helper scripts and configuration files that I write. Basically, anything where in the past I would simply rename the file to &#8220;File.old&#8221;, it makes more sense to add it to source control instead. That way I can go back as many versions as I need to (without having an .oldX) and also see exactly what I have changed.</p>
<h2>Gitosis vs Gitolite</h2>
<p>I started off using Gitosis for repository management on my server. I wanted to be able to clone repositories and commit updates easily. While Gitosis works; I have decided that I want to migrate to Gitolite for a few reasons:</p>
<ul>
<li>Gitolite is still being maintained &#8212; Gitosis is not</li>
<li>Better user management of repositories. Allow different users different access. I.E. I can do everything, but a friend is unable to delete files permanently.</li>
<li>Multiple keys per user. I have a few different machines that I develop on, and each machine has its own ssh key. Gitolite allows a nice format where one user can have multiple keys without cluttering up the config file.</li>
<li>I don&#8217;t like how I have to use MyRepository.git when cloning with Gitosis. Gitolite allows simply a clone of MyRepository.</li>
<li>Easier to create new repositories.</li>
</ul>
<h2><span id="more-166"></span></h2>
<h2>Migration</h2>
<p>I followed the guide on the Gitolite site: <a href="http://sitaramc.github.com/gitolite/doc/migrate.html">http://sitaramc.github.com/gitolite/doc/migrate.html</a></p>
<p>And, I used this one to install Gitolite: <a href="http://sitaramc.github.com/gitolite/doc/1-INSTALL.html#_root_method_directly_on_the_server_manually_with_root_access">http://sitaramc.github.com/gitolite/doc/1-INSTALL.html#_root_method_directly_on_the_server_manually_with_root_access</a></p>
<p>Both guides are pretty accurate.</p>
<p>This was the only issue I found in the migration guide:</p>
<blockquote><p>src/gl-conf-convert &lt; $GSAC/gitosis.conf &gt;&gt; $GLAC/gitolite.conf</p></blockquote>
<p>should be</p>
<blockquote><p>src/gl-conf-convert &lt; $GSAC/gitosis.conf &gt;&gt; $GLAC/conf/gitolite.conf</p></blockquote>
<h2>Using Gitolite</h2>
<p>Once Gitolite is installed, creating new repositories becomes easy (A lot easier than Gitosis seemed to make it).</p>
<p>Get your gitolite-admin repository (this should have already been done in the install phase)</p>
<pre class="brush: bash; light: true; title: ; notranslate">git clone ssh://git@SERVER:gitolite-admin</pre>
<p>Edit <code>gitolite-admin/conf/gitolite.conf</code> and add a repository:</p>
<blockquote><p>repo    scripts<br />
RW+   =       YourGitoliteUserHere<br />
R       =       daemon</p></blockquote>
<p>The R = daemon allows for public read access to this repository (see <a href="#Git_Daemon">Git-Daemon Below</a>)</p>
<p>Then, simply save commit and push your changes.</p>
<pre class="brush: bash; light: true; title: ; notranslate">
git commit -am &quot;Added new scripts repository&quot;
git push
</pre>
<p>You now have an empty repository with which to do your bidding.</p>
<pre class="brush: bash; light: true; title: ; notranslate">git clone ssh://git@SERVER:scripts</pre>
<p>or for git-daemon read only:<br />
<span style="color: #ff99cc;">Notice the &#8220;/repoName&#8221; syntax instead of the normal &#8220;:repoName&#8221;</span></p>
<pre class="brush: bash; light: true; title: ; notranslate">git clone git://SERVER/scripts</pre>
<p><a name="Git_Daemon"></a></p>
<h2>Git-Daemon</h2>
<p>I wanted to allow public access to some of my repositories. Git-daemon is the perfect way to do this. And, gitolite supports allowing certain repositories access with git-daemon.</p>
<p>To get git-daemon working, I created a git-daemon service file:</p>
<pre class="brush: bash; collapse: true; light: false; title: /etc/init.d/git-daemon; toolbar: true; wrap-lines: false; notranslate">
# Taken from here: http://pastie.org/227647
#Really from here: https://help.ubuntu.com/community/Git

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=git-daemon
PIDFILE=/var/run/$NAME.pid
DESC=&quot;the git daemon&quot;
DAEMON_USER=git
DAEMON_BASEPATH=/home/git/repositories
DAEMON=/usr/lib/git-core/git-daemon
DAEMON_OPTS=&quot;--base-path=$DAEMON_BASEPATH --verbose --syslog --detach --pid-file=$PIDFILE --user=$DAEMON_USER --group=nogroup&quot;

test -x $DAEMON || exit 0

[ -r /etc/default/git-daemon ] &amp;&amp; . /etc/default/git-daemon

. /lib/lsb/init-functions

start_git() {
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--startas $DAEMON -- $DAEMON_OPTS
}

stop_git() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE
rm -f $PIDFILE
}

status_git() {
start-stop-daemon --stop --test --quiet --pidfile $PIDFILE &gt;/dev/null 2&gt;&amp;1
}

case &quot;$1&quot; in
start)
log_begin_msg &quot;Starting $DESC&quot;
start_git
log_end_msg 0
;;
stop)
log_begin_msg &quot;Stopping $DESC&quot;
stop_git
log_end_msg 0
;;
status)
log_begin_msg &quot;Testing $DESC: &quot;
if status_git
then
log_success_msg &quot;Running&quot;
exit 0
else
log_failure_msg &quot;Not running&quot;
exit 1
fi
;;
restart|force-reload)
log_begin_msg &quot;Restarting $DESC&quot;
stop_git
sleep 1
start_git
log_end_msg 0
;;
*)
echo &quot;Usage: $0 {start|stop|restart|force-reload|status}&quot; &gt;&amp;2
exit 1
;;
esac

exit 0
</pre>
<p>The only things that really needs to be modified are the DAEMON* lines (Lines 8-11).<br />
<span style="color: #00ff00;">DAEMON_USER=</span> Your gitolite user name. This is typically &#8220;git&#8221; or &#8220;gitolite&#8221;<br />
<span style="color: #00ff00;">DAEMON_BASEPATH=</span> Where your Gitolite repositories are stored.<br />
<span style="color: #00ff00;">DAEMON=</span> Where the git-daemon binary is stored<br />
<span style="color: #00ff00;">DAEMON_OPTS=</span> Any extra options that should be passed to the daemon</p>
<p>You will need to make the script executable.</p>
<pre class="brush: bash; light: true; title: ; notranslate">sudo chmod +x /etc/init.d/git-daemon</pre>
<p>Now you can control the git-daemon service:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
sudo /etc/init.d/git-daemon start
sudo /etc/init.d/git-daemon stop
sudo /etc/init.d/git-daemon restart
sudo /etc/init.d/git-daemon status
</pre>
<p>If you want git-daemon to start automatically at boot, you can run this (Ubuntu only):</p>
<pre class="brush: bash; light: true; title: ; notranslate">sudo update-rc.d git-daemon defaults</pre>
<p>Now any repository with a user &#8220;daemon&#8221; setup for read access (git-daemon only allows read-only). is publicly available using the git:// protocol (assuming the git port 9418 is forwarded to your git server)</p>
<pre class="brush: bash; light: true; title: ; notranslate">git clone git://llamabyte.com/testing</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.llamabyte.com/2011/upgrading-to-gitolite-from-gitosis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sendmail Masquerading</title>
		<link>http://www.llamabyte.com/2011/sendmail-masquerading/</link>
		<comments>http://www.llamabyte.com/2011/sendmail-masquerading/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 18:20:58 +0000</pubDate>
		<dc:creator>Howler</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[masquerade]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.llamabyte.com/?p=161</guid>
		<description><![CDATA[I got tired of having my sendmail server send mail from user@Pulsar.NotLlamabyte.com instead of user@NotLlamabyte.com. I went on to research how to change this. I found sendmail masquerading that would do exactly what I wanted. Masquerading I figured out that I can just masquerade as NotLlamabyte.com which would leave out the hostname. This feature allows [...]]]></description>
			<content:encoded><![CDATA[<p>I got tired of having my sendmail server send mail from user@Pulsar.NotLlamabyte.com instead of user@NotLlamabyte.com. I went on to research how to change this. I found sendmail masquerading that would do exactly what I wanted.</p>
<p><span id="more-161"></span></p>
<h2>Masquerading</h2>
<p>I figured out that I can just masquerade as NotLlamabyte.com which would leave out the hostname. This feature allows multiple hosts to send mail from the same domain name. In my case, I only have the one host, but I still want it to be from my real domain name and not host.domainName.</p>
<h2>Configuring</h2>
<p>All it took was a few lines in my sendmail.mc file.</p>
<p><code>/etc/mail/sendmail.mc</code></p>
<blockquote><p>MASQUERADE_AS(NotLlamabyte.com)dnl<br />
FEATURE(masquerade_envelope)dnl<br />
FEATURE(masquerade_entire_domain)dnl<br />
MASQUERADE_DOMAIN(NotLlamabyte.com)dnl</p></blockquote>
<p>Save the file, run <code>sendmailconfig</code> to load the new settings, and it&#8217;s all set! All the mail sent from my server is now from user@NotLlamabyte.com instead of user@Pulsar.NotLlamabyte.com.</p>
<h2>Testing</h2>
<p>Simply send an email from your server, and check the reply-to address.</p>
<h2>Alternate method</h2>
<p>You can configure sendmail to read the masquerade information from an external table file (like the aliases file). This method allows you to support multiple domain names, and have different users masquerade as different hosts. I opted not to do it this way, since I only have the one host.</p>
<p>This is what it would look like had I chosen this route:</p>
<p><code>/etc/mail/sendmail.mc</code></p>
<blockquote><p>FEATURE(genericstable)dnl<br />
FEATURE(generics_entire_domain)dnl<br />
FEATURE(masquerade_envelope)dnl<br />
GENERICS_DOMAIN(`NotLlamabyte.com&#8217;)dnl</p></blockquote>
<p><code>/etc/mail/genericstable</code></p>
<blockquote><p>@Pulsar.NotLlamabyte.com    %1@NotLlamabyte.com</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.llamabyte.com/2011/sendmail-masquerading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPF Records</title>
		<link>http://www.llamabyte.com/2011/spf-records/</link>
		<comments>http://www.llamabyte.com/2011/spf-records/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 18:01:28 +0000</pubDate>
		<dc:creator>Howler</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spf]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.llamabyte.com/?p=147</guid>
		<description><![CDATA[I have recently been helping a friend get his sendmail and redmine server up and going. He used my previous post(s) to get everything set up. But, during testing it appeared that no emails were actually getting sent. Even though the sendmail log file showed a &#8220;Sent&#8221; status for them. Eventually I checked my spam [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently been helping a friend get his sendmail and redmine server up and going. He used my previous post(s) to get everything set up. But, during testing it appeared that no emails were actually getting sent. Even though the sendmail log file showed a &#8220;Sent&#8221; status for them.</p>
<p>Eventually I checked my spam folder, and found all the test emails I had sent from his server. After trying to figure out why emails from his server were getting treated as spam instantly, I came across <em>Sender Policy Framework (SPF) </em>records.</p>
<h2><span id="more-147"></span></h2>
<h2>SPF</h2>
<p>Basically, SPF is a way to verify that a certain server is allowed to send email from a host.</p>
<p>When a server that supports SPF queries (like gmail) gets an email, it will query the TXT record that is associated with that host. If an SPF record comes back, it will check to see if the sending IP is listed in the &#8220;accepted hosts&#8221; list of the SPF record. If it is listed, it&#8217;s unlikely that a spammer is trying to spoof your domain name; thus less likely of being a spam email.</p>
<h2>Enabling SPF</h2>
<p>Enabling SPF for your mail server is pretty easy. All you need to do is add a TXT record to your domain&#8217;s DNS entry. I used the <a title="SPF Wizard" href="http://old.openspf.org/wizard.html" target="_blank">SPF wizard at openSPF.org</a>. I answered the questions there to come up with the SPF record I should use:</p>
<p><code> "v=spf1 a mx ~all"</code></p>
<p>Which says that any servers listed as A records or MX records can send emails from my domain, but no one else is allowed to send mail on behalf of my domain.</p>
<p>So, I added that as a new TXT record in zone edit, and sent a test mail to my gmail account.</p>
<h2>Testing</h2>
<p>In Gmail, if you go to more options (The down arrow next to the reply button at the top), and click on &#8220;Show Original&#8221; you can see the SPF result.</p>
<p>Before the SPF record:</p>
<blockquote><p>Received-SPF: neutral (google.com: 99.188.39.169 is neither permitted nor denied by best guess record for domain of wwolfe@pulsar.NotLlamabyte.com) client-ip=99.188.39.169;</p></blockquote>
<p>After the SPF record:</p>
<blockquote><p>Received-SPF: pass (google.com: domain of wwolfe@NotLlamabyte.com designates 99.188.39.169 as permitted sender) client-ip=99.188.39.169;</p></blockquote>
<p>Now, email sent from my server should be less likely to be marked as spam; at least on server that support SPF queries.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.llamabyte.com/2011/spf-records/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure Redmine to receive emails with sendmail</title>
		<link>http://www.llamabyte.com/2011/configure-redmine-to-receive-emails-with-sendmail/</link>
		<comments>http://www.llamabyte.com/2011/configure-redmine-to-receive-emails-with-sendmail/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 20:56:22 +0000</pubDate>
		<dc:creator>Howler</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.llamabyte.com/?p=110</guid>
		<description><![CDATA[Information I have a redmine install that I am using for my personal projects. It helps me log tasks/features that I want to implement in my projects while I think of them instead of &#8220;Oh, I really need to remember that for later!&#8221; (The remembering never actually happens). Redmine.llamabyte.com I am using a pretty standard [...]]]></description>
			<content:encoded><![CDATA[<h2>Information</h2>
<p>I have a <a title="Redmine" href="http://http://www.redmine.org" target="_blank">redmine </a>install that I am using for my personal projects. It helps me log tasks/features that I want to implement in my projects while I think of them instead of &#8220;Oh, I really need to remember that for later!&#8221; (The remembering never actually happens).</p>
<p><a title="My Redmine Install" href="http://redmine.llamabyte.com">Redmine.llamabyte.com</a></p>
<p>I am using a pretty standard <a title="My sendmail config" href="http://www.llamabyte.com/2011/my-sendmail-config/">sendmail configuration</a> to allow redmine (and some other programs) to send emails easily.</p>
<p>Redmine also has the ability to <strong>receive</strong> emails as well, and add them as issues/tasks to projects.</p>
<p>That way, I can send an email to redmine@NotLlamabyte.com with:</p>
<p><code><br />
Add a new feature to allow sending emails if the program crashes.</code></p>
<p><code> </code></p>
<p><code>Project: myNewProgram<br />
Tracker: Feature<br />
Priority: Urgent<br />
</code></p>
<p>And, redmine will parse that and create a new Urgent feature request on &#8220;myNewProgram&#8221; project with the text &#8220;Add a new feature to allow sending emails if the program crashes.&#8221;</p>
<p>This will be great for creating tasks from my phone, or as a &#8220;Feature Request&#8221; button in my actual programs themselves, so my users can easily request things.</p>
<h2><span id="more-110"></span></h2>
<h2>Configuration</h2>
<p>Basing my configuration off the Redmine site: <a href="http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails#Forwarding-emails-from-your-email-server">http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails#Forwarding-emails-from-your-email-server</a></p>
<p>The rdm-mailhandler.rb already exists in the standard redmine install. My redmine is installed to the standard <code>/usr/share/redmine/</code>, so the full path to the mail handler is: <code>/usr/share/redmine/extra/mail_handler/rdm-mailhandler.rb</code></p>
<p>Since I already have sendmail configured, I can simply add an alias that will call the mail handler.</p>
<p>I think I will simply create a redmine alias, and not one per project. At least for now. I will also make an alias per project, but that will be for real emails about the project. Such that emails to redmine@NotLlamabyte.com will be for creating issues/tasks, while myNewProgram@NotLlamabyte.com would be used for questions/comments about myNewProgram app from anyone using it.</p>
<p>First, set up Redmine to recieve emails. In the Administration section, go to Settings. Then, go to the Incoming Emails tab.<br />
Check &#8220;Enable WS for incoming emails&#8221;, and either type or generate a key.</p>
<p>I need to create the new alias. This will run the redmine script and inject the new issue into redmine when an email is sent to that alias.<br />
<code>/etc/aliases</code></p>
<blockquote><p>#<br />
# Mail aliases for sendmail<br />
#<br />
# You must run newaliases(1) after making changes to this file.<br />
#</p>
<p># Required aliases<br />
postmaster:     root<br />
MAILER-DAEMON:  postmaster</p>
<p># Common aliases<br />
abuse:          postmaster<br />
spam:           postmaster</p>
<p># Other aliases</p>
<p><span style="color: #ff0000;">redmine:        &#8220;|/usr/share/redmine/extra/mail_handler/rdm-mailhandler.rb &#8211;url http://redmine.llamabyte.com &#8211;tracker bug &#8211;priority normal &#8211;allow-override project,tracker,category,priority,status &#8211;key ThisIsMyRedmineEmailKey&#8221;</span></p></blockquote>
<p>I am setting the default tracker to be the bug tracker, with a default of normal priority. However, I allow everything to be overridden in the email body itself.</p>
<p>Since I am using a virtusertable file to support multiple domains, I need to modify that to send email to my local alias. I need to do it this way, because the virtusertable does not support running scripts. It will only send email to a local alias, or an email address.<br />
<code>/etc/mail/virtusertable</code></p>
<blockquote><p>wwolfe@pulsar.NotLlamabyte.com     wwolfe<br />
wwolfe@NotLlamabyte.com            wwolfe+llamabyte@NotGmail.com<br />
<span style="color: #ff0000;">redmine@NotLlamabyte.com           redmine</span><br />
@NotLlamabyte.com                  wwolfe+Llamabyte@NotGmail.com<br />
@pulsar.NotLlamabyte.com           wwolfe+Pulsar@NotGmail.com</p></blockquote>
<p>Finally, I just need to restart sendmail using the new config.<br />
<code>sendmailconfig</code></p>
<h2>Testing</h2>
<p>Now, I am able to send an email to redmine@NotLlamabyte.com in the format:</p>
<blockquote><p>To: redmine@NotLlamabyte.com<br />
Subject: Issue Title</p>
<p>This is a new issue that overrides a few attributes</p>
<p>Project: myProjectIdentifier<br />
Tracker: Bug<br />
Priority: Urgent<br />
Status: New</p></blockquote>
<p>You can watch the sendmail log file and see that the incoming email is &#8220;sent&#8221; to the email script, and the issue will be created in redmine. If you are subscribed to that project&#8217;s issues, redmine will also send you an &#8220;issue created&#8221; email. If you respond to one of the &#8220;issue created&#8221; emails, the script will realize that and add your response as a note on that issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.llamabyte.com/2011/configure-redmine-to-receive-emails-with-sendmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My sendmail config</title>
		<link>http://www.llamabyte.com/2011/my-sendmail-config/</link>
		<comments>http://www.llamabyte.com/2011/my-sendmail-config/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 23:03:44 +0000</pubDate>
		<dc:creator>Howler</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.llamabyte.com/?p=114</guid>
		<description><![CDATA[This is a post that will try to document my sendmail configuration since I have spent a few days trying to make it work properly. I have setup sendmail such that email to [anything] @ llamabyte.com will forward to my personal gmail account. However an email sent to wwolfe @ pulsar.llamabyte.com will remain in my [...]]]></description>
			<content:encoded><![CDATA[<p>This is a post that will try to document my sendmail configuration since I have spent a few days trying to make it work properly.</p>
<p>I have setup sendmail such that email to [anything] @ llamabyte.com will forward to my personal gmail account. However an email sent to wwolfe @ pulsar.llamabyte.com will remain in my local mailbox.</p>
<h2><span id="more-114"></span></h2>
<h2>MX records</h2>
<p>First thing I had to do was set my MX record for my domain, so that any email server asking what server is handling mail, my server&#8217;s IP address will be given back.<br />
In ZoneEdit, this is done by going to the &#8220;Mail Servers (MX)&#8221; tab of your domain, and entering something like:<br />
<code>mail.llamabyte.com handles mail	[1st]	 for domain	llamabyte.com</code></p>
<p>In dig this looks like:</p>
<blockquote><p>wwolfe@Pulsar:~$ dig llamabyte.com mx<br />
; &lt;&lt;&gt;&gt; DiG 9.7.0-P1 &lt;&lt;&gt;&gt; llamabyte.com mx<br />
;; global options: +cmd<br />
;; Got answer:<br />
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 9596<br />
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0</p>
<p>;; QUESTION SECTION:<br />
;llamabyte.com.                 IN      MX</p>
<p>;; ANSWER SECTION:<br />
<span style="color: #ff0000;">llamabyte.com.          7200    IN      MX      0 mail.llamabyte.com.</span></p>
<p>;; Query time: 895 msec<br />
;; SERVER: 192.168.1.254#53(192.168.1.254)<br />
;; WHEN: Mon Mar 28 08:42:49 2011<br />
;; MSG SIZE  rcvd: 52</p></blockquote>
<h2>Hostname</h2>
<p>Next, I had to configure the hostname and domain name on Pulsar (my server).</p>
<p><code>/etc/hostname</code></p>
<blockquote><p>Pulsar</p></blockquote>
<p><code>/etc/hosts</code></p>
<blockquote><p>127.0.0.1       localhost.llamabyte.com localhost<br />
127.0.1.1       Pulsar.llamabyte.com Pulsar</p></blockquote>
<h2>Sendmail</h2>
<p>Next, I installed sendmail.</p>
<blockquote><p>apt-get install sendmail</p></blockquote>
<p>I used the sendmailconfig program to get the default settings (answer Y to everything,</p>
<blockquote><p>sendmailconfig</p></blockquote>
<p>Next, I modified the sendmail configuration files to do my bidding.</p>
<p>I needed to tell sendmail what server names for which it should handle the mail. I set it up to handle mail for llamabyte.com, localhost, pulsar, and pulsar.llamabyte.com.<br />
<code>/ect/mail/local-host-names</code></p>
<blockquote><p>localhost<br />
Pulsar<br />
llamabyte.com<br />
pulsar.llamabyte.com</p></blockquote>
<p>After that, I needed to allow sendmail to accept connections from the outside world. By default, it will only accept email sent from the local machine (security feature). I would like other people to be able to send email to the server.</p>
<p><code>/etc/mail/sendmail.mc</code><br />
I changed the line:</p>
<blockquote><p>DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp, Addr=127.0.0.1&#8242;)dnl</p></blockquote>
<p>To: (Removed the addr restriction)</p>
<blockquote><p>DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp&#8217;)dnl</p></blockquote>
<p>I also enabled the virtusertable feature, so that I can enable forwarding for separate accounts, and also to get a catchall for all email for unknown users.<br />
<code>/etc/mail/sendmail.mc</code></p>
<blockquote><p>FEATURE(`virtusertable&#8217;)dnl</p></blockquote>
<p>Now I edited the virtusers table to send emails wherever I would like. This setup will forward almost everything to my gmail account. I have censored this file slightly to try and prevent spam bots, but the concept should be clear.<br />
<code>/etc/mail/virtusertable</code></p>
<blockquote><p>wwolfe@pulsar.llamabyte.com     wwolfe<br />
wwolfe@llamabyte.com                   wwolfe+llamabyte@NotGmail.com<br />
@llamabyte.com                                 wwolfe+Llamabyte@NotGmail.com<br />
@pulsar.llamabyte.com                   wwolfe+Pulsar@NotGmail.com</p></blockquote>
<p>A quick note about the &#8220;+&#8221; syntax that I am using for my to addresses here. This is a way to &#8220;tag&#8221; an email. Basically, wwolfe+[anything] will get sent to wwolfe@, but the to address will remain the same. This allows me to identify the source a little quicker. I can write filters based on the To address to add labels, star, etc. Here&#8217;s the <a title="Wiki Email Address Tags" href="http://en.wikipedia.org/wiki/Email_address#Address_tags" target="_blank">Wiki</a> article about address tags, and a <a title="2 hidden ways to get more from your Gmail address" href="http://gmailblog.blogspot.com/2008/03/2-hidden-ways-to-get-more-from-your.html" target="_blank">GmailBlog </a>post about plus signs and periods in email addresses.</p>
<p>Now, I just need to reload the sendmail configuration. The easiest way is to just run <code>sendmailconfig</code></p>
<p>But, you can compile the files manually and then restart sendmail. The only files that need to be compiled are sendmail.mc (converts it to sendmail.cf), and virtusertable.<br />
<code>/etc/mail/sendmail.mc</code></p>
<blockquote><p>m4 /etc/mail/sendmail.mc &gt; /etc/mail/sendmail.cf</p>
<p>OR</p>
<p>make</p></blockquote>
<p><code>/etc/mail/virtusertable</code></p>
<blockquote><p>makemap hash /etc/mail/virtusertable &lt; /etc/mail/virtusertable</p></blockquote>
<p>Finally, restart sendmail</p>
<blockquote><p>sudo /etc/init.d/sendmail restart</p></blockquote>
<h2>Testing</h2>
<p>Some side notes about testing your server:<br />
if you tail the log, you will see emails come through.</p>
<blockquote><p>tail -f /var/log/mail.log</p></blockquote>
<p>When an email hits your server, you will see something like this in your mail.log:</p>
<blockquote><p>Mar 27 08:49:15 Pulsar sm-mta[30288]: p2RCnDK7030285: to=<br />
, delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=121906, relay=gmail-smtp-in.l.google.com. [74.125.95.27], dsn=2.0.0, stat=Sent (OK 1301230150 yd20si8417090icb.5)</p></blockquote>
<p>The Stat section shows you if it&#8217;s successful or not. <code>stat=Sent (OK 1301230150 yd20si8417090icb.5)</code> Means that it was successfully sent.</p>
<p>One word of caution that caused me to spend a LOT more time reconfiguring sendmail than I should have.<br />
If you send an email from a gmail account, and your server forwards it back to the same account, gmail will simply ignore it. Sendmail will say everything is fine, and it is. The email will get sent from the gmail account, but the reply will simply never show up.</p>
<p><strong>Test using two different email accounts!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.llamabyte.com/2011/my-sendmail-config/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DroidLockBox Build</title>
		<link>http://www.llamabyte.com/2011/droidlockbox-build/</link>
		<comments>http://www.llamabyte.com/2011/droidlockbox-build/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 21:43:13 +0000</pubDate>
		<dc:creator>Howler</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[droidlockbox]]></category>

		<guid isPermaLink="false">http://wordpress.llamabyte.com/?p=59</guid>
		<description><![CDATA[DroidLockBox Build Log This is my post about the technical details of building the box. Hopefully I will provide enough information for someone else to build their own, or gather some knowledge from my mistakes and triumphs. The Box When I was first looking for the box, I wanted a nice simple wooden box. Mahogany, perhaps; [...]]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: center;">DroidLockBox Build Log</h1>
<p>This is my post about the technical details of building the box. Hopefully I will provide enough information for someone else to build their own, or gather some knowledge from my mistakes and triumphs.</p>
<h2><span id="more-59"></span></h2>
<h2>The Box</h2>
<p>When I was first looking for the box, I wanted a nice simple wooden box. Mahogany, perhaps; like a simple jewelery box. Really my only size requirements were that I had to be able to fit a servo inside of it.  I couldn&#8217;t really find anything that was to my liking for less than $100. And, to be honest, I didn&#8217;t want to spend that much money just to tear up the box with a plan that I didn&#8217;t even know would work.  After some thinking and chatting with my co-workers, I decided to give a Cigar Humidor a shot. I stopped at a cigar shop on my way home from work. After describing my requirements, the gentleman said that I wouldn&#8217;t really find a humidor for less than $70 (I saw that one and I didn&#8217;t like it).  However, they had some  plain old Cigar boxes in which the cigars were shipped to them. After making sure that I understood that these boxes would do <strong>absolutely</strong> nothing to protect my cigars, I bought one for a whopping $2.  
<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/img_4939.jpg" title="" class="shutterset_singlepic1" >
	<img class="ngg-singlepic ngg-center" src="http://www.llamabyte.com/wp-content/gallery/cache/1__320x240_img_4939.jpg" alt="Original Cigar Box" title="Original Cigar Box" />
</a>
  Not bad. Size is about right at about 5in x 7in x 2in. The servo is about 1.75in tall, so that leaves me plenty of room for other hardware. If only that cigar logo wasn&#8217;t on the front.  
<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_5041.JPG" title="" class="shutterset_singlepic159" >
	<img class="ngg-singlepic" src="http://www.llamabyte.com/wp-content/gallery/cache/159__320x240_IMG_5041.JPG" alt="IMG_5041" title="IMG_5041" />
</a>
  I sanded the box down, and then re-painted it. I used some Valspar metallic spray paint, as well as Valspar clear coat. This came out pretty well. Next time I would use better paint. Perhaps an acrylic and using an air brush kit to paint it.</p>
<h2>The Lock</h2>
<p>Time to get the lock figured out.</p>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_4994.JPG" title="" class="shutterset_singlepic122" >
	<img class="ngg-singlepic ngg-left" src="http://www.llamabyte.com/wp-content/gallery/cache/122__320x240_IMG_4994.JPG" alt="IMG_4994" title="IMG_4994" />
</a>

<p>After going through a couple different types of locks, and how I could activate them using a servo; I ended up using a simple dead-bolt style. I put one &#8220;Lock&#8221; on each side of the box, using the circular motion of the servo to activate them both at the same time. There are two aluminum rods connected to the servo using a 1/16&#8243; (the size of the holes in the servo horn) pin and collar connectors to hold it. Each rod then go through an eye-bolt to keep it going straight as the servo horn turns.</p>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_4997.JPG" title="" class="shutterset_singlepic125" >
	<img class="ngg-singlepic ngg-right" src="http://www.llamabyte.com/wp-content/gallery/cache/125__320x240_IMG_4997.JPG" alt="IMG_4997" title="IMG_4997" />
</a>

<p>With the servo and eye bolts attached to the bottom of the box, all I needed to do was add something to the lid. I was planning on using an eye bolt on the lid as well, but decided on simple angle bracket instead. This way my lock didn&#8217;t have to be exact on where it would hit the lock hardware on the lid. The angle allows for some wiggle room, and the bottom eye bolt keeps it in line. Especially since lining up the eye bolt on the lid exactly in the right spot without being able to see it (lid is closed when in locked position) would be a challenge.</p>
<p>I ended up placing some heat shrink tubing on the angle bracket. This helped stop most of the metal-metal rattle of the lock hitting the angle bracket.</p>
<h2>The Design</h2>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_5052.JPG" title="" class="shutterset_singlepic166" >
	<img class="ngg-singlepic" src="http://www.llamabyte.com/wp-content/gallery/cache/166__320x240_IMG_5052.JPG" alt="IMG_5052" title="IMG_5052" />
</a>


<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_5053.JPG" title="" class="shutterset_singlepic167" >
	<img class="ngg-singlepic" src="http://www.llamabyte.com/wp-content/gallery/cache/167__320x240_IMG_5053.JPG" alt="IMG_5053" title="IMG_5053" />
</a>

<p>I decided that I should draw and measure everything, so that I would have a better idea on what size to cut everything. I wanted as few surprises as I could get. I happen to have a small notebook with grid lines, and it was the perfect size for a 1:1 representation of the box. I used this as a guide to figure out how long to make to rod for the lock, etc.</p>
<h2>The Electronics</h2>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/simplified-schematic.png" title="" class="shutterset_singlepic168" >
	<img class="ngg-singlepic ngg-center" src="http://www.llamabyte.com/wp-content/gallery/cache/168__320x240_simplified-schematic.png" alt="simplified-schematic" title="simplified-schematic" />
</a>

<p>I started with a simple power supply. I used a 7805 regulator to turn 7-20 volt input into 5volts. I am going to use a 9 volt battery inside the box for power. Though, out of paranoia, I also added a plug for an external power supply. I just had visions of the battery dying, and having my ring locked inside! I also added a power switch, so everything could be turned off to save power.</p>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_5006.JPG" title="" class="shutterset_singlepic134" >
	<img class="ngg-singlepic ngg-left" src="http://www.llamabyte.com/wp-content/gallery/cache/134__320x240_IMG_5006.JPG" alt="IMG_5006" title="IMG_5006" />
</a>

<p>I started to program an Atmel AVR microcontroller to use PWM (Pulse Width Modulation) to control the servo, and accept commands over a serial port. After I successfully got the servo motor working, I was confident enough to order some more parts from Sparkfun. The main thing that I ordered was the Bluetooth module. I ended up with the <a title="Sparkfun BlueSMiRF Silver" href="http://www.sparkfun.com/products/10269" target="_blank">BlueSMiRF Silver</a>. This little fellow creates a Bluetooth serial port which a device can use to send data across. Just to happens that my AVR was programmed to read serial data (what a coincidence)!</p>
<p>ATTiny 2313 source:</p>
<pre class="brush: cpp; collapse: true; light: false; title: ; toolbar: true; wrap-lines: false; notranslate">
#include &lt;stdio.h&gt;
#include &lt;avr/interrupt.h&gt;
#include &lt;util/delay.h&gt;
#include &quot;uart.h&quot;
#include &quot;defines.h&quot;
#include &quot;DroidLockBox.h&quot;

/*
*
*Read a character from the USART port
*/
char USARTReadChar()
{
 while ( !(UCSRA &amp; (1&lt;&lt;RXC)) );
 /* Get and return received data from buffer */
 return UDR;
}

/*
*
*Write a character to the USART port
*/
void USARTWriteChar(char data)
{
  while ( !( UCSRA &amp; (1&lt;&lt;UDRE)) )
  ;
  UDR = data;
}

int main()
{
 //Initialize everything
 TimerInit();
 uart_init();

 //Always start out locked.
 LockServo();

 SREG |= _BV(SREG_I);// enable global interrupts

 for(;;)
 {
   if(DEBUG)
   {
     //Debug mode!
     UnlockServo();
     delay_1s();
     delay_1s();
     delay_1s();
     delay_1s();
     delay_1s();
     LockServo();
     delay_1s();
     delay_1s();
     delay_1s();
     delay_1s();
     delay_1s();
   }
   else
   {
     //Wait for a USART character
     char input = USARTReadChar();
     USARTWriteChar(input);

     /*
     *  Serial read interrupt
     *
     * &quot;L&quot; = Lock servo
     *  &quot;U&quot; = Unlock servo
     *  &quot;S&quot; = Request status of lock
     *  &quot;I&quot; = Request information (version of firmware, BT connection, etc)
     */
     switch(input)
       {
         case 'L':
         LockServo();
         break;
       case 'U':
         UnlockServo();
         break;
       case 'I':
         PrintInfo();
         break;
       case 'C':
         OCR1A = 1500;
         break;
       case 'A':
         OCR1A = OCR1A + 10;
         break;
       case 'Z':
         OCR1A = OCR1A - 10;
         break;
       }
   }
 }
 return 0;    //If we reach here, the Universe has collasped!
}

void PrintInfo()
{
 USARTWriteChar('D');
 USARTWriteChar('r');
 USARTWriteChar('o');
 USARTWriteChar('i');
 USARTWriteChar('d');
 USARTWriteChar('L');
 USARTWriteChar('o');
 USARTWriteChar('c');
 USARTWriteChar('k');
 USARTWriteChar('B');
 USARTWriteChar('o');
 USARTWriteChar('x');
 USARTWriteChar(' ');
 USARTWriteChar('V');
 USARTWriteChar('e');
 USARTWriteChar('r');
 USARTWriteChar('s');
 USARTWriteChar('i');
 USARTWriteChar('o');
 USARTWriteChar('n');
 USARTWriteChar(' ');
 USARTWriteChar('1');
 USARTWriteChar('.');
 USARTWriteChar('0');
}
void LockServo()
{
 OCR1A = 1700;
}
void UnlockServo()
{
 //OCR1A = ICR1 * SERVO_UNLOCK_TIME / SERVO_PERIOD;
 //Ok, no floating point or division. Got a 300% reduction in size here...
 OCR1A=1080;
}

/*
 * Configure Timer1
 *  - Fast PWM
 *  - ICR1 is TOP
 */
void TimerInit()
{
 TCCR1A = 0;// disable all PWM on Timer1 whilst we set it up

 /*TOP = ([CPU Freq] / ([Prescaler] * [PWM freq])) - 1
   TOP = (8,000,000 / (8 * 50)) - 1 = 19,999
   ICR1 (Therefore TOP) is a 16-bit int. so, it needs to be 0-65,535
(This is how we choose the prescaler)
 */
 ICR1 = 19999;   // frequency is every 20ms

 // Configure timer 1 for Fast PWM mode via ICR1, with 8x prescaling
 TCCR1A = (1&lt;&lt;WGM11) | (1&lt;&lt;COM1A1); //WGM1[13-0] = 14 ; Clear PWN pin
on OCR1A match
 TCCR1B = (1 &lt;&lt; WGM13) | (1&lt;&lt;WGM12) | (1 &lt;&lt; CS11); //WGM1[13-0] = 14
; CS1[2:0] = 2 -- Timer clock = CPU/8
}

static void delay_1s()
{
 uint8_t i;
 for (i = 0; i &lt; 100; i++)
   _delay_ms(10);
}
/*
 * Initialize the UART to 9600 Bd, tx/rx, 8N1.
 */
void
uart_init(void)
{
  UCSRB |= _BV(TXEN) | _BV(RXEN); // enable xmit, recv &amp; recv interrupt
  UCSRC |= _BV(UCSZ1) | _BV(UCSZ0);// use 8-bit character size
  UBRRH = 0;
  UBRRL = 51;// set 9600 baud with a 8MHz clock
}
</pre>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_5003.JPG" title="" class="shutterset_singlepic131" >
	<img class="ngg-singlepic ngg-right" src="http://www.llamabyte.com/wp-content/gallery/cache/131__320x240_IMG_5003.JPG" alt="IMG_5003" title="IMG_5003" />
</a>

<p>Alright, well&#8230;truth be told, this was my third bluetooth module from Sparkfun. Moral of the story: if a chip says it has a max of 3.3v, don&#8217;t send it 5v. It will work for a few minutes and get your hopes up, then stop working to leave you wondering. Oh, and the second module? Definitely don&#8217;t send the module 13v! It lets out the <a title="Magic Smoke" href="http://en.wikipedia.org/wiki/Magic_smoke" target="_blank">Magic Smoke</a>, and will never work again. You know&#8230;so I&#8217;ve heard; I certainly would have learned from the first time and triple check the voltage levels.</p>
<h2>Putting it all together</h2>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_4976.JPG" title="" class="shutterset_singlepic107" >
	<img class="ngg-singlepic ngg-left" src="http://www.llamabyte.com/wp-content/gallery/cache/107__320x240_IMG_4976.JPG" alt="IMG_4976" title="IMG_4976" />
</a>

<p>I connected the BlueSMiRF to the AVR board, and the servo to the AVR board. After a little tweaking of the AVR code, everything was working!</p>
<p>Now that I know it is going to work, I start mounting everything in the box.</p>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_5010.JPG" title="" class="shutterset_singlepic138" >
	<img class="ngg-singlepic ngg-right" src="http://www.llamabyte.com/wp-content/gallery/cache/138__320x240_IMG_5010.JPG" alt="IMG_5010" title="IMG_5010" />
</a>

<p>I drill a hole in the back of the box for the power switch and drill/dremel out a hole for the power plug. I screw the servo down in the middle of the box. Blocks of wood for the eye hooks on either side of the servo. I glued some extra blocks of wood to the lid of the box, so that I have some room to mount the angle brackets. Screw in the eye hooks, and attach the locking rods to the servo.</p>
<p>I mount the small pcb boards using some double stick tape. If I were to do it again, I would put mounting holes in the board, and screw them into the box bottom (using spacers). I connected everything together using some jumper cables. Plugged in a 9 volt battery and powered it up.</p>
<h2>Android App</h2>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/droidlockbox-main-screen.png" title="" class="shutterset_singlepic169" >
	<img class="ngg-singlepic ngg-left" src="http://www.llamabyte.com/wp-content/gallery/cache/169__320x240_droidlockbox-main-screen.png" alt="droidlockbox-main-screen" title="droidlockbox-main-screen" />
</a>

<p>I wrote a very simple android app. It contained &#8220;Lock&#8221;, &#8220;Unlock&#8221;, and &#8220;Connection Info&#8221; buttons.</p>
<p>The app used the built-in Bluetooth of the phone to connect to the BlueSMiRF module.</p>
<p>If the Lock button was pressed, the app would send an &#8220;L&#8221; command to the box, putting the servo into the locked position.</p>
<p>If the Unlock button was pressed, the app would check the current GPS location. If it was within 100 meters of our first date location (see my <a title="DroidLockBox" href="http://www.llamabyte.com/2011/droidlockbox/" target="_self">DroidLockBox </a>post), it would send a &#8220;U&#8221; command to unlock the box. After the initial unlock, the app remembers and allows unrestricted locking and unlocking. However, in the current version of the code, I have removed the location check. This is rather trivial to do in Android, so I decided to simplify the code a bit.</p>
<p>And, the info button just sent an &#8220;I&#8221; to get the version of the box. This was more of a connection test than anything else.</p>
<p>Android Source: <a href="http://www.llamabyte.com/wp-content/uploads/2011/02/Android-Source.zip">Android Source</a></p>
<p>Git repository of the whole project:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
git clone git://www.llamabyte.com/DroidLockBox.git
</pre>
<h2>Feedback</h2>
<p>This was my first Build Log post. Please leave me some feedback on it. As, I&#8217;m sure I will write more as I work on more projects. Was it too long, too short, have enough pictures? Anything would be helpful.</p>
<p>Thanks for reading!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.llamabyte.com/2011/droidlockbox-build/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DroidLockBox</title>
		<link>http://www.llamabyte.com/2011/droidlockbox/</link>
		<comments>http://www.llamabyte.com/2011/droidlockbox/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 06:10:23 +0000</pubDate>
		<dc:creator>Howler</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[droidlockbox]]></category>
		<category><![CDATA[Project]]></category>

		<guid isPermaLink="false">http://wordpress.llamabyte.com/?p=31</guid>
		<description><![CDATA[DroidLockBox What is it? The DroidLockBox is a small wooden box that locks and unlocks using an application running on an android based cellphone. Why? Well, there are a few reasons why I chose to build this box. First and foremost, I wanted a fun and unique (read: geeky) means of proposing to my (now) fiancée, [...]]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: center;">DroidLockBox</h1>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_5041.JPG" title="" class="shutterset_singlepic159" >
	<img class="ngg-singlepic ngg-center" src="http://www.llamabyte.com/wp-content/gallery/cache/159__320x240_IMG_5041.JPG" alt="IMG_5041" title="IMG_5041" />
</a>

<h2>What is it?</h2>
<p>The DroidLockBox is a small wooden box that locks and unlocks using an application running on an android based cellphone.</p>
<h2>Why?</h2>
<p>Well, there are a few reasons why I chose to build this box. First and foremost, I wanted a fun and unique (read: geeky) means of proposing to my (now) fiancée, Heather.</p>
<p>I had read ﻿﻿<a title="The Reverse Geocache Puzzle" href="http://arduiniana.org/projects/the-reverse-geo-cache-puzzle/" target="_blank">The Reverse Geocache Puzzle</a> story awhile back and thought it was a fantastic idea. As I was thinking about a creative way to propose, this Reverse Geocache puzzle came to my mind. I thought to myself, &#8220;Hey, self, you might be able to do something similar.&#8221;</p>
<p>And, of course, the other reason I wanted to build it: To see if I could.</p>
<h2><span id="more-31"></span></h2>
<h2>How does it work?</h2>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_4998.JPG" title="" class="shutterset_singlepic126" >
	<img class="ngg-singlepic ngg-left" src="http://www.llamabyte.com/wp-content/gallery/cache/126__320x240_IMG_4998.JPG" alt="Locking mechanism" title="Locking mechanism" />
</a>

<p>Inside the box, there is a servo motor that slides two bolts through eyebolts. One eye attached to the top and one attached to the bottom of the box. When the servo is in the Locked position, the bolt is slid through both top and bottom locks, and the box will not open.</p>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_5011.JPG" title="" class="shutterset_singlepic139" >
	<img class="ngg-singlepic ngg-right" src="http://www.llamabyte.com/wp-content/gallery/cache/139__320x240_IMG_5011.JPG" alt="Inside of box" title="Inside of box" />
</a>

<p>The servo is connected to an <a title="ATTiny 2313" href="http://www.sparkfun.com/products/212">Atmel ATtiny 2313</a>, which is also connected to a <a title="BlueSMiRF Silver" href="http://www.sparkfun.com/products/10269" target="_blank">Bluetooth module</a>.  When a device (such as a cellphone) connects to the Bluetooth module, and sends the correct command, the servo will move into either the lock, or unlock position.</p>
<p>I wrote an Android application for Heather&#8217;s phone that will connect to the box and send out the unlock command when she was in the correct location. I wanted to make more of a scavenger hunt app, but I was a little pressed for time.</p>
<p>For detailed information on the inner workings of the box, please read my build log post.</p>
<h2>Mission Accomplished?</h2>
<p>Short answer: Yes.</p>
<p>Long answer:</p>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/img_5046.jpg" title="" class="shutterset_singlepic155" >
	<img class="ngg-singlepic ngg-left" src="http://www.llamabyte.com/wp-content/gallery/cache/155__320x240_img_5046.jpg" alt="Box with ring inside" title="Box with ring inside" />
</a>

<p>I made an insert to go into the box out of black foam board. This is intended to hide some of the circuitry and wires. Then, I wrapped the foam board in some felt material. I wanted to give the ring a nice soft place to live, and also make it pop, with everything around it being black.</p>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/IMG_5027.JPG" title="" class="shutterset_singlepic150" >
	<img class="ngg-singlepic ngg-right" src="http://www.llamabyte.com/wp-content/gallery/cache/150__320x240_IMG_5027.JPG" alt="Wrapping the box" title="Wrapping the box" />
</a>

<p>I finished the box up late Christmas eve. I placed the ring inside, and locked the box. I was pretty nervous about this part, as there were visions of the ring being locked inside for all eternity going through my head. I wrapped it as a Christmas present (Remember when I said I was pressed for time?). I wrote a card with &#8220;directions&#8221; for the box. These directions were that Heather was to turn on the box (switch on the back), and to run the DroidLockBox app on her phone. I was able to install the app without her knowing it (she was napping <img src='http://www.llamabyte.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).</p>
<p>Christmas morning, we open our gifts. It was a good morning. She unwrapped the box, and promptly complained that I had &#8220;painted it shut.&#8221; I reminded her that she should read the card. After reading the card, she ran the app on her phone. When she pressed the &#8220;unlock&#8221; button, a toast came up and said, &#8220;You are 14,042 meters away from the correct location. Unlock is disabled.&#8221; This was all the direction that I gave her. No other hints.</p>
<p>In her excitement, and wanting to know what was in the box, she asked me &#8220;Do I need to go upstairs for this to work?&#8221; After giving her that &#8220;Really? Really?&#8221; look, she asked if she needed to go outside instead. After she calmed down a little bit, she actually realized that it said ~14,000 meters, and that was further away than our backyard.</p>
<p>So, we were off on our adventure to unlock the box&#8230;.almost.</p>
<p>First, we needed to go to her parents house to have the family Christmas. However, as we are driving to her parents house, the distance from the correct location was going down. So, we were at least heading in the correct direction. After the family Christmas, it was decided that we would try to get the box open. So Heather, myself, and Regan (Heather&#8217;s daughter) started traveling in the direction that led us closer to the correct location.</p>
<p>After a few wrong turns that lead the distance to going back up, Heather narrowed down the location to be the local Mall. So, we pulled in to the theater at the mall. Everything worked out pretty well, since the theater was just about the only place open on Christmas day. And, this particular theater just happened to be the location of our first date. After the fact, she told me that she thought I had put movie tickets in the box, and we were all going to see a movie. She didn&#8217;t expect a ring at all.</p>

<a href="http://www.llamabyte.com/wp-content/gallery/droidlockbox/proposal-2.jpg" title="" class="shutterset_singlepic157" >
	<img class="ngg-singlepic ngg-left" src="http://www.llamabyte.com/wp-content/gallery/cache/157__320x240_proposal-2.jpg" alt="proposal-2" title="proposal-2" />
</a>

<p>I suggested that we get out of the car and walk around (since the app said that we were under 100 meters from the correct location). We got out, and walked a little closer to the theater entrance. She tried the unlock button once more, and&#8230; Success! The box unlocks properly. She opens the box, and I get down on one knee (in the middle of the parking lot), and proposed to her.  She started to cry, and managed to nod her head.</p>
<p>So, Heather and I are now engaged to be married.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.llamabyte.com/2011/droidlockbox/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.llamabyte.com/2011/hello-world/</link>
		<comments>http://www.llamabyte.com/2011/hello-world/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 15:48:40 +0000</pubDate>
		<dc:creator>Howler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wordpress.llamabyte.com/?p=1</guid>
		<description><![CDATA[I just installed WordPress and I plan on using it for my whole website. Still getting used to a few things, but so far so good. Found a nice theme that I like, and a couple neat plugins that should help keep the site nice a tidy.]]></description>
			<content:encoded><![CDATA[<p>I just installed WordPress and I plan on using it for my whole website. Still getting used to a few things, but so far so good.</p>
<p>Found a nice theme that I like, and a couple neat plugins that should help keep the site nice a tidy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.llamabyte.com/2011/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

