<?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>Cory Collier &#187; tutorial</title>
	<atom:link href="http://corycollier.com/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://corycollier.com</link>
	<description>Web Developer and System Administrator in Orlando, FL</description>
	<lastBuildDate>Fri, 02 Dec 2011 04:10:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Linux Deployment Scripts</title>
		<link>http://corycollier.com/2011/04/linux-deployment-scripts/</link>
		<comments>http://corycollier.com/2011/04/linux-deployment-scripts/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 18:07:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://corycollier.com/?p=627</guid>
		<description><![CDATA[A common issue in web development is getting new code to production environments. Nobody wants their site down for long, and depending on who you are a long time could be seconds or less. If you&#8217;re production environment is running a versioned instance of your code, updating that environment is as simple as using your [...]]]></description>
			<content:encoded><![CDATA[<p>A common issue in web development is getting new code to production environments. Nobody wants their site down for long, and depending on who you are a long time could be seconds or less. If you&#8217;re production environment is running a versioned instance of your code, updating that environment is as simple as using your version control. If your moving to a new location however, this isn&#8217;t the case.</p>
<p>So if you&#8217;re moving your production environment, or even just adding another server to your production environment, bash scripts will be of great help to you. The reason for scripting out your deployment is simple: reproducibility. Don&#8217;t take chances migrating a live environment manually. Deployment scripts are testable and version-able.</p>
<p>WARNING: This isn&#8217;t a tutorial on bash-scripting. I presume you already know at least some of the basics.</p>
<p>The strategy of this script is simple: Setup all of the variables up front, then execute the following:</p>
<ol>
<li>Checkout all code into a holding folder (servername.hold)</li>
<li>Switch to the appropriate version of code (git checkout tags/release-0.1)</li>
<li>Create any necessary folders that are not versioned (like cache and log folders)</li>
<li>Apply any necessary ownership/permissions (apache, 0700)</li>
<li>Move the folder from the holding location, to the operating location</li>
</ol>
<style>
code {font-size:0.9em;}
.code-comment { color: #aaa; }
.code-string {color: #c00; }
.code-variable {color: #c0c; }
.code-keyword {color: #0cc; }</p>
</style>
<p>The strategy is simple enough in fact, that you could have multiple site deployment scripts that merely setup the variables for use with the same operational script. Anyways, here&#8217;s an example of how to get this done.<br />
<code><br />
<span class="code-comment">#!/bin/bash</span></p>
<p><span class="code-comment">###########################################################</span><br />
<span class="code-comment"># Setup section of code. Setup necessary values for use in operational section of code</span><br />
<span class="code-comment">###########################################################</span></p>
<p><span class="code-comment">#establish some base values for what the server name is and where to check it out at</span><br />
<span class="code-keyword">SERVER</span>="<span class="code-string">awesome.com</span>"<br />
<span class="code-keyword">PROD_LOCATION</span>="<span class="code-string">/var/www/html/<span class="code-variable">$SERVER</span></span>"<br />
<span class="code-keyword">HOLD_LOCATION</span>="<span class="code-string">/var/www/html/<span class="code-variable">$SERVER</span><span class="code-string">.hold</span>"</p>
<p><span class="code-comment">#establish base values for app and lib git repositories</span><br />
<span class="code-keyword">GIT_REPO_URL</span>="<span class="code-string">git@awesome.com</span>"<br />
<span class="code-keyword">GIT_APP_REPO</span>="<span class="code-string">awesome.git</span>"<br />
<span class="code-keyword">GIT_LIB_REPO</span>="<span class="code-string">awesome-library.git</span>"<br />
<span class="code-keyword">GIT_APP_BRANCH</span>="<span class="code-string">tags/release-1.0</span>"<br />
<span class="code-keyword">GIT_LIB_BRANCH</span>="<span class="code-string">tags/releases-1.0</span>"</p>
<p><span class="code-comment"># create a list of folders that will be used for apache access</span><br />
<span class="code-keyword">FOLDERS</span>="<span class="code-variable">$HOLD_LOCATION</span><span class="code-string">/app/var/log</span><br />
<span class="code-variable">$HOLD_LOCATION</span><span class="code-string">/app/var/cache</span><br />
<span class="code-variable">$HOLD_LOCATION</span><span class="code-string">/app/var/backup</span>"</p>
<p><span class="code-comment">###########################################################</span><br />
<span class="code-comment"># Operational section of code. Modify at your own risk</span><br />
<span class="code-comment">###########################################################</span></p>
<p><span class="code-comment"># echo some information for the user to see what's going on</span><br />
echo<br />
echo "<span class="code-string">DEPLOYMENT SCRIPT:</span> <span class="code-variable">$0</span>"<br />
echo</p>
<p><span class="code-comment"># if the folder already exists, then stop. We won't be able to checkout if the folder already exists </span><br />
if [ -e <span class="code-variable">$HOLD_LOCATION</span> ];<br />
then<br />
    echo "<span class="code-string">Folder already exists</span>"<br />
    exit<br />
fi</p>
<p><span class="code-comment"># echo the results of checking out the application code, and switching to the release tag</span><br />
echo <span class="code-variable">`git clone $GIT_REPO_URL:$GIT_APP_REPO $HOLD_LOCATION`</span><br />
cd <span class="code-variable">$HOLD_LOCATION</span><br />
echo <span class="code-variable">`git checkout $GIT_APP_BRANCH`</span><br />
echo</p>
<p><span class="code-comment"># echo the results of checking out the library code, and switching to it's release tag</span><br />
echo <span class="code-variable">`git clone $GIT_REPO_URL:$GIT_LIB_REPO $HOLD_LOCATION/lib`</span><br />
cd <span class="code-variable">$HOLD_LOCATION</span>"<span class="code-string">/lib"<br />
echo <span class="code-variable">`git checkout $GIT_LIB_BRANCH`</span><br />
echo</p>
<p><span class="code-comment"># iterate over the folders creating them, then assigning them to apache</span><br />
for folder in <span class="code-variable">$FOLDERS</span>;<br />
do<br />
    <span class="code-comment"># output what directory is currently being operated upon</span><br />
    echo "<span class="code-variable">$folder</span>"<br />
    mkdir "<span class="code-variable">$folder</span>"<br />
    chown -R apache: "<span class="code-variable">$folder</span>"<br />
    chmod -R <span class="code-string">0700</span> "<span class="code-variable">$folder</span>"<br />
    echo<br />
done</p>
<p><span class="code-comment">#move the files from the holding area, to the actual area</span><br />
echo <span class="code-variable">`mv $HOLD_LOCATION $PROD_LOCATION`</span><br />
</code></p>
<p>As you can see, everything from the operational section down is basically plug and play. The variables are set, and it&#8217;s off to the races. Note that the library repository is just something that&#8217;s common for what I typically deal with. That may not apply to your situation. This script shouldn&#8217;t serve as the definition of what a production deployment script should be. Rather, this is just an example of one that&#8217;s been quite helpful to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://corycollier.com/2011/04/linux-deployment-scripts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Check For Valid Email With Telnet</title>
		<link>http://corycollier.com/2008/05/check-for-valid-email-with-telnet/</link>
		<comments>http://corycollier.com/2008/05/check-for-valid-email-with-telnet/#comments</comments>
		<pubDate>Thu, 22 May 2008 01:58:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[telnet]]></category>
		<category><![CDATA[validate]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://corycollier.com/?p=64</guid>
		<description><![CDATA[Often, I get asked by folks why an e-mail didn&#8217;t reach someone. People get an email that has some cryptic message about why their email didn&#8217;t reach it&#8217;s intended recipient. While there are an untold number of reasons as to why that could happen, there are a few things you can do to narrow down [...]]]></description>
			<content:encoded><![CDATA[<p>Often, I get asked by folks why an <a href="http://corycollier.com/2008/05/google-saves-e-mail/">e-mail</a> didn&#8217;t reach someone. People get an <a href="http://corycollier.com/2008/05/google-saves-e-mail/">email</a> that has some cryptic message about why their email didn&#8217;t reach it&#8217;s intended recipient. While there are an untold number of reasons as to why that could happen, there are a few things you can do to narrow down why it failed.</p>
<p>Regardless, the first thing I always do, is check that the email address is valid. It might sound funny, but just like that hot girl might have given you a phony number, you might have the wrong email address. This happens a lot more often then you might think.</p>
<p>So, how do you check the email? Enter Telnet to the rescue. Don&#8217;t worry, Telnet is cross platform. If you have Linux, Mac, or Windows (geez), you can use Telnet to figure out if the e-mail address you&#8217;re trying to reach is valid. It&#8217;s one of the few things that seem to work on damn near any operating system you can think of.</p>
<p><span id="more-64"></span>Sooo go ahead and fire up Terminal (or Command Prompt). Once you&#8217;ve gotten that done, you&#8217;ll need to type in &#8216;telnet&#8217;. You&#8217;ll see a window, something similar to the one below:</p>
<p><a href="http://corycollier.com/wp-content/uploads/2008/05/picture-1.png"><img class="alignnone size-full wp-image-65" title="picture-1" src="http://corycollier.com/wp-content/uploads/2008/05/picture-1.png" alt="" width="500" height="185" /></a></p>
<p>Now, you&#8217;ll need to get the domain name of the mail server you&#8217;re trying to check the email address against. This is not as easy as just checking the domain name itself. Nearly always, the mail server for a domain is mail.domain.com. So, if you&#8217;re checking the valid email address for JoeBalls@physics.org, then the mail server is probably mail.physics.org. It&#8217;s a much bigger topic than I&#8217;ve got to cover here. I&#8217;ll get to that later. So let&#8217;s just say the right email server is mail.physics.org. </p>
<p>So, type in &#8216;open mail.physics.org smtp&#8217; in the command prompt. In case you&#8217;re a little confused, it should look like the following:</p>
<p><a href="http://corycollier.com/wp-content/uploads/2008/05/picture-2.png"><img class="alignnone size-full wp-image-66" title="picture-2" src="http://corycollier.com/wp-content/uploads/2008/05/picture-2.png" alt="" width="500" height="185" /></a></p>
<p>So, after you enter this, you&#8217;ll see the telnet program try to connect to an IP address. If it works, then you&#8217;ll get a message about an escape character, as well as the mail server&#8217;s welcome message. If you&#8217;ve gotten here, then pat yourself on the back. You&#8217;ve at least gotten a valid mail server. We&#8217;ll assume for now, it&#8217;s the right one.</p>
<p>The next thing to do, is type in the following command: &#8216;HELO mail.example.com&#8217;. It&#8217;s probably more effective to use a valid mail server for this, but this is supposed to be a simple tutorial. So anyways, after you type in &#8216;HELO &#8230;&#8217;, you&#8217;ll see something similar to the following:</p>
<p><a href="http://corycollier.com/wp-content/uploads/2008/05/picture-3.png"><img class="alignnone size-full wp-image-67" title="picture-3" src="http://corycollier.com/wp-content/uploads/2008/05/picture-3.png" alt="" width="500" height="206" /></a></p>
<p>This is kinda like saying &#8216;Hi, I&#8217;m Cory&#8217;. Ehh, don&#8217;t worry about it. Now, you&#8217;ll have to enter who this test email is from. Usually can use anything that looks like a valid email address. I usually use dude@example.com. So, here it is:</p>
<p><a href="http://corycollier.com/wp-content/uploads/2008/05/picture-4.png"><img class="alignnone size-full wp-image-68" title="picture-4" src="http://corycollier.com/wp-content/uploads/2008/05/picture-4.png" alt="" width="500" height="206" /></a></p>
<p> </p>
<p>So, the way to check the validity of the email (That&#8217;s right, we&#8217;re at the climax &#8230;. drumroll please &#8230;.), is to type &#8216;RCPT TO:&#8217; and the email address you want to check. I&#8217;m using Gmail as a mail proxy these days, so I don&#8217;t mind handing out my email address: corycollier@corycollier.com. Go ahead and spam me, I dare you. <img src='http://corycollier.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Yeah, so go ahead and test that email. So, it looks like &#8216;RCPT TO: corycollier@corycoller.com&#8217;, and a visual representation looks like:</p>
<p><a href="http://corycollier.com/wp-content/uploads/2008/05/picture-5.png"><img class="alignnone size-full wp-image-69" title="picture-5" src="http://corycollier.com/wp-content/uploads/2008/05/picture-5.png" alt="" width="500" height="206" /></a></p>
<p>Wait, it didn&#8217;t tell me anything??!?</p>
<p>Ahhh, but yes it did. This mail server returned a number, before it returned anything else. That number, is ALWAYS a three digit number. 2xx, 3xx, 4xx, or 5xx. 2xx indicates success. So, the 250 blah blah blah, basically means that the email address is valid. Sorta anti-climatic? Maybe, but what&#8217;s the end result? You&#8217;ve just made sure that an email address is valid. Give yourself another pat on the back.</p>
<p>So, just in case you were wondering, I wrote this tutorial on Melissa&#8217;s MacBook. Thanks honey for volunteering your computer long enough for me to write this. Then again, you&#8217;re watching American Idol, so I doubt you need the computer right now. And, since this is a tech tutorial, I doubt you&#8217;ve read this far.</p>
<p> <img src='http://corycollier.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://corycollier.com/2008/05/check-for-valid-email-with-telnet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Shadow Copy Tutorial</title>
		<link>http://corycollier.com/2007/06/shadow-copy-tutorial/</link>
		<comments>http://corycollier.com/2007/06/shadow-copy-tutorial/#comments</comments>
		<pubDate>Thu, 28 Jun 2007 11:11:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tutorial]]></category>
		<category><![CDATA[2003]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[shadow copy]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://corycollier.com/?p=35</guid>
		<description><![CDATA[I&#8217;ve been a Network Administrator for several years now. One of my favorite features on Windows Server 2003 is Shadow Copy. Shadow Copy is a backup feature that allows you to right click a file, and restore that file to a previous version. If the file is missing, you can right click it&#8217;s folder, find [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a Network Administrator for several years now. One of my favorite features on Windows Server 2003 is Shadow Copy. Shadow Copy is a backup feature that allows you to right click a file, and restore that file to a previous version. If the file is missing, you can right click it&#8217;s folder, find the file, and put it back!</p>
<p>Shadow Copy is a snapshot of a drive, at a particular moment in time. It&#8217;s comparable to incremental backups, kinda.</p>
<p>While Shadow Copy is not intended to replace regular backups, it&#8217;s a very handy tool to quickly find files that users lose all of the time. Note, this is only available on Windows Server machines. Your XP and Vista machines aren&#8217;t going to do this.</p>
<p>Heres how to use it:</p>
<p>First, make sure the Shadow Copy service is running in the services mmc. You&#8217;re looking for the service called &#8216;Volume Shadow Copy&#8217;. Make sure it&#8217;s started, and it&#8217;s set to Automatically start. Once you have that covered, you can move on.</p>
<p>On the server you wish to use Shadow Copy on, navigate to &#8216;My Computer&#8217;.</p>
<p>Right Click the Drive (usually &#8216;C:&#8217;) that you want to use Shadow Copy on.</p>
<p>Click Properties</p>
<p>Click the tab &#8216;Shadow Copies&#8217;</p>
<p><a title="shadowcopy1" name="shadowcopy1"></a><img title="Shadow Copy Property Box" src="../files/shadowcopy_1.JPG" alt="Shadow Copy Property Box" width="371" height="524" /></p>
<p>Click the enable button if it&#8217;s not grayed out. If the button is grayed out, then you&#8217;re already running Shadow Copy. We&#8217;ll assume you&#8217;re not, so at least pretend to click the enable button.</p>
<p>Now, click the &#8216;Settings&#8217; button. You should see the following dialog box:</p>
<p><img title="Shadow Copy Settings" src="../files/shadowcopy_2.JPG" alt="Shadow Copy Settings" width="394" height="524" /></p>
<p>This is where you set the maxium size you want your shadow copy database to be. As a general rule of thumb, you should never use less than 10% of what your max storage capacity is.</p>
<p>You can also set how often you make Shadow Copies. Keep in mind that the more often you make a Shadow Copy, the more space you will need. The default settings are twice a day, at 7:00am, and 12:00pm. I&#8217;ve never found a reason to change this, but I&#8217;m sure some of you out there will find plenty of reasons.</p>
<p><img title="Shadow Copy Schedule Settings" src="../files/shadowcopy_3.JPG" alt="Shadow Copy Schedule Settings" width="422" height="527" /></p>
<p>Now that Shadow Copy is setup, it&#8217;s time to see it in action. Back in the <a href="../shadowcopy#shadowcopy1">first dialog box we saw</a> , click the &#8216;Create Now&#8217; button to manually create your first Shadow Copy. Don&#8217;t worry, you won&#8217;t have to do this again.</p>
<p>Now here&#8217;s the sort of tricky part. In order to access the shadow copies that have been created via file or folder, you have to view the folders via net connection.</p>
<p>You can either type in the UNC name of the server (i.e. \\YOUR-SERVER-NAME) and navigate to the folder or file you want, or you can view them over a <a title="Map Network Drive" href="../mapnetworkdrive">mapped network drive </a></p>
<p>Once you do that, THEN you can right click your file, or folder, click on properties, and then click on the &#8216;Previous Versions&#8217; tab.</p>
<p><img title="Shadow Copy " src="../files/shadowcopy_4.JPG" alt="Shadow Copy " width="367" height="453" /></p>
<p>From here, you can view a previous version, copy or restore. Usually, your best bet is to view the files you want to restore first. It doesn&#8217;t help anyone to restore old files that were wrong to begin with. Get someone else&#8217;s (think management) OK before restoring files.</p>
]]></content:encoded>
			<wfw:commentRss>http://corycollier.com/2007/06/shadow-copy-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Map A Network Drive</title>
		<link>http://corycollier.com/2007/06/how-to-map-a-network-drive/</link>
		<comments>http://corycollier.com/2007/06/how-to-map-a-network-drive/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 20:37:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tutorial]]></category>
		<category><![CDATA[drive]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://corycollier.com/?p=41</guid>
		<description><![CDATA[One of the things I have to show people how to do all of the time, is map a network drive. This varies if you&#8217;re on a Mac or PC. For this tutorial, we&#8217;ll just focus on Windows. For a PC, You&#8217;ll need to know the name of the server that has the files you&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things I have to show people how to do all of the time, is map a network drive. This varies if you&#8217;re on a Mac or PC. For this tutorial, we&#8217;ll just focus on Windows.</p>
<p>For a PC, You&#8217;ll need to know the name of the server that has the files you&#8217;re looking for. If you don&#8217;t know the name of the server, the IP address will suffice.</p>
<p>Open &#8216;My Computer&#8217;</p>
<p><img src="../files/mycomputer.jpg" alt="My Computer" width="450" height="450" /></p>
<p>You should something similiar to the above picture. The details will differ with your computer. They&#8217;ll look quite different if you&#8217;re using Vista.</p>
<p>OK, Now click the &#8216;Tools&#8217; Menu and click &#8216;Map Network Drive&#8217;</p>
<p><img src="../files/mapnetworkdrive_1.jpg" alt="Map Network Drive" width="450" height="450" /></p>
<p>Select the drive letter you wish to map, then type 2 backslashes and the folder name in the folder textbox. You should follow that with the path to the folder you want mapped. If you don&#8217;t know, you can click the browse button, and locate it.</p>
<p>You should see something like the following by now.</p>
<p><img src="../files/mapnetworkdrive_2.jpg" alt="Map Network Drive" width="450" height="450" /></p>
<p>That&#8217;s all there is to it. It&#8217;s pretty much the same for Vista, though the location of the &#8216;Map Network Drive&#8217; is more direct. Just look in the toolbar of your explorer.</p>
]]></content:encoded>
			<wfw:commentRss>http://corycollier.com/2007/06/how-to-map-a-network-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

