Time Machine & AirPort Update breaks 10.5.2 Combo Update [Update 2]

About This Mac 9C7010[Update 2] So I recently attempted to re-apply the Mac OS X 10.5.2 Combo update to my MacBook Pro in the hopes that it would fix an annoying little bug that is preventing the contents of my Desktop folder to get dynamically updated. To my surprise, when I went to select my boot volume to install on, the Installer wouldn’t let me continue stating:

“You cannot install Mac OS X Update Combined on this volume. This volume does not meet the requirements for this update.”

At first I thought my OS installation was corrupted, but before I reached for my Leopard install DVD to do a clean install I decided to investigate whether one of the recent Apple software updates may have caused the problem. Read on to see the results of my investigation.

Continue Reading 14 comments March 25th, 2008

Set Safari’s window size with one click of the mouse

Safari window sizeOK, here’s a hint I think a lot of you Windows switchers are going to love, and I’m sure more than a few long time Mac users will appreciate as well. I love Safari. I think it’s the best web browser out there. My primary Mac is a MacBook Pro that I use in a dual monitor setup at home, connected to a 24″ widescreen monitor, and on it’s own when at work or on the road. I use Safari all the time, no matter where I’m at, and one thing that can be annoying is having to manually move/resize my Safari window whenever I switch between single and dual monitor set up. Since Safari is always running, this is something I have to deal with at least twice a day.

For the longest time I got around this by using an AppleScript, which I placed inside my ~/Library/Scripts/Applications/Safari/ folder (where “~” represents my home folder). Then whenever I’d switch monitor setups, I’d simply run that script from within Safari via the AppleScript menu on the top right side of the menubar. The AppleScript menu can be enabled using AppleScript Utility located in the /Applications/AppleScript/ folder. For those interested, this is the script I used:

    tell application "Safari"
    set the properties of front window to {bounds:{1, 23, 1200, 1194}}
    end tell

You can copy and past that code into Script Editor and save as a script with an appropriate name like “Set Window Size - External Display”. Just substitute your own values inside the curly brackets. The values correspond with x,y screen coordinates measured in pixels from the top-left edge of the screen, and indicate the location of the top left and bottom right corners of the window. In this case, my script told Safari to set the top left corner of the front window to 1 pixel from the left and 23 pixels down (to accomodate the menu bar), and the bottom right corner to 1200 pixels from the left and 1194 pixels down.

This script has worked well for me for several years, but it wasn’t quite as convenient as I would have liked since it required me to navigate and click on the Script menu, then click on the script I wanted to run. Being the lazy computer user I am, I’ve longed for a solution that would take one less click and would be even easier to activate. Then one day, I came across a useful hint in the ehmac.com forums about this simple javascript that you could save as a bookmark that would make Safari’s window full-screen:

    javascript:self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);

This was in response to a Windows switcher who really missed a simple way to make his browser window go full screen like Windows does when you click the maximize window. Thought it was pretty handy, so I added it to my Safari Bookmarks bar and called it “Full Screen” and left it there untouched for several weeks. Turns out I never want my Safari window to fill my screen since my displays are all fairly large and wide.

I guess today I had an epiphany. Lightning had just struck my brain (that had to hurt)*. If a Javascript can set my window full-size, then it should be able to set the window to any arbitrary size. Looking at the full screen javascript, it was ridiculously obvious how to modify it to fit my needs. Simply substitute the desired width and height in the resizeTo section like so:

    javascript:self.moveTo(0,0);self.resizeTo(1200,1170);

You could even specify a custom window position by changing the x,y coordinates in the moveTo section if you wish.

Bookmark bar iconsThis in itself is quite brilliant, but still a bit inelegant having bookmarks named “Full Screen” and “Big Monitor” taking up all that space on your Bookmark bar. So I came up with some nice simple bookmark names that visually represented what I wanted to accomplish in a way that would look a bit like an icon, and take a minimal amount of space on my bookmark bar, as seen in the image to the right. So from left to right, I have |-| to resize the Safari window for my small display, |+| to resize the window for my large display and |‹ ›| to resize the window full screen.

This is how they appear in my Bookmarks window:

Window bookmarks

Just to clarify, the “|” character is achieved by pressing shift+\, and the ‹ › characters are created by pressing shift+option+3 and shift+option+4 separated by a space on a Mac. These symbols are smaller than the standard less than and greater than symbols “< >” and make for a nicer looking icon in my opinion. I was also trying to make all three “icons” appear as similar in size as possible for consistency sake and to strengthen the illusion that they are icons. What you name your bookmarks doesn’t make any difference to how they work, so be creative if my choices don’t fit your likes or needs. If you think you’ve improved on my names, let me know in the comments!

Having one-click access to these controls directly within the window is not only more convenient, but also more intuitive. It may not seem like a huge improvement over my previous AppleScript solution, but when you do the same operation multiple times a day, every day of your life, all those clicks really add up. Sometimes, it’s the little things that make all the difference.

7 comments February 29th, 2008

Useful Mac OS X Terminal Commands

Terminal.app iconMac OS X is a very powerful OS. One of it’s most amazing traits is how well it scales from being dead easy to use for novice users to allowing power users near unlimited capabilities. The former comes from the excellent UI design and GUI tools that Apple has built, the latter from Mac OS X’s FreeBSD Unix underpinnings. While most users will never have to touch the Mac OS X Terminal application to go about their day to day computing, those who like to push the limits of what they can do will most likely spend at least a bit of time at the command prompt. This article is for those aspiring command line gurus, like myself.

I’ve been using Mac OS X since the Public Beta was released in 2000. Over the years, as I’ve delved further into learning about the operating system’s Unix underpinnings, I’ve always kept a Stickies note handy where I would paste terminal commands that I thought might come in handy at some point in the future. Every one of these commands required countless Google searches and time scouring the results to find solutions to the problem I had at the time. It’s in the interest of saving others from spending too much time searching that I present my Stickies Mac OS X terminal command list. I hope these help all of you as much as they have helped me.

A warning for newbies:

If you’re not familiar with the Mac OS X Terminal, it’s an application that allows a user to directly execute Unix commands by typing them into text based command prompt. You can find the Terminal application in /Applications/Utilities on your hard disk. Please be aware that the terminal and Unix commands are very unforgiving. A simple typo or misplaced punctuation can mean the difference between your command working and you deleting or overwriting something important, especially when executing commands with administrator rights (via the sudo command). If you aren’t sure what you’re doing, it’s better to take the time to research the answer than to simply guess and possibly mess something up you won’t know how to fix. This article is not meant to be a tutorial on how to use the Terminal. If have never used the terminal, may I suggest you visit O’Reilly’s MacDevCenter which has some good tutorials to get you started.

The Commands

Disclaimer: Please note that I cannot be held responsible for anything bad you do to your computer while attempting to use any of these commands. Use them at your own risk!

Eject Stubborn CDs
    disktool -e disk#

I found myself one day with a CDROM stuck in my CDROM drive, but no way to eject it. It didn’t show up in the Finder or on the Desktop, and hitting the “Eject” button on the keyboard did nothing. I found and tried two or three other terminal and GUI based solutions from sites like Mac OS X Hints, but none of them worked except this little gem. I haven’t had to use it for years and it may not work for every stuck CD, but this one saved me from having to reboot my computer to get a bad CD out. Type disktool by itself to get help.

Unmount Stubborn Network Volumes
    umount -f /Volumes/volumename

Like the stuck CD issue above, I have once or twice come across a network volume that I could not disconnect. Substitute the stuck network share’s name in place of “volumename” in this command. You can view the pdisk man page to get help by typing man umount at the prompt and hitting return.

Delete partition table on iPod
    pdisk

This menu based terminal app saved a dead iPod. I once made the mistake of formatting my iPod as an external FireWire drive as some non-standard format (maybe NTFS or Unix File System). After doing that, I couldn’t re-initialize the iPod using the latest iPod updater. While I don’t remember exactly the steps I used to get the iPod working again (it had to do with deleting the partition table), this tool is what did the trick for me. You can view the pdisk man page to get help by typing man pdisk at the prompt and hitting return.

Restart Bonjour service
    Stop Bonjour service:
    sudo launchctl unload /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
    Start Bonjour service:
    sudo launchctl load /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

A while back I had a problem where one of my Macs would periodically fail to broadcast it’s Bonjour name for things like print and file serving. Rebooting the computer would resolve the problem for a time, but it would always come back. Rather than having to reboot my computer all the time, I searched for and found this handy set of commands for stopping and starting the Bonjour service which would do the trick until the problem occurred again. Since this was a service, it was great not having to reboot. I eventually solved the problem, which if memory serves was caused by my router, but I felt it was handy to hold onto this in case I ever needed to stop or restart the Bonjour service again. These commands need to be run as administrator, which is why they are prefixed with the sudo command. You will be prompted to enter your admin password to execute them.

Restart Apple Remote Desktop (ARD) service
    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent -menu
    Note: This is a very long command that should all be typed or copied/pasted as one line.

I had a problem with Apple Remote Desktop once where if I left a remote control session running for too long (say overnight), the remote display would no longer refresh automatically. In my quest to avoid rebooting my server, I found this handy command that restarts the ARD service, which listens for and manages remote control requests. This has to be run on the machine you want to control normally. Since I was having problems remote controlling said computer, I would log in remotely via SSH by typing ssh ip_address and execute the command while logged in remotely. Very handy indeed. Being able to remotely login via SSH is no doubt one of the most useful reasons to learn the command line. All terminal commands that are covered in this article can be executed remotely. You can view the SSH man page to get help by typing man ssh at the prompt and hitting return.

Reset Network Interface
    Shut down network interface:
    sudo ifconfig en0 down
    Start up network interface:
    sudo ifconfig en0 up
    Note: Substitute en0 for appropriate network interface id (a.k.a. BSD device name). You can use System Profiler (in the /Applications/Utilities folder) to find the BSD device name for the network connection you want to reset.

I can’t remember why I needed to do this. Might have been while I was troubleshooting that Bonjour service issue, or maybe I was trying to change the connection’s MAC hardware address. Doesn’t really matter. The point is you can use this combination of commands to restart a network interface. These commands use the SUDO command to run using administrator rights and so you will be prompted for your admin password.

[Edit: Thanks to commenter "why o why" for pointing out, "it should be noted that if you remotely shutdown the ethernet interface you are using, it will be difficult to get it back up remotely ;) "]

Restart Apache Webserver
    sudo apachectl graceful

While restarting Mac OS X’s built-in Apache web server is as easy as toggling the “Personal Web Sharing” service’s status in the Sharing preference pane, you can’t do this easily remotely unless you can remote control the server in question. Over a modem connection, this can be near impossible or at least very painful. This command comes in handy if you’ve modified the Apache configuration file via a remote SSH connection as the changes only take effect after the Apache service is restarted.

Restart MySQL Server
    Stop MySQL Server
    sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
    Start MySQL Server
    sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

Not so long ago I installed the MySQL open source SQL database on my web server so I could run a phpBB based forum site. MySQL also happens to be the database that runs the Art Of Geek blog. These two commands are useful for stopping or restarting the MySQL service via SSH, or if like me you have ever broken your MySQL installation just enough for the MySQL preference pane to stop working.

Change a file’s type code to make an AAC file an iTunes/iPod audio book
    /Developer/Tools/SetFile -t 'm4b ' filename.m4b
    Note: You must have the Mac OS X developer tools installed for this command to work!

This gem of a command will set the type code of a file to ‘m4b ‘ (there is a space after the ‘b’), which tells iTunes it’s an audio book. This is required if you have ever ripped an audio book from CD, and want iTunes to see it as an audio book. The file must be an AAC file, and you need to change the file extension to .m4b. The truth is, this command can come in handy any time you need to implicitly set a file’s ‘type’ or ‘creator’ codes. You can view the SetFile man page for help by typing man SetFile at the terminal prompt and hitting return.

That’s all the time (and commands) we have for today folks! I’ll post more in a future article!

12 comments September 22nd, 2006

Apple enters phase 3 of it’s Mac ad strategy

Apple's 14-page magazine insertMost Mac enthusiasts were relieved when Apple launched it’s Get a Mac TV campaign a few months back, but we weren’t holding our breath that it would last, given Apple’s past Mac advertising efforts. The ads have been received quite well among the Mac faithful, and have certainly ruffled some feathers in the Windows world. Apple added more spots to the lineup, each one targeting one feature or benefit. A great way to communicate the Mac’s benefits without information overload. Let the masses learn about the Mac one feature or benefit at a time and eventually people will start to wake up.

The Get A Mac TV ads were actually phase 2 of their marketing campaign, phase 1 being the opening of Apple Stores across the United States and later expansion to other countries such as Japan, UK, and Canada. Now numbering 160 stores and growing, this strategy is geared towards giving people an excellent consumer experience and the opportunity to test drive Apple’s products in a relaxed no-pressure environment. The TV spots have played a strong role in boosting brand awareness and driving traffic into Apple Stores.

Well now it looks like Apple is following up on this successful strategy with some informative print advertising. A 14-page brochure has been spotted attached to a 3 full page ad in Entertainment Weekly magazine. In it, Apple hilights the most popular iLife applications (iPhoto, iTunes, iMovie, GarageBand), as well as a couple of Mac OS X features (iChat, Dashboard) and Microsoft Office. The brochure closes by showcasing the Macintosh consumer lineup (iMac, MacBook, MacBook Pro and Mac mini). You can see scanned images of the entire brochure on Flickr.

This is an excellent follow-up to the TV ad campaign, because it is more product focused rather than branding/symbolic in nature, as the TV spots are. By making it a brochure that can be removed from the magazine, potential customers can pull it out and save it for later or pass it on to a friend. I think these brochures will get far more views than they would if they were simply full-page ads. Assuming Apple runs these print ads in a wide range of popular publications, I think they’ll go far to finally bridge the gap between the branding/imagery of the TV spots and the hand-on experience of the Apple Store. These brochures dangle a bit more of a carrot to pique the interest of consumers enough to get them to visit the apple website or stop in at their local Apple Store.

I am curious why Apple has chosen to avoid mentioning Windows compatibility in the 14-page brochure though. While I don’t think Apple should be focusing too much of it’s marketing message on luring people to the Mac platform with the intention of using it for Windows, they have mentioned it in their TV spot titled Touché. Following that up with a page on their brochure with a screenshot of Windows XP running in virtual machine window with Mac OS X apps wouldn’t be such a bad idea, would it?

Critique aside, Apple’s Mac marketing strategy is now coming into focus and seems to be close to firing on all cylinders for the upcoming holiday season. It will be interesting to see how much thunder Apple can steal from Microsoft Windows Vista before it launches. There has never been such a great opportunity to steal market share as there is now, especially given that Windows Vista will drive most Windows customers to buy new hardware in order to keep up with the latest version. Many of those customers may just decide to spend that money on a new Mac instead.

Add comment September 7th, 2006


Forums

Feeds

Categories

Tags

Browse By Date

November 2008
S M T W T F S
« Oct    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Recent Comments

Links

Recent MacDailyNews Headlines

Recent Ars Technica Headlines

Recent Kotaku Headlines

Blog