Skip to content


Remote Disc on a MacBook Air

I am in the process of migrating my office to Apple products. I needed a way to install iWorks and Parallels on my boss’s shiny new MacBook Air, but the MacBook Air has no optical drive, and we have not yet ordered an external drive. My assumption was that I would need to make an image and copy it over to her machine; I was wrong. After I launched Finder on her machine, I saw “Remote Disc” as one of her drive options. A little research revealed that I could enable “DVD or CD Sharing” from my Sharing Preferences pane. Doing so made my drive visible from her machine, and the installation went along without a hitch.

Posted in Miscellaneous. Tagged with , .

Code Igniter was fun, sort of

My time with CodeIgniter was fun, but it’s time to switch back to Rails. I enjoyed the ability to really get in and handle some of the code the way that I preferred, but overall I found that I missed a lot of the automagical things that happen with Rails. The biggest shortcoming for me was the lack of a real ActiveRecord model. I might give it a shot where it seems appropriate in the future, but for now I’m going back to Rails.

Posted in Host. Tagged with , , .

The change you wanted was rejected – Rails Problem

I received the error “The change you wanted was rejected” after I moved a rails app from one host to another.

Looking into the log file, the following error appears:

ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
/usr/lib/ruby/1.8/mongrel/rails.rb:76:in `process'
/usr/lib/ruby/1.8/mongrel/rails.rb:74:in `synchronize'
/usr/lib/ruby/1.8/mongrel/rails.rb:74:in `process'
/usr/lib/ruby/1.8/mongrel.rb:159:in `process_client'
/usr/lib/ruby/1.8/mongrel.rb:158:in `each'
/usr/lib/ruby/1.8/mongrel.rb:158:in `process_client'
/usr/lib/ruby/1.8/mongrel.rb:285:in `run'
/usr/lib/ruby/1.8/mongrel.rb:285:in `initialize'
/usr/lib/ruby/1.8/mongrel.rb:285:in `new'
/usr/lib/ruby/1.8/mongrel.rb:285:in `run'
/usr/lib/ruby/1.8/mongrel.rb:268:in `initialize'
/usr/lib/ruby/1.8/mongrel.rb:268:in `new'
/usr/lib/ruby/1.8/mongrel.rb:268:in `run'
/usr/lib/ruby/1.8/mongrel/configurator.rb:282:in `run'
/usr/lib/ruby/1.8/mongrel/configurator.rb:281:in `each'
/usr/lib/ruby/1.8/mongrel/configurator.rb:281:in `run'
/usr/lib/ruby/1.8/mongrel/command.rb:212:in `run'

Rendering /vol/sites/site/public/422.html (422 Unprocessable Entity)

Some further investigation revealed that there was an issue with how rails 2.3.8 was handling cookies.  I stumbled upon the following fix at https://rails.lighthouseapp.com/projects/8994/tickets/4690.

I used Ken Collins’ fix of adding his mongrel.rb (http://gist.github.com/471663) to config/initializers and now all is well.

Posted in Host, Infrastructure. Tagged with .

HTML pages returned as plaintext, who is the culprit?


I have been moving applications from my Rackspace host over to Amazon’s EC2 service.  Moving simple LAMP apps has been fairly cut and dry, but while moving a RoR app and accessing it through apache w/ mod_proxy, the html is delivered to the browser as plaintext.  If I access the app directly on mongrel’s port, it renders correctly.   So it appears that something with either my mod_proxy configuration, or something about how my EC2 instance is set up is causing the problem.


> curl -I http://linux.local:3000
HTTP/1.1 200 OK
Connection: close
Date: Thu, 15 Jul 2010 14:27:27 GMT
Content-Length: 0

> curl -I http://linux.local
HTTP/1.1 200 OK
Date: Thu, 15 Jul 2010 14:27:35 GMT
Via: 1.1 linux.local
Content-Type: text/plain

As you can see, when accessing the page through Apache/mod_proxy, the Content-Type that is returned is explicitly set as text/plain.

Update
This is a bit shoe-horned, but it works for right now. In the apache2.conf file, I changed the DefaultType from text/plain to text/html. The reason this solution “concerns” me is that on my other servers, (where this problem is not occurring) the DefaultType is also set to text/plain, but the html is output correctly.

Posted in Infrastructure. Tagged with .

How to flush your dns cache in OS X


From time to time you may need to flush the dns cache on your mac.  I had recently moved a site from one host to another, and while the nameservers at the various levels returned the new IP address, my browser still looked to the old IP address.

To resolve issues like this, (in Leopard) open a terminal and type in

> dscacheutil -flushcache

The same issue is resolved in 10.5.1 and earlier, open a terminal and type

> lookupd -flushcache

Posted in Miscellaneous. Tagged with , .

First Impressions of Code Igniter


Code Igniter Last night I was forced to start working with CodeIgniter, a PHP web-framework, and I have to say that so far I am enjoying the experience.

CodeIgniter provides a simple framework that allows you to quickly get an application up and running.  The learning curve (so far) has been very low.  I like web-frameworks for projects. I have done a number of projects in Ruby on Rails, and I have dabbled in Django. Those have been pleasant experiences, but I prefer PHP as my preferred development language for most projects due to a number of reasons (not interested in jumping into that holy war right now.)

Up to this point, if I wanted to use a PHP framework, my choices were Zend and CakePHP. Zend is a monster. I’m sorry, I know a lot of developers swear by Zend, but I’m not one of them. Nobody “quickly” picks up Zend. Zend is so incredibly dense/bloated/abstracted that debugging something becomes an exercise that is more time consuming than the original problem that you were trying to solve. CakePHP felt too much like I was pretending to be Ruby on Rails, and there were so many hoops to jump through. And it was frequently a little “too magical.”

After exploring these different options, I wrote my own framework that took the parts of Ruby on Rails that I enjoyed, but kept the flexibility and familiarity of PHP. I have been using this for over a year now and it has served me well. I was pleased to find that the structure of CodeIgniter was almost identical to the structure of my own framework. This has made it a very easy switch for me.

Continued…

Posted in Host. Tagged with , , , , .

Installing MySQL gem on OS X


I encountered the following error when installing the mysql gem on a shiny new Macbook Pro running OS X Leopard.

Note: I have ~/.gem set as my GEM_HOME and GEM_PATH to avoid needing to sudo


> gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

The workaround was fairly simple. Since I had installed MySQL from source the situation was resolved with a few command line options:


> export ARCHFLAGS="-arch x86_64"
> gem install mysql -- \
--with-mysql-dir=/usr/local/mysql \
--with-mysql-lib=/usr/local/mysql/lib \
--with-mysql-include=/usr/local/mysql/include \
--with-mysql-config=/usr/local/mysql/bin/mysql_config

Building native extensions. This could take a while...
Successfully installed mysql-2.8.1
1 gem installed

Posted in Host, Infrastructure. Tagged with , .

Gizmodo “finds” another Apple product

Hilarity below

Posted in Miscellaneous. Tagged with , .

For the Facebook-Matrix, I’m taking the red pill

Facebook used to be a site that I visited when I was bored or had downtime. It was a diversion that could be accessed at any given moment, and then put back away when it’s purpose was served. The problem is that now, you can’t put Facebook away. You can close your browser window and continue on to surf other sites, but no matter where you go, you’re back at Facebook again. If I’m reading an article on cnn.com, my friends’ comments are listed to the right of the article. If I’m visiting (seemingly) random blogs, I’m being encouraged to be the first of my friends to “Like” the posting. Enough. I’m unplugging from the Facebook version of The Matrix.

Continued…

Posted in Trends. Tagged with .

Facebook “likes” violating your privacy

Facebook’s recent modifications to their privacy policies is causing concern for a lot of people, and for good reason. Facebook is encouraging third-party sites and developers to leverage their developer platform to gain deliver a more social experience for their users.  Facebook is referring to this new practice as “Instant Personalization”, and it means that  sites will be able to pull profile information about their visitors, as well as about the visitor’s friends.  That last sentence deserves some attention because it is possibly one of the bigger threats to privacy that I have seen done out-in-the-open on the web.

Essentially what this means is that if your friend visits a site that you have no affiliation with whatsoever, that friend can pass your personal information on to that site.  Meaning that whatever permission that you had previously extended to your friend to use your profile details have now been extended to a site with which you have no affiliation, and with whom you have no knowledge.

This attempted increase in reach is startling.  Not starting because Facebook is doing it (research has shown that adding personal information to advertisements results in significantly higher click-thru) but startling because it’s being allowed in the first place.  Google received FAR more attention for their Buzz Privacy Snafu, and that was a much smaller risk to my privacy than what Facebook is attempting.

Continued…

Posted in Miscellaneous, Trends. Tagged with , .