terminal

Latest

  • Friday Favorite (on a Tuesday): OpenTerminal

    by 
    Brett Terpstra
    Brett Terpstra
    06.22.2010

    I'm aware that it's not, in fact, Friday. When we find an app that's not new, but is really useful to us, we usually save it for a Friday before we salivate all over it. I'm an impatient guy, though, so here's your Friday Favorite on a Tuesday. It's five o'clock somewhere. This one's for the geeks. If you have no idea why you'd want to open the current finder folder in Terminal, you'll have little interest in this app, and I hope the rest of today's news is more thrilling for you. If, however, you get a little excited about a button on your Finder window that drops you into the UNIX subsystem, read on: I think I've found the best-of-breed. OpenTerminal does what it says, it opens Terminal and cd's to the folder of the foreground Finder window. There are plenty of AppleScript or Automator-based buttons that will do this, and apps like cdto do the job in a very utilitarian fashion. It's pretty easy to craft your own, too, but this free utility packs a few extra tricks.

  • Use networksetup to change AirPort networks from the command line

    by 
    TJ Luoma
    TJ Luoma
    05.06.2010

    The other night I needed to change Wi-Fi networks on a computer that I was connected to via ssh. Just about every page that I found via Google led me to try the exact same thing (type "airport -A") with one minor problem: it didn't work. Let's back up a little bit. You may know that there is a commandline tool called "airport" which is buried fairly deeply in the filesystem: System » Library » PrivateFrameworks » Apple80211.framework » Versions » Current » Resources » airport Not the usual place to find a commandline utility. Translation? "This is here for Apple to use, but it's not something you ought to rely on." But of course that's not going to stop us. Read on for more...

  • Rudix, a lightweight way to add new Unix utilities

    by 
    TJ Luoma
    TJ Luoma
    05.04.2010

    Rudix offers a collection of Unix utilities which do not come with OS X by default. When setting up a new Mac I always install these Unix utilities: wget, ncftp, lynx with SSL support, and the GNU Core Utilities. I compile them manually whenever possible, despite options like MacPorts or Fink. I don't need everything that MacPorts and Fink offer, and installing them always felt like overkill -9 (that's a commandline joke, kids). Generally they try to mimic the commandline syntax of either Linux or FreeBSD, neither of which I have used extensively. Although Rudix offers a giant 361MB DMG with all of the packages includes, I recommend only installing what you need. You can find each program with its own OS X .pkg installer. These pkgs install to the traditional location of /usr/local/ (something both MacPorts and Fink avoid, a side effect of the volume of software they are designed to install, as well as a difference in approach).

  • msmtp, a free tool to send email from Terminal

    by 
    TJ Luoma
    TJ Luoma
    05.04.2010

    I fully expected that my article on mailsend would lead to several "Why don't you use use XYZ instead?" replies, and it did. Suggestions included Ruby, Python, iPhone push notifications, and configuring postfix/sendmail. But one suggestion was to use msmtp, and that turned out to be the golden nugget. What makes msmtp so great, especially compared to mailsend, is that it completely eliminates the need to store your Gmail password in a plain text file on your computer. msmtp uses the Mac OS X Keychain instead. The other big advantage is that mailsend required several command line arguments every time, which makes it very likely that someone (i.e. "me") is going to screw it up. Once msmtp is configured, I can use the venerable "/usr/bin/Mail" to send email from the command line, and /usr/bin/Mail is nearly idiot proof. (Note I said "nearly" -- this is not a challenge!) In short: msmtp was what I was looking for when I found mailsend. Although configuring msmtp took about 30 minutes, it was well worth it, and now that you have these handy instructions, it should take you even less time than it took me. (You can also get mstmp from Rudix or MacPorts but I still like building my own whenever possible. You might not share my neuroses, however.) Read on for a complete walk-through.

  • Use mailsend to send email from the Terminal

    by 
    TJ Luoma
    TJ Luoma
    05.03.2010

    Update: After this article was written I learned of mstmp which I highly recommend instead of mailsend. There are times that I want my iMac to be able to email me: when certain scripts run via cron or launchd, when certain events happen (a backup has been completed), etc. I've found that none of the included command-line programs work. The good news is that, with a UNIX foundation, it was fairly easy to find a free program which would do just that. A little searching turned up a free program called mailsend, which will work. For this example I will be using a Gmail account, which requires OpenSSL. Your mail server may not require OpenSSL support, but if it's possible, I encourage you to use it. The short version of the instructions are as follows: 1) Download and install OpenSSL to /usr/local/ssl/ 2) Download and install mailsend to somewhere in your path such as /usr/local/bin/ 3) Use mailsend -h to learn how to use it on the commandline 4) (Optional) Use TextExpander 3 to fill in some of the variable fields, such as To, Subject, and Message. Read on for more of a step by step walk-through.

  • iPad 'Spirit' jailbreak demonstrated by MuscleNerd, now it really is magical (video)

    by 
    Richard Lai
    Richard Lai
    04.04.2010

    You better believe it when notorious iPhone jailbreaker MuscleNerd -- a well-respected member of the iPhone Dev-Team -- declares root access on an iPad. According to this fella's tweets, this new hack is a port of Comex's "Spirit" jailbreak that exploits a bug found on both iPhone OS 3.1.3 and the iPad's 3.2. No downloads are offered right at this moment, but it shouldn't be long before we can throw in all sorts of wild apps and widgets as we wish. Video after the break. [Thanks to everyone who sent this in]

  • Top Terminal easter eggs

    by 
    Michael Grothaus
    Michael Grothaus
    04.04.2010

    Yeah, the headline makes it sound like the eggs are on their deathbed. But no, easter eggs (in software jargon) are little presents or surprises that developers have slipped into an application or operating system. One excellent place to find easter eggs in Mac OS X is in the Terminal. Now technically, these easter eggs aren't part of Mac OS X. The Terminal app is a portal into the UNIX underpinnings of Mac OS X. You can find the Terminal app in the Applications > Utilities folder. Here are four of my favorites: 1. Important dates in history -- Lord of the Rings style At the Terminal prompt paste the following: cat /usr/share/calendar/calendar.history and press return. You'll get a list of famous dates throughout the centuries -- including some that take place in Middle Earth. 2. Snake Game At the Terminal prompt type in emacs, then press enter. You'll see a bunch of text come up. Once it does hold down the ESC key and press X. If you timed your presses right, you'll notice the cursor has moved to the bottom of the page next to the letters M-x. Now type in snake and enjoy! 3. Tetris Follow the same steps as for the Snake game. At the Terminal prompt type in emacs, then press enter. You'll see a bunch of text come up. Once it does hold down the ESC key and press X. If you timed your presses right, you'll notice the cursor has moved to the bottom of the page next to the letters M-x. This time, type in tetris. Use the arrow keys to move and rotate the blocks, and press the space to make the blocks fall. 4. Emacs psychoanalysis Like the previous two, this last easter egg is an extension of the emacs UNIX command. At the Terminal prompt type in emacs, then press enter. You'll see a bunch of text come up. Once it does hold down the ESC key and press X. If you timed your presses right, you'll notice the cursor has moved to the bottom of the page next to the letters M-x. This time, type in psychoanalyze-pinhead. You'll get a speedy conversation between two doctors. Press Ctrl-G to stop the conversation and then read the transcript. All these easter egg tips were taken from The Easter Egg Archive which lists Easter eggs found in movies, TV, books, art, music, and software. Check out the site for many more Mac easter eggs and please post any that you know of in the comments! [Binary egg photo by Rakka]

  • Terminal Tips: Generate random filenames for digital photo frame images

    by 
    Aron Trimble
    Aron Trimble
    02.25.2010

    It's not at all unlikely that you or a relative have received a digital photo frame as some sort of gift. The concept is great, one frame on your mantle, many pictures on display. Unfortunately, Apple has yet to enter the photo frame market -- at least until the iPad is released, that is. In the interim, we are stuck dealing with photo frames that look good but do not always function as we expect. One example of a photo frame feature gap is the lack of ability to "shuffle" photos so that they can be displayed in a random order. While sitting at my grandma's house for hours on end, it quickly became a personal challenge to try and successfully guess the next photo that would appear. Luckily, the screencast junkies over at Murphy Mac have found a somewhat simple solution to this conundrum. The problem is the result of frames using the all-too-common alphabetical sorting method when showing photos. While this is useful for organization, it is less helpful for the purposes of the photo frame. The answer lies in assigning totally random filenames to your digital photos. As the title indicates, this is a Terminal.app-based tip so you'll have to get your hands a little dirty with this one. The process is something that could take a long time, especially when you consider that many photo libraries have thousands of images. However, through the power of Terminal and the use of a for-loop, it is possible to randomly rename an entire folder of images with one fell swoop. To begin, you will need to place all of your images in a single folder. We here at the TUAW HQ cannot recommend strongly enough using copied image files and triple-checking your backups prior to moving forward. Open up Terminal.app and use cd to navigate to the new directory where you placed your image copies (now might be a good time to check your backups a fourth time). When done, type the following command and then press return. for i in *.jpg; do mv $i $RANDOM.jpg; done Assuming all of your photos are jpegs and located in same directory, then after some whizzbangery you will have a folder filled with very strangely-named images. Copy these files to your photo frame and you now have a fully randomized photo slideshow. Feel free repeat as often as your guests (or your OCD) require. Got any other handy Terminal tips? Feel free to share them in the comments!

  • Fix iPhone EXIF rotation from the command line

    by 
    TJ Luoma
    TJ Luoma
    02.17.2010

    My iPhone is the camera that i use more than any other, but there's one thing that has consistently annoyed me about it. Apple uses an EXIF tag to rotate images. This can be a problem when you share images with others. Safari will rotate the image correctly, but no other browser will. Adding to the trouble is that Mail.app and the Finder will also "auto-correct" the rotation, so it can be hard to tell which images need to be "fixed" and which don't. You could use the '/usr/bin/sips' program (sips --rotate 90 picture.jpg) if you knew which pictures need to be corrected, and which direction they need to be rotated (clockwise or counter-clockwise). But I wanted something that would, as they say, "just work." (I also wanted something I could use on my webserver, which runs Linux, but that's really a side issue.) My attempts to find a solution on Google were fruitless, so I asked on Twitter. Michael Baltaks pointed me to jhead, which describes itself as a "Exif Jpeg header manipulation tool" which includes the source code as well as pre-built binaries for OS X, Linux, FreeBSD, and even Windows. To fix a picture named "image.jpg" just type "jhead -autorot image.jpg" and you will see "Modified: image.jpg". You can fix all JPGs in the current folder using "jhead -autorot *.jpg" and it will only change the images which have the EXIF tag. Note: You might be tempted to use the "-norot" argument, which will "zero out" the rotation tag, but it will not have the desired effect, and (even worse) once you have used the "-norot" you can't use "-autorot" -- trust me, I learned that one the hard way.

  • MaComfort brings a little Mac back to your PC

    by 
    Mike Schramm
    Mike Schramm
    02.04.2010

    Let's face it -- as much as we love our Macs, sometimes you've got to use a PC, whether that be for work or at a friend's house, or just for playing some games. But when you absolutely must use Windows, maComfort can make the transition easier. It's a free Windows application (with some premium options) that brings all of the nice software things you appreciate on your Mac back to your PC. It's got a QuickLook-style feature, translates the Windows key to all of your Command hotkeys, and even replicates familiar Mac features like one-button volume control and Spaces and Active Corners. And the app also has a add-on system, so you can download extra features like homemade Docks and shadows just like on your Mac back home. Of course, it's not perfect -- QuickLook only works in Explorer, not everywhere, and obviously all of the less-superficial features on the Mac (like Terminal and Stacks) will stay in OS X. But if you have to use a PC away from home and are frustrated that hitting what's supposed to be the Command key keeps popping up the Start menu instead, try a little maComfort. The app is a free download with limited functionality, or $20 for full use. [via LH]

  • Manually schedule Software Update 'the OS X way' with launchd

    by 
    Brett Terpstra
    Brett Terpstra
    01.10.2010

    In response to a Macworld article, TidBits' Chris Pepper elaborated on ways to run Software Update, Apple's means of delivering updates and patches, on your own schedule. Beginning with the fact that Software Update schedules its next update based on the time it's currently being run, setting the time for the next update is as easy as running it manually at the time you want it to be scheduled for in the future. Later, Pepper delves into the command line method of updating, using the softwareupdate tool (which we've talked about on TUAW, too) to run it from Terminal. Taking that a step further, it's suggested that you run the command from cron, a UNIX command for scheduling tasks, to automate the command-line updates. However, while it still works fine and is perfectly capable of the task, cron has technically been deprecated in OS X since Tiger. I thought I'd mention the newfangled "Mac OS X way" of handling scheduled tasks, and demonstrate a little of its flexibility. Launchd is Apple's replacement for several UNIX ways of doing things, including init, rc.d scripts and cron. It provides a uniform, XML configuration method and -- in many cases -- is more secure than the replaced methods. Launchd can trigger applications and scripts at boot time, at intervals or even when a file or the contents of a folder change. It can also make sure a daemon or an application keeps running, with the ability to respawn and throttle it. If that's just a bunch of nerd-speak to you, don't worry, this isn't going to be an overly technical post. You can read more specifics about launchd on Apple's developer site, if you want more geeky goodness.

  • Homebrew, the perfect gift for command line lovers

    by 
    Brett Terpstra
    Brett Terpstra
    12.25.2009

    If you're an OS X user who spends as much time on the command line as you do in the GUI, you're probably familiar with the MacPorts and Fink package management projects, making open source software easier to compile and run on Mac OS X. You may also be well-aware of the shortcomings of these projects when it comes to future-proof package management. A new, open source project called Homebrew may be exactly what you've been looking for. If you're not a lover of all things CLI, send a link to Homebrew as a great (free) last-minute gift for the Terminal-lover in your life. My favorite thing about Homebrew is its ability to function perfectly well with /usr/local as its base directory, installing packages in their own folders but linking them to /usr/local/command. This makes them manageable with existing command line tools. Homebrew can work out of any directory you like, if /usr/local isn't your cup of tea. Installed packages are optimized and stripped based on your architecture, and makes great use of libraries you already have installed or that came with the system, reducing duplication and speeding up download, compile and install times significantly. Add in the zero-config installation, an already-extensive list of "formulas" (packages), a greatly-reduced need to sudo anything, and a Ruby-based framework for creating your own formulae and you've got a killer package for extending your command line toolset. Homebrew is available for free on GitHub, and the main page has complete instructions for various types of installation (and reasons why you'd pick each one). Check it out, and have a merry CLI-mas!

  • Snow Leopard Fixes: Terminal shell workaround

    by 
    Erica Sadun
    Erica Sadun
    10.23.2009

    Ever since I installed Snow Leopard, I've been dealing with a particularly annoying bug. Terminal keeps forgetting my shell preferences. I generally prefer to use tcsh rather than bash. This is mostly because I'm a technological dinosaur. I also have a lot invested into my ancient and extensive .cshrc that has taken years to grow and develop. Normally, I set the default shell inside the Terminal app preferences. But there's a problem. Snow Leopard keeps losing my preferences for reasons I do not begin to understand. With this Snow Leopard bug, I had to find another approach for choosing my shell. Terminal preferences were no longer going to work for me. There are actually two very good ways to handle this problem. First, there's chsh, as pointed out by Richard Buckle and Brian "Shmit" this morning. A command line utility, chsh edits the OS X user database, allowing you to change a user's default shell. chsh is built into OS X, and you can pull up a man page to read details about its use. Supply the shell you want to use, authenticate, and you're set. There is, however, an easier solution. It's System Preferences. As Bill Bumgarner and Jordan Breeding reminded me today, you can access advanced user settings by right-clicking (or Ctrl-clicking) a user name in the Accounts settings; then choose Advanced Options. (Please note that you must first unlock the settings before this trick becomes available.) When selected, an Advanced Options screen appears. You can set the new login shell in this screen. A simple pop-up list offers easy access to all installed shells. Select the one you want to use and, once selected, click OK to dismiss the screen and return to the Accounts settings pane. This solution works a lot better than the bash .profile approach I had been using for a few weeks. Running tcsh through the .profile initialization file had caused an extra layer of interaction each time I wanted to close a terminal window. The application warned me that I was about to kill a running process (i.e. my tcsh subprocess). Changing my default shell meant I could create and close windows on demand without that extra dialog, a welcome respite. In conclusion, while I'm not sure why Terminal keeps losing its preferences, I'm pleased that I at least learned a way to bypass the shell issue. Hopefully, Apple will get this bug fixed soon.

  • Snow Leopard Fixes: the angle-bracket "copy email" behavior

    by 
    Dave Caolo
    Dave Caolo
    10.22.2009

    Snow Leopard introduced many welcome changes to Leopard and one huge annoyance. When copying an email address from Mail, Snow Leopard wraps the address in "< >" brackets, for example, "<annoying@email.com>". When pasting, you've got to go back and remove the brackets. Mac Daddy World has identified the preference setting and posted the simple Terminal commands that will eliminate the brackets. I tried it and it's working perfectly! Thanks, Mac Daddy World. That was very simple and most welcome. While most users are happy with Snow Leopard, there are these annoyances. Is there something bothering you?

  • Force Snow Leopard's Dictionary.app to reuse definition window

    by 
    TJ Luoma
    TJ Luoma
    09.30.2009

    The Dictionary.app in Snow Leopard has been driving me nuts. If you use LaunchBar or Spotlight (or probably any other method of sending a word to Dictionary.app), it opens a new window. And then another. And then another. This might be handy if the window bar was updated to show the word that you had looked up, but it doesn't, meaning that the extra windows are just clutter. Before 10.6, Dictionary.app reused the same window for each new definition. If you wanted to go back to a previous word, you could simply use the "Back" button. As we've heard countless times, Snow Leopard has been about subtle refinements, but this was a step backwards to me. I was surprised that there isn't a Preference setting to reuse the same window or open a new one. In a fit of frustration yesterday, I posted a bounty on Twitter and asked Rob Griffiths to see if he knew of an answer. Rob is the proprietor of MacOSXHints.com which I consider essential reading for Mac users (I have even submitted a few tips of my own over the years). I knew if anyone could find an answer, it was Rob. Well, it turns out they don't call him Rob "The Hints Guru" Griffiths for nothing. Not long after my cry for help, Rob figured out how to Force Dictionary to show definitions in one window. As you might expect, it involves entering a command in Terminal.app while Dictionary.app is not running: defaults write com.apple.Dictionary ProhibitNewWindowForRequest -bool TRUE Voilà! Dictionary will now revert back to the 10.5 and earlier behavior of using one window for all definitions. Rob must truly be credited for discovering this gem, because (as of this writing) Google comes up 100% empty when looking for 'ProhibitNewWindowForRequest'. When was the last time you tried to Google something and came up completely empty? That doesn't happen often anymore! Turns out that Rob used another tip from his site to find hidden preferences (something else which has gotten more difficult in Snow Leopard). It's the circle of life... or at least, tips. Thanks again, Rob. Now where do you want me to send your Ferrari? (You'll have to read Rob's post to get that joke. It also explains how to undo this change if you decide you want to revert to the standard 10.6 behavior.)

  • Change the behavior of the iTunes zoom button in 9

    by 
    TJ Luoma
    TJ Luoma
    09.28.2009

    For me, one of the most welcome new features of iTunes 9 was the restoration of sanity to the way that iTunes responded to the zoom button. I had long been irritated by the non-standard behavior iTunes had displayed, brazenly flaunting the accepted practice of how the zoom button worked by toggling the mini player on and off, instead of zooming the window like a well-behaved Mac app. Never once in all my years of using iTunes have I wanted to use the mini player. Whenever I tried to zoom the app and the mini player appeared, it would be quickly followed by muttering and grumbling. So you can imagine my joy and bliss at discovering that iTunes 9 finally validated what I had known all along. The zoom button was supposed to act a certain way, and if you want to do something different than the standard, then you ought to use the option/alt key. I celebrated this change. I called friends I had not spoken with in ages to tell them about it. I wrote a sonnet to the proper use of the zoom button. A party was planned. Ok, maybe not all of that, but I was pleased with the change. Then iTunes 9.0.1 came out and ruined everything. Yes, I said everything! No, you're the one who's overly emotionally attached to a relatively minor UI issue! Well, apparently I'm not the only only one. Over on Twitter @zadr and @siracusa reported that you could revert iTunes 9.0.1 to iTunes 9.0's behavior through a command in Terminal.app: defaults write com.apple.iTunes zoom-to-window -bool YES This tip was then "retweeted" about 50 times and ended up on MacOSXHints.com which is where I first saw it, moments before breaking out into song and dance. If you would prefer not to get into Terminal.app, you can get the 9.0 standard zoom behavior in 9.0.1 (and presumably later versions as well) by holding down the alt/option key when clicking the zoom button.

  • Credit card terminals for iPhone

    by 
    John Burke
    John Burke
    09.23.2009

    It's no secret that the iPhone is much more than just a smartphone. Apple has even started giving iPhones to Apple Store Concierge employees to schedule appointments and manage the store. The ability to complete mobile transactions with credit card terminals is a great use of the iPhone for employees on the go or companies that do home or office calls. Like most applications in the iTunes App Store, there is no shortage of alternatives available for you to try. Here's a roundup of some of the most popular credit card terminals for iPhone. Credit Card Terminal [iTunes Link] - $0.99 This app is pretty awesome. So awesome in fact, that it was featured internationally in an Apple commercial. The 99 cent application offers a (very) cheap alternative to expensive terminals and hardware. With a clean and easy to use interface, users can enter credit card information, complete transactions, and even view and refund past sales. The app also gives you the ability to collect customer information. The developer even offers telephone and email support and will walk you through setup. Billing: Credit Card Terminal [iTunes Link] - $19.99 Another "easy to use" credit card terminal that is guaranteed to help make transactions easier. Sporting a pretty cool, and somewhat different kind of interface, the $20 application makes setting up a sale as simple as tapping a button. One cool feature offered in this version is the ability to get a customer's signature. Some screenshots from the featured applications: %Gallery-73813%

  • Mac 301: Time Machine backups after your Mac's brain surgery

    by 
    Chris Rawson
    Chris Rawson
    07.20.2009

    As I've discovered recently, one of the unfortunate side effects of having the logic board on your computer replaced (aside from the potentially hefty bill involved if your AppleCare has lapsed) is that your Time Machine backups won't play nicely with your Mac after the repair if you're using a Time Capsule. Replacing the logic board is essentially like getting a whole new Mac; though all the data on the hard drive is identical, the new logic board will have different hardware identifiers (specifically, the MAC address) that will tell your Time Capsule, "This is a new Mac that's never been backed up before. Please treat it as such." The Time Capsule, doing as it's told, will fumble along and create a new Time Machine backup while ignoring the old backups completely.Your options then are these:1. Scrap your old Time Machine backups and start fresh. There may be an allure to this, but it's almost certainly unnecessary, and you can lose months of perfectly good backups. Plus, you then have to deal with the incredibly long first Time Machine backup all over again.2. Hack your Time Machine backup using the following procedure, which will allow you to resume Time Machine backups as though your logic board was never replaced.

  • 3.0 firmware release expected at 10am PT/1pm ET, quick Terminal tip to check

    by 
    Erica Sadun
    Erica Sadun
    06.17.2009

    Hey, iPhone 3G owners: Please do not download the 2,1 firmware files listed below. They are for the 3G S and will not work on your phone. Read the whole post for details. The correct firmware for the 3G will start with "iPhone1,2" instead. If you were up all night waiting for the new iPhone OS to arrive, you're in good company -- we were too, until we began getting Twitter reports from users in Hong Kong and Sweden that the local carriers sent out SMS alerts to their customers suggesting when they could download 3.0. Those times both align with a 10 am PT/1 pm ET go time, and that's when we're calling it for now; Engadget concurs. That's why you're still seeing 2.2.1 as the most current version in iTunes; the new version hasn't been released yet. Those with a command-line bent and an inability to wait without doing something can launch Terminal and type in the following every few minutes to see whether 3.0 has launched, rather than repeatedly clicking the Check for Upgrade button in iTunes (note that the up-arrow in Terminal reloads the previous command): curl -s -L http://phobos.apple.com/version |\ grep -i restore |\ grep '_3.' | open -f The results will look something like URLs ending with this: iPhone2,1_3.0_7A341_Restore.ipswiPhone2,1_3.0_7A341_Restore.ipsw The model number indicates which unit has downloadable firmware. As of right now, only the iPhone 3G S firmware has been updated. That's the 2,1 iPhone model. Yes, the 1,2 iPhone 3G model was considered a revision of the first generation 1,1 iPhone as it only had moderate hardware changes. The two iPods are 1,1 and 2,1 for the first and second generation. (No, for those wondering in the comments, you cannot download the 2,1 firmware and install it on your iPhone or iPhone 3G -- it will only work with the 3G S.) To download, copy the URL and paste it into Safari's download window or use any other favorite method to retrieve the firmware. Then hold the Option key and click Update in iTunes. Navigate to the firmware (the ipsw file), select it, and 3.0's good to go. Of course, you can also download directly through iTunes as soon as the update is available.

  • Terminal Tips: Rebuild your Launch Services database to clean up the Open With menu

    by 
    Jason Clarke
    Jason Clarke
    06.11.2009

    Problem: Some piece (or pieces) of rogue software have cluttered up your Open With contextual menu, which you can see by right-clicking or control-clicking any document in the Finder. This problem seems to be most prevalent with virtual machines that allow you to open documents with Windows applications, but tend not to clean up after themselves. After having both Parallels and VMWare installed on my MacBook Pro, my Open With menu was a mess. Solution: Lucky for me, I noticed David Chartier's question about this on Twitter around the same time as I was wondering what to do about it. Some friendly person pointed him to a posting on Apple's discussion forum (also noted on Mac OS X Hints here and here), noting that running a specific command in a terminal window will rebuild your launch services, which repopulates the Open With menu with a current list of applications, without duplicates. It worked perfectly for me, but beware, on my system it took about 10 minutes to complete, and I suspect it could take more on a sufficiently gummed-up system. Here's the Leopard version of the command (the path to the tool is different in Tiger, see here). I broke it into three lines for readability, but the \ at the end of the line is bash-speak for "keep on going with the same command" -- you can copy and paste it directly and it should work, or if you type it on one line without the backslashes, it will also work fine. Just copy and paste it into terminal and it'll work just fine. /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user If, preferring to avoid the Terminal, you want a handy GUI app to rebuild the Launch Services database with a couple of clicks, check out Titanium's OnyX or Maintenance utilities, both free of charge.