Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Simple Text To Speech in Mac OSX

Answer:

It is easy to invoke the internal Mac OSX Text To Speech engine using command in Terminal.

# say "Hello World"

It is all you need.

Restart Apache web server in Mac OSX

Answer:

Open the terminal, and type

sudo apachectl -k restart

To stop it, type

sudo apachectl -k stop

To start it, type

sudo apachectl -k start

How to flush DNS cache in Mac OSX

Answer:

On or before Mac OSX versions 10.5.1, use

lookupd -flushcache

After Leopard, use

dscacheutil -flushcache

Mac OS X: How to Add Hosts to Local Hosts File

Mac OS X 10.0 through 10.1.5

  1. Open /Applications/Utilities/NetInfo Manager.
  2. To allow editing the NetInfo database, click the padlock in the lower left corner of the window.
  3. Enter your Admin password and click OK.
  4. In the second column of the browser view, select the node named "machines." You will see entries for -DHCP-, broadcasthost, and localhost in the third column.
  5. The quickest way to create a new entry is to duplicate an existing one. So select the "localhost" item in the third column.
  6. Choose Duplicate from the Edit menu. A confirmation alert appears.
  7. Click Duplicate. A new entry called "localhost copy" appears, and its properties are shown below the browser view.
  8. Double-click the value of the ip_address property and enter the IP address of the other computer.
  9. Double-click the value of the name property and enter the hostname you want for the other computer.
  10. Click the serves property and choose Delete from the Edit menu.
  11. Choose Save from the File menu. A confirmation alert appears.
  12. Click Update this copy.
  13. Repeat steps 6 through 12 for each additional host entry you wish to add.
  14. Choose Quit from the NetInfo Manager menu. You do not need to restart the computer.

Source: http://support.apple.com/kb/TA27291

Opens the current folder in Finder in Mac OSX Terminal

Answer:

Assume you are currently in folder /tmp/ in Terminal, and you want open this folder in Finder, you can type the following command:

# cd /tmp/
# open .