Updating /etc/hosts on OS X

Updating /etc/hosts on OS X

Sometimes you need to have a static IP address configured to a specific domain name on OS X. For instance, locally testing a web server is a great reason to do this. Doing so is fairly easy to setup, but does take a bit of command line work.

First, edit /etc/hosts with your favorite text editor.

the default looks something like this:

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
## localhost broadcasthost
::1 localhost

Edit the file, add in the IP address under the address, then put in the hostname with spaces over under “localhost.”

Then you have to reload the hosts file.

OS X 10.4 type:

sudo niload -v -m hosts . < /etc/hosts

on OS X 10.5 and 10.6
lookupd -flushcache
dscacheutil -flushcache

Then simply ping the new domain name and check that is resolves to the correct IP address. (assuming the other computer is setup to respond correctly)

Linux: Printer Commands

Linux: Printer Commands

Using the Printconf command (Printer Configuration)

Install printer: printconf

To see printers: lpstat -p

After configuring printers, export printer settings to another machine:
printconf-tui –Xexport > printers.ppd

Copy file to new computer then import:
printconf-tui –Ximport < printers.pdd

After setting up printers restart cups.
service cups restart