Mac Memos

Bill Andersen’s how-to reminders

Archive for the ‘Command Lines’ Category

Cluttered Desktop? Try this…

You get to feel geeky doing this one. Open your Terminal application. It’s in your Applications folder, inside the Utilities folder.

Type the commands exactly as you see them below, including the capital D in Desktop.

After the dollar sign (it acts as what we call the “command prompt” meaning starting place), type the following:
chflags hidden ~/Desktop/*
Now press the return key.

TaDah! Everything cluttering your Desktop is invisible.

terminal1

To make everything visible again, type the following and press return:
chflags nohidden /Desktop/*

Want to know what you just did? You told Mac OS X to change the transparency state from visible to invisible and back again. The “ch” part of “chflags” stands for “change”. The ~ sign stands for your username and it starts a “path” to your Desktop. The * is a wildcard symbol that stands for “everything”

So the command ” chflags hidden ~/Desktop/* ” is telling Mac OS X “follow the path to my Desktop and make everything you find there hidden”.

Updating Leopard Mac OS X Ruby installation

I wanted to do this so I could use Xcode to write a Ruby app that is outlined on the Apple Developer site. Prior to running the following commands in Terminal, I kept getting an error in Xcode, complaining that

Rails requires RubyGems >= 1.3.1 (you have 1.0.1). Please `gem update –system` and try again.

I ran ‘gem update –system; and it kept reporting that there was “nothing to update”.

Only when I ran the following four commands did Xcode begin to behave properly:

$ sudo /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem update –system

$ sudo /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem install rails

$ sudo /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem update rake

$ sudo /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem update sqlite3-ruby

There was a hiccup running the last command, but Xcode is working so I’ll come back to that if I have to.

My Ruby on Rails/MySQL installation

Note to self: Your stock installation of Ruby on Rails and MySQL (the one that comes standard with Leopard) is no longer what you are running.

Your custom installation was done with Hivelogic’s guidance and your installation files are now located as that site indicates.

MySQL installation

Ruby on Rails installation

Generate unique ID numbers with Terminal

Open Terminal and type

uuidgen

Press return. There’s your ID string.

Starting and stopping MySQL on Leopard

Starting SQL:

sudo /usr/local/mysql/support-files/mysql.server start

Stopping SQL:

sudo /usr/local/mysql/support-files/mysql.server stop

Make a sym link

ln -s [path to the file you want to link to] [name of the alias]

For example:

ln -s /private/var/mysql/mysql.sock /private/tmp/mysql.sock

creates a symbolic link (an alias) of the mysql.sock file in /var/ and places the alias in /tmp

BTW, to get the path of a file into Terminal, just drag the file icon into the Terminal window.