<?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>danielsenhwong.com &#187; Tech</title>
	<atom:link href="http://blog.danielsenhwong.com/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.danielsenhwong.com</link>
	<description></description>
	<lastBuildDate>Tue, 22 Feb 2011 01:54:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Setting up Ruby on Rails in OS X</title>
		<link>http://blog.danielsenhwong.com/2011/01/setting-up-ruby-on-rails-in-os-x/</link>
		<comments>http://blog.danielsenhwong.com/2011/01/setting-up-ruby-on-rails-in-os-x/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 00:54:01 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/?p=96</guid>
		<description><![CDATA[I consulted quite a few sources online to try and figure out how to do this, and ran into a few problems that took entirely too much time to solve. Now that I&#8217;ve figured them out, I&#8217;m writing the solutions here in the event I need them again. Hopefully they&#8217;ll be useful to a few [...]]]></description>
			<content:encoded><![CDATA[<p>I consulted quite a few sources online to try and figure out how to do this, and ran into a few problems that took entirely too much time to solve. Now that I&#8217;ve figured them out, I&#8217;m writing the solutions here in the event I need them again. Hopefully they&#8217;ll be useful to a few other people as well.</p>
<p><strong>Goals</strong></p>
<p>Create a Ruby on Rails development environment with Apache, MySQL, and PHP.</p>
<p>There are several possible ways of doing this, but since OS X is a Unix-based platform, I don&#8217;t see any reason to use pre-compiled packages like MacPorts and replacing the built-in software. Plus, this is supposed to be a learning experience.</p>
<p><strong>Sources</strong></p>
<p><a href="http://maestric.com/doc/mac/apache_php_mysql_snow_leopard">http://maestric.com/doc/mac/apache_php_mysql_snow_leopard</a></p>
<p><a href="http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/">http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/</a></p>
<p><span id="more-96"></span></p>
<p><strong>Basic Setup</strong></p>
<p>OS X comes with Apache, Ruby, Rails, and PHP pre-loaded; the specific versions of each are dependent upon the installed version of OS X. In my case, I am starting with a fresh installation of Snow Leopard (10.6), and beginning by downloading all available System Updates, which brings my system to version 10.6.5, with Apache version 2.2.15, Ruby 1.8.7, Rails 2.3.5 , and PHP 5.3.3.</p>
<p>In order to use the pre-loaded Apache installation, go to &#8220;System Preferences&#8221; &gt; &#8220;Sharing&#8221;  and check &#8220;Web Sharing&#8221;. This will enable the Apache web server. If you ever need to restart the server, either uncheck and re-check this box, or use the command &lt;code&gt;sudo apachectl restart&lt;/code&gt; from the command line.</p>
<p>Next, we need a compiler, so we&#8217;ll install Apple&#8217;s Xcode Developer Tools, which can be found on the OS X installation CD/DVD and also online directly from Apple (<a href="http://developer.apple.com/technologies/tools/xcode.html">http://developer.apple.com/technologies/tools/xcode.html</a>). I have version 3.2.3 installed. I&#8217;m writing this up after having performed all of the updates, so the initial version may have been different.</p>
<p><strong>MySQL</strong></p>
<p>MySQL doesn&#8217;t come installed as part of the normal OS X distribution; just OS X Server. No problem; just download an OS X *.dmg package for MySQL Community Server: <a href="http://www.mysql.com/downloads/mysql/#downloads">http://www.mysql.com/downloads/mysql/#downloads</a></p>
<p>Note: OS X Snow Leopard (10.6) and later compile in 64-bit C, so be sure to download the 64-bit version of MySQL (x86_64 suffix). This took me a while to figure out, as I had downloaded the 32-bit version for my 32-bit kernel. I thought it made sense. Version 5.1 should work just fine; I didn&#8217;t try 5.5.</p>
<p>Anyway, the MySQL *.dmg contains three files: the MySQL installer, the MySQL Startup Item installer, and the Preference Pane item. Install them in the order I have listed here. Once it&#8217;s installed, go ahead and try starting the server. The indicator in the Preference Pane item should turn green.</p>
<p>Edit /etc/profile and add &#8220;PATH=$PATH:/usr/local/mysql/bin&#8221;, otherwise you&#8217;ll have to type the full path to the mysql and mysqladmin executables in order to use them.</p>
<p><strong>PHP</strong></p>
<p>You&#8217;ll need to enable PHP by un-commenting a line beginning with &#8220;LoadModule php5_module&#8230;&#8221; in your Apache configuration file, typically found at /private/etc/apache2/apache2.conf.</p>
<p>Additionally, you&#8217;ll have to create a php.ini file in /etc/, which is most easily done by making a copy of &#8220;/etc/php.ini.default&#8221;. While you&#8217;re doing that, un-comment the line for your time zone, and enter a valid value. Additionally, change the three occurrences of &#8220;/var/mysql/mysql.sock&#8221; to &#8220;/tmp/mysql.sock&#8221; in order to point PHP at your MySQL installation.</p>
<p>I like using phpMyAdmin to manage my MySQL databases, so I&#8217;ll need to install this. The process is straightforward and well-documented. However, once you do this, you&#8217;ll notice that you&#8217;ll need PHP to have been compiled with the mcrypt extension, and the OS X distribution hasn&#8217;t been. Not to worry, Michael Gracie has a solution to that problem (<a href="http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/">http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/</a>).  Be sure to update the version numbers of the different software packages accordingly.</p>
<p>Restart the Apache server so these changes to php.ini take effect.</p>
<p><strong>Ruby on Rails</strong></p>
<p>I&#8217;m going to be using Rails 3.0, so I&#8217;ll need to update RubyGems with &#8220;sudo gem update &#8211;system&#8221; followed by &#8220;sudo gem update&#8221; to update all installed gems.</p>
<p>I&#8217;ll need to install a database adapter so that RoR can interface with MySQL. Rails 3 defaults to the mysql2 gem for MySQL databases, so we&#8217;ll install that with &#8220;sudo gem install mysql2 &#8212; &#8211;with-mysql-config=/usr/local/mysql/bin/mysql_config&#8221;.</p>
<p>I want to use the devise plugin for user authentication, so I&#8217;ll install that and its dependent gem, warden.</p>
<p>Finally, I want to use passenger to deploy my Rails application just to make my life easier: &#8220;sudo gem install passenger&#8221; followed by &#8220;sudo passenger-install-apache2-module&#8221; and follow the directions.</p>
<p><strong>Done!</strong></p>
<p>I was going to write more about configuring virtual hosts, but this post languished with &#8220;draft&#8221; status for over a week already.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2011/01/setting-up-ruby-on-rails-in-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7, and Disabling Windows Live Messenger Automatic Startup</title>
		<link>http://blog.danielsenhwong.com/2009/10/windows-7-and-disabling-windows-live-messenger-automatic-startup/</link>
		<comments>http://blog.danielsenhwong.com/2009/10/windows-7-and-disabling-windows-live-messenger-automatic-startup/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 19:14:21 +0000</pubDate>
		<dc:creator>dan</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[widnows live messenger]]></category>
		<category><![CDATA[windows 7]]></category>
		<category><![CDATA[windows security essentials]]></category>

		<guid isPermaLink="false">http://blog.danielsenhwong.com/?p=59</guid>
		<description><![CDATA[I just installed Windows 7 Professional on my desktop and Windows 7 Home Premium on my laptop.  Both computer are now running faster than they were under Vista and XP, respectively.  I don&#8217;t know exactly what Microsoft did differently this time, but they did it right.  Vista and XP didn&#8217;t run this quickly even after [...]]]></description>
			<content:encoded><![CDATA[<p>I just installed Windows 7 Professional on my desktop and Windows 7 Home Premium on my laptop.  Both computer are now running faster than they were under Vista and XP, respectively.  I don&#8217;t know exactly what Microsoft did differently this time, but they did it right.  Vista and XP didn&#8217;t run this quickly even after clean installs.</p>
<p>In any case, I installed Microsoft Security Essentials as antivirus software on both, partly to test it out, and I&#8217;ll move my Avast license over if I can once I&#8217;ve migrated over from Vista.  No complaints yet.</p>
<p>I also installed Windows Live Essentials, which is a suite of programs, including Windows Mail (formerly Outlook Express), Movie Maker, Photo Gallery, and a few others.  One of the &#8220;others&#8221; is Windows Live Messenger, which just like MSN Messenger before it in XP, starts up automatically when you boot up your computer, and it&#8217;s annoying as hell, especially considering I don&#8217;t plan on using it.  So, to disable it, follow these steps:</p>
<ul>
<li>In the search box at the bottom of the Start menu, type &#8220;msconfig&#8221; to bring up the System Configuration utility.</li>
<li>Click the &#8220;Startup&#8221; tab.</li>
<li>Find the &#8220;Windows Live Messenger&#8221; entry, and uncheck the box to disable.  I sorted the list by Startup Item to make this easy.</li>
<li>Click OK, and you&#8217;re done!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielsenhwong.com/2009/10/windows-7-and-disabling-windows-live-messenger-automatic-startup/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

