<?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>Tech Notes</title>
	<atom:link href="http://www.ryannitz.org/tech-notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ryannitz.org/tech-notes</link>
	<description>Miscellaneous technology examples and notes</description>
	<lastBuildDate>Sun, 03 Apr 2011 16:48:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<image>
  <link>http://www.ryannitz.org/tech-notes</link>
  <url>http://ryan-nitz/favicon.ico</url>
  <title>Tech Notes</title>
</image>
		<item>
		<title>MongoDB Wildcard Query</title>
		<link>http://www.ryannitz.org/tech-notes/2009/08/10/mongodb-wildcard-query/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/08/10/mongodb-wildcard-query/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 18:29:58 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://ryan-nitz.com/tech-notes/?p=211</guid>
		<description><![CDATA[MongoDB uses regex in certain parts of their query syntax. The following is an example of how to perform a wildcard query: db.collectionName.find( { fieldName : /.*cnn.*/ } ); This example searches the collection for all documents with a field that contains, &#8220;%cnn%&#8221;. Of course in your query you need to replace &#8220;collectionName&#8221; with the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-189" title="icon" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2009/07/icon.png" alt="icon" width="42" height="42" /></p>
<p><a href="http://www.mongodb.org/" target="_blank">MongoDB</a> uses <a href="http://en.wikipedia.org/wiki/Regular_expression" target="_blank">regex</a> in certain parts of their query syntax. The following is an example of how to perform a wildcard query:</p>
<pre>db.collectionName.find( { fieldName : /.*cnn.*/ } );</pre>
<p>This example searches the collection for all documents with a field that contains, &#8220;%cnn%&#8221;. Of course in your query you need to replace &#8220;collectionName&#8221; with the name of your collection and &#8220;fieldName&#8221; with the field you are interested in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/08/10/mongodb-wildcard-query/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create Amazon EC2 AMI</title>
		<link>http://www.ryannitz.org/tech-notes/2009/08/09/create-amazon-ec2-ami/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/08/09/create-amazon-ec2-ami/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 19:36:10 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[EC2]]></category>

		<guid isPermaLink="false">http://ryan-nitz.com/tech-notes/?p=202</guid>
		<description><![CDATA[Creating an Amazon EC2 AMI from an existing image seems like a challenging process however, it is actually fairly simple. Before looking at the steps to create the image, first have the following AWS information/files handy: Access key Secret Key Account Number Private key (e.g., pk-37BKCPZ2AVHVSYBK2WZXUQ9D4GQZEB4Q.pem) Certificate (e.g., cert-38BKCPZ1BOHVSYBK4WZXUQ4D4GQZEB2Q.pem) Next, login to your instance and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-92" title="aws" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2008/12/aws.gif" alt="aws" width="150" height="60" /></p>
<p>Creating an Amazon EC2 AMI from an existing image seems like a challenging process however, it is actually fairly simple. Before looking at the steps to create the image, first have the following AWS information/files handy:</p>
<ul>
<li>Access key</li>
<li>Secret Key</li>
<li>Account Number</li>
<li>Private key (e.g., pk-37BKCPZ2AVHVSYBK2WZXUQ9D4GQZEB4Q.pem)</li>
<li>Certificate (e.g., cert-38BKCPZ1BOHVSYBK4WZXUQ4D4GQZEB2Q.pem)</li>
</ul>
<p>Next, login to your instance and make sure you have the <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=368" target="_blank">Amazon AMI</a> and <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351&amp;categoryID=88" target="_blank">EC2 API</a> tools installed and available in your PATH. Also, upload your private key and certificate to the server.</p>
<p>Now you are ready to create your image file. First create a directory to store this image in.</p>
<p>E.g.</p>
<pre>mkdir /mnt/ami</pre>
<p>The actual AMI bundle is created by running:</p>
<pre>ec2-bundle-vol -d /mnt/ami -k YOUR_PRIVATE_KEY -c YOUR_CERTIFICATE -u YOUR_ACCOUNT_NUMBER</pre>
<p><strong>note:</strong> The account number should not contain any dashes (&#8216;-&#8217;).</p>
<p>Creating the bundle takes a few minutes. After the bundle has been created, it is time to upload it to S3. This is done by running:</p>
<pre>ec2-upload-bundle -b YOUR_BUNDLE_NAME -m /mnt/ami/image.manifest.xml -a YOUR_ACCESS_KEY -s YOUR_SECRET_KEY</pre>
<p>This walks through the files generated by the bundle command and inserts them into S3.</p>
<p>After your files have been uploaded, it is time to register the AMI using the following command:</p>
<pre>ec2-register YOUR_BUNDLE_NAME/image.manifest.xml</pre>
<p>The result of running this command is your AMI id.</p>
<p>E.g.</p>
<pre>ami-323FEA</pre>
<p>Finally, your AMI has been created, uploaded and registered and you are able to launch a new instance of your AMI.</p>
<p>If you need more help, there is <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=938" target="_blank">a good video</a> available from an Amazon employee. Additionally, take a look at the <a href="http://docs.amazonwebservices.com/AmazonEC2/dg/2006-06-26/bundling-an-ami.html" target="_blank">Amazon docs</a> on the subject.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/08/09/create-amazon-ec2-ami/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Ignore Untracked Files</title>
		<link>http://www.ryannitz.org/tech-notes/2009/08/04/git-ignore-untracked-files/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/08/04/git-ignore-untracked-files/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 00:47:24 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://ryan-nitz.com/tech-notes/?p=195</guid>
		<description><![CDATA[If you do not want to see Git messages about build directories or miscellaneous scratch files then add them to your .gitignore file. To do so, create the file, add the directories/files and then add the file to git. E.g. touch .gitignore Edit the file to suit your needs and then add/commit. git add .gitignore [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-145" title="git-logo" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2009/02/git-logo.png" alt="git-logo" width="73" height="28" /></p>
<p>If you do not want to see Git messages about build directories or miscellaneous scratch files then add them to your .gitignore file. To do so, create the file, add the directories/files and then add the file to git.</p>
<p>E.g.</p>
<pre>touch .gitignore</pre>
<p>Edit the file to suit your needs and then add/commit.</p>
<pre>git add .gitignore
git commit .gitignore
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/08/04/git-ignore-untracked-files/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MongoDB &#8211; Find Documents Missing Fields</title>
		<link>http://www.ryannitz.org/tech-notes/2009/07/29/monogodb-document-missing-field/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/07/29/monogodb-document-missing-field/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 17:59:10 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://ryan-nitz.com/tech-notes/?p=188</guid>
		<description><![CDATA[In MongoDB it is possible that some documents will not contain fields other documents have. The following code shows how to find these documents using the mongo shell. db.collectionName.find("function() { return this.fieldName == null }") db.collectionName.find("function() { return this.fieldName == null }").count() The second example shows how to only get the count. In this example. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-189" title="icon" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2009/07/icon.png" alt="icon" width="42" height="42" /></p>
<p>In <a href="http://www.mongodb.org/" target="_blank">MongoDB</a> it is possible that some documents will not contain fields other documents have. The following code shows how to find these documents using the mongo shell.</p>
<pre>db.collectionName.find("function() { return this.fieldName == null }")
db.collectionName.find("function() { return this.fieldName == null }").count()</pre>
<p>The second example shows how to only get the count.</p>
<p>In this example. you would replace &#8220;collectionName&#8221; with the name of the collection you are interested in querying. Additionally, you would change &#8220;fieldName&#8221; to the name of the field that interests you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/07/29/monogodb-document-missing-field/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Push a Branch to Git</title>
		<link>http://www.ryannitz.org/tech-notes/2009/07/14/push-a-branch-to-git/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/07/14/push-a-branch-to-git/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 01:41:02 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://ryan-nitz.com/tech-notes/?p=183</guid>
		<description><![CDATA[I found this example of how to push a branch to Git in the GitHub documentation. git push &#60;remote_repository_name&#62; &#60;branch_name&#62; E.g. git push origin master Execute this from the base of your local repository. This pushes your local commits to the TOT.]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-145" title="git-logo" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2009/02/git-logo.png" alt="git-logo" width="73" height="28" /></p>
<p>I found this example of how to push a branch to Git in the <a href="http://github.com/guides/push-a-branch-to-github" target="_blank">GitHub documentation</a>.</p>
<pre><code>git push &lt;remote_repository_name&gt; &lt;branch_name&gt;</code></pre>
<p>E.g.</p>
<pre><code>git push origin master</code></pre>
<p>Execute this from the base of your local repository. This pushes your local commits to the TOT.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/07/14/push-a-branch-to-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chkconfig Notes</title>
		<link>http://www.ryannitz.org/tech-notes/2009/07/10/chkconfig-notes/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/07/10/chkconfig-notes/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 02:26:32 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[chkconfig]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://ryan-nitz.com/tech-notes/?p=175</guid>
		<description><![CDATA[Chkconfig is a simple utility available on Linux that allows you to register services to start/stop on bootup and shutdown. The following are the basic commands you need to know to get things going: chkconfig --list (lists all the commands that are registered) chkconfig --add httpd (add httpd to the chkconfig list) chkconfig  --level 35 [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-42" title="linux" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2008/08/linux.jpeg" alt="linux" width="113" height="124" /></p>
<p><a href="http://linuxcommand.org/man_pages/chkconfig8.html" target="_blank">Chkconfig</a> is a simple utility available on Linux that allows you to register services to start/stop on bootup and shutdown. The following are the basic commands you need to know to get things going:</p>
<pre>chkconfig --list (lists all the commands that are registered)
chkconfig --add httpd (add httpd to the chkconfig list)
chkconfig  --level 35 httpd on (enables the httpd daemon to start on <a href="http://en.wikipedia.org/wiki/Runlevel" target="_blank">runlevels</a> 3 and 5)
chkconfig --level 35 mysqld on (enables the mysqld daemon to start on runlevels 3 and 5)
chkconfig --level 35 memcached on (enables the memcached daemon to start on runlevels 3 and 5)
chkconfig --level 2345 sendmail on (enabled the sendmail daemon to start on runlevels 2, 3, 4 and 5)</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/07/10/chkconfig-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Explorer 6 On OS X</title>
		<link>http://www.ryannitz.org/tech-notes/2009/07/05/internet-explorer-6-os-x/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/07/05/internet-explorer-6-os-x/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 09:51:55 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Darwine]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[ie4osx]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Wine]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=165</guid>
		<description><![CDATA[Recently, the need arose to run IE 6 on OS X. Microsoft released IE for OS X but discontinued support in version 5.x. Fortunately, this problem has been solved by running a IE 6 on top of a Wine port on OS X. The simple steps below describe how to get this running: Download and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ryannitz.org/tech-notes/wp-content/uploads/2009/07/ies4osx_256.png"><img class="alignnone size-thumbnail wp-image-167" title="ies4osx_256" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2009/07/ies4osx_256-150x150.png" alt="" width="150" height="150" /></a></p>
<p>Recently, the need arose to run <a href="http://en.wikipedia.org/wiki/Internet_Explorer_6" target="_blank">IE 6</a> on OS X. Microsoft released IE for OS X but discontinued support in version 5.x. Fortunately, this problem has been solved by running a IE 6 on top of a <a href="http://en.wikipedia.org/wiki/Wine_(software)" target="_blank">Wine</a> port on OS X. The simple steps below describe how to get this running:</p>
<ul>
<li>Download and install <a href="http://www.kronenberg.org/darwine/" target="_blank">Darwine</a></li>
<li>Download and install <a href="http://www.kronenberg.org/ies4osx/" target="_blank">ie4osx</a></li>
</ul>
<p>It is as simple as that!</p>
<p><strong>Note:</strong> Darwine requires the <a href="http://en.wikipedia.org/wiki/X_Window_System" target="_blank">X11</a> libraries that come with OS X (not installed by default but ships with the OS X install disks).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/07/05/internet-explorer-6-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OS X &#8211; Remove Glass Dock</title>
		<link>http://www.ryannitz.org/tech-notes/2009/06/05/os-x-remove-glass-dock/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/06/05/os-x-remove-glass-dock/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 18:12:14 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Config]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[dock]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=160</guid>
		<description><![CDATA[When running OS X Leopard, many people are annoyed by the glass dock provided by default. There are several applications that can be downloaded to remove this but we found a very easy way of removing the glass dock. In a shell type: defaults write com.apple.dock no-glass -boolean YES Next, it is time to remove [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-137" title="apple_logo" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2009/02/apple_logo.jpg" alt="apple_logo" width="128" height="150" /></p>
<p>When running <a href="http://en.wikipedia.org/wiki/Mac_OS_X_v10.5" target="_blank">OS X Leopard</a>, many people are annoyed by the glass <a href="http://en.wikipedia.org/wiki/Mac_OS_X_Dock" target="_blank">dock</a> provided by default. There are several applications that can be downloaded to remove this but we found a very easy way of removing the glass dock. In a shell type:</p>
<pre>defaults write com.apple.dock no-glass -boolean YES</pre>
<p>Next, it is time to remove a couple of files. Type the following:</p>
<pre>cd /System/Library/CoreServices/Dock.app/Contents/Resources</pre>
<p>Delete the glass dock images by typing:</p>
<pre>sudo rm -Rf bottom*.png</pre>
<p>Now it is time to restart your dock:</p>
<pre>killall Dock</pre>
<p>That is all!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/06/05/os-x-remove-glass-dock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash &#8211; Write A Sequential For Loop</title>
		<link>http://www.ryannitz.org/tech-notes/2009/03/30/bash-for-loop/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/03/30/bash-for-loop/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 02:10:36 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=156</guid>
		<description><![CDATA[A sequential for loop in bash script is accomplished in the following example: for i in {1..100} do # Do something here echo "${i}" done This example iterates from 1 to 100 (inclusive) and prints the index number. Note: This only works in modern versions of bash (3.x+).]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-157" title="bashterm" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2009/03/bashterm.png" alt="bashterm" width="180" height="100" /></p>
<p>A sequential <em>for</em> loop in bash script is accomplished in the following example:</p>
<pre>for i in {1..100}
do
    # Do something here
    echo "${i}"
done</pre>
<p>This example iterates from 1 to 100 (inclusive) and prints the index number.</p>
<p>Note: This only works in modern versions of <a href="http://en.wikipedia.org/wiki/Bash" target="_blank">bash</a> (3.x+).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/03/30/bash-for-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OS X &#8211; Empty Trash Command Line</title>
		<link>http://www.ryannitz.org/tech-notes/2009/03/23/os-x-empty-trash-command-line/</link>
		<comments>http://www.ryannitz.org/tech-notes/2009/03/23/os-x-empty-trash-command-line/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 13:35:10 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://leisuremech.com/?p=152</guid>
		<description><![CDATA[It is possible to empty the trash in OS X from the command line by running the following command in the terminal: rm -Rf ~/.Trash/* This command permanently removes all the files you have placed in your OS X trash bin.]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-153" title="apple-logo" src="http://www.ryannitz.org/tech-notes/wp-content/uploads/2009/03/apple-logo.jpg" alt="apple-logo" width="80" height="93" /></p>
<p>It is possible to empty the trash in OS X from the command line by running the following command in the terminal:</p>
<pre>rm -Rf ~/.Trash/*</pre>
<p>This command <em>permanently</em> removes all the files you have placed in your OS X trash bin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannitz.org/tech-notes/2009/03/23/os-x-empty-trash-command-line/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

