<?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>Coding With Cody</title>
	<atom:link href="http://www.codingwithcody.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codingwithcody.com</link>
	<description>write compile run repeat</description>
	<lastBuildDate>Tue, 10 Jan 2012 21:52:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Python 2.7 on CentOS 5.6</title>
		<link>http://www.codingwithcody.com/2012/01/python-2-7-on-centos-5-6/</link>
		<comments>http://www.codingwithcody.com/2012/01/python-2-7-on-centos-5-6/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 03:55:28 +0000</pubDate>
		<dc:creator>Cody Snider</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.codingwithcody.com/?p=151</guid>
		<description><![CDATA[Here you have it, folks. A shell script that will handle all the ugliness associated with installing Python 2.7 on CentOS 5.6 (and probably CentOS 5.7, too). Use the following command in your shell (the easy way): wget -q -O http://codingwithcody.com/downloads/python_27_on_centos_56/install.sh &#124; sh Alternately, you can download and run it manually: Download install.sh Here are [...]]]></description>
			<content:encoded><![CDATA[<p>Here you have it, folks. A shell script that will handle all the ugliness associated with installing Python 2.7 on CentOS 5.6 (and probably CentOS 5.7, too).</p>
<p>Use the following command in your shell (the easy way):</p>
<blockquote><p>wget -q -O http://codingwithcody.com/downloads/python_27_on_centos_56/install.sh | sh</p></blockquote>
<p>Alternately, you can download and run it manually: <a title="Installation shell script for Python 2.7 on CentOS 5.6" href="http://www.codingwithcody.com/downloads/python_27_on_centos_56/install.sh">Download install.sh</a></p>
<p>Here are the tarballs used just in case the servers hosting them go down and you&#8217;re eager to get Python 2.7 working:</p>
<ul>
<li><a href="http://www.codingwithcody.com/downloads/python_27_on_centos_56/sqlite-amalgamation-3.7.3.tar.gz">sqlite-amalgamation-3.7.3.tar.gz</a></li>
<li><a href="http://www.codingwithcody.com/downloads/python_27_on_centos_56/Python-2.7.1.tgz">Python-2.7.1.tgz</a></li>
<li><a href="http://www.codingwithcody.com/downloads/python_27_on_centos_56/setuptools-0.6c11-py2.7.egg">setuptools-0.6c11-py2.7.egg</a></li>
</ul>
<p>And, just FYI, here&#8217;s the contents of install.sh:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p151code2'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1512"><td class="code" id="p151code2"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">gcc</span> gdbm-devel readline-devel ncurses-devel zlib-devel bzip2-devel sqlite-devel db4-devel openssl-devel tk-devel bluez-libs-devel <span style="color: #c20cb9; font-weight: bold;">make</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>sqlite.org<span style="color: #000000; font-weight: bold;">/</span>sqlite-amalgamation-3.7.3.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> xfz sqlite-amalgamation-3.7.3.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> sqlite-3.7.3<span style="color: #000000; font-weight: bold;">/</span>
.<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.python.org<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>2.7.1<span style="color: #000000; font-weight: bold;">/</span>Python-2.7.1.tgz
<span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz Python-2.7.1.tgz
<span style="color: #7a0874; font-weight: bold;">cd</span> Python-2.7.1
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>python2.7.1 <span style="color: #660033;">--with-threads</span> <span style="color: #660033;">--enable-shared</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ld.so.conf.d<span style="color: #000000; font-weight: bold;">/</span>opt-python2.7.1.conf
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;/opt/python2.7.1/lib/&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ld.so.conf.d<span style="color: #000000; font-weight: bold;">/</span>opt-python2.7.1.conf
ldconfig
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>python2.7.1<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python2.7
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>pypi.python.org<span style="color: #000000; font-weight: bold;">/</span>packages<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.7</span><span style="color: #000000; font-weight: bold;">/</span>s<span style="color: #000000; font-weight: bold;">/</span>setuptools<span style="color: #000000; font-weight: bold;">/</span>setuptools-0.6c11-py2.7.egg
<span style="color: #c20cb9; font-weight: bold;">sh</span> setuptools-0.6c11-py2.7.egg <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>python2.7.1
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>python2.7.1<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>easy_install pip
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>python2.7.1<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pip <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pip
&nbsp;
pip <span style="color: #c20cb9; font-weight: bold;">install</span> virtualenv
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>python2.7.1<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>virtualenv <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>virtualenv
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python-backup
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python2.7 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python</pre></td></tr></table></div>

<p>Any improvements are more than welcome. Enjoy and happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingwithcody.com/2012/01/python-2-7-on-centos-5-6/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Google Analytics Country Names</title>
		<link>http://www.codingwithcody.com/2011/05/google-analytics-country-names/</link>
		<comments>http://www.codingwithcody.com/2011/05/google-analytics-country-names/#comments</comments>
		<pubDate>Fri, 13 May 2011 06:13:54 +0000</pubDate>
		<dc:creator>Cody Snider</dc:creator>
				<category><![CDATA[Analytics]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.codingwithcody.com/?p=138</guid>
		<description><![CDATA[Google Analytics Data Export API doesn&#8217;t use country names that align with the ISO-3166-1 standard for country names. This, as I have recently discovered, makes it incredibly difficult to query the API for country details without receiving errors of the error code 500 variety. The answer is this list (published as an HTML table below [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/apis/analytics/docs/gdata/gdataDeveloperGuide.html" title="Google Analytics Data Export API Guide">Google Analytics Data Export API</a> doesn&#8217;t use country names that align with the <a href="http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm" title="ISO-3166-1 standard details">ISO-3166-1 standard</a> for country names. This, as I have recently discovered, makes it incredibly difficult to query the API for country details without receiving errors of the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" title="HTTP error codes">error code 500</a> variety.</p>
<p>The answer is this list (published as an HTML table below as well as a CSV file at the link below). This list still has minor gaps, but is largely complete and ready for implementation. In addition to the name details (along with the <a href="http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm" title="ISO-3166-1 standard details">ISO-3166-1 Alpha-2 codes</a>, safe for one-to-one relationships) are the latitude, longitude and square kilometers for each (where information from my research was readily available as my deadlines on this assignment were not allowing for further research). If you have additional details, please leave them in a comment below and I can add them to the list and update the list for all to enjoy. The CSV is field separated by a comma, uses double-quotes for the text delimiter, CRLF is the row delimiter and the title is the first row.</p>
<p>If you find any part of this collection in error, please let me know so I can make the corrections.</p>
<p><a href="http://www.codingwithcody.com/country.csv" title="Download country code CSV">Download CSV</a></p>
<table style="width: 50%;margin: 0 auto;">
<tr>
<td style="width:50%"><strong>ISO-3166 Alpha-2</strong></td>
<td><strong>Google Name</strong></td>
</tr>
<tr>
<td>AF</td>
<td>Afghanistan</td>
</tr>
<tr>
<td>AX</td>
<td>Åland Islands</td>
</tr>
<tr>
<td>AL</td>
<td>Albania</td>
</tr>
<tr>
<td>DZ</td>
<td>Algeria</td>
</tr>
<tr>
<td>AS</td>
<td>American Samoa</td>
</tr>
<tr>
<td>AD</td>
<td>Andorra</td>
</tr>
<tr>
<td>AO</td>
<td>Angola</td>
</tr>
<tr>
<td>AI</td>
<td>Anguilla</td>
</tr>
<tr>
<td>AQ</td>
<td>Antarctica</td>
</tr>
<tr>
<td>AG</td>
<td>Antigua and Barbuda</td>
</tr>
<tr>
<td>AR</td>
<td>Argentina</td>
</tr>
<tr>
<td>AM</td>
<td>Armenia</td>
</tr>
<tr>
<td>AW</td>
<td>Aruba</td>
</tr>
<tr>
<td>AU</td>
<td>Australia</td>
</tr>
<tr>
<td>AT</td>
<td>Austria</td>
</tr>
<tr>
<td>AZ</td>
<td>Azerbaijan</td>
</tr>
<tr>
<td>BS</td>
<td>Bahamas</td>
</tr>
<tr>
<td>BH</td>
<td>Bahrain</td>
</tr>
<tr>
<td>BD</td>
<td>Bangladesh</td>
</tr>
<tr>
<td>BB</td>
<td>Barbados</td>
</tr>
<tr>
<td>BY</td>
<td>Belarus</td>
</tr>
<tr>
<td>BE</td>
<td>Belgium</td>
</tr>
<tr>
<td>BZ</td>
<td>Belize</td>
</tr>
<tr>
<td>BJ</td>
<td>Benin</td>
</tr>
<tr>
<td>BM</td>
<td>Bermuda</td>
</tr>
<tr>
<td>BT</td>
<td>Bhutan</td>
</tr>
<tr>
<td>BO</td>
<td>Bolivia</td>
</tr>
<tr>
<td>BA</td>
<td>Bosnia and Herzegovina</td>
</tr>
<tr>
<td>BW</td>
<td>Botswana</td>
</tr>
<tr>
<td>BV</td>
<td>Bouvet Island</td>
</tr>
<tr>
<td>BR</td>
<td>Brazil</td>
</tr>
<tr>
<td>IO</td>
<td>British Indian Ocean Territory</td>
</tr>
<tr>
<td>BN</td>
<td>Brunei Darussalam</td>
</tr>
<tr>
<td>BG</td>
<td>Bulgaria</td>
</tr>
<tr>
<td>BF</td>
<td>Burkina Faso</td>
</tr>
<tr>
<td>BI</td>
<td>Burundi</td>
</tr>
<tr>
<td>KH</td>
<td>Cambodia</td>
</tr>
<tr>
<td>CM</td>
<td>Cameroon</td>
</tr>
<tr>
<td>CA</td>
<td>Canada</td>
</tr>
<tr>
<td>CV</td>
<td>Cape Verde</td>
</tr>
<tr>
<td>KY</td>
<td>Cayman Islands</td>
</tr>
<tr>
<td>CF</td>
<td>Central African Republic</td>
</tr>
<tr>
<td>TD</td>
<td>Chad</td>
</tr>
<tr>
<td>CL</td>
<td>Chile</td>
</tr>
<tr>
<td>CN</td>
<td>China</td>
</tr>
<tr>
<td>CX</td>
<td>Christmas Island</td>
</tr>
<tr>
<td>CC</td>
<td>Cocos (Keeling) Islands</td>
</tr>
<tr>
<td>CO</td>
<td>Colombia</td>
</tr>
<tr>
<td>KM</td>
<td>Comoros</td>
</tr>
<tr>
<td>CG</td>
<td>Congo</td>
</tr>
<tr>
<td>CD</td>
<td>Congo [DRC]</td>
</tr>
<tr>
<td>CK</td>
<td>Cook Islands</td>
</tr>
<tr>
<td>CR</td>
<td>Costa Rica</td>
</tr>
<tr>
<td>CI</td>
<td>Côte d&#8217;Ivoire</td>
</tr>
<tr>
<td>HR</td>
<td>Croatia</td>
</tr>
<tr>
<td>CU</td>
<td>Cuba</td>
</tr>
<tr>
<td>CY</td>
<td>Cyprus</td>
</tr>
<tr>
<td>CZ</td>
<td>Czech Republic</td>
</tr>
<tr>
<td>DK</td>
<td>Denmark</td>
</tr>
<tr>
<td>DJ</td>
<td>Djibouti</td>
</tr>
<tr>
<td>DM</td>
<td>Dominica</td>
</tr>
<tr>
<td>DO</td>
<td>Dominican Republic</td>
</tr>
<tr>
<td>EC</td>
<td>Ecuador</td>
</tr>
<tr>
<td>EG</td>
<td>Egypt</td>
</tr>
<tr>
<td>SV</td>
<td>El Salvador</td>
</tr>
<tr>
<td>GQ</td>
<td>Equatorial Guinea</td>
</tr>
<tr>
<td>ER</td>
<td>Eritrea</td>
</tr>
<tr>
<td>EE</td>
<td>Estonia</td>
</tr>
<tr>
<td>ET</td>
<td>Ethiopia</td>
</tr>
<tr>
<td>FK</td>
<td>Falkland Islands [Islas Malvinas]</td>
</tr>
<tr>
<td>FO</td>
<td>Faroe Islands</td>
</tr>
<tr>
<td>FJ</td>
<td>Fiji</td>
</tr>
<tr>
<td>FI</td>
<td>Finland</td>
</tr>
<tr>
<td>FR</td>
<td>France</td>
</tr>
<tr>
<td>GF</td>
<td>French Guiana</td>
</tr>
<tr>
<td>PF</td>
<td>French Polynesia</td>
</tr>
<tr>
<td>TF</td>
<td>French Southern Territories</td>
</tr>
<tr>
<td>GA</td>
<td>Gabon</td>
</tr>
<tr>
<td>GM</td>
<td>Gambia</td>
</tr>
<tr>
<td>GE</td>
<td>Georgia</td>
</tr>
<tr>
<td>DE</td>
<td>Germany</td>
</tr>
<tr>
<td>GH</td>
<td>Ghana</td>
</tr>
<tr>
<td>GI</td>
<td>Gibraltar</td>
</tr>
<tr>
<td>GR</td>
<td>Greece</td>
</tr>
<tr>
<td>GL</td>
<td>Greenland</td>
</tr>
<tr>
<td>GD</td>
<td>Grenada</td>
</tr>
<tr>
<td>GP</td>
<td>Guadeloupe</td>
</tr>
<tr>
<td>GU</td>
<td>Guam</td>
</tr>
<tr>
<td>GT</td>
<td>Guatemala</td>
</tr>
<tr>
<td>GG</td>
<td>Guernsey</td>
</tr>
<tr>
<td>GN</td>
<td>Guinea</td>
</tr>
<tr>
<td>GW</td>
<td>Guinea-Bissau</td>
</tr>
<tr>
<td>GY</td>
<td>Guyana</td>
</tr>
<tr>
<td>HT</td>
<td>Haiti</td>
</tr>
<tr>
<td>HM</td>
<td>Heard Island and McDonald Islands</td>
</tr>
<tr>
<td>VA</td>
<td>Holy See (Vatican City State)</td>
</tr>
<tr>
<td>HN</td>
<td>Honduras</td>
</tr>
<tr>
<td>HK</td>
<td>Hong Kong</td>
</tr>
<tr>
<td>HU</td>
<td>Hungary</td>
</tr>
<tr>
<td>IS</td>
<td>Iceland</td>
</tr>
<tr>
<td>IN</td>
<td>India</td>
</tr>
<tr>
<td>ID</td>
<td>Indonesia</td>
</tr>
<tr>
<td>IR</td>
<td>Iran</td>
</tr>
<tr>
<td>IQ</td>
<td>Iraq</td>
</tr>
<tr>
<td>IE</td>
<td>Ireland</td>
</tr>
<tr>
<td>IM</td>
<td>Isle of Man</td>
</tr>
<tr>
<td>IL</td>
<td>Israel</td>
</tr>
<tr>
<td>IT</td>
<td>Italy</td>
</tr>
<tr>
<td>JM</td>
<td>Jamaica</td>
</tr>
<tr>
<td>JP</td>
<td>Japan</td>
</tr>
<tr>
<td>JE</td>
<td>Jersey</td>
</tr>
<tr>
<td>JO</td>
<td>Jordan</td>
</tr>
<tr>
<td>KZ</td>
<td>Kazakhstan</td>
</tr>
<tr>
<td>KE</td>
<td>Kenya</td>
</tr>
<tr>
<td>KI</td>
<td>Kiribati</td>
</tr>
<tr>
<td>KR</td>
<td>South Korea</td>
</tr>
<tr>
<td>KP</td>
<td>North Korea</td>
</tr>
<tr>
<td>KW</td>
<td>Kuwait</td>
</tr>
<tr>
<td>KG</td>
<td>Kyrgyzstan</td>
</tr>
<tr>
<td>LA</td>
<td>Lao People&#8217;s Democratic Republic</td>
</tr>
<tr>
<td>LV</td>
<td>Latvia</td>
</tr>
<tr>
<td>LB</td>
<td>Lebanon</td>
</tr>
<tr>
<td>LS</td>
<td>Lesotho</td>
</tr>
<tr>
<td>LR</td>
<td>Liberia</td>
</tr>
<tr>
<td>LY</td>
<td>Libya</td>
</tr>
<tr>
<td>LI</td>
<td>Liechtenstein</td>
</tr>
<tr>
<td>LT</td>
<td>Lithuania</td>
</tr>
<tr>
<td>LU</td>
<td>Luxembourg</td>
</tr>
<tr>
<td>MO</td>
<td>Macao</td>
</tr>
<tr>
<td>MK</td>
<td>Macedonia [FYROM]</td>
</tr>
<tr>
<td>MG</td>
<td>Madagascar</td>
</tr>
<tr>
<td>MW</td>
<td>Malawi</td>
</tr>
<tr>
<td>MY</td>
<td>Malaysia</td>
</tr>
<tr>
<td>MV</td>
<td>Maldives</td>
</tr>
<tr>
<td>ML</td>
<td>Mali</td>
</tr>
<tr>
<td>MT</td>
<td>Malta</td>
</tr>
<tr>
<td>MH</td>
<td>Marshall Islands</td>
</tr>
<tr>
<td>MQ</td>
<td>Martinique</td>
</tr>
<tr>
<td>MR</td>
<td>Mauritania</td>
</tr>
<tr>
<td>MU</td>
<td>Mauritius</td>
</tr>
<tr>
<td>YT</td>
<td>Mayotte</td>
</tr>
<tr>
<td>MX</td>
<td>Mexico</td>
</tr>
<tr>
<td>FM</td>
<td>Micronesia</td>
</tr>
<tr>
<td>MD</td>
<td>Moldova</td>
</tr>
<tr>
<td>MC</td>
<td>Monaco</td>
</tr>
<tr>
<td>MN</td>
<td>Mongolia</td>
</tr>
<tr>
<td>ME</td>
<td>Serbia and Montenegro</td>
</tr>
<tr>
<td>MS</td>
<td>Montserrat</td>
</tr>
<tr>
<td>MA</td>
<td>Morocco</td>
</tr>
<tr>
<td>MZ</td>
<td>Mozambique</td>
</tr>
<tr>
<td>MM</td>
<td>Myanmar [Burma]</td>
</tr>
<tr>
<td>NA</td>
<td>Namibia</td>
</tr>
<tr>
<td>NR</td>
<td>Nauru</td>
</tr>
<tr>
<td>NP</td>
<td>Nepal</td>
</tr>
<tr>
<td>NL</td>
<td>Netherlands</td>
</tr>
<tr>
<td>AN</td>
<td>Netherlands Antilles</td>
</tr>
<tr>
<td>NC</td>
<td>New Caledonia</td>
</tr>
<tr>
<td>NZ</td>
<td>New Zealand</td>
</tr>
<tr>
<td>NI</td>
<td>Nicaragua</td>
</tr>
<tr>
<td>NE</td>
<td>Niger</td>
</tr>
<tr>
<td>NG</td>
<td>Nigeria</td>
</tr>
<tr>
<td>NU</td>
<td>Niue</td>
</tr>
<tr>
<td>NF</td>
<td>Norfolk Island</td>
</tr>
<tr>
<td>MP</td>
<td>Northern Mariana Islands</td>
</tr>
<tr>
<td>NO</td>
<td>Norway</td>
</tr>
<tr>
<td>OM</td>
<td>Oman</td>
</tr>
<tr>
<td>PK</td>
<td>Pakistan</td>
</tr>
<tr>
<td>PW</td>
<td>Palau</td>
</tr>
<tr>
<td>PS</td>
<td>Palestinian Territories</td>
</tr>
<tr>
<td>PA</td>
<td>Panama</td>
</tr>
<tr>
<td>PG</td>
<td>Papua New Guinea</td>
</tr>
<tr>
<td>PY</td>
<td>Paraguay</td>
</tr>
<tr>
<td>PE</td>
<td>Peru</td>
</tr>
<tr>
<td>PH</td>
<td>Philippines</td>
</tr>
<tr>
<td>PN</td>
<td>Pitcairn</td>
</tr>
<tr>
<td>PL</td>
<td>Poland</td>
</tr>
<tr>
<td>PT</td>
<td>Portugal</td>
</tr>
<tr>
<td>PR</td>
<td>Puerto Rico</td>
</tr>
<tr>
<td>QA</td>
<td>Qatar</td>
</tr>
<tr>
<td>RE</td>
<td>Réunion</td>
</tr>
<tr>
<td>RO</td>
<td>Romania</td>
</tr>
<tr>
<td>RU</td>
<td>Russia</td>
</tr>
<tr>
<td>RW</td>
<td>Rwanda</td>
</tr>
<tr>
<td>BL</td>
<td>Saint Barthélemy</td>
</tr>
<tr>
<td>SH</td>
<td>Saint Helena</td>
</tr>
<tr>
<td>KN</td>
<td>Saint Kitts and Nevis</td>
</tr>
<tr>
<td>LC</td>
<td>Saint Lucia</td>
</tr>
<tr>
<td>MF</td>
<td>Saint Martin</td>
</tr>
<tr>
<td>PM</td>
<td>Saint Pierre and Miquelon</td>
</tr>
<tr>
<td>VC</td>
<td>Saint Vincent and the Grenadines</td>
</tr>
<tr>
<td>WS</td>
<td>Samoa</td>
</tr>
<tr>
<td>SM</td>
<td>San Marino</td>
</tr>
<tr>
<td>ST</td>
<td>São Tomé and Principe</td>
</tr>
<tr>
<td>SA</td>
<td>Saudi Arabia</td>
</tr>
<tr>
<td>SN</td>
<td>Senegal</td>
</tr>
<tr>
<td>RS</td>
<td>Serbia</td>
</tr>
<tr>
<td>SC</td>
<td>Seychelles</td>
</tr>
<tr>
<td>SL</td>
<td>Sierra Leone</td>
</tr>
<tr>
<td>SG</td>
<td>Singapore</td>
</tr>
<tr>
<td>SK</td>
<td>Slovakia</td>
</tr>
<tr>
<td>SI</td>
<td>Slovenia</td>
</tr>
<tr>
<td>SB</td>
<td>Solomon Islands</td>
</tr>
<tr>
<td>SO</td>
<td>Somalia</td>
</tr>
<tr>
<td>ZA</td>
<td>South Africa</td>
</tr>
<tr>
<td>GS</td>
<td>South Georgia and the South Sandwich Islands</td>
</tr>
<tr>
<td>ES</td>
<td>Spain</td>
</tr>
<tr>
<td>LK</td>
<td>Sri Lanka</td>
</tr>
<tr>
<td>SD</td>
<td>Sudan</td>
</tr>
<tr>
<td>SR</td>
<td>Suriname</td>
</tr>
<tr>
<td>SJ</td>
<td>Svalbard and Jan Mayen</td>
</tr>
<tr>
<td>SZ</td>
<td>Swaziland</td>
</tr>
<tr>
<td>SE</td>
<td>Sweden</td>
</tr>
<tr>
<td>CH</td>
<td>Switzerland</td>
</tr>
<tr>
<td>SY</td>
<td>Syria</td>
</tr>
<tr>
<td>TW</td>
<td>Taiwan</td>
</tr>
<tr>
<td>TJ</td>
<td>Tajikistan</td>
</tr>
<tr>
<td>TZ</td>
<td>Tanzania</td>
</tr>
<tr>
<td>TH</td>
<td>Thailand</td>
</tr>
<tr>
<td>TL</td>
<td>Timor-Leste</td>
</tr>
<tr>
<td>TG</td>
<td>Togo</td>
</tr>
<tr>
<td>TK</td>
<td>Tokelau</td>
</tr>
<tr>
<td>TO</td>
<td>Tonga</td>
</tr>
<tr>
<td>TT</td>
<td>Trinidad and Tobago</td>
</tr>
<tr>
<td>TN</td>
<td>Tunisia</td>
</tr>
<tr>
<td>TR</td>
<td>Turkey</td>
</tr>
<tr>
<td>TM</td>
<td>Turkmenistan</td>
</tr>
<tr>
<td>TC</td>
<td>Turks and Caicos Islands</td>
</tr>
<tr>
<td>TV</td>
<td>Tuvalu</td>
</tr>
<tr>
<td>UG</td>
<td>Uganda</td>
</tr>
<tr>
<td>UA</td>
<td>Ukraine</td>
</tr>
<tr>
<td>AE</td>
<td>United Arab Emirates</td>
</tr>
<tr>
<td>GB</td>
<td>United Kingdom</td>
</tr>
<tr>
<td>US</td>
<td>United States</td>
</tr>
<tr>
<td>UM</td>
<td>United States Minor Outlying Islands</td>
</tr>
<tr>
<td>UY</td>
<td>Uruguay</td>
</tr>
<tr>
<td>UZ</td>
<td>Uzbekistan</td>
</tr>
<tr>
<td>VU</td>
<td>Vanuatu</td>
</tr>
<tr>
<td>VE</td>
<td>Venezuela</td>
</tr>
<tr>
<td>VN</td>
<td>Vietnam</td>
</tr>
<tr>
<td>VG</td>
<td>British Virgin Islands</td>
</tr>
<tr>
<td>VI</td>
<td>U.S. Virgin Islands</td>
</tr>
<tr>
<td>WF</td>
<td>Wallis and Futuna</td>
</tr>
<tr>
<td>EH</td>
<td>Western Sahara</td>
</tr>
<tr>
<td>YE</td>
<td>Yemen</td>
</tr>
<tr>
<td>ZM</td>
<td>Zambia</td>
</tr>
<tr>
<td>ZW</td>
<td>Zimbabwe</td>
</tr>
</table>
<p><strong>Update &#8211; Dec 2011</strong> Many thanks to our friend Lars for combing over the list and poviding updated values for country names. If there are any further updates or corrections, please make note in the comments below and I&#8217;ll get this list updated with those values.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingwithcody.com/2011/05/google-analytics-country-names/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Arduino Default Fuse Settings</title>
		<link>http://www.codingwithcody.com/2011/04/arduino-default-fuse-settings/</link>
		<comments>http://www.codingwithcody.com/2011/04/arduino-default-fuse-settings/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 04:50:22 +0000</pubDate>
		<dc:creator>Cody Snider</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.codingwithcody.com/?p=129</guid>
		<description><![CDATA[Here are the default fuse settings for each Arduino from the boards.txt included with the Arduino development software. To understand more about the fuse settings for your microcontroller, visit Engbedded&#8217;s AVR Fuse Calculator. To write fuse settings, you will need a programmer with this capability. I use Mighty Ohm&#8217;s high-voltage rescue shield available here. Arduino [...]]]></description>
			<content:encoded><![CDATA[<p>Here are the default fuse settings for each Arduino from the boards.txt included with the Arduino development software.</p>
<p>To understand more about the fuse settings for your microcontroller, visit <a href="http://www.engbedded.com/fusecalc/">Engbedded&#8217;s AVR Fuse Calculator</a>.</p>
<p>To write fuse settings, you will need a programmer with this capability. I use <a href="http://mightyohm.com">Mighty Ohm&#8217;s</a> high-voltage rescue shield available <a href="http://mightyohm.com/blog/products/hv-rescue-shield-2-x/">here</a>.</p>
<h2>Arduino Uno</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDE</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;05</td>
</tr>
</table>
<h2>Arduino Duemilanove or Nano w/ ATmega328</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDA</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;05</td>
</tr>
</table>
<h2>Arduino Diecimila, Duemilanove, or Nano w/ ATmega168</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDD</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;00</td>
</tr>
</table>
<h2>Arduino Mega 2560</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xD8</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0xFD</td>
</tr>
</table>
<h2>Arduino Mega (ATmega1280)</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDA</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0xF5</td>
</tr>
</table>
<h2>Arduino Mini</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDD</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;00</td>
</tr>
</table>
<h2>Arduino Fio</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDA</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;05</td>
</tr>
</table>
<h2>Arduino BT w/ ATmega328</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xD8</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;05</td>
</tr>
</table>
<h2>Arduino BT w/ ATmega168</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDD</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;00</td>
</tr>
</table>
<h2>LilyPad Arduino w/ ATmega328</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDA</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;05</td>
</tr>
</table>
<h2>LilyPad Arduino w/ ATmega168</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xE2</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDD</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;00</td>
</tr>
</table>
<h2>Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDA</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;05</td>
</tr>
</table>
<h2>Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega168</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDD</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;00</td>
</tr>
</table>
<h2>Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDA</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;05</td>
</tr>
</table>
<h2>Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega168</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xC6</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDD</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;00</td>
</tr>
</table>
<h2>Arduino NG or older w/ ATmega168</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xFF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xDD</td>
</tr>
<tr>
<td>Extended Fuse</td>
<td>0&#215;00</td>
</tr>
</table>
<h2>Arduino NG or older w/ ATmega8</h2>
<table>
<tr>
<td>Low Fuse</td>
<td>0xDF</td>
</tr>
<tr>
<td>High Fuse</td>
<td>0xCA</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.codingwithcody.com/2011/04/arduino-default-fuse-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding getIds() Method to Zend Framework Memcache Backend</title>
		<link>http://www.codingwithcody.com/2011/03/adding-getids-method-to-zend-framework-memcache-backend/</link>
		<comments>http://www.codingwithcody.com/2011/03/adding-getids-method-to-zend-framework-memcache-backend/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 08:19:23 +0000</pubDate>
		<dc:creator>Cody Snider</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.codingwithcody.com/?p=121</guid>
		<description><![CDATA[Zend Framework doesn&#8217;t allow the use of getIds() with the Memcache backend. This is likely due to performance issues, but the option should still be available. To enable this functionality, change the contents of library/Zend/Cache/Backend/Memcached.php in the getIds() function to the following: View Code PHP$list = array&#40;&#41;; $allSlabs = $this-&#62;_memcache-&#62;getExtendedStats&#40;'slabs'&#41;; $items = $this-&#62;_memcache-&#62;getExtendedStats&#40;'items'&#41;; foreach&#40;$allSlabs as [...]]]></description>
			<content:encoded><![CDATA[<p>Zend Framework doesn&#8217;t allow the use of getIds() with the Memcache backend. This is likely due to performance issues, but the option should still be available. To enable this functionality, change the contents of library/Zend/Cache/Backend/Memcached.php in the getIds() function to the following:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p121code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1214"><td class="code" id="p121code4"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$list</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$allSlabs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_memcache<span style="color: #339933;">-&gt;</span><span style="color: #004000;">getExtendedStats</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'slabs'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$items</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_memcache<span style="color: #339933;">-&gt;</span><span style="color: #004000;">getExtendedStats</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'items'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$allSlabs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$server</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$slabs</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$slabs</span> <span style="color: #b1b100;">AS</span> <span style="color: #000088;">$slabId</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$slabMeta</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_numeric"><span style="color: #990000;">is_numeric</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$slabId</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$cdump</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_memcache<span style="color: #339933;">-&gt;</span><span style="color: #004000;">getExtendedStats</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cachedump'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$slabId</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cdump</span> <span style="color: #b1b100;">AS</span> <span style="color: #000088;">$server</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$entries</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$entries</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_options<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cache_id_prefix'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_options<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cache_id_prefix'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #000088;">$prefix</span>    <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_options<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cache_id_prefix'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
						<span style="color: #000088;">$prefixLen</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/strlen"><span style="color: #990000;">strlen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$prefix</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$entries</span> <span style="color: #b1b100;">AS</span> <span style="color: #000088;">$eName</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$eData</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/strpos"><span style="color: #990000;">strpos</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$eName</span><span style="color: #339933;">,</span> <span style="color: #000088;">$prefix</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
								<span style="color: #000088;">$list</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$eName</span><span style="color: #339933;">;</span>
							<span style="color: #009900;">&#125;</span>
						<span style="color: #009900;">&#125;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$entries</span> <span style="color: #b1b100;">AS</span> <span style="color: #000088;">$eName</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$eData</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							<span style="color: #000088;">$list</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$eName</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<a href="http://www.php.net/ksort"><span style="color: #990000;">ksort</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$list</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$list</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.codingwithcody.com/2011/03/adding-getids-method-to-zend-framework-memcache-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hidden Images in Email to Confirm Receipt, Part 2.5</title>
		<link>http://www.codingwithcody.com/2010/08/hidden-images-in-email-to-confirm-receipt-part-2-5/</link>
		<comments>http://www.codingwithcody.com/2010/08/hidden-images-in-email-to-confirm-receipt-part-2-5/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 07:44:27 +0000</pubDate>
		<dc:creator>Cody Snider</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://codingwithcody.com/?p=90</guid>
		<description><![CDATA[In part 1 of this series, we discussed how to track email views using an image. In part 2, we setup the tables and functions necessary to record the emails. Before we start building the reporting and campaign tracking mechanisms for step 3, we will need to adjust the code so it will be more [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.codingwithcody.com/2010/07/hidden-images-in-email-to-confirm-receipt/">part 1</a> of this series, we discussed how to track email views using an image. In <a href="http://www.codingwithcody.com/2010/08/hidden-images-in-email-to-confirm-receipt-part-2/">part 2</a>, we setup the tables and functions necessary to record the emails. Before we start building the reporting and campaign tracking mechanisms for step 3, we will need to adjust the code so it will be more maintainable in the future. Based on the traffic and emails I&#8217;ve received regarding this script, we are going to develop this into an easy-to-use, quick-to-deploy solution that can adapt to a variety of existing content management systems and web frameworks but still work as a standalone system.</p>
<p>This is simply a cleanup step and the code below is the revised version of the functionality from <a href="http://www.codingwithcody.com/2010/08/hidden-images-in-email-to-confirm-receipt-part-2/">step 2</a>. Please update the constants in the <em>Config</em> class to use this script.</p>
<p>Requests to this new version also have an argument change and the URL should now look like this (where ID is the id for the user that will receive the email):</p>
<p><em>http://YOUR-SITE.com/signup_complete.php?userId=ID</em></p>
<blockquote>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p90code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p906"><td class="code" id="p90code6"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// SCRIPT CONFIGURATION</span>
<span style="color: #000000; font-weight: bold;">class</span> Config <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">const</span> EMAIL_ADDRESS <span style="color: #339933;">=</span> <span style="color: #0000ff;">'you@site.com'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// YOUR EMAIL ADDRESS</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">const</span> SITE_DOMAIN <span style="color: #339933;">=</span> <span style="color: #0000ff;">'site.com'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// YOUR DOMAIN</span>
    <span style="color: #000000; font-weight: bold;">const</span> IMG_PATH <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/images/email/'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// PATH TO PNG IMAGE AND TRACK.PHP</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">const</span> DB_HOST <span style="color: #339933;">=</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// YOUR DB HOST</span>
    <span style="color: #000000; font-weight: bold;">const</span> DB_USERNAME <span style="color: #339933;">=</span> <span style="color: #0000ff;">'username'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// YOUR DB USERNAME</span>
    <span style="color: #000000; font-weight: bold;">const</span> DB_PASSWORD <span style="color: #339933;">=</span> <span style="color: #0000ff;">'password'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// YOUR DB PASSWORD</span>
    <span style="color: #000000; font-weight: bold;">const</span> DB_SCHEMA <span style="color: #339933;">=</span> <span style="color: #0000ff;">'database'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// YOUR DATABASE/SCHEMA NAME</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// PRESISTENT DB CONNECT</span>
<a href="http://www.php.net/mysql_pconnect"><span style="color: #990000;">mysql_pconnect</span></a><span style="color: #009900;">&#40;</span>Config<span style="color: #339933;">::</span><span style="color: #004000;">DB_HOST</span><span style="color: #339933;">,</span> Config<span style="color: #339933;">::</span><span style="color: #004000;">DB_USERNAME</span><span style="color: #339933;">,</span> Config<span style="color: #339933;">::</span><span style="color: #004000;">DB_PASSWORD</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/mysql_select_db"><span style="color: #990000;">mysql_select_db</span></a><span style="color: #009900;">&#40;</span>Config<span style="color: #339933;">::</span><span style="color: #004000;">DB_SCHEMA</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// USER MODEL</span>
<span style="color: #000000; font-weight: bold;">class</span> User <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$id</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$emailAddress</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// WE'LL USE THIS AS AN ACTIVE/CAN-BE-EMAILED FLAG</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// STATIC METHODS</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> addUser<span style="color: #009900;">&#40;</span><span style="color: #000088;">$emailAddress</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'INSERT IGNORE INTO `user` SET `email_address` = &quot;'</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/mysql_escape_string"><span style="color: #990000;">mysql_escape_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$emailAddress</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// PUBLIC METHODS</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$userId</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$userId</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetchDetails</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">status</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">status</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// PRIVATE METHODS</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> fetchDetails<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT * FROM `user` WHERE `user_id` = '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">';'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/mysql_num_rows"><span style="color: #990000;">mysql_num_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	    <span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_array"><span style="color: #990000;">mysql_fetch_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">emailAddress</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email_address'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// EMAIL MODEL</span>
<span style="color: #000000; font-weight: bold;">class</span> Email <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> send<span style="color: #009900;">&#40;</span>User <span style="color: #000088;">$user</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">status</span> <span style="color: #339933;">===</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	    <span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Test email from '</span> <span style="color: #339933;">.</span> Config<span style="color: #339933;">::</span><span style="color: #004000;">SITE_DOMAIN</span><span style="color: #339933;">;</span>
	    <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;html&gt;&lt;body&gt;&lt;h1&gt;Test Email&lt;/h1&gt;&lt;img src=&quot;http://'</span> <span style="color: #339933;">.</span> Config<span style="color: #339933;">::</span><span style="color: #004000;">SITE_DOMAIN</span> <span style="color: #339933;">.</span> Config<span style="color: #339933;">::</span><span style="color: #004000;">IMG_PATH</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'image'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'-'</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/rand"><span style="color: #990000;">rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">9999</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.png&quot; /&gt;&lt;/body&gt;&lt;/html&gt;'</span><span style="color: #339933;">;</span>
	    <span style="color: #000088;">$headers</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: &quot;</span> <span style="color: #339933;">.</span> Config<span style="color: #339933;">::</span><span style="color: #004000;">EMAIL_ADDRESS</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	    <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Content-type: text/html<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	    <span style="color: #b1b100;">return</span> <a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">emailAddress</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> User<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'userId'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Email<span style="color: #339933;">::</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.codingwithcody.com/2010/08/hidden-images-in-email-to-confirm-receipt-part-2-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hidden Images in Email to Confirm Receipt, Part 2</title>
		<link>http://www.codingwithcody.com/2010/08/hidden-images-in-email-to-confirm-receipt-part-2/</link>
		<comments>http://www.codingwithcody.com/2010/08/hidden-images-in-email-to-confirm-receipt-part-2/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 12:07:12 +0000</pubDate>
		<dc:creator>Cody Snider</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://codingwithcody.com/?p=82</guid>
		<description><![CDATA[In a previous post, we discussed how to track the viewing of an email using a 1x1px image, PHP and htaccess. Now we’ll see how to generate the ID that is associated with the email and update a database to record the action. First, we’ll need a table to record the information. The following are [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codingwithcody.com/2010/07/hidden-images-in-email-to-confirm-receipt/">In a previous post</a>, we discussed how to track the viewing of an email using a 1x1px image, PHP and htaccess. Now we’ll see how to generate the ID that is associated with the email and update a database to record the action.</p>
<p>First, we’ll need a table to record the information. The following are two SQL queries to create the tables we need. The first query is for the table we’ll use for the tracking event and the second is a query to create the user table to identify each unique user (if you use some type of user login/account system, feel free to adjust the table parameters to work with that system):</p>
<blockquote>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p82code11'); return false;">View Code</a> SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p8211"><td class="code" id="p82code11"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`user`</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #ff0000;">`user_id`</span> int<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`email_address`</span> varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">40</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`user_id`</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">UNIQUE</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #ff0000;">`email`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`email_address`</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span> ENGINE<span style="color: #66cc66;">=</span>MyISAM <span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #66cc66;">=</span>utf8</pre></td></tr></table></div>

</blockquote>
<blockquote>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p82code12'); return false;">View Code</a> SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p8212"><td class="code" id="p82code12"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`email_tracker_event`</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #ff0000;">`event_id`</span> int<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`user_id`</span> int<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`event_timestamp`</span> datetime <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`event_id`</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span> ENGINE<span style="color: #66cc66;">=</span>MyISAM <span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #66cc66;">=</span>utf8</pre></td></tr></table></div>

</blockquote>
<p>Next, in the document root folder for your site, add a file named <em>signup_complete.php</em>. This file will be the last step to your user signup form (which goes beyond the scope of this tutorial) and requires only that the user’s email address be passed as the first argument to the <em>addUser()</em> function we’re creating. If you are using a framework, consider adding a static method similar to this to your user model:</p>
<blockquote>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p82code13'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p8213"><td class="code" id="p82code13"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<a href="http://www.php.net/mysql_connect"><span style="color: #990000;">mysql_connect</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'YOUR-DB-HOSTNAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'YOUR-USERNAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'YOUR-PASSWORD'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/mysql_select_db"><span style="color: #990000;">mysql_select_db</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'YOUR-DB'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> addUser<span style="color: #009900;">&#40;</span><span style="color: #000088;">$emailAddress</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// PREPARE QUERY</span>
    <span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'INSERT IGNORE INTO `user` SET `email_address` = &quot;'</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/mysql_escape_string"><span style="color: #990000;">mysql_escape_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$emailAddress</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;;'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// EXECUTE QUERY</span>
    <span style="color: #000088;">$resultResource</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// IF IT EXECUTED</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resultResource</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//  AND AFFECTED ONE ROW</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/mysql_affected_rows"><span style="color: #990000;">mysql_affected_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	    <span style="color: #666666; font-style: italic;">// RETURN THE ID</span>
	    <span style="color: #b1b100;">return</span> <a href="http://www.php.net/mysql_insert_id"><span style="color: #990000;">mysql_insert_id</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/mysql_affected_rows"><span style="color: #990000;">mysql_affected_rows</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	    <span style="color: #666666; font-style: italic;">// OOPS! THIS ADDRESS IS ALREADY IN THE TABLE, RETURN THE ID</span>
	    <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SELECT `user_id` AS `id` FROM `user` WHERE `email_address` = &quot;'</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/mysql_escape_string"><span style="color: #990000;">mysql_escape_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$emailAddress</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_array"><span style="color: #990000;">mysql_fetch_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// SOMETHING MUST HAVE GONE WRONG, RETURN FALSE</span>
    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> sendEmail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$emailAddress</span><span style="color: #339933;">,</span> <span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Test email from your site'</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;html&gt;&lt;body&gt;&lt;h1&gt;Test Email&lt;/h1&gt;&lt;img src=&quot;http://YOUR-SITE.com/assets/images/email/image'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'-'</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/rand"><span style="color: #990000;">rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">9999</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.png&quot; /&gt;&lt;/body&gt;&lt;/html&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$from</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'YOUR-EMAIL-ADDRESS'</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$headers</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$from</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Content-type: text/html<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$emailAddress</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// KILL ANY REQUEST THAT HAS NEWLINE/RETURN IN THE EMAIL ADDRESS, THEY'RE TRYING TO PULL A FAST ONE ON YA</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/eregi"><span style="color: #990000;">eregi</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;(<span style="color: #000099; font-weight: bold;">\r</span>|<span style="color: #000099; font-weight: bold;">\n</span>)&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// ADD THE USER AND GET THE ID</span>
<span style="color: #000088;">$userId</span> <span style="color: #339933;">=</span> addUser<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$userId</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'USER ID: '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$userId</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>sendEmail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$userId</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Email sent!'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Email NOT sent!'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Something went wrong, check DB connection.'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</blockquote>
<p>Using the following URL, this script will add a user to the user table we created earlier and return the new user’s ID. This ID is what we will use for the image to track emails from the system that they have viewed.</p>
<blockquote><p>http://YOUR-SITE.com/signup_complete.php?email=name@site.com</p></blockquote>
<p>Last but not least, we’ll need to modify the /images/email/track.php we created in the previous post to record the viewing of the email:</p>
<blockquote>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p82code14'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p8214"><td class="code" id="p82code14"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<a href="http://www.php.net/mysql_connect"><span style="color: #990000;">mysql_connect</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'YOUR-DB-HOSTNAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'YOUR-USERNAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'YOUR-PASSWORD'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/mysql_select_db"><span style="color: #990000;">mysql_select_db</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'YOUR-DB'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$trackingNumber</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'x'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'INSERT INTO `email_tracker_event` SET `user_id` = '</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/mysql_escape_string"><span style="color: #990000;">mysql_escape_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$trackingNumber</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">', `event_timestamp` = NOW();'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type:image/png'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <a href="http://www.php.net/file_get_contents"><span style="color: #990000;">file_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'track.png'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</blockquote>
<p>In part 3 of this tutorial series, we&#8217;ll look at how to create campaigns and reports.</p>
<p></p>
<h3>UPDATE:</h3>
<p><a href="http://www.codingwithcody.com/2010/08/hidden-images-in-email-to-confirm-receipt-part-2-5/">Part 2.5</a> has been posted to clean up the code above and prepare it for the next step in creating a more complex email tracking system. Please review this step before proceeding to step 3 (you can still use the code above, but we&#8217;ll be building something much more complex by the end of this series).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingwithcody.com/2010/08/hidden-images-in-email-to-confirm-receipt-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hidden Images in Email to Confirm Receipt</title>
		<link>http://www.codingwithcody.com/2010/07/hidden-images-in-email-to-confirm-receipt/</link>
		<comments>http://www.codingwithcody.com/2010/07/hidden-images-in-email-to-confirm-receipt/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 01:56:27 +0000</pubDate>
		<dc:creator>Cody Snider</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://codingwithcody.com/?p=71</guid>
		<description><![CDATA[It&#8217;s a little rude to ask someone to confirm they read an email, isn&#8217;t it? Well, there&#8217;s a way to get a confirmation without them knowing it using PHP and htaccess. First, create a directory in your images folder called &#8216;email&#8217; (/images/email/ for this tutorial). Inside that folder, create an .htaccess file. Be sure that [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a little rude to ask someone to confirm they read an email, isn&#8217;t it? Well, there&#8217;s a way to get a confirmation without them knowing it using PHP and htaccess.</p>
<p>First, create a directory in your images folder called &#8216;email&#8217; (/images/email/ for this tutorial). Inside that folder, create an .htaccess file. Be sure that your Apache directive for AllowOverride is set to All.</p>
<p>In this .htaccess file, add the following:</p>
<blockquote>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p71code18'); return false;">View Code</a> HTACCESS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p7118"><td class="code" id="p71code18"><pre class="htaccess" style="font-family:monospace;">RewriteEngine On
ReWriteRule ^image(.*?)\-\d{4}\.png$ track.php?x=$1 [L]</pre></td></tr></table></div>

</blockquote>
<p>Next, create a 1x1px PNG image in the same folder and name it track.png. This will be the image loaded in the email.</p>
<p>Finally, in the same folder create a file named track.php and add the following:</p>
<blockquote>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p71code19'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p7119"><td class="code" id="p71code19"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$trackingNumber</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'x'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// logic here for updating your database tables</span>
&nbsp;
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type:image/png'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <a href="http://www.php.net/file_get_contents"><span style="color: #990000;">file_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'track.png'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</blockquote>
<p>Inside the email you are sending, include the following line. This will allow the system to track the ID &#8217;1234&#8242; when that image is loaded. Additionally, as we are using htaccess to mask the script being used, the image will appear to be a regular PNG without any extra parameters.</p>
<blockquote>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p71code20'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p7120"><td class="code" id="p71code20"><pre class="html" style="font-family:monospace;">&lt;img src=&quot;http://www.yoursite.com/images/email/image1234.png&quot; /&gt;</pre></td></tr></table></div>

</blockquote>
<p><a href="http://www.codingwithcody.com/2010/08/hidden-images-in-email-to-confirm-receipt-part-2/">In part 2 of this tutorial</a>, we&#8217;ll discuss where the ID is generated and how it is used.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingwithcody.com/2010/07/hidden-images-in-email-to-confirm-receipt/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Stopping Non-Essential Services on CentOS</title>
		<link>http://www.codingwithcody.com/2010/07/stopping-non-essential-services-on-centos/</link>
		<comments>http://www.codingwithcody.com/2010/07/stopping-non-essential-services-on-centos/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 04:55:23 +0000</pubDate>
		<dc:creator>Cody Snider</dc:creator>
				<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://codingwithcody.com/?p=68</guid>
		<description><![CDATA[Under an out-of-the-box installation of CentOS, many services are running that are non-essential for a LAMP stack to run effectively. Running the following (either individually or as a script) will remove these services from the boot. Original post from VPS.net View Code BASH#Shut down non essential services: &#160; # 1. sendmail # Purpose: sending mail, [...]]]></description>
			<content:encoded><![CDATA[<p>Under an out-of-the-box installation of CentOS, many services are running that are non-essential for a LAMP stack to run effectively. Running the following (either individually or as a script) will remove these services from the boot.</p>
<p><a href="http://www.vps.net/forum/public-forums/general-discussion/850-removing-unnecessary-servies-on-centos-lamp-config" target="_blank">Original post from VPS.net</a></p>
<blockquote>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p68code22'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6822"><td class="code" id="p68code22"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Shut down non essential services:</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># 1. sendmail</span>
<span style="color: #666666; font-style: italic;"># Purpose: sending mail, most use another</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span> stop
chkconfig <span style="color: #c20cb9; font-weight: bold;">sendmail</span> off
&nbsp;
<span style="color: #666666; font-style: italic;"># 2. nfs</span>
<span style="color: #666666; font-style: italic;"># Purpose: mount a disk from another machine</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>portmap stop
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nfs stop
chkconfig portmap off
chkconfig nfs off
&nbsp;
<span style="color: #666666; font-style: italic;"># 3. chargen</span>
<span style="color: #666666; font-style: italic;"># Purpose: testing char generation</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>chargen stop
chkconfig chargen off
&nbsp;
<span style="color: #666666; font-style: italic;"># 4. ypbind</span>
<span style="color: #666666; font-style: italic;"># Purpose: stores info on NIS domains</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>ypbind stop
chkconfig ypbind off
&nbsp;
<span style="color: #666666; font-style: italic;"># 5. anacron</span>
<span style="color: #666666; font-style: italic;"># Purpose: cron for systems that shut down a lot</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>anacron stop
chkconfig anacron off
&nbsp;
<span style="color: #666666; font-style: italic;"># 6. atd</span>
<span style="color: #666666; font-style: italic;"># Purpose: at cmd daemon</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>atd stop
chkconfig atd off
&nbsp;
<span style="color: #666666; font-style: italic;"># 7. routed</span>
<span style="color: #666666; font-style: italic;"># Purpose: Route packets, log tables</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>routed stop
chkconfig routed off
&nbsp;
<span style="color: #666666; font-style: italic;"># 8. snmpd</span>
<span style="color: #666666; font-style: italic;"># Purpose: network monitoring</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>snmpd stop
chkconfig snmpd off
&nbsp;
<span style="color: #666666; font-style: italic;"># 9. gpm</span>
<span style="color: #666666; font-style: italic;"># Purpose: mouse</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>gpm stop
chkconfig gpm off
&nbsp;
<span style="color: #666666; font-style: italic;"># 10. smartd</span>
<span style="color: #666666; font-style: italic;"># Purpose: disk health monitor</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>smartd stop
chkconfig smartd stop
&nbsp;
<span style="color: #666666; font-style: italic;"># 11. hidd</span>
<span style="color: #666666; font-style: italic;"># Purpose: bluetooth</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>hidd stop
chkconfig hidd off
&nbsp;
<span style="color: #666666; font-style: italic;"># 12. pcscf</span>
<span style="color: #666666; font-style: italic;"># Purpose: smart card reader</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>pcscd stop
chkconfig pcscf off
&nbsp;
<span style="color: #666666; font-style: italic;"># 13. isdn</span>
<span style="color: #666666; font-style: italic;"># Purpose: digital network</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>isdn stop
chkconfig isdn off
&nbsp;
<span style="color: #666666; font-style: italic;"># 14. kudzu</span>
<span style="color: #666666; font-style: italic;"># Purpose: watches for new hardware</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>kudzu stop
chkconfig kudzu off
&nbsp;
<span style="color: #666666; font-style: italic;"># 15. cups</span>
<span style="color: #666666; font-style: italic;"># Purpose: printing</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>cups stop
chkconfig cups off
&nbsp;
<span style="color: #666666; font-style: italic;"># 16. xfs</span>
<span style="color: #666666; font-style: italic;"># Purpose: serves x# 1# 1 fonts</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>xfs stop
chkconfig xfs off
&nbsp;
<span style="color: #666666; font-style: italic;"># 17. nfslock</span>
<span style="color: #666666; font-style: italic;"># Purpose: file sys lock</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nfslock stop
chkconfig nfslock off
&nbsp;
<span style="color: #666666; font-style: italic;"># 18. canna</span>
<span style="color: #666666; font-style: italic;"># Purpose: Chinese chars</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>canna stop
chkconfig canna off
&nbsp;
<span style="color: #666666; font-style: italic;"># 19. freeWnn</span>
<span style="color: #666666; font-style: italic;"># Purpose: Japanese chars</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>FreeWnn stop
chkconfig FreeWnn off
&nbsp;
<span style="color: #666666; font-style: italic;"># 20. cups-config-daemon</span>
<span style="color: #666666; font-style: italic;"># Purpose: print config</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>cups-config-daemon stop
chkconfig cups-config-daemon off
&nbsp;
<span style="color: #666666; font-style: italic;"># 21. iiim</span>
<span style="color: #666666; font-style: italic;"># Purpose: internet language input</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>iiim stop
chkconfig iiim off
&nbsp;
<span style="color: #666666; font-style: italic;"># 22. mDNSResponder</span>
<span style="color: #666666; font-style: italic;"># Purpose: dns service discovery</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mDNSResponder stop
chkconfig mDNSResponder off
&nbsp;
<span style="color: #666666; font-style: italic;"># 23. nifd</span>
<span style="color: #666666; font-style: italic;"># Purpose: monitors net interfaces</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nifd stop
chkconfig nifd off
&nbsp;
<span style="color: #666666; font-style: italic;"># 24. rpcimpad</span>
<span style="color: #666666; font-style: italic;"># Purpose: used for nfs server</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>rpcimpad stop
chkconfig rpcimpad off
&nbsp;
<span style="color: #666666; font-style: italic;"># 25. bluetooth</span>
<span style="color: #666666; font-style: italic;"># Purpose: bluetooth devices</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>bluetooth stop
chkconfig bluetooth off
&nbsp;
<span style="color: #666666; font-style: italic;"># 26. saslauthd</span>
<span style="color: #666666; font-style: italic;"># Purpose: handles plaintext authentication requests</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>saslauthd stop
chkconfig saslauthd off
Notes: some systems use this <span style="color: #000000; font-weight: bold;">for</span> email auth<span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># 27. avahi-daemon</span>
<span style="color: #666666; font-style: italic;"># Purpose: instant network recognition</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>avahi-daemon stop
chkconfig avahi-daemon off
&nbsp;
<span style="color: #666666; font-style: italic;"># 28. avahi-dnsconfd</span>
<span style="color: #666666; font-style: italic;"># Purpose: instant network recognition</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>avahi-dnsconfd stop
chkconfig avahi-dnsconfd off
&nbsp;
<span style="color: #666666; font-style: italic;"># 29. sbadm</span>
<span style="color: #666666; font-style: italic;"># Purpose: rapid reboot</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>sbadm stop
chkconfig sbadm off
&nbsp;
<span style="color: #666666; font-style: italic;"># 30. haldaemon</span>
<span style="color: #666666; font-style: italic;"># Purpose: monitors for hardware changes</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>haldaemon stop
chkconfig haldaemon off
&nbsp;
<span style="color: #666666; font-style: italic;"># 31. acpi</span>
<span style="color: #666666; font-style: italic;"># Purpose: sleep/hibernate control</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>acpi stop
chkconfig acpi off
&nbsp;
<span style="color: #666666; font-style: italic;"># 99. gamin</span>
<span style="color: #666666; font-style: italic;"># Purpose: monitors file/dir changes</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>gamin stop
yum <span style="color: #660033;">-y</span> remove gamin</pre></td></tr></table></div>

</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.codingwithcody.com/2010/07/stopping-non-essential-services-on-centos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Symbolic Links</title>
		<link>http://www.codingwithcody.com/2010/07/using-symbolic-links/</link>
		<comments>http://www.codingwithcody.com/2010/07/using-symbolic-links/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 22:41:59 +0000</pubDate>
		<dc:creator>Cody Snider</dc:creator>
				<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://codingwithcody.com/?p=60</guid>
		<description><![CDATA[Symbolic links (symlinks) are an extremely useful tool to every system admin and web application developer. They work a lot like a shortcut in Windows. Let&#8217;s say you were working with a web application that used a framework that held all Javascript, CSS and image files in a tucked-away location (for the sake of this [...]]]></description>
			<content:encoded><![CDATA[<p>Symbolic links (symlinks) are an extremely useful tool to every system admin and web application developer. They work a lot like a shortcut in Windows. Let&#8217;s say you were working with a web application that used a framework that held all Javascript, CSS and image files in a tucked-away location (for the sake of this example, that location is /var/www/html/production/clientside/, making /var/www/html/production/clientside/js/ the location of the Javascript files). And you, the developer working on creating these Javascript, CSS and image files, wanted to use /js/somefile.js instead of a longer name like /production/clientside/js/somefile.js in your public-facing code. To do this, use the following commands:</p>
<p><code>ln -s /var/www/html/production/clientside/js/ /var/www/html/js/</code></p>
<p><code>ln -s /var/www/html/production/clientside/css/ /var/www/html/css/</code></p>
<p><code>ln -s /var/www/html/production/clientside/images/ /var/www/html/images/</code></p>
<p>Bear in mind that if you are using a framework that has pretty URL rules in the .htaccess file, you will have to make exclusions (below is the basic /var/www/html/.htaccess in our example framework):</p>
<p><code>RewriteEngine on<br />
RewriteCond $1 !^(index\.php|images|robots\.txt|css|js)<br />
RewriteRule ^(.*)$ /index.php/$1 [L]</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingwithcody.com/2010/07/using-symbolic-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SERPSight Testers Needed!</title>
		<link>http://www.codingwithcody.com/2010/06/serpsight-testers-needed/</link>
		<comments>http://www.codingwithcody.com/2010/06/serpsight-testers-needed/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 09:42:48 +0000</pubDate>
		<dc:creator>Cody Snider</dc:creator>
				<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://codingwithcody.com/?p=58</guid>
		<description><![CDATA[Visit SERPSight.com for the pre-beta tests. Free automated search engine result page tracking credits for the testers (this is open to anyone). Bonus credits for anyone who can find and report an exploit in the system.]]></description>
			<content:encoded><![CDATA[<p>Visit <a href="http://serpsight.com">SERPSight.com</a> for the pre-beta tests. Free <a href="http://serpsight.com">automated search engine result page tracking</a> credits for the testers (this is open to anyone). Bonus credits for anyone who can find and report an exploit in the system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingwithcody.com/2010/06/serpsight-testers-needed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

