Archive for the ‘Mac OS X’ Category

Stickies deleted my To Do list
Now I use Do It

Tuesday, January 22nd, 2008
Do ItI have used Stickies to manage my multiple To Do lists for awhile now until the other day when I restarted my laptop and the Stickies database was magically cleared out. Apparently this happens more than you would think because I found lots of discussion about it online. With Stickies there are no backups unless you make them yourself, which I had not of course, so I was out of luck. You're only options are to write a shell or applescript script to do rotating backups, but that's a pain in the ass.

Luckily there are people in the world that write really cool free software, although you can donate to the cause if you like. Do IT is a really amazing list organizing application that will also backup your data as an XML file. It's such a great little program I would put it in the same class as Adium and Cyberduck, both of which are favorites of mine.

Hiding Illustrator

Tuesday, December 4th, 2007
cmd-H hides just about everything except Adobe's Illustrator. I'm not sure why "Hide Edges" is so much more important than having the program work in the most basic of ways as other programs do. Not supporting cmd-H is like making "Copy" cmd-U because you wanted to make cmd-C "Copy Filter", it just doesn't make since. At least there is an easy solution.

In Illustrator:
1) Choose Edit > Keyboard Shortcuts
2) Select Menu Commands from the drop down
3) Expand the first option named Illustrator
4) Click in the Shortcut column in the Hide Illustrator row
5) Press the keys that you want to assign to that command, cmd-H
6) Click Go To to change Hide Edges which previously had cmd-H
7) Click in the Shortcut column in the Hide Edges row
8) Press the keys that you want to assign to this command, cmd-option-H
6) Click Save... and name the profile
7) Click OK

Other Keyboard Shortcut Resources
5 Obscure Illustrator Keyboard Shortcuts
Adobe Illustrator CS3 keyboard shortcuts

http://localhost

Friday, August 3rd, 2007
Having a local web server to test your web sites and applications is essential to your development environment. It is very easy to set-up numerous virtual hosts for each of your projects, which allows you to develop your interactive masterpieces in a close to real world implementation. There are actually many aspects of Flash development that will exhibit different behavior or not even work at all if not served from a valid domain and by golly localhost counts.

The worst thing that can happen to a developer is deploying your site or application to the clients server and having it not work and it's usually because it was tested only in Flash or by dragging your HTML file into a browser. All developers on my team are required to have an active local web server that they manage, which also makes it easy for me to track their development efforts in basically real-time. If you have a Mac, then you're cool, but also already have everything installed that you're going to need. Let's get started.

The easiest way to do this with minimal fuss and muss is to do it though your Systems Preferences -> Sharing Preference panel. Click on the Services tab and select Personal Web Sharing from the list. Click start and there you go, Apache 1.3.33 is up and running. Your web site's URL is displayed at the bottom, which is usually your computer's IP address. You can also type in http://localhost to get there. The actual directory where you place files to be viewed at this URL is /Library/WebServer/Documents/. Anything you place in this directory can be viewed in any web browser, even IE6, just as if it were on a real grown up web server. Only other computers on your LAN will be able to access this web site, by IP only - not localhost, but that's cool. You wouldn't want to use your dev or personal computer to serve live sites anyway.

Ok, so you've got a single site up and running. Now if you're like me you have a ton of projects that should be set-up this way. Time to get our hands dirty and dig into the Apache config file, enable the root user and a brief tutorial on managing your Apache install from the Terminal.

First off you have to enable your root user and give it a password if you haven't done so already. Only the root user has permission to edit the Apache config file, so let's start there. In your /Applications/Utilities folder you will find a program called NetInfo Manager. Go ahead and launch it. In the top menu bar click on Security -> Authenticate and type in your computer's admin password. Now the Enable Root User option will be available so go ahead and do that, you'll have to authenticate again, type in the new root password, click ok, then Security -> Deauthenticate for good measure and you're done.

Now we can make the necessary changes to the Apache config file and start/stop/restart the web server from the Terminal. Be extremely careful when using the Terminal as the root user, you can cause some very serious damage to your computer if not used with knowledge and caution. Open the terminal and type the following (do not type the $ or # characters, they represent the command line prompt):
$ su -
Password: <type in your new root password>
# vi /etc/httpd/httpd.conf
Now your in the text editor vi which I will not discuss here, but believe me you will love to hate it. You can also use pico instead of vi which is a bit easier to use, but your sys admin will laugh at you if caught doing so. For now use the arrow keys to move up and down through the config file. Since we're already here we might as well turn on PHP. Arrow down until you see the following line:
#LoadModule php4_module        libexec/httpd/libphp4.so
In the config file the # symbol represents a commented out line of text, same as using // in ActionScript or JavaScript. Right now you are in the browse mode of vi and are unable to edit text. Hit the i key to go into insert mode, move the cursor in front of the # symbol and hit the delete key to remove it. Hit the esc key to get back out of edit mode and now you have uncommented that line of text. Keep arrowing down until you find this:
#AddModule mod_php4.c
Do the same thing you just did to remove the # comment symbol. If at this point you feel you are struggling with vi, Google it and there are a million vi tutorials online. Now that you have edited the config file to enable PHP lets go ahead and save, then test to make sure it's going ok so far. To save in vi type :wq, this saves the file and quits vi. To just save and not quit type :w and to quit and not save type :q!

To make this take effect you need to restart Apache, but first lets check to make sure we haven't saved a bad config. At the command prompt type the following:
# apachectl configtest
If everything goes ok, you'll see the following output: Syntax OK. Now use the up arrow key to see your previous commands until you see:
# vi /etc/httpd/httpd.conf
then hit enter.

Now were back in the config file again. Scroll all the way to the bottom of the file where the VirtualHosts directive is. The best way to have multiple virtual hosts on your local computer, since you're probably not part of a domain or if so have no access to the Domain Controller, is to set them up on ports. A virtual host URL running on a port looks like this: http://localhost:9000. You may have see this before because there all kinds of services running on other ports on your computer. If you have Tomcat set-up, it runs on port 8080 as an example. It is generally safe to pick port numbers in the 9000 and 10000 range. The secret to this kind of set-up is to be sure to configure a port based virtual host for the default server which runs on port 80. Here is an example of a VirtualHost configuration that includes the default host and a custom one. All of your custom VirtualHost can have root directories anywhere on your computer.
Listen *:80
<virtualhost *:80>
  DocumentRoot /Library/WebServer/Documents
</virtualhost>

Listen *:9000
<virtualhost *:9000>
  DocumentRoot /Users/chris/projects/sample/build/bin
</virtualhost>
Now write, save, test the config and restart - done. You now have the power to create tons of individual web sites on your own computer. Check out the Mac DevCenter for more information on this subject.

[update: 10/1/2007]
For those of us still on Tiger (10.4.x) and want to upgrade to PHP5, check out Entropy's site for a super easy installer.

[update: 12/10/2007]
For those that are cool enough to be using Leopard here are some updates to the above information.

Enabling root user:
enable root user using utilities/Directory Utility
unlock to enable changes
go to edit-->enable root password
done.

httpd.conf configuration:
check out this blog post on Bust Out Solutions

Unix directories in the finder

Thursday, June 21st, 2007
cmd-shift-g

Most Mac users don't even realize that there is a Unix based underbelly on their Mac, so it's probably good that those directories are not readily available in the Finder. For those of us that rock the Terminal on a regular basis, it can sometimes be frustrating that the only way to utilize the Unix side is through command line only.

Luckily God invented key command shortcuts! Press cmd+shift+G with an open Finder window, open or save dialog box and you can navigate to any directory on your computer by typing it in starting with the root directory. This is great when you want to use TextMate for editing or viewing config files. You may run into some permission issues, but some careful manipulation of what group you belong to can fix that.

Garbled Fonts on Mac OS X

Tuesday, May 1st, 2007
Have you ever had this problem?
Font display issues in AIM.

I've had this problem off and on over the past couple years and never figured out exactly what the issue was. Removing all my fonts always did the trick, but seemed a bit excessive. I finally came across this article that explains it all: http://docs.info.apple.com/article.html?artnum=301245

Basically you need to remove Helvetica Fractions from your system and it clears up right away. You'd be suprised how many people have this issue. Since I figured it out I've helped quite a number of people with this, which has led me to post it here. Hope it helps.