28 Jul 2010

Hackintosh

I finally took the plunge and built a Hackintosh.

I was against the idea for the longest time, previously willing to trade a bit of cash for the extra stability and legality that an Apple-Mac-proper offers. However, when comparing a Mac Pro to a homegrown solution the extra bit of cash is now a serious few thousand dollars.

Design Goals

I really wanted a fast machine for web development with Ruby and Rails, with enough horsepower to run Photoshop on some big files. This meant: SSD and RAM. Even with 12G of RAM I think the biggest speed differentiator on this machine that blows it out out of the water is the SSD. I’ll post some further benchmarks, but a quick comparison of a Rails unit test shows a speedup of about 7x from my Mac Book Pro.

The Goods

Component Item Price (Vendor)
Displays hp ZR24W 2 x $399.99 (Amazon.com / Buy.com)
Case LIAN LI PC-A05NA $40 from a friend
Motherboard Gigabyte GA-X58A-UD3R $209.99 (Newegg)
System Drive Crucial RealSSD C300 128GB SSD $334 (Newegg)
PSU OCZ StealthXStream OCZ700SXS 700W $30 from a friend
CPU Intel Core i7-920 $294.99 (Newegg)
Heatsink ZALMAN CNPS10X FLEX CPU Cooler $52.99 (Newegg)
Memory Crucial 6GB DDR3 1333 2 x $143.98 (Newegg)
Graphics PNY GeForce 9800 GT 1GB $69 after rebate (Newegg)
Optical Drive Sony Optiarc CD/DVD Burner $19.99 (Newegg)
Total about $2,100 (+ time)

The Work

Getting everything to work together was a bit of a hassle, mostly due to never having to worry about drivers on OS X in the past and learning how all the kernel subsystems work. Kexts? (kernel extensions) SLE? (/System/Library/Extensions).

This tutorial (using iBoot and Multibeast) was a big help, as was the InsanelyMac Forum.

I had a lot of problems trying to get an nVidia GT240 to work with two displays, but I finally gave in and ordered a 9800GT which was reported to work perfectly — it did.

I’m not claiming this build is perfect, I still have a few odd issues with USB, but its close. And way more economical than buying a Mac Pro from Apple.

12 Feb 2009

Jekyll

I’ve taken the plunge to a static-HTML blog with Jekyll. I’m impressed so far. I love having the whole she-bang in git, but then again the whole idea of a datastore in git has fascinated me from the start.

And pushing to GitHub pages (willcodeforfoo.github.com) just worked. A few minutes after pushing, I hit the URL. Half expecting an error page and half expecting just nothing I found the site. Just the way I hoped it would work.

I thought I’d share some of the things I encountered along the way to help folks just getting started.

Source Code

First up, feel free to check out the full source code that Jekyll uses to build all this html: http://github.com/willcodeforfoo/willcodeforfoo.github.com/tree/master

Importing from Mephisto

Here’s a hacky, super-simple, one-liner script that I threw together at the Mephisto Rails console:

Content.find_by_sql("SELECT id, permalink, body, published_at, title FROM contents WHERE type = 'Article' AND published_at IS NOT NULL ORDER BY published_at").each {|c| File.open("#{c.published_at.strftime('%Y-%m-%d')}-#{c.permalink}.textile", "w+"){|f| f.puts "---\nlayout: post\ntitle: #{c.title}\n---\n\n"; f.puts c.body }}

This will not work 100%, though. It doesn’t do anything fancy like output real YAML, with escaped characters. So if you have funky characters in your titles, things could blow up.

uninitialized constant Classifier::LSI::Matrix (NameError) when running with --lsi option

Applying this patch to Classifier’s lsi.rb file seemed to do the trick.

As an aside: I’m truly impressed with the Classifier gem. I’ve seen its Bayesian stuff before, but Jekyll was my first exposure to LSI.

Categories

I was thinking about adding other “types” of posts to my site, something along the lines of books I’m reading, music I’m enjoying, etc.

I decided I could use Categories to pull this off, so my structure looks something like this:

|-- CNAME
|-- _layouts
|   |-- book.html
|   |-- master.html
|   |-- music.html
|   `-- post.html
|-- about.textile
|-- articles
|   `-- _posts
|       |-- 2009-02-10-reducing-the-noise.textile
|       `-- 2009-02-12-jekyll.textile
|-- atom.xml
|-- books
|   `-- _posts
|       `-- 2009-02-12-click.textile
|-- images
|   `-- feed.png
|-- index.html
|-- movies
|   `-- _posts
|-- music
|   `-- _posts
|       `-- 2009-02-12-ray-lamontagne-gossip-in-the-grain.textile
`-- stylesheets
    `-- styles.css

Then on my homepage, for example, I can pull all the music entries with album art from Amazon by doing:

{ % for music in site.categories.music % }
  <a href=""><img alt="" src="http://ec1.images-amazon.com/images/P/.01.MZZZZZZZ.jpg"></a>
{ % endfor % }    

(I added an asin key to the post’s metadata header.) Slick!

Excerpts

Thankfully thanks to Jekyll’s slick metadata feature for posts, all I had to do was add a excerpt key to the header of a post and throw my excerpt there:

---
layout: post
title: Jekyll
excerpt: |-
  I've taken the plunge to a static-HTML blog with Jekyll. I'm impressed so far. I love having the whole she-bang in git, but then again the whole idea of a "datastore in git":/2008/04/13/git-as-a-data-store.html has fascinated me from the start.

  And pushing to GitHub pages (willcodeforfoo.github.com) just _worked_. A few minutes after pushing, I hit the URL. Half expecting an error page and half expecting just nothing I found the site. Just the way I hoped it would work.

  Big ups to "Michael Bleigh":http://mbleigh.com for making his whole blog available on "GitHub":http://github.com/mbleigh/mbleigh.github.com/tree/master. I didn't take much design-wise, but seeing how things were structured was a huge help. I did nick his Atom feed template.  
---

h3. Importing from Mephisto

Here's a hacky, super-simple, one-liner script that I threw together at the Mephisto Rails console:

The next gotcha was that I couldn’t get Jekyll to Textilize anything other than the content, and since my excerpt needed to be rendered as Textile, this was a problem.

So I submitted a patch that creates a filter called textilize that I can pass my excerpt into for formatting. Hopefully it gets applied to the master branch that GitHub Pages uses.

Inspiration

Big ups to Tom Preston-Werner for writing Jekyll and Michael Bleigh for making his whole blog’s source available on GitHub. I didn’t take much design-wise, but seeing how things were structured was a huge help. (I did nick his Atom feed template.)

10 Feb 2009

Reducing the Noise

I’m spending some time tonight to try and reduce some of the noise in my life. From a practical standpoint, this means I’m:

  • Unsubscribing from a few RSS feeds that I end up just reading past anyway
  • Deleting some iTunes tracks that I usually end skipping, both at my desk and in my car (the Skip Count in iTunes is great for this)
  • Unsubscribing from a few mailing lists I rarely read, are definitely not active in, and end up just Google searching when I need a topical answer
  • Taking steps to reduce blog spam
  • Creating server-side and client-side rules to move bulk e-mail from companies like Dell to their own folder or tag, and skipping the inbox altogether. Even better, unsubscribing from most of these completely.
  • Deleting rarely used Apps

While these minor things seem really trivial piece-by-piece, I think the sum of them cause a lot of distraction and cloud meaningful activities. As such, I plan to do this de-lousing on a periodic basis.

OK, this one is almost too hacky and simple to share, but I wanted to get it out there. Want to show your site’s users what’s changed? Just show them your git changelog:

It’s a bit dorky, and definately not as pretty as a properly parsed and formatted changelog, but for showing stakeholders what’s changed it’s been useful.

Here’s how it’s done (again, kind of a hack):

Controller

@code = `cd /var/www/vintageaerial.com/htdocs/shared/cached-copy && git-log --max-count=20 --no-merges`

View

<pre class="changelog"><%= @changes %></pre>

Stylesheet

pre.changelog { overflow: scroll; }

I definitely wouldn’t use this in high-traffic production areas without some caching. It’s also enforcing me to write better, more communicative changeset descriptions, because I know someone can read them.

Older Posts

rake db:production:clone 17 Apr 2008
Git as a Data Store 13 Apr 2008
sitesmetric Progress 24 Jan 2008
Another Project, or, Introducing sitesmetric 22 Jan 2008
Merb Asset Helpers 15 Jan 2008
Minor Leopard Rails Wrinkle 30 Oct 2007
My Rails Stack Setup Notes 02 Oct 2007
The Only Way Digg Can Redeem Itself 02 May 2007
Coda 24 Apr 2007
Rails Scalability Problems Solved 23 Apr 2007
When To Say Yes to Feature Requests 19 Mar 2007
dotfiles.org Now Has Search 06 Feb 2007
reddit, digg, and Slashdot 30 Jan 2007
Best of 2006 Playlist 31 Dec 2006
My Dream App 28 Dec 2006
Junebug and Nginx 15 Nov 2006
Toward a more Republic Democracy 25 Oct 2006
Dotfiles 21 Oct 2006
Mephisto 16 Oct 2006
Tab-completion for Ruby Cheat Sheets 15 Oct 2006
Bracket accessors for your Rails models 11 Oct 2006
iTunes Visual Refresh 12 Sep 2006
Ruby Web Fetching Options Benchmarked 19 Aug 2006
Terra got the bat! 31 Jul 2006
Wireless Mighty Mouse Observations 28 Jul 2006
Dead Simple Full-text Searching with Rails 17 Jul 2006
Clickity Clack--whine--Clickity Clack 13 Jul 2006
BarnRaisr and Knowledge Markets 26 Jun 2006
RailsConf 23 Jun 2006
TextMate and WordPress 20 Jun 2006
RSS Aggregation 20 Jun 2006
January!? 08 May 2006
Everything old is new again, or, Embrace and extend 06 Jan 2006
New Features Galore! 05 Jan 2006
Commenting Fixed 02 Jan 2006
Creating Mobile or Lite Versions of Rails Apps 05 Nov 2005
How to Succeed In The Web 2.0 Days 18 Aug 2005
Ajax on the Desktop 14 Aug 2005
Don't Compare Ruby on Rails with PHP 03 Aug 2005
On Presenting Software 29 Jul 2005
Site Fixes 19 Jul 2005
Unix Geeks Wanted! 20 Apr 2005
Tiger: April 29th 12 Apr 2005
Rails Tip: Plan your Database 11 Apr 2005
RubyOnRails 09 Apr 2005
Frustration 16 Mar 2005
Free Cheat Sheets 01 Feb 2005
Waiting for the Bus 24 Jan 2005
Slacking 21 Jan 2005
Vim Tips 23 Nov 2004
Speeding up Textpattern 17 Nov 2004
SongMeanings Improvements 13 Nov 2004
Ben Folds 31 Oct 2004
FreeBSD r0x 20 Oct 2004
Why Less is More, and Simple is Complex (Draft) 29 Sep 2004
FavoriteSearch 27 Sep 2004
Odds and Ends 23 Sep 2004
SongMeanings is Back! 17 Sep 2004
Class, Gmail 04 Sep 2004
Fall Mac Imaging 19 Aug 2004
Lack of Updates 11 Aug 2004
Greatest Accomplishment? 05 Aug 2004
Knoppix STD Saves the Day! 14 Jul 2004
SongMeanings is Down 08 Jul 2004
Cedar Point III 08 Jul 2004
Vacation 02 Jul 2004
Pieces 30 Jun 2004
Giving Blood 29 Jun 2004
Mac OS X Tiger 28 Jun 2004
Cedar Point II 26 Jun 2004
LSG 25 Jun 2004
Things to Remember When Upgrading your Linux Kernel 20 Jun 2004
Promotions 17 Jun 2004
Pretty Pictures 17 Jun 2004
E-mail addresses 15 Jun 2004
Cool Thing to Do With A Linux Box I - Text-Based Games 14 Jun 2004
Weekend 13 Jun 2004
Gmail Invites 08 Jun 2004
Back! 07 Jun 2004
Cedar Point I 05 Jun 2004
Preparing for Cedar Point... 30 May 2004
Computer Lab Attendent Kevin 30 May 2004
RIP TechTV 28 May 2004
Updates 25 May 2004
Imports 24 May 2004
I'm Back! 24 May 2004
Textpattern 20 May 2004
Now With RSS! 19 May 2004
Grades 10 May 2004
Summertime 07 May 2004
Gmail! 07 May 2004
Gmail 05 May 2004
Dotgeek 26 Apr 2004
How Does It Feel 13 Apr 2004
Project Stamina 30 Mar 2004
C++ Perversion 23 Mar 2004
You'll Think of Me 16 Mar 2004
Frequency 01 Mar 2004
Blog Cheating 01 Mar 2004
40 GB 01 Mar 2004
Linux Box 23 Feb 2004
Uptime 18 Feb 2004