It seems to be a good idea to make NFS mounts soft and interruptible on OS X. If a server disappears, or you disconnect your laptop, your machine is royally screwed if you touch a hard mounted file system. Finder will lock up waiting for a response from the server, and you will lose the ability to launch new programs via Finder, you won't be able to unmount, and you won't be able to reboot (even with /sbin/halt).
So I use the automounter and specify the -i and -s flags to enable interruptible and soft mounts. This solution may not save you from the Finder locking up (you'll have to wait for the soft timeout), but if you have Terminal running, you can terminate stalled programs, such as the Finder.
But I discovered a memory of sorts in the kernel ... mounts once mounted as hard mounts will not demonstrate the behavior of interruptible or soft mounts when remounted. A reboot is required. Umounting and then remounting does not prove sufficient.
Did you know rsync is available under Mac OS X 10.2? Cool, now you can remotely mirror directories rather than using rcp or scp. rsync can be tunneled over ssh, making it as secure as scp. I'll not go into that for this hint; you'll need to get the general idea first.
As a Solaris admin, I have a hardware failover server, and I need to mirror the web_site directory from the primary to secondary server. I use rsync running as a daemon on the "server" to mirror (synchronize) the secondary client. I do this via a cron job at midnight, so I'm never more than 24 hours behind.
One of the first things I tried to do under OS X 10.2 Jaguar was to configure my HP Laserjet 6L, which was connected through an HP JetDirect Print Server. This printer does not support Postscript, and does not appear in the printer list in the Printer Center application. Attempts to print to it failed miserably, resulting in postscript formatting commands appearing on the printer.
Thankfully, Jaguar implements Common UNIX Printing System (CUPS). The solution was readily apparent after reading a few pages of the CUPS system admin guide from the CUPS System Administation Manual on my Mac. The solution was to delete the printer from the Print Center application, and add it from the terminal application. In my case, I typed the following command from the terminal application:
[Shown on two lines; enter on one with a space between the "100" and the "-m".] Not only does the printer now work (no more PostScript garbage), but it shows up in the Print Center as laserjet6L instead of the default _192.168.0.100 name it was assigned when I tried to add it from the GUI.
[Editor's note: Regarding CUPS printing hints, my general approach is to publish as many hints on the subject as possible, given the wide range of printers and connection options available. So apologies if this one is a dup that slipped through my searching. I also haven't tested it as I don't have a non-PostScript printer to test with.]
If you're a UNIX user before Mac, then you'll probly know this hint and say this lame, and if you're a Mac Only user you'll (hopefully) say "Wow, that's cool!"
OK picture this. I've been working all night long on a PowerPoint Presentation on my desktop at home. In the morning, I pick up my trusty iBook and go to the office ready for my presentation, but I find that I forgot to copy the file to the laptop!
I don't shutdown my desktop at home, and my internet connection is always on. I also allow SSH (secure shell) connections through my firewall, and my Mac has the "Remote Login" option ticked in the sharing prefs (which enables SSH). So I open up my laptop at work, connect to the office network, then open up Terminal and type:
Note that the above is all one line, and don't forget the fullstop on the end.
Basically, this command (scp = secure copy; type 'man scp' for more information) uses the SSH tunnel (encrypted) to make a connection to my system at home (22.214.171.124) and login as zed. It asks for my password and then downloads that file I specify. I have to know the path but I could ssh in first to check that out. The fullstop at the end says "save the file here," so that's where ever you are in the directory when you issue the command.
You can also run the command the other way around to copy a file from your local system to the remote:
It's also worth noting that if your user names are the same on the remote system and the local system, then you do not need to type email@example.com but rather you can just type 126.96.36.199. Replace these numbers with your home machine's IP address, of course.
All the data transfered this way is encrypted and means that you do not have to run web servers or FTP servers which are not secure!
I'm working on a Mac OS X port of SystemImager, an automated software installation and distribution tool.
The first thing I needed was a configurable DHCP server that supports NetBooting.
I suspect bootp (aka DHCP) on Mac OS X Server does this, but I've never been able to figure out how to create statically assigned IP addresses assigned by MAC address. Gave up and replaced the built in bootp with the standards-based dhcpd from ISC, modified to support NetBoot, configured to sit cozy on Mac OS X.
Below are the directions, for anyone that might find it useful.
[Editor's note: I have not tested this hint myself, as it's well beyond my skill set! However, I don't see anything malicious in the script, and it might prove useful to some of you, so here it is...]
I was continually frustrated with SMB in OS X 10.2. It is extremely unreliable, crashes the Finder, and times out for large files. So, I found the simple solution, both of which I think also work in 10.1: use FTP Access or Personal Web Sharing (Apache). In the Sharing system prefs pane, check one of them.
If you use Personal Web Sharing, put the files you want to transfer in ~/Sites, then on the Windows machine, go to http://ip/~shortusername/ to access your files. If you want to do bidirectional transfers (i.e., from Windows to Mac and vice versa), use FTP Access. On the Windows machine, connect to the Mac using your short username and password.
Using either method, you can only browse your home directory, but that's where you should be storing documents and such anyway. If you're concerned about security, use something like Norton Personal Firewall (I use it on my iBook because I use multiple wireless networks).
I'm now happily transferring files at 600 KB/sec over Airport to Windows after struggling for weeks with Samba!
After lots of trial and error I've managed to have osx actually BE a network server that starts automagically. Indeed, as many of us have discovered, in order to share one's internet connexion with a LAN, one has to click the "start" internet sharing after each restart. Bummer... but no longer !
This tip may be a bit complicated, and it requires a couple of scripts, but I believe that it's still quite straightforward. Be prepared to part from the InternetSharing prefs pane, though (RIP).
In the following instructions, I'm assuming that you have a dynamic connection to your ISP (ie through DHCP) that uses an Ethernet modem. I believe this hint should work as well with a static IP, but I haven't tested it this way.
[Editor's note: This is a long and fairly complex hint, and I have not tested it myself. Please make sure you have good backups prior to doing anything such as the following on your machine ... it's just common sense!]
When configuring OS X to print to a network printer (i.e. to a printer that is connected to a linux machine), you'll need to create a file /etc/hosts.lpd on the linux machine and add the hostname of your Mac in that file.
The hostname is the name you gave your computer in the Computer Name field on the Sharing tab of the Internet & Network system preferences.
[Editor's note: No linux box to test with here, so I can't vouch for this one...]
I wanted to mount two AFP volumes that I have shared from my Redhat box to my home directory. There is a utility called Sharepoints Autmount, but it lacks a way to pass passwords during the mounting process. then I thought about exporting the volumes as NFS shares.
On the Linux side it was very simple, I used the Webmin Server configurator that comes with Redhat. I simply exported the volumes to my IP address and added myself as a read/write user. I tested it with this command:
% sudo mount server:/path/to/export /home/username/server/
This worked fine, but was only temporary. It needed to be performed at every boot.
[Editor's note: The following information deals with modifying the NetInfo database. Proceed at your own risk, and make sure you know what you're doing -- I have not tested this hint myself!]