Tag Archive for 'os x'

Installing RMagick on Snow Leopard / Leopard

This used to be quite a complicated task to install ImageMagick and RMagick from source, but these days (thanks to some great work by others) it’s a piece of cake…

First install ImageMagick using this install script hosted on github (http://github.com/masterkain/ImageMagick-sl):

cd ~/src
git clone git://github.com/masterkain/ImageMagick-sl.git
cd ImageMagick-sl
chmod +x install_im.sh
sh install_im.sh

Now simply sit back and wait. (Oh, you’ll need to enter your password at some points as the libraries are installed into /usr/local).

Then, once that’s done, RMagick is installed by:

gem install rmagick

Simples. :)

Add Git and SVN Branch to Bash Prompt

EDIT: (12-Mar-2010) slight update to the svn prompt code to give a better / more useful output…

I’ve seen things like this posted on the net before but never really had a chance to play with the idea. But as I’m now using git and svn a lot more these days (fingers crossed i’ll be totally free of cvs soon!) I thought it was about time I pulled my finger out.

So here’s the end goal, in a normal directory, we just get a normal bash promt, but in a directory controlled by git or svn, we also get an addition telling us the source control tool in use and the current branch:

git_svn_bash_terminal

So, fire up yer terminal and add the following to your .profile, .bash_profile or .bashrc (whichever one you use):

parse_git_branch () {
	git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)# (git::\1)#'
}
parse_svn_branch() {
	parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk '{print " (svn::"$1")" }'
}
parse_svn_url() {
	svn info 2>/dev/null | sed -ne 's#^URL: ##p'
}
parse_svn_repository_root() {
	svn info 2>/dev/null | sed -ne 's#^Repository Root: ##p'
}
 
BLACK="\[\033[0;38m\]"
RED="\[\033[0;31m\]"
RED_BOLD="\[\033[01;31m\]"
BLUE="\[\033[01;34m\]"
GREEN="\[\033[0;32m\]"
 
export PS1="$BLACK[ \u@$RED\h $GREEN\w$RED_BOLD\$(parse_git_branch)\$(parse_svn_branch)$BLACK ] "

Simples. Now just open up a new terminal and move into a project directory using svn or git. :)

Trash Stuff From the Command Line

A great little command-line tool for Leopard:

osx-trash manipulates the Mac OS X trash from the command line, just like the Finder does. It uses AppleScript via Scripting Bridge on top of to communicate with the Finder. You can move files to the trash, empty the trash, and list items currently in the trash.

project page via

(1)

Unix Toolbox

Found this via a post on Digg. A very useful read if you want to get some more advanced things done in Unix.

This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.

full article

(0)

Developing Rails Applications on Mac OS X Leopard

First in a series of three articles from Apple on Ruby on Rails development on Mac OS X Leopard. Definitely worth a bookmark.

Ruby on Rails is a popular and powerful open source web framework for rapidly creating high-quality web applications to help you keep up with the speed of the Web. Rails is thriving on Mac OS X, and Leopard comes pre-installed with Ruby, Rails, Mongrel, Capistrano, Subversion, and other tools that help to streamline the development and deployment of Rails applications. In addition, the Organizer feature of XCode 3.0 keeps your development workflow efficient.

This article gives you a full tour of Ruby on Rails 2.0 on Leopard—starting with building a web application using the latest Rails features with Xcode 3.0, and finishing with deploying the application to a production server running Leopard Server. Along the way we’ll explore unique features and benefits that Leopard brings to the party. In the end you’ll be better equipped to consider the advantages of powering your web application with Rails on Leopard.

This is the first in a series of three articles:

  • This article on Development, where you learn to build a basic RESTful Rails application using Xcode 3.0;
  • Customization, where we discuss working with views and web forms, adding AJAX support, and supporting an iPhone interface;
  • Deployment, where we set up version control, write a Capistrano recipe, and deploy on Leopard Server.

Together they will give you a great start in working with Rails on Mac OS X Leopard.

full article

(2)

Hiding Keynote Presentations

I don’t give many presentations these days, but this is a great tip:

If you give many presentations on the Mac, chances are you’re using Apple’s Keynote presentation software. One cool feature in Keynote is the ability to demo something on your Mac without giving away your next slide or notes. When you’re in the middle of a presentation, just hit the “h” key on your keyboard. This will hide the entire Keynote application and show your desktop.

When you press the h key, the Keynote icon in the dock will change and include a play button. When you want to resume your presentation, just click the Keynote icon in the dock.

keynote_icon_in_dock.png

via

(0)

Is the MacBook Air THAT Bad?!?

Finally, a common sense response to all of these MacBook Air bashing articles. I admit - I don’t want one, i’d rather have a ‘regular’ MacBook or a MacBook Pro, but there are people out there that would want something like this…

Direct from the Canadian Ministry of Silly Punditry we learn that the MacBook Air may increase risk of laptop loss (tip o’ the antlers to Colin Morton).

Indeed. The only way to ensure your laptop won’t get stolen is to buy big fat honkin’ ugly ones.

But, clearly, neither of those beats this gem from PC World’s Mike Barton:

MacBook Air Amiss: Time to License Mac OS X?

Good question! Like “I Have Stubbed My Toe And Find It Painful: Time to Commit Suicide?”

via

(0)

NetNewsWire’s Now Freeware

This is great news - NetNewsWire, the best news reader on the Mac is now completely free! Not just the ‘Lite’ version anymore, but the full product! This is my default (and only) news reader on the Mac.

There’s a FAQ that explains a bunch of things—I’m not going to repeat it all here.

But I will say that, for me personally, this is a dream come true. Every developer wants to be able to work on the software they love, make a living at it, and give it to the world for free.

Usually you get to pick two out of three—if you’re lucky. Me, I get all three.

via

(0)

SSH Shared-Key Setup - SSH Logins Without Passwords

SSH is a great tool for remotely accessing another machine, but entering your password every time you log into a remote box can be a pain if you would like to set-up some background scripts to connect to a server and do something (i.e. a backup script running as a cron job). Here’s how I set-up my Mac to be able to log into my server without the need for a password to be entered each time - the instructions should be good for any variant of Unix/Linux, but you need to take into account path names etc. on your machine.

Continue reading ‘SSH Shared-Key Setup - SSH Logins Without Passwords’

A Better Ls for Mac OS X

I’m a bit of a command-line freak and like to spend a fair amount of time with the terminal open… As such I like to spend a small amount of time getting the terminal set-up nicely. Other than changing the default colour scheme and font, one (slightly) more drastic change is to replace the standard implementation of ls for one that is slightly more configurable.

The default ls on OS X comes from BSD and compared to the GNU/Linux alternative is slightly lacking when it comes to comes to changing how things look - so what I like to do is replace it with the GNU ls available in MacPorts - this allows me to get a terminal setup like below:

terminal.png

Continue reading ‘A Better Ls for Mac OS X’