"...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.

Start, Stop, and Restart Windows Services from Mac OS X

Monday, 4 October 2010 09:12 by Davian

Mac OS X includes Samba support by default, and this is really handy if you’d like to remotely restart and monitor services running on a Windows machine.

To list services running on the Windows machine, use this command:

net rpc service list -I IPADDRESS -U USERNAME%PASSWORD

A practical example would be:

net rpc service list -I 192.168.0.115 -U Windows%myPassword

After identifying the service you want to restart, you issue the following command to stop the service:

net rpc service stop SERVICENAME -I IPADDRESS -U USERNAME%PASSWORD

Then you can restart (or start) the service by using the following command:

net rpc service start SERVICENAME -I IPADDRESS -U USERNAME%PASSWORD

Access Mac Special Characters with the Character Viewer

Monday, 4 October 2010 09:10 by Davian

You can access the Character Viewer in most Mac apps by just hitting Command+Option+T

From this special character viewer, you can easily insert any special character and browse through all of the special characters available to Mac OS X. You can also use it to insert special characters in foreign languages, assuming you have the foreign language packs installed.

 

mac-special-character-view.jpg

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.

Trim an MP3 on your Mac

Monday, 4 October 2010 08:55 by Davian

You can trim any MP3 file for free in Mac OS X thanks to QuickTime Player. Here’s how:

  • Make a copy of the MP3 file you want to trim
  • Open the MP3 file with QuickTime Player
  • Hit Command+T to open the Trim function
  • Drag the yellow sliders on the left and right side to trim down the section of the song to where you want
  • When you’re finished, click the yellow ‘Trim’ button
  • Go to File -> Save As and save as an iPhone .m4v movie file

Now the MP3 has been trimmed down the section of the song you wanted, but you’ll want to use iTunes to convert the song to MP3 format again from it’s new m4v type.

This works in the newer versions of QuickTime Player, but I’m not sure if the same function exists in older releases.

trim-mp3.jpg

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

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