vi /Users/rubys/Sites/index.html
, for example. Yech.I didn’t buy the mac-mini for iTunes, iPhoto, iMovie, GarageBand or the like. While I may explore those later, I probably won’t. Nor is it my intent to move my mail. My intended use for this machine is mostly to run a browser and a few shell windows.
While Ubuntu’s approach is a delightful mix of YAGNI coupled with the ability to quickly and easily snap on more function as you need it; this Mac’s approach is definitely batteries included. I say “this Mac” because I see Dave Thomas pointing to instructions that require quite a bit more than I had to do.
First step of any desktop OS (at least on Windows, Ubuntu, and OS X) is the same: locate the command prompt / terminal and drag it to the taskbar / panel / dock. Much to my surprise, the fonts on the terminal window wasn’t all that great. Turning on anti-aliasing and switching to Courier helped.
Initial version of .bash_login
:
source /etc/bashrc set -o vi export PS1="\u@\h:\w\$ " export RUBYOPT=-rubygems export PATH=/Users/rubys/bin:$PATH export EDITOR=vi # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' ;; *) ;; esac
I found that most tools I care about are already installed: vim, svn, ssh, apache, ruby, gem, irb, python. With the exception of Python, none of those are automatically installed on Ubuntu. On the Mac, all I needed to do is go into System Preferences -> Sharing and enable Web Sharing and Remote Login.
To date, all I’ve installed is Xcode (insert CD and click) and rails (gem install rails). Both went smoothly. The majority of the time was spent trying to figure out how to get the CD to eject. Installing MYSQL is still yet to be done. Perhaps that will be harder.
Much to my surprise, the Mac seems well suited for someone who prefers the keyboard over the mouse. A number of differences to learn, things like: ⌘-W instead of Alt-F4. Home and End are page oriented instead of line oriented. Creating a second terminal isn’t done from the dock, it is done by entering ⌘-N from the keyboard when a Terminal window has the focus. I’m sure that all of this is tailorable, but I want to learn the system before adapting it too much. The mouse is nice too: this is the first time in my life that I have a scroll wheel, and I’ve already found it to be quite handy.
A few things definitely have a cygwin-ish uncanny valley feeling to them. vi /Users/rubys/Sites/index.html
, for example. Yech.
Since you’re going to be spending much of your time in Terminal (a Cocoa app), you should check out Services (hint: hilite some text, then look at the Services option in the application’s first menu (i.e. Terminal for Terminal, Safari for Safari...)) Using the app ThisService you can write Services (think right-click applets) in any installed scripting language. I’ve got ones that invoke Tidy, pipe text through Markdown and/or SmartyPants, do word counts, etc.
Also, check UnicodeChecker, a very handy application for working with character sets, encoding, escaping, etc. It also has many functions which will work from the Services menu. Highly recommended.
If you’re unsatisfied with your Terminal font choices, font installation is as simple as you’d expect — double-clicking .ttf or .otf files runs the most excellent Font Book app which gives you options for previewing the font, installing it systemwide or for a single user, etc.
When I was switching, the best piece of advice I received was “Cmd-H is your friend.” That’s helped to send VPN windows and the like to places where they are less annoying.
A year or two ago, I began using a newline at the end of <code>PS1</code> (on all operating systems) after seeing a colleague using that style. That’s been a welcome change. YMMV.
However, you couldn’t, for example, tab-complete that path w/o the correct case
bashrc to the rescue:
set completion-ignore-case true
I really don’t like the idea of using:
export RUBYOPT=-rubygems
You can get a similar effect by simply requiring rubygems from within your .irbrc file.
I worry that with all the tutorials that have been written instructing people to set the RUBYOPT variable like this, eventually we’ll start seeing people writing code that loads up gems without first making sure rubygems was actually loaded. IE, code will run perfectly in one person’s environment, but won’t run anywhere that RUBYOPT hasn’t been set.
I may be worrying needlessly, but hey, someone’s gotta do it.
As others say.. try iTerm. I prefer it to Terminal.app.
And you must install MacPorts. Then ‘sudo port install mysql’ and forget about it. In fact you may want to consider installing ruby, python, etc. via MacPorts (all to /opt/local/...) and then make certain the /opt paths precede your /usr paths in your PATH. This way you can track the latest versions without stomping on the OS X install.
I actually haven’t found iTerm needed on Leopard. Also, why did you need to install Rails? It should have been installed with Leopard.
Thanks for the prompt tips. I couldn’t get the set completion-ignore-case true
to work, but I will find it!
With the exception of Python, none of those are automatically installed on Ubuntu
Vim is as well. Pretty sure POSIX demands that vi (or some behemoth distantly descended from it) be present.
- Chris
Jim: yea, but did you look at that file? ^m’s scattered throughout and all one line. Yech.
Bob: I’ve been a victim of that too, so I empathize. But not wanting to continue to be a victim, and seeing that that will be the default with Ruby 1.9 (and successor), I decided to succumb.
Chris: Ubuntu comes with vi, and makes it easy for you to replace it with vim. OS X comes with vim.
Put the following in .inputrc
:
set completion-ignore-case on
And then you can try to figure this out. Ouch.
I’m with Tim (scroll to Tools heading) in thinking that Preview.app is just spectacularly good at dealing with large PDFs - such as specs.
Dan Benjamin regularly posts good info for installing MySQL on OS X but there’s tons of guidance out there and it mostly ‘just works’.
For playing with MySQL, CocoaMySql just rocks 98% of the time (and crashes the other 2%).
Have fun.
Preview.app is just spectacularly good at dealing with large PDFs - such as specs
I call bullshit. Nobody reads specs.
As others say.. try iTerm. I prefer it to Terminal.app.
While iTerm was much necessary under e.g. Panther and Tiger (10.3 and 10.5), the slew of improvements in Leopard’s Terminal make it pretty much unnecessary, in my experience.
I call bullshit. Nobody reads specs.
Oh Mark, you old cynic, I didn’t actually say ‘read’, did I?
Preview is fantastic because I can look something up in a PDF version of a spec using the built in search which happens to be the quickest, most effective way I know of extracting key information from a mountain of words that would, as you say, usually go unread.
Any thoughts yet on Apple’s newly announced MacRuby?
Seems like a Mac OS X version of JRuby in that it can seemlessly access Objective C and Cocoa technologies. Apparently they’ve also been talking to the Rubinius folks as they’re keen not to fork, but remain compatible.