"...to become the leader in providing faster, friendlier, and more affordable subscription-based computer support services."

Ask Dr.Tech solution database


Change your Mac Hostname via Terminal

Monday, 4 October 2010 09:14 by Davian

For most people if you want to change your Mac computer name you just do it through the Sharing system preference, it’s quick and very easy. For those of us that are more geekishly inclined, we like to do things through the Terminal.

Here’s how to change your Mac hostname with the command line and make it permanent:

scutil –set HostName new_hostname

Simply replace new_hostname with whatever you want your hostname to be changed to, for example I want to change my Mac’s hostname to MacBookPro, I will use this command:

scutil –set HostName MacBookPro

You will be asked for your admin password since you’re using the sudo command. After the command is executed you can verify that the changes took place by typing:

hostname

You can also set a temporary hostname change by using the following command:

sudo hostname new_hostname

This will reset itself after your Mac reboots though, so if you want a permanent hostname change, use the above command instead.

Disable the “Are you sure you want to open this file?” warning dialogue in Mac OS X

Monday, 4 October 2010 09:07 by Davian

mac-download-message_1.png

Starting in Mac OS X Leopard, you may have noticed that when you download a file from the web and go to open it, you will get a prompt saying something along these lines.

This is Mac OS X just being safe, but if you always know for sure what you’re downloading it could even be overly safe. You can disable this quarantine message by launching the Mac Terminal and typing the following command:

defaults write com.apple.LaunchServices LSQuarantine -bool NO

You will then need to reboot (although killing the Finder should work as well) for the changes to take effect. To reverse this and get the file quarantine message back, type:

defaults write com.apple.LaunchServices LSQuarantine -bool YES

Again you will need to reboot (or kill the Finder) to have the changes back.

Disable “application downloaded from the internet” message in Mac OS X

Monday, 4 October 2010 09:05 by Davian

You can remove the “Blah is an application downloaded from the internet. Are you sure you want to open it?” on a per application basis by using the following command:

xattr -d -r com.apple.quarantine /Path/to/application/

mac-download-message.png

If you want to remove the that warning message from all in your ~/Downloads directory, you can type the following command:

xattr -d -r com.apple.quarantine ~/Downloads

Remember this method only effects items you choose to specify.

Convert songs to MP3, AAC, M4A, or other formats in iTunes

Monday, 4 October 2010 09:01 by Davian

iTunes 9.1 and forward changed the way it handles song conversions. I’m not quite sure why but Apple made it so converting a song to a different format is no longer just a matter of right-clicking and converting. Instead, with iTunes you’ll have to make an adjustment in iTunes Preferences first.

First, select the conversion format in iTunes:
* Open iTunes Preferences
* Click on “Import Settings”
* Choose the format you want to convert to by using the ‘Import Using’ menu: AAC, AIFF, Apple Lossless Encoder (MP4 or M4A), MP3, WAV
* Click ‘OK’

Now when you want to convert any song to the new format:
* Click on the song you want converted in iTunes
* Click on the ‘Advanced’ menu
* Scroll down to ‘Create MP3 Version’ (or whatever format you selected earlier)

iTunes will then convert the song to the format you selected just as it did in any prior version. If you want to make an iPhone ringtone you’ll want to use the Apple Lossless Encoder or AAC and then rename the .m4a file extension to .m4r just as before.

 

convert-song-format-itunes.JPG

Use Tab to auto-complete paths in the Finder Go To Folder window

Monday, 4 October 2010 09:00 by Davian

autofill-go-folder-finder.jpg

You can use the tab key to autocomplete any path in the Finder Go To Folder window (Command+Shift+G).

To try it out, open the Go To Folder window and start typing the path to a folder, like ~/Library/Pre then hit the tab key to complete the rest of “Pre” with “Preferences” – this is extremely useful when you are accessing lengthy paths in your filesystem.

Auto-completion should be familiar to anyone with a unix background, since it is regularly used within the command line interface.

Change MAMP to default Apache and MySQL ports

Monday, 4 October 2010 08:58 by Davian

MAMP is a great app for Mac OS X that lets you quickly and easily run an entire pre-configured web server on top of Mac OS X, it’s really helpful and I use it frequently. Now my only complaint about MAMP is the port settings, by default they are set to 8888 and 8889, so instead of being able to visit localhost you have to load localhost:8888. Thankfully this is easy to change.

mamp_ports.png

  • Open up MAMP and hit the Preferences button
  • Click on the Ports tab
  • Click on “Set to default Apache and MySQL ports
  • Click OK

MAMP will restart itself with the new default ports configured. This is the first thing I do when I setup MAMP and I find it makes working with the app much more natural.

And yes, I realize that Mac OS X comes with Apache server by default, but in my opinion nothing beats MAMP for it’s simple setup.

Access and Mount an SMB Share via Command Line

Monday, 4 October 2010 08:47 by Davian

This first command lists the available shares at the destination IP:

smbclient -U user -I 192.168.0.105 -L //smbshare/

Now you’ll want to pass set your SMB shares mount point:

mount -t smbfs -o username=winusername //smbserver/myshare /mnt/smbshare

and finally you’ll want to gain access to the SMB share by specifying your Windows login and the machines IP address:

mount -t cifs -o username=winusername,password=winpassword //192.168.0.105/myshare /mnt/share

Map a network drive on a Mac

Monday, 4 October 2010 08:41 by Davian

map-network-drive-mac.jpg

If you frequently access a file server from a Mac it’s pretty helpful to map the network drive to your desktop. There’s two ways to do this, one method is just mapped for one time use and will reset after a reboot, and another method is a more permanent route that allows the mapped network drive to always appear and mount on your desktop after system reboots and user logins.

 

Map a network drive to Mac OS X

This method maps a network drive that will disappear if the network connection drops or if you reboot your Mac:

  • From the Mac OS X Finder, hit Command+K to bring up the ‘Connect to Server’ window
  • Enter the path to the network drive you want to map, ie: smb://networkcomputer/networkshare and click ‘Connect’
  • Enter your login/password and click “OK” to mount the network drive
  • The drive will now appear on your desktop and in the Finder window sidebar

Map a network drive to Mac OS X that re-mounts after system reboot

This method allows you to reboot your Mac and have the mapped network drive automatically remount and appear on the desktop, this is more persistent than the above method:

  • From the Finder, hit Command+K
  • Enter the path to the network drive you want to map, ie: smb://networkcomputer/networkshare and click ‘Connect’
  • Enter your login credentials and click “OK”
  • The drive is now mounted, but continue on to map for system reboot persistence
  • Now enter into System Preferences, from the Apple menu
  • Click on ‘Accounts’
  • Click on “Login Items”
  • Click on the + button to add another login item
  • Locate the network drive you previously mounted and click “Add”
  • Exit out of System Preferences

Your network drive will now be mapped and automatically remounted when you reboot your Mac.

Make the mapped network drive visible on the Mac desktop

It’s possible that the mounted drive will not appear on the desktop due to a system setting. If you want the mapped drive icon to be visible on the Desktop, be sure to do the following additional steps:

  • From the Finder, open Finder Preferences by hitting Command+,
  • Click the General tab
  • Select the checkbox next to ‘Connected Servers’
  • Close Finder Preferences

Selecting the checkbox next to Connected Servers ensures that you’ll see the icon on your Mac Desktop, otherwise it will only be visible in the Finder window sidebars and Open/Save dialogues.

Remount mapped network drive with a click

A great additional step for either method is to create an alias of the mapped network drive. This allows you to reconnect to the share with just a click. Here’s how to do this:

  • Right-click on the mapped network drive on the Mac OS desktop
  • Select “Make Alias”

Now you can double-click that alias to reconnect to the network drive instantly.

Open any man page in Preview and save as PDF

Monday, 4 October 2010 08:28 by Davian

If you’re tired of looking over a man page within the Terminal, you can launch any man page into Preview with the following command:

man -t ipconfig | open -f -a /Applications/Preview.app

This example uses ipconfig, but just replace ‘ipconfig’ with any other man page you’d like to read within Preview and it’ll work the same.

Save the man page as PDF

Once the man page is opened within Preview, you can then use Preview to “Save As” and then create a PDF file of the man page for later viewing.

 

man-page-preview.jpg

Hide All Desktop Icons in Mac OS X

Monday, 4 October 2010 08:24 by Davian

It’s easy to hide the Mac hard drive icons, but what about all the other stuff that gets dumped to your desktop? Well that’s easy to hide too actually, following these instructions:

Clean up the Desktop by Hiding Desktop Icons

Launch Terminal and type the following:

defaults write com.apple.finder CreateDesktop -bool false

After hitting enter, you’ll want to kill the Finder so that it relaunches and the changes take effect:

killall Finder

All of the files will still exist, but they’re now discretely hidden in your home folder’s “Desktop” directory rather than cluttering up your actual desktop.

To show the Desktop icons again, open the Mac Terminal and type the following:

defaults write com.apple.finder CreateDesktop -bool true

Again, kill the Finder and your icons will show on the desktop as usual.


Sign up now - $98.00 annual plan
Also available plans: 15 day money back guarantee
per-incident $37.00
month to month* $47.00
* Plans include unlimited number of support incidents

A “must-have” service


Using Ask Dr. Tech is like having your personal technician always at hand *
* for only 26 cents per day