<?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>./cmsimike</title>
	<atom:link href="http://www.cmsimike.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cmsimike.com/blog</link>
	<description>thoughts from a computer scientist</description>
	<lastBuildDate>Sun, 08 Jan 2012 22:20:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Install MySQL on Ubuntu Without Being Prompted for a Password</title>
		<link>http://www.cmsimike.com/blog/2012/01/08/install-mysql-on-ubuntu-without-being-prompted-for-a-password/</link>
		<comments>http://www.cmsimike.com/blog/2012/01/08/install-mysql-on-ubuntu-without-being-prompted-for-a-password/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 22:20:29 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[debconf]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[provisioning]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.cmsimike.com/blog/?p=281</guid>
		<description><![CDATA[I&#8217;ve been doing quite a lot of development lately, on various projects, and have been making great use of Vagrant for isolated development. As such, I need to write provisioning scripts so that each machine can be built exactly as the production machine will be. I&#8217;ve tried Puppet once but it was far more than what I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing quite a lot of development lately, on various projects, and have been making great use of Vagrant for isolated development. As such, I need to write provisioning scripts so that each machine can be built exactly as the production machine will be. I&#8217;ve tried Puppet once but it was far more than what I needed, so I just settled with using a shell script provisioner. Just a basic bash file with a bunch of apt-gets, pips and what not. Most of my projects require a database so MySQL it is. The issue I had was automatically installing MySQL without being asked for a password (as the provisioner is non-interactive). One amazing way I&#8217;ve found is issuing these commands before the apt-get (or tasksel) commands to install MySQL</p>
<pre>
echo "mysql-server mysql-server/root_password select (YOUR PASSWORD)" | sudo debconf-set-selections
echo "mysql-server mysql-server/root_password_again select (YOUR PASSWORD)" | sudo debconf-set-selections
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.cmsimike.com/blog/2012/01/08/install-mysql-on-ubuntu-without-being-prompted-for-a-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Up Local Mail Delivery on Ubuntu with Postfix and Mutt</title>
		<link>http://www.cmsimike.com/blog/2011/10/30/setting-up-local-mail-delivery-on-ubuntu-with-postfix-and-mutt/</link>
		<comments>http://www.cmsimike.com/blog/2011/10/30/setting-up-local-mail-delivery-on-ubuntu-with-postfix-and-mutt/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 03:06:26 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.cmsimike.com/blog/?p=279</guid>
		<description><![CDATA[I am getting pretty close to deploying m webap and am currently looking into ways to monitor exceptions once deployed. Django has the ability to email whenever it encounters a 500 error. I don&#8217;t really want any emails being sent out (yet) so I decided that I should probably just stick with local mail delivery [...]]]></description>
			<content:encoded><![CDATA[<p>I am getting pretty close to deploying m webap and am currently looking into ways to monitor exceptions once deployed. Django has the ability to email whenever it encounters a 500 error. I don&#8217;t really want any emails being sent out (yet) so I decided that I should probably just stick with local mail delivery until such time that I want to be notified right away of a problem.<br />
<span id="more-279"></span><br />
I&#8217;ve set up local mail delivery before using <a title="Postfix Home Page" href="http://www.postfix.org/" target="_blank">Postfix</a> but I always end up having to figure out how to do it over and over. This post is really going to be for me to remember how to do it but I figured that others may like to know about my methodologies for exception monitoring. The brilliant part about that is since I will be using a pretty beefy server, all my webapps will be able to use the same local email delivery so all my mails indicating problems will be in one place.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> postfix</pre></div></div>

<p>Under &#8220;General type of mail configuration&#8221; select Local only</p>
<p>System mail name: localhost (I will presume from here on out that you are sending email to &lt;user&gt;@localhost)</p>
<p>Once complete, issue this command to tell postfix where to deliver mail:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> postconf <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;home_mailbox = Maildir/&quot;</span></pre></div></div>

<p>Now we install mutt:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mutt</pre></div></div>

<p>And then configure mutt to know where our email will be delivered to and what kind of mailbox it will be:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> ~<span style="color: #000000; font-weight: bold;">/</span>.muttrc</pre></div></div>

<p>Paste this into the file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">mbox_type</span>=Maildir
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">folder</span>=<span style="color: #ff0000;">&quot;~/Maildir&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">mask</span>=<span style="color: #ff0000;">&quot;!^\\.[^.]&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">mbox</span>=<span style="color: #ff0000;">&quot;~/Maildir&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">record</span>=<span style="color: #ff0000;">&quot;+.Sent&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">postponed</span>=<span style="color: #ff0000;">&quot;+.Drafts&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">spoolfile</span>=<span style="color: #ff0000;">&quot;~/Maildir&quot;</span></pre></div></div>

<p>Then start mutt so that it can create our mailbox.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mutt</pre></div></div>

<p>You will probably get a message that says:</p>
<pre>/home/USER/Maildir is not a mailbox.</pre>
<p>Don&#8217;t worry about it for now. Postfix will fix that for us on first delivery.</p>
<p>This part is optional &#8211; set where any mail sent to root is forwarded to.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.forward</pre></div></div>

<p>and in it, type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">USER<span style="color: #000000; font-weight: bold;">@</span>localhost</pre></div></div>

<p>If you want all mail for root to be sent to the user mike, you&#8217;d write<br />
mike@localhost</p>
<p>Now you can test this out using python</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">smtplib</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">string</span>
SUBJECT = <span style="color: #483d8b;">&quot;Test email&quot;</span>
TO = <span style="color: #483d8b;">&quot;root@localhost&quot;</span> <span style="color: #808080; font-style: italic;"># This is to test forwarding from root to another user. if you didn't set up forwarding, use your username</span>
FROM = <span style="color: #483d8b;">&quot;python@localhost&quot;</span>
text = <span style="color: #483d8b;">&quot;blah blah blah&quot;</span>
BODY = <span style="color: #dc143c;">string</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>
        <span style="color: #483d8b;">&quot;From: %s&quot;</span> <span style="color: #66cc66;">%</span> FROM,
        <span style="color: #483d8b;">&quot;To: %s&quot;</span> <span style="color: #66cc66;">%</span> TO,
        <span style="color: #483d8b;">&quot;Subject: %s&quot;</span> <span style="color: #66cc66;">%</span> SUBJECT,
        <span style="color: #483d8b;">&quot;&quot;</span>,
        text
        <span style="color: black;">&#41;</span>,
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span>
server = <span style="color: #dc143c;">smtplib</span>.<span style="color: black;">SMTP</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'localhost'</span><span style="color: black;">&#41;</span>
server.<span style="color: black;">sendmail</span><span style="color: black;">&#40;</span>FROM, TO,BODY<span style="color: black;">&#41;</span>
server.<span style="color: black;">quit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Now you can send mail to any users on the system. If I ever want change the delivery from local to something that gets sent out, I can follow one of the many articles on the internet describing how to set up <a href="http://ykyuen.wordpress.com/2011/02/05/postfix-relay-via-gmail/">relaying through Gmail</a> and set my local user&#8217;s .forward to an email (not verified, hypothesized).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmsimike.com/blog/2011/10/30/setting-up-local-mail-delivery-on-ubuntu-with-postfix-and-mutt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>django-boilerplate-layout</title>
		<link>http://www.cmsimike.com/blog/2011/09/18/django-boilerplate-layout/</link>
		<comments>http://www.cmsimike.com/blog/2011/09/18/django-boilerplate-layout/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 22:55:18 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[boilerplate]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[file layout]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.cmsimike.com/blog/?p=277</guid>
		<description><![CDATA[Very quickly, I&#8217;d like to introduce to you my newest github project &#8211; django-boilerplate-layout. It is my hope that for each new version of django, you can check out this project layout and just start coding. More info on what this project is on the README.markdown
]]></description>
			<content:encoded><![CDATA[<p>Very quickly, I&#8217;d like to introduce to you my newest github project &#8211; <a title="django-boilerplate-layout" href="https://github.com/cmsimike/django-boilerplate-layout" target="_blank">django-boilerplate-layout</a>. It is my hope that for each new version of django, you can check out this project layout and just start coding. More info on what this project is on the README.markdown</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmsimike.com/blog/2011/09/18/django-boilerplate-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Session-Backed URL Redirect After Login with Django</title>
		<link>http://www.cmsimike.com/blog/2011/07/30/session-backed-url-redirect-after-login-with-django/</link>
		<comments>http://www.cmsimike.com/blog/2011/07/30/session-backed-url-redirect-after-login-with-django/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 02:00:45 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://www.cmsimike.com/blog/?p=275</guid>
		<description><![CDATA[I am working on a Django-powered website, a website with no actual login of it&#8217;s own. I am using 3rd parties (Facebook/Twitter/etc) to provide authentication for my users. The issue I ran into is, what happens if a user goes to a url that is protected with a @login_requred decorator? Well, it should be simple &#8211; Django [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on a Django-powered website, a website with no actual login of it&#8217;s own. I am using 3rd parties (Facebook/Twitter/etc) to provide authentication for my users. The issue I ran into is, what happens if a user goes to a url that is protected with a @login_requred decorator? Well, it should be simple &#8211; Django redirects the user to the supposed login page, with a parameter of next=/some/url/to/go/to. Since my app doesn&#8217;t do the login itself, the user then clicks on which third party service they wish to authenticate against. The user is taken through the third party&#8217;s authentication workflow and redirected back to my site. The problem here is that the &#8220;next&#8221; url parameter is lost in the process. I thought I would need to write a @login_required_session decorator, which would be less than ideal if my app then uses built in views with the @login_required decorator.</p>
<p><span id="more-275"></span>There is a simple work around for this: shove the value for the &#8220;next&#8221; url paramter into the session of where ever your login page is. Upon return, check to see if a session value exists for url redirection and if so, use it. Here is the code I came up with:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">    <span style="color: #808080; font-style: italic;"># If we have a redirect URL in our session, redirect to it.</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> request.<span style="color: black;">session</span>.<span style="color: black;">has_key</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'redirect-url'</span><span style="color: black;">&#41;</span>:  
        redirect_url = request.<span style="color: black;">session</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'redirect-url'</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">del</span> request.<span style="color: black;">session</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'redirect-url'</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponseRedirect<span style="color: black;">&#40;</span>redirect_url<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># if the url has a next paramter, save it in the session</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> request.<span style="color: black;">GET</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'next'</span>, <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
        request.<span style="color: black;">session</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'redirect-url'</span><span style="color: black;">&#93;</span> = request.<span style="color: black;">GET</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'next'</span><span style="color: black;">&#93;</span></pre></div></div>

<p>Note here that where the user is redirected to if not logged in and where the user is redirected to post-third party authentication is the same for me. If you have two separate views for this, you&#8217;d break the above code up and put them where they make sense.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmsimike.com/blog/2011/07/30/session-backed-url-redirect-after-login-with-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>django-twitter-oauth on github</title>
		<link>http://www.cmsimike.com/blog/2011/06/16/django-twitter-oauth-on-github/</link>
		<comments>http://www.cmsimike.com/blog/2011/06/16/django-twitter-oauth-on-github/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 03:49:56 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[django-twitter-oauth]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.cmsimike.com/blog/?p=273</guid>
		<description><![CDATA[Just a quick post to link (one of my) works in progress &#8211; django-twitter-oauth that I forked on github. It is a work in progress as I am using it on another project I&#8217;m working on currently so, hopefully, this app can only get better over time. There are a few things I may want [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick post to link (one of my) works in progress &#8211; <a href="https://github.com/cmsimike/django-twitter-oauth" target="_blank">django-twitter-oauth</a> that I forked on github. It is a work in progress as I am using it on another project I&#8217;m working on currently so, hopefully, this app can only get better over time. There are a few things I may want to change (caching the access token in the session instead of always going to the DB) and, really, this has not been tested on MySQL yet (I am using sqlite3 for dev), but it should work. Works well so far. Only a few problems I have yet to start working on (off the top of my head, random BadStatusLine exception every once in a while, mainly) .</p>
<p>I will try to update my blog whenever I update the app with what I changed, but we&#8217;ll see.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmsimike.com/blog/2011/06/16/django-twitter-oauth-on-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Separating Out Django Models into Different Files</title>
		<link>http://www.cmsimike.com/blog/2011/06/06/separating-out-django-models-into-different-files/</link>
		<comments>http://www.cmsimike.com/blog/2011/06/06/separating-out-django-models-into-different-files/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 06:55:12 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.cmsimike.com/blog/?p=270</guid>
		<description><![CDATA[This will be a really quick post since, for whatever reason, I could not find this information out easy on the internet. The only reason I was able to find it is due to my great and good friend, Andres Buritica&#8217;s help. Starting a Django project, then an app gives you a models.py which Django expects [...]]]></description>
			<content:encoded><![CDATA[<p>This will be a really quick post since, for whatever reason, I could not find this information out easy on the internet. The only reason I was able to find it is due to my great and good friend, Andres Buritica&#8217;s help. Starting a Django project, then an app gives you a models.py which Django expects to house all the models. This does not seem like the best of ideas, so obviously I want to split up the models into their own files in a specific model directory. To accomplish this, you must do two things:</p>
<ol>
<li>Create a meta class for the model with a field &#8220;app_label&#8221; being set to the name of your app</li>
<li>In your __init__.py file, import that model.</li>
</ol>
<p>For example, if you started an app by typing out &#8216;python manage.py startapp foo&#8217;, you can delete your models.py file, replace it with a directory named models (what I do), and inside have an __init__.py and Bar.py files.<br />
in Bar.py:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">db</span> <span style="color: #ff7700;font-weight:bold;">import</span> models
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Bar<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
    bar    = models.<span style="color: black;">TextField</span><span style="color: black;">&#40;</span>blank=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">class</span> Meta:
        app_label = <span style="color: #483d8b;">&quot;foo&quot;</span></pre></div></div>

<p>then in __init__.py:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> Bar <span style="color: #ff7700;font-weight:bold;">import</span> Bar</pre></div></div>

<p>This also goes for other things specified outside of the Django &#8220;norm&#8221; I guess?<br />
If I wanted to associate Bar with the admin, I create a subdirectory inside my app named admin, and inside it I have<br />
BarAdmin.py</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> foo.<span style="color: black;">models</span> <span style="color: #ff7700;font-weight:bold;">import</span> Bar
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">contrib</span> <span style="color: #ff7700;font-weight:bold;">import</span> admin
&nbsp;
admin.<span style="color: #dc143c;">site</span>.<span style="color: black;">register</span><span style="color: black;">&#40;</span>Bar<span style="color: black;">&#41;</span></pre></div></div>

<p>Inside the __init__.py for the admin subdirectory, you&#8217;d have:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> BarAdmin</pre></div></div>

<p>Now I could be doing this all wrong but this is the only way I managed to get everything working. If there is a better way to do this, I am all ears. To you Django/Python professionals out there, this may be common knowledge but I am noobing it up right now trying to better learn Python and Django.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmsimike.com/blog/2011/06/06/separating-out-django-models-into-different-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ease Switching Between OS X and Linux Environments for Development</title>
		<link>http://www.cmsimike.com/blog/2011/05/07/ease-switching-between-os-x-and-linux-environments-for-development/</link>
		<comments>http://www.cmsimike.com/blog/2011/05/07/ease-switching-between-os-x-and-linux-environments-for-development/#comments</comments>
		<pubDate>Sun, 08 May 2011 01:55:07 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[file system]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[symlink]]></category>

		<guid isPermaLink="false">http://www.cmsimike.com/blog/?p=268</guid>
		<description><![CDATA[As I may have pointed out in a previous post, I&#8217;ve switched all my non-server computers over to OSX. My desktop is OSX and dual boots Windows (for very few things). My latptop, my development machine, dual boots OSX and Linux. Each instance of OSX has Virtual Box and Windows XP as well as Linux, [...]]]></description>
			<content:encoded><![CDATA[<p>As I may have pointed out in a previous post, I&#8217;ve switched all my non-server computers over to OSX. My desktop is OSX and dual boots Windows (for very few things). My latptop, my development machine, dual boots OSX and Linux. Each instance of OSX has Virtual Box and Windows XP as well as Linux, the mentality that for simple Windows and Linux things where OSX wouldn&#8217;t/couldn&#8217;t work, I can use a VM. For 99% of the time, that works. Ultimately I switch into the secondary OSes only when I need to access the hardware natively.</p>
<p>One issue I&#8217;d run into switching between OSX and Linux for development  - and one thing that really bothered me &#8211; is OSX&#8217;s home directory is /Users while any Linux box is /home. Call me lazy for not having a better way to manage configuration files but I didn&#8217;t want to manage configuration files. I finally decided that my OSX box should probably match my Linux box in terms of directory structure, at least superficially. I backed up the current /home directory on OSX and created a symlink to /Users so that /home -&gt; /Users.</p>
<p>I don&#8217;t know if this is a bad thing or not, so try this at your own risk, but so far for me, I like it. I don&#8217;t know what&#8217;s taken me so long to do this.</p>
<p>These commands backup your current /home to /home_bkup, in case you ever need it again. Why? I don&#8217;t know.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>
 <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> home<span style="color: #000000; font-weight: bold;">/</span> home_bkup</pre></div></div>

<p>This creates the symlink.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>home</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cmsimike.com/blog/2011/05/07/ease-switching-between-os-x-and-linux-environments-for-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modernizing My Javascript Practices</title>
		<link>http://www.cmsimike.com/blog/2011/05/06/modernizing-my-javascript-practices/</link>
		<comments>http://www.cmsimike.com/blog/2011/05/06/modernizing-my-javascript-practices/#comments</comments>
		<pubDate>Fri, 06 May 2011 22:04:26 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[doug crockford]]></category>
		<category><![CDATA[good parts]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[paul irish]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://www.cmsimike.com/blog/?p=263</guid>
		<description><![CDATA[Few reasons why I haven&#8217;t updated this with any meaty updates:

I&#8217;ve taken time off to do the life thing. Cliche but needed.
Now that I&#8217;ve got back into developing software, I am trying new things out: Python/Django and Javascript

Now my Javascript experience has always been very poor but lately I&#8217;ve been finding videos that talk about [...]]]></description>
			<content:encoded><![CDATA[<p>Few reasons why I haven&#8217;t updated this with any meaty updates:</p>
<ol>
<li>I&#8217;ve taken time off to do the life thing. Cliche but needed.</li>
<li>Now that I&#8217;ve got back into developing software, I am trying new things out: Python/Django and Javascript</li>
</ol>
<p>Now my Javascript experience has always been very poor but lately I&#8217;ve been finding videos that talk about Javascript and it is really getting me interested and excited about the language. The two so far I&#8217;ve found are:<br />
JavaScript: The Good Parts talk by Doug Crockford<br />
<iframe width="425" height="349" src="http://www.youtube.com/embed/hQVTIJBZook?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>and the 10 Things I Learned from the jQuery Source by Paul Irish:<br />
<iframe width="560" height="349" src="http://www.youtube.com/embed/i_qE1iAmjFg?rel=0" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmsimike.com/blog/2011/05/06/modernizing-my-javascript-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Fangled Javascript Best Practices</title>
		<link>http://www.cmsimike.com/blog/2011/04/13/new-fangled-javascript-best-practices/</link>
		<comments>http://www.cmsimike.com/blog/2011/04/13/new-fangled-javascript-best-practices/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 23:47:58 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.cmsimike.com/blog/?p=252</guid>
		<description><![CDATA[Subtitle: Or At Least, New Best Practices for Me
Now let me be honest: I&#8217;ve never been a fan of front end development. HTML sucked, Javascript wasn&#8217;t close to my favorite (I&#8217;d much rather code up some assembly than touch Javascript) and their interaction with each other was dirty, at best. With the dawn of HTML5, [...]]]></description>
			<content:encoded><![CDATA[<p>Subtitle: Or At Least, New Best Practices for Me</p>
<p>Now let me be honest: I&#8217;ve never been a fan of front end development. HTML sucked, Javascript wasn&#8217;t close to my favorite (I&#8217;d much rather code up some assembly than touch Javascript) and their interaction with each other was dirty, at best. With the dawn of HTML5, I&#8217;ve become interested in HTML again and viewing (or, trying to view) the Javascript source of the very prominent websites got me interested in Javascript. The real turning point for me was watching <a href="http://paulirish.com/" target="_blank">Paul Irish&#8217;s</a> <a href="http://paulirish.com/2010/10-things-i-learned-from-the-jquery-source/" target="_blank">10 Things I Learned from the jQuery Source</a>. That video, really, has turned me around on the power of Javascript.</p>
<p>Here&#8217;s what I&#8217;ve got out of it so far:</p>
<p>test.html</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;test.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;test.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;</span>hi<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>test.js</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> TEST <span style="color: #339933;">=</span> window.<span style="color: #660066;">TEST</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#123;</span>test<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
    TEST.<span style="color: #660066;">test</span><span style="color: #339933;">++;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>TEST.<span style="color: #660066;">test</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    window<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'TEST'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> TEST<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now what am I going on about?</p>
<p><span id="more-252"></span></p>
<p>Now after some research, this looks to be the &#8220;cool&#8221; way to do Javascript these days. I kind of like it. I wrote this up due to line #1 in test.js as a test. Many times I&#8217;ve seen people write</p>
<pre>
var OBJ = OBJ || {};
</pre>
<p>Now the cool part about this is including the file multiple times by mistake. That line tries to guarantee that regardless of how many times you try to include the Javascript on the page, only one object is created. The problem is, without checking window.OBJ, the reference will be lost and overwritten. The two test files I&#8217;ve pasted tests this. The HTML includes the Javascript twice. The EXPECTED behavior is to include the file once, have the alert show you 1 include the file again then the alert should show you 2. Leaving off the window. part of window.OBJ alerts you with 1 both times. Probably not what you want. Anyway I thought it was just an interesting test to confirm what I thought was correct. Also, I am asking for input. Is this correct? Is there a fancier way to go about doing this? Any references out there that will help me learn the latest and greatest way to use Javascript?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmsimike.com/blog/2011/04/13/new-fangled-javascript-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome is My Default Browser and Here&#8217;s Why</title>
		<link>http://www.cmsimike.com/blog/2011/02/14/google-chrome-is-my-default-browser-and-heres-why/</link>
		<comments>http://www.cmsimike.com/blog/2011/02/14/google-chrome-is-my-default-browser-and-heres-why/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 02:39:19 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[extentions]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://www.cmsimike.com/blog/?p=248</guid>
		<description><![CDATA[I&#8217;ve always loved Google Chrome, since I first got my hands on it, but there were always so many things that I depended on in Firefox did but Chrome didnt &#8211; Live Bookmarks and Adblock mainly. Today marks the day that I&#8217;ve converted to using Chrome exclusively and here&#8217;s why.


Adblock for Chrome &#8211; This has [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always loved Google Chrome, since I first got my hands on it, but there were always so many things that I depended on in Firefox did but Chrome didnt &#8211; Live Bookmarks and Adblock mainly. Today marks the day that I&#8217;ve converted to using Chrome exclusively and here&#8217;s why.</p>
<p><span id="more-248"></span></p>
<ol>
<li><a title="Adblock for Google Chrome" href="https://chrome.google.com/extensions/detail/gighmmpiobklfepjocnamgkkbiglidom" target="_blank">Adblock for Chrome</a> &#8211; This has been around for a while, yes, and it&#8217;s been installed for a while.</li>
<li><a title="Personal Blocklist" href="https://chrome.google.com/webstore/detail/nolijncfnkgaikbjbdaogikpmpbdcdef" target="_blank">Personal Blocklist (by Google)</a> &#8211; This I&#8217;ve just discovered today (I think it was made available today) and this is something I&#8217;ve been wanting in Google search results for a very long time. This plugin gives you an option to block domains from Google search results. Say &#8220;bye-bye&#8221; to those stupid content farms. This also sends block information back to Google so that they can further tune their anti-content-farm algorithms. The only shortcoming of this is that the extension&#8217;s data still doesn&#8217;t sync to my Google account which means I&#8217;d have to add each domain in on each instance of Chrome, which isn&#8217;t a deal breaker, but I can&#8217;t wait to everything just automagically works everywhere.</li>
<li><a title="RSS Live Links" href="https://chrome.google.com/extensions/detail/hcamnijgggppihioleoenjmlnakejdph" target="_blank">RSS Live Links</a> &#8211; This is, by far, the most important thing for me. I have a bunch of &#8220;daily&#8221; links set up through del.icio.us and setup through Firefox as live links so that I can open my browser, click one button and have all my important links open. This was not available on Chrome for a while. I just found this extension today.</li>
</ol>
<p>And with the RSS Live Links extension, I am content enough with Chrome to get rid of Firefox for my daily browsing needs. Congrats Google, you&#8217;ve won again. No amount of Firefox 4 is going to convince me to switch back to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmsimike.com/blog/2011/02/14/google-chrome-is-my-default-browser-and-heres-why/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

