RailsConf 2008 Personal Take Aways

in Programming

I had a blast at RailsConf this year and just wanted to say a few things regarding the experience.

First off I want to thank Ruby Central (Chad, Rich and David) for their continued hard work.  All the hard work from O’Reilly employees as well.  Some unsung heros there I’m sure.

The Doubletree hotel bumped me up to the 15th floor because I checked in so late on Thursday night.  The room was amazing.  I didn’t want to leave, but the conference was better.

The conference sessions had some great speakers.  I was pleasantly surprised by how entertaining Joel Spolsky was.  I really took a lot out of his lesson.  More than just the three bullet points:

  • Put the user in control
  • Obsessive over aesthetic
  • Observe culture code

These three things are the qualities that if you had all three you have the maximum potential for what he called a “blue chip” product.  If you can focus on these things you can create a superior product.

For those people who didn’t attend the third point really boils down to knowing the language or jargon of your product’s domain.  So if you were creating a product for a 9-1-1 telecommunications center you’d probably need to know a term like EMT stood for Emergency Medical Technician.

The other big thing for me I took away from the conference was Nathaniel Talbott’s talk: 23 Hacks.  He mention that when talking to Chad Fowler about the joy of hacking Fowler admitted that he starts many more projects than he actually finishes.

For the longest time I have punished myself for starting so many “failed” projects as I might have called them.  But that both Nathaniel and Chad do the same thing, start many but complete few, that made me feel less self-conscious about my “incomplete” projects (note the adjective change).

Chad also said that musicians create much more music than they actually release.  And it’s in that joy or act of “jamming” on music where they practice in order to get better for when it is publicly consumed.

It all gels into a new paradigm for me and my programming.  That I can start as many personal projects as I want, as long as I’m hacking and having fun I can learn/practice/grow my art.

Sounds like next year is Vegas.  Should be interesting.  From personal experience working for another company, they should be ready for a huge increase in attendance.  Good thing O’Reilly has their back.

Now I’m off to code something.  Anything.  And have fun in the process.

0 Comments

Change default font Personal Brain Mac OS X

in Programming

So I’ve been compiling a bunch of reused and useful command line snippets into my Personal Brain software. They then become searchable and easy to refer to when I need them the most.

But I don’t want to have to keep changing the font of the notes every time I write a new one. There is no way in the UI to set the default font so you have to hack it.

Open your Terminal and type:

mate /Applications/PersonalBrain.app/Contents/Resources/app/res/notes.css

I assume TextMate installed with the Terminal hook. But whatever editor you have will work, just use the path above.

NOTE: This is a global setting for all notes.

This is a definite weakness of the software. If you change the font of a note and come back to add to it, it won’t use the new font, it will use the global default.

I chose Monaco because it’s fixed width and I like it. Problem solved for me. Hope it helps for you.

0 Comments

Create Zoom Shortcut in Mac OS X Terminal

in Programming

So lately I’ve been getting into this flow of wanting to make a terminal screen full-screen when I need to focus or read long lines. And I’ve been getting sick of having to use the mouse to push the green plus sign to toggle this.

I did a quick search and found an Apple Script that will work for Terminal and TextMate, which are my bread and butter, respectively.

-- A script to automatically zoom the frontmost window.
-- © 2006 by Daniel Jalkut, Inspired by:
--
-- http://www.macosxhints.com/article.php?story=20051227001809626&lsrc=osxh
--

tell application "System Events"
	set frontAppName to name of first application process whose frontmost is true
end tell

set tryZoomedAttribute to true
set tryMenuScripting to false
set tryButtonScripting to false
set allMethodsFailed to false

-- Special cases. For Applications whose behavior we know responds to one or the other
-- method, force that method here.
if (frontAppName is equal to "iTunes") then
	set tryZoomedAttribute to false
	set tryMenuScripting to true
end if

if (tryZoomedAttribute is equal to true) then
	tell application frontAppName
		try
			set zoomed of window 1 to not (zoomed of window 1)
		on error
			set tryMenuScripting to true
		end try
	end tell
end if

-- Make sure the user has UI scripting enabled before we go on...
if ((tryMenuScripting is equal to true) or (tryButtonScripting is equal to true)) then
	tell application "System Events"
		if UI elements enabled is false then
			tell application "System Preferences"
				activate
				set current pane to pane "com.apple.preference.universalaccess"
				display dialog "UI element scripting is not enabled. Check 'Enable access for assistive devices'"
			end tell
		end if
	end tell
end if

if (tryMenuScripting is equal to true) then
	tell application "System Events"
		tell process frontAppName
			try
				click menu item "Zoom" of menu of menu bar item "Window" of menu bar 1
			on error
				set tryButtonScripting to true
			end try
		end tell
	end tell
end if

if (tryButtonScripting is equal to true) then
	-- UI Scripting method:
	tell application "System Events"
		try
			tell process frontAppName
				click button 2 of window 1
			end tell
		on error
			set allMethodsFailed to true
		end try
	end tell
end if

if (allMethodsFailed is equal to true) then
	display dialog "I'm sorry, I couldn't figure out how to zoom this window."
end if

As they suggest you’ll want to add it as a trigger via Quicksilver. This is where the article lacks information about how to do this so I give that here. I assume you’re using Quicksilver.

  1. Create a folder ~/Library/Scripts (if you don’t already have one)
  2. Copy the above script and paste it into Script Editor.
  3. Save that script as Green Zoomer.scpt in your ~/Library/Scripts folder.
  4. Use the Quicksilver keyboard shortcut Command + ; to bring up the Catalog.
  5. Click Custom on the left hand side, then on the bottom right you’ll see the plus sign to add a Source.
  6. Click that plus sign and choose File & Folder Scanner.
  7. Use the keyboard shortcut Command + Shift + G to type in a manual path.
  8. Type in ~/Library/Scripts, click Open.
  9. Click on the refresh icon in the bottom menu to make sure Quicksilver picks up the new script you added.
  10. Use the Quicksilver keyboard shortcut Command + ‘ to bring up the Triggers.
  11. Click the plus sign at the bottom and choose HotKey.
  12. The Select an item dialog box will appear or you can make it appear by clicking on the new trigger you’ve added.
  13. Type in the first field Green Zoomer and Quicksilver will pickup the file you created, and give it a default action of Run. That’s what we want.
  14. Click Save and you’re ready to zoom!

My Firefox browser would give me the error ‘UI element scripting is not enabled. Check ‘Enable access for assistive devices’ when I tried to zoom it.

Daniel’s script even apologizes for the error. But no apology is necessary, because OS X pops up Universal Access and you can just click on the Enable access for assistive devices check box and you’re good.

Thanks Simon for the original and Daniel for the rewrite!

2 Comments

Parallels and Ubuntu 7.10 Server, BFF

in Programming

So I’ve been reading Deploying Rails Applications beta book and it’s been a blast to learn how to put together a Rails stack on a *nix based server.

I watched topfunky’s video on building a deployment server with Parallels and Ubuntu Desktop. It looked great, but I wanted more of a challenge. Not too much more, just a smidge. So I decided I’d go with Ubuntu Server package instead. Go GUI-less or go home!

After downloading the ISO, I get everything in the Parallels VM setup just like it would be if I got a slice at slicehost.com (one of the VPS providers I’m looking at) to give me an idea of how much storage it would take to build a Rails stack on Ubuntu Server.

I boot to the ISO, set everything up how I want, and reboot to a stark, black screen with the words:

Kernel panic: CPU too old for this kernel

My dreams dashed and my hopes gone, I was defeated. Until… I remembered that Google exists and I looked up the error message.

Cut To the Chase

My “cut to the chase” brand walk-throughs make more assumptions than your average walk through and give you only what you need to fix a specific problem.

Here’s what we’ll assume you have done:

  • Installed Parallels (build 5584)
  • Created a Ubuntu VM with 256 MB ram and 10240 MB (10 GB) hard drive with Shared Networking (so your VM can use the internet your host has)
  • Booted to the ISO and installed the defaults for the Ubuntu Server
  • You’ve rebooted your VM computer
  • And you got the error message I did

Note: I assume you got the error message I did, otherwise why are you reading all this?

The Fix Is In

You’ll need boot back into the ISO you downloaded, except now the VM machine wants to boot from the hard drive first. On a real life computer you’d set the BIOS to change the boot order. You’ll have to do that in the VM way by editing the settings.

  1. With your VM open and the machine stopped, click on Edit / Virtual Machine.
  2. The Configuration Editor window appears and on the right hand side is three tabbed options. General, Booting and Advanced.
  3. Choose Booting.
  4. Change the boot sequence to CD-ROM, Hard Disk, Floppy.
  5. Click OK.
  6. Start your VM.
  7. From the Ubuntu boot menu, choose Rescue a broken system.
  8. Follow the prompts to setup the system. I usually do NOT allow it to detect my keyboard because it’s a painful process that never seems to get the right keyboard. I just set the keyboard manually and you’re through that step sooooo much faster.
  9. Set your host name, if you want, to what you set it as when you created the computer. It’s not really that important. What is important is what is next.
  10. When you get to the Enter rescue mode dialog, you’ll want to choose /dev/sda1 as your root file system.
  11. Then under Rescue operations, choose Execute a shell in /dev/sda1.
  12. From the shell run each of these steps in turn:
  13. apt-get update
    apt-get install linux-386
    apt-get remove linux-server

This will first get the latest links to the current versions of the packages to install (apt-get update) and then you install the latest linux-386 kernel (apt-get install linux-386). You remove the linux-server because this site told me to and it worked (apt-get remove linux-server).

Reboot and enjoy the sweet fixed-width font goodness of white text on a black background!

Then go and buy the Deploying Rails Applications: A Step-by-Step Guide beta book from the Pragmatic Programmers and follow the steps on how to create your own VPS Rails stack on Ubuntu (chapter 4).

Oh and btw, its about 1.26 GB total once I setup Rails and MySQL, etc. Lots of room for production logs, database files, and bears, oh my!  So it can host a small to medium size rails site.  Have fun!

KTHXBBQFTW!

1 Comment

First Chapter Goes Live

in Programming

The first chapter has gone live for the Capistrano documentation project. It is authored by Srinivas Aki on the subject of the Default Tasks you use in Capistrano. Can I has default tasks?

“Oh and… you’re welcome.” – Jimmy Fallon playing “The Company Computer Guy” on SNL

0 Comments