How to Get Current Screen Resolution from Command Line in Mac OS X

Typically Mac users will retrieve the screen resolution of connected displays through the Displays system preference panel in OS X. There’s certainly nothing wrong with that approach, it’s easy and quick, but because it uses the graphical interface of OS X it’s not necessary helpful for scripting purposes or remote management through Remote Login and SSH connections. In these situations, and plenty of others, you may wish to retrieve the current screen resolutions of displays from the command line in Mac OS X.


How to Completely Remove Apps & Software in Mac OS X by Manual Terminal Uninstall

Most apps in Mac OS X can be uninstalled easily by dragging them into the Trash from the /Applications/ folder, and many others come with accompanying uninstall applications that will clean house and completely remove the apps too. Additionally, there are third party utilities for OS X that can make total removal of apps as …


Workaround for the Slow Open / Save Dialog Box Problem in OS X Mavericks

A fair amount of Mac users running OS X Mavericks have discovered a peculiar slow speed issue when attempting to use various actions found in the File menu, including the Open, Save, and Export dialog boxes. The problem manifests as an intensely slow lag when trying to use the Open or Save dialog windows, where the spinning beachball shows up, spins aimlessly for 3-15 seconds, followed by a lengthy slow delay before any files or folders populate the file action windows and allow a user to proceed.

Slow Open and Save dialog box in Mac OS X

This behavior is almost certainly a bug and not all users of OS X Mavericks encounter the problem, thus if you have not experienced this issue there is no reason to make any changes. That said, plenty of commenters in our Mavericks Finder speed fix article also have the slow dialog box problem, and thankfully a workaround solution has been found on Apple Support Forums (thanks Droo!) that may work for some other users encountering the issue.

Note this solution is a workaround, not a proper fix. The slow Open/Save issue seems to pertain to accessing network drives, and this workaround prevents network shares from automatically mounting. Accordingly, this will not be a valid option for users who map network drives for auto mounting, or for users who rely on automating network shares in any way. You must edit a system file using the command line, if you are not comfortable with Terminal then waiting for an official bug fix is probably a better idea.

Launch Terminal and enter the following command:

sudo nano /etc/auto_master

Enter an admin password when requested, then find the line that says “/net -hosts ….” looking something like this:

/net -hosts -nobrowse,hidefromfinder,nosuid

Use the arrow keys to navigate to the front of that string, and then place a # (pound sign) in front of the / to signify that it has been commented out, it should now look something like this:

#/net -hosts -nobrowse,hidefromfinder,nosuid

The modified /etc/auto_master file should now look like this, the #/net has been highlighted:

Workaround for slow Open and Save dialog box problem in Mac OS X

Now hit Control+O to save the file, then Control+X to exit out of the nano text editor and return back to the command line.

Now you must flush the automount cache, so type the following command string:

sudo automount -vc

Now you should be good to go, so exit out of Terminal and try to access any Open, Save, or Export dialog box window again. The slowness should be gone completely, and you’ll be back to speedy file interactions through the dialog windows as expected.

This bug has been encountered and reported enough that we can assume a solution from Apple is likely to be due in a future OS X Mavericks update, be it 10.9.1 or otherwise. If you do use this automount workaround, remember to remove the # from the /net entry in auto_mount if and when an official bug fix arrives from Apple.

Fixing the “Unable to Verify Update” Error in iOS

Unable to Verify Update error message on iPhone

It seems that an “Unable to Verify Update” error message arrives at random for some users with just about every single iOS software update, perhaps unsurprisingly, the problem has resurfaced for some when trying to download and install the recent 7.0.4 update. The error seems to be exclusive to using OTA (Over-The-Air) updates, and sometimes it reports an improper iOS version as being available, or tell you that an update “failed verification because you are no longer connected to the Internet” – despite having an active entirely functioning wi-fi connection. If you happen to encounter this error when trying to download and install any iOS update, you’ll be able to fix it in a minute or two using one of these two tips.

1: Kill the Settings App & Relaunch

Before anything else, try just simply quitting out of the Settings app and reopening it. Quitting apps in iOS 7 is done with a simple gesture trick:

  • Double-tap the Home button to bring about the multitasking screen
  • Navigate to “Settings” then swipe up on the Settings app to send it off the screen, thereby quitting
  • Go back to the home screen, relaunch Settings, and try to download the update again

Update downloading and installing now? Good, just killing and relaunching Settings will resolve the issue for many users.

If you still see the “Unable to verify update” error message, or you get the “no longer connected to the internet” error, you will probably have to reset your network settings to resolve the problem, which we’ll cover next.

2: Reset Network Settings & Reboot

If killing Settings didn’t fix the problem, you’ll need to trash network settings, which also restarts the iOS device in the process. This isn’t a big deal, but it does require you to re-enter wi-fi passwords, so jot them down down beforehand if that’s a problem:

  • Open Settings and go to “General” followed by “Reset”
  • Choose “Reset Network Settings” and tap the red text to confirm the reset – this will trash the network configuration and restart iOS
  • Reset the Network Settings in iOS

  • When booted back to the home screen, reconnect to a Wi-Fi network through settings
  • Install the iOS update as usual

A peculiar bug and error, but one of these two tricks should resolve it quickly enough.

Having encountered this twice earlier when updating an iPhone 4S and iPhone 4 to the latest release with OTA, iOS erroneously reported an older iOS version available as being the update available, and then, unsurprisingly, refused to install that improper update with the aforementioned “Unable to Verify Update” error, claiming the perfectly working internet connection wasn’t connected.

Fix the Unable to Verify Update error for iOS

The solution in this specific instance was to reset network settings, total elapsed time from problem to resolution was about 3 minutes. Not too shabby, and certainly beats some of the more complicated troubleshooting tricks to resolve software update problems.

Users may be more likely to see this error if a user is on older version of iOS prior to the version immediately preceding the new release. In other words, if you’re on iOS 7.0.3, you may encounter this when trying to skip a version and update directly to iOS 7.0.5. Regardless, the solution remains the same. Enjoy your fresh iOS update!

How to Install Java in OS X Mavericks

Install Java in OS X Mavericks Java has plenty of real-world applications and uses, but because it has been used as an attack vector in the past, Apple has made OS X reasonably aggressive in limiting Java on Macs. As a result, Mavericks does not come with Java preinstalled, and upgraded Macs will remove Java in Mavericks installation process. For most users this is a very good thing, it further reduces the unlikely event of a trojan or something nefarious being installed on Macs, and many Mac users won’t notice Java missing at all. On the other hand, many of us do need Java installed in OS X.

Many common applications use Java, ranging from the excellent cloud backup service CrashPlan, to the Eclipse IDE, and even some online banking and financial services, and without installing Java yourself in Mavericks you’ll find these apps and websites simply don’t work. Fortunately it’s a simple fix just like in 10.8, and you can go about installing Java on OS X Mavericks in several different ways.

Install Java in Mavericks through the Command Line

Installing Java through the command line is perhaps the easiest. All you need to do is launch Terminal, found in /Applications/Utilities/, and enter the following command:

java -version

Assuming Java is not on the Mac already, this command will trigger a popup that says something along the lines of “To open Java, you need a Java SE runtime. Would you like to install one now?” – click “Install” when asked to begin the simple process.

Installing Java in Mavericks

From here on it’s just like installing any other package. Remember, you will probably need to relaunch certain apps that are Java dependent to get them working again, including web browsers if it’s a website you are attempting to access that requires a Java applet to run.

If you run that command and already have Java installed, you’ll simply see the currently installed Java version instead, like so:

java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-465, mixed mode)

If you’re not a fan of the command line, or would rather get the latest version of Java installed in OS X 10.9 directly from Oracle, that’s what we’ll cover next.

Option 2: Installing the Latest Java Version from Oracle

The other option to get the latest version of Java is to simply download it from Oracle and install manually.

Most casual Mac users only need to get the JRE (Java Runtime Environment) and not the full JDK (Java Development Kit).

Downloading directly from Oracles website insures the latest version will be installed, and it also has the advantage of allowing for remote installation and upgrades on Macs through Remote Login or SSH.

OS X handles Java well these days, and and newer versions of Safari even let you allow the Java plugin on a per website basis, further limiting it’s potential problems.

Remember, for most Mavericks users, you can avoid Java and not worry about it. Installing Java is really only necessary if a crucial application or web service requires it.

Get iOS 7 to remember passwords even for sites that don't want it to

iOS 7 uses iCloud to store your passwords for websites you log into. But sometimes, by default, Safari won't prompt you to save passwords for certain sites—sites that explicitly request that web browsers not save such data.

But they're your passwords, and Apple clearly thinks you deserve a vote on whether your iOS device saves them. Head over to the Settings app, tap on Safari, and then tap on Passwords & Autofill. Enable the Always Allow setting, and Safari will now be willing to save every single password you enter, even on sites that attempt to disallow that option.

Connect to SMB & NAS Network Shares in OS X Mavericks

Mac to Windows File Sharing with SMB and CIFS Sharing files between Macs and NAS drives and Windows PC’s has always been very easy, but Mavericks brought a slight change that has caused some problems for certain users in mixed PC and Mac environments. Without getting too geeky, Apple adjusted the default protocol for SMB (Samba, the Windows file sharing ability) from SMB1 to SMB2, and the SMB2 implementation apparently carries a bug which is incompatible with many NAS (Network Attached Storage) devices, and some versions of Windows. The issue is pretty obvious when you encounter it: Many Windows PC’s, NAS drives, and Linux machines won’t access or mount from the Mac, and instead will try to connect or mount forever and ultimately time out, preventing connections, mapped drives, and general access.

Fortunately there’s a very easy workaround to connect to SMB and NAS shares from OS X Mavericks:

  • From the OS X Finder, hit Command+K to summon “Go To Server” as usual
  • In the “Server Address” field, enter the IP to connect to with the cifs:// prefix as follows:
  • cifs://

    Connect to SMB NAS shares in OS X Mavericks

  • Connect to the SMB, NAS, or Windows share as usual
  • CIFS uses SMB sharing

SMB Share connected in OS X Mavericks

Yes it really is as simple as specifying the protocol to be cifs:// rather than smb://, which if you’ve ever mounted Samba shares from the command line you’ve probably already used cifs before.

If you’re wondering why this works, it’s because using CIFS connects with SMB1 rather than the (currently) buggy implementation of SMB2. The result; cross-platform network shares functioning as usual. I ran into this last night and it was fairly frustrating to experience, but a big thanks to TUAW who discovered the simple workaround a few days ago. Because there are tons of Mac-to-PC networks out there, this will probably be a frequently encountered issue for many Mavericks users. With that said, going the other way around and file sharing from Mac OS X to Windows continues to work exactly as intended, though it should be noted that OS X Mavericks has seamlessly moved all network-based Mac-to-Mac file sharing to SMB2 as well, though the traditional AFP continues to function as well for legacy support and for connecting between Mavericks and earlier versions of OS X.

This really is just a bug with the newest version of Mac OS X, and it will probably be resolved shortly with an update to Mavericks, perhaps as OS X 10.9.1 or even a smaller supplemental update.

How to Repair a Mac Disk with fsck from Single User Mode

Using Disk Utility through Recovery Mode is the preferred and primary tool for repairing disks on the Mac platform, but if Disk Utility is either unavailable or not able to repair a drive, then Single User Mode and the command line tool fsck should be your next choice.

The fsck tool is bundled with every Mac, but because it’s accessible exclusively through the command line it may appear complex and sound more intimidating than it really is. Fear not though, because using fsck is actually quite simple, and there are several cases where it can repair a problem with a drive that Disk Utility was unable to.

How to use Single User Mode and fsck to repair a disk

  • Boot the Mac into Single User Mode by holding down Command+S during system boot after you hear the boot chime, you know you will have successfully entered Single User Mode because you will see a bunch of white text on a black background scroll by
  • When the Single User boot sequence has finished, you’ll find a small command prompt at the bottom of the screen prefixed by a hash sign (#), when you see that type the following command exactly:
  • fsck -fy
  • Once fsck completes, if you see a “File system was modified” message, then you should run “fsck -fy” again until you see a message stating “The volume (name) appears to be OK” – this is standard procedure of using fsck
  • Type “reboot” to leave Single User Mode and boot the Mac back into OS X as usual

Once OS X is booted again, it can be a good idea to confirm all is well by going back to Disk Utility and running the “Verify” tool to check on the drives health.

Keep in mind that if the ‘fsck’ tool continuously fails or reports errors and Disk Utility is a no go as well, the hard drive itself very well may be failing and on its last legs, so be sure to initiate a back up all of your critical data using Time Machine or your backup method of choice, and aim to get the drive replaced sooner than later.

Enable the Talking Calculator in Mac OS X

Enable the Talking Calculator in Mac OS X

Talking calculators are very useful, whether for accessibility reasons or just for entering a lot of numbers that you want to be sure are correct by hearing the auditory response. Thanks to the Mac’s excellent text-to-speech abilities and a simple settings adjustment, you can transform the bundled Calculator app in Mac OS X into a talking calculator, and it will speak both the buttons pressed as well as the calculated result. It’s super easy to enable and use:

  • Open Calculator app and pull down the “Speech” menu, check both “Speak Button Pressed” and “Speak Result”
  • Use the Calculator as usual, now with spoken responses to input and calculations

The speak on button press feature works both for using the onscreen buttons and also on keyboard buttons, making this particularly useful for those with the extended keyboards with their own numerical keypad.

How to Quickly Fix Stuck Orientation on the iPad, iPhone, iPod touch

Every once in a while an iOS device or app will get stuck in the wrong orientation, unresponsive to rotating the device and it either stays in portrait or horizontal mode, despite every effort to rotate the device any which direction. Though this seems to happen more often on the iPad than the iPhone or iPod touch, it can still occur on every iOS device and with just about any app.


Change Network Location Quickly in Mac OS X via Apple Menu

Network Locations in OS X allow you to save specific configurations and settings for different networks. Once they’re setup, you can use them to change between various network configurations quickly, without having to re-enter any settings. These are perfect if you are switching between things like an automatic DHCP config vs a manually assigned IP address, different routers with unique settings at different locations, toggling proxy use on or off, using different and specific DNS configurations, or just have custom network configs for specific places like work, home, or school.

Making the Network Location feature even better is that you can instantly switch between preconfigured network customizations just by accessing an underused menu item.

  • Go to the  Apple menu and pull down to “Location” to view the list of available network locations
  • Select the desired network location from the list to instantly switch to it

Switch Network Locations quickly in Mac OS X from the menu bar

The network settings will change immediately with the selection of a new location, and using this menu bar trick is so much quicker than going through the preference panel.

If the Location menu is not visible for you, it’s because you have not created or saved any new network locations. This can be done through the Network system preference panel in OS X:

  • Open System Preferences from the  Apple menu and choose the “Network” preference panel
  • Click on “Location” and choose “Edit Locations” then click the [+] plus button to add a new network location, name it appropriately to the network settings
  • Configure the network settings as desired: TCP/IP, DNS, Proxy, etc, then choose “Apply” for the changes to be saved and to make the Location menu appear

Add a new Network Location

This trick has been around in Mac OS X for quite some time, but it often doesn’t get the attention it deserves. I use this constantly for changing network needs, and have configurations setup for auto and manual DHCP, proxies, alternate DNS settings that are faster on some networks, and a variety of other networks.

While you’re setting this up, don’t forget that you can also change the connection priority for networks, meaning if some locations have multiple wi-fi networks and/or ethernet, you can set which connection type to prioritize.