I've got my mini hooked up in one room to a TV. It doesn't really have easy access to a keyboard and mouse, but it is connected to a huge external hard drive that I store all sorts of files on. So sometimes, when the mini is asleep I need at the files. Searching on Google for "wake mac on lan" took me to this older hint, which hasn't had much action lately.
After trying the hints on that page, the problem was that after waking the mini, I would still have a terminal window open. Now there may be away around that, but I couldn't find one. So I took the information I learned there and plugged it into an Automator workflow, using the Automator: Run Shell Script action. The Shell should be /usr/bin/python, the Pass input should be to stdin, and the body of the script should be:
You will have to replace the 00, 11, 22, 33, 44, 5a with your own mac address, of course -- you can find this in the Network System Preferences panel.
Then save the Automator action as an application or a Finder plug-in. When it is run, there is no Terminal window. (I saved mine as an application, changed the icon to a picture of a mini, and now I have an icon in my dock that, when clicked, wakes my mini in the other room).
I was playing around with making SSH access to a remote machine as easy as possible for my other half. Initially, I generated a key pair using ssh-keygen and installed the public key on the server as usual, put the private key in a folder with a .command (double-clickable shell script for Finder) script like the following:
# chimpy.command - Logs user bob into chimpy using private
# key bob.dsa
ssh -i ./bob.dsa email@example.com
Alas, that did not work as the .command file sets the current working directory to the user's home directory, not the directory it was executed from. Annoying. But then I realized that as the key is actually a text file, so why not make the key itself an executable script?
Disclaimer: The following is a highly technical hint.
Summary: This hint is for Network Engineers who want their firewalls to accept VPN connections from standard OS X L2TP / IPSec clients (should also work for Windows and Linux clients). If you are not a network engineer, but are having trouble connecting to one of these devices, you can also forward this tip to your company's "firewall person," so that they can fix it.
Problem: A Cisco ASA or PIX firewall can be a VPN server, but a basic VPN configuration will not allow the default OS X L2TP/IPSec client to connect, even though the Cisco client will. It may not be convenient to distribute the Cisco VPN clients, or your users may not wish to use them.
Recently, my company implemented a new Exchange 2007 server for our email. No special changes or accommodations were made to support OS X. After a bit of searching and trial and error, I figured out the settings for Entourage to work when connected to the corporate network: email, contacts, and calendar all work.
I started with version 11.3.6 (070618) of Entourage, and added a new Exchange email account. I then tried the automatic setup, but it failed so I went into manual mode. During the setup, i found two fields that require surprising entries:
Under the Account Settings tab, the Exchange Server field. Here is what works for me:
Many users have problems mounting shares from Windows 2003 Servers from OS X Tiger (10.4 - 10.4.10) clients. The following solution has been tested in our enterprise where we have W2K3 servers, physical as well as virtual, and some within a SAN.
Problem: From the network view in OS X, we could browse to the servers, but when we tried to connect, we would get the Delete/Fix Alias error. When connecting from the Finder with Command-K (either with smb://servername, smb://ip.address, smb://servername.fqdn, cifs://servername, etc.), we would get the dreaded Error -36 and the Console would show:
mount_smbfs: session setup failed (extended security lookup2): syserr = Socket is not connected
mount_smbfs: could not login to server SERVERNAME: syserr = Socket is not connected
Using smbclient from the terminal would work fine.
Solution: After making sure that there are no Local or Domain policies interfering (NETBIOS, WINS, Kerberos, Firewalls, IRPStackSize problems, etc.), try the following.
On the server in question, in Control Panel » Network Connections, select the NIC, click on Properties, then on "File and Printer Sharing for Microsoft Networks," click on Properties and check the option for either Maximize Throughput for File Sharing or Maximize Throughput for Network Applications (depending on the use of the server). This changes the value of the REG-DWORD "Size" at HKEY_LOCAL_MACHINESYSTEM » CurrentControlSetServices » lanmanserverparameters from 1 or 2 to 3. From the command line or Services.msc, restart the "Server" service or reboot the machine. Thanks to Joel Ayala for the expert Windows perspective.
The following is not mine, but I ran across it and it looks awesome. If you like the services .Mac provides, but would rather provide them yourself and you have a spare machine lying around, this how-to explains the steps required to do just that. I'm going to try it later tonight on an ubuntu server at home, and will post my findings in the comments.
[robg adds: Typically I would contact the author and request permission to repost their solution here, so we have it in the system. However, this particular how-to is quite long, very detailed, and contains lots of screenshots. It's also not for the faint of heart, as you'll have to do a fair bit of digging to find info, and then some configuration work. You're not just setting up a server that provides .Mac-like services, but you're setting it up such that the functions on your machine that use .Mac actually work with your internal server.]
At my work, we have a large number of SMB shares, and for some reason they stop showing up on desktops sometimes. If you look for them in Terminal, they are mounted, but they are not in the Finder anywhere. If this happens, here's one way to get them back.
Launch Terminal and type cd /Volumes
Type ls to list the directory's contents, and find the volume name in the list.
Type open volumename, where volumename is the name as shown in the prior output.
A new Finder window will open with the root contents of the volume you chose, and the icon will then appear in the Finder window and on the desktop (if you have network volumes showing on your desktop).
If your laptop is running unplugged and you need to conserve battery life, one way of saving power is to turn off AirPort. (You may also run into situations where you'd want to turn AirPort on or off as part of a longer script, such as to keep it from dying completely when putting a MacBook to sleep while Internet Sharing is enabled.) Although there seems to be no reliable way of turning AirPort on or off directly via the shell, it is possible to get around that by manipulating OS X's Locations with the scselect command.
First, create a new location called AirPort-Off in the Network preferences pane. With this new location selected, select Network Port Configurations under the Show pop-up menu, and deselect AirPort. Then select your previous location, which for most people would probably be Automatic.
Now, you can turn AirPort off by running scselect AirPort-Off and back on by running the last command, replacing AirPort-Off with the name of your normal location name. To assign a hot key to the command using a utility like Butler, create a simple AppleScript containing this one line:
do shell script "/usr/sbin/scselect AirPort-Off"
Then have Butler (or your app of choice) run that APpleScript. (With Butler, running a shell script containing only the bare command doesn't seem to work.)
A few days ago, a friend came by with his AirPort Extreme base station (AEBS) and his external USB hard disk. He was having problems getting the hard disk recognized and shared through the AEBS in a seemingly random way. The AEBS would correctly share the disk, until you would directly connect it to a Windows PC to transfer files. After that, reconnecting it to the AEBS's USB port would lead to an unmountable network share on the Mac, and an empty share on the PC (Windows XP SP2).
We thought of a formatting problem, so we first reformatted the 500GB disk as an HFS+ volume, and tried again connecting it to the AEBS. Transfers would work both ways from the PC and the Mac through the AEBS. But after connecting the disk directly to the PC and transfering files with TransMac, then plugging the disk back on the AEBS, we would get the same problem with an unmountable share (the problem wouldn't appear after connecting the disk directly to the Mac).
We restarted the base station several times using the AirPort Utility without success. Until, on a hunch, I decided to try unplugging the power plug from the AEBS, and then plugging it back in. After trying the same procedure several times, this appeared to reliably lead to the recognition and mounting of the shared hard disk.
Unfortunately, we didn't have time to test more scenarios (like reformatting the disk as FAT32), but the bottom line is: restarting the AEBS from the AirPort utility doesn't seem enough, so unplugging the power and plugging it back may be more helpful.
While looking for a way to disable Apple Remote Desktop and other services from the command line, I happened to be in /System » Library » LaunchDaemons. In my boredom, I opened ssh.plist in that directory, and find that Bonjour is a key. Anyway, skipping a long explanation and some inevitable tinkering, I figured out how to stop Bonjour from pointing out to the world (or at least my local network) that I have ssh enabled.
Be warned that while I have had no problems, I can not insure that you will not. This hint edits a system file, and messes with Bonjour, so think before you act. It also may take a system restart, in addition to undoing this hint, to re-enable Bonjour broadcasting of ssh and sftp. I would make a backup of /System » Library » LaunchDaemons » ssh.plist first, as we will be be deleting two strings from that file. (When I tried commenting them out, they disappeared after I stopped and restarted ssh.)
After you've made your backup, here's one way to edit the file:
sudo vi /System/Library/LaunchDaemons/ssh.plist
In the editor, delete these two lines:
They should be found around lines 22 and 23. Save the file and quit the editor. Then go to System Preferences » Sharing » Services, unlock it, disable Remote Login, and final re-enable Remote Login. You can check if things worked by using Bonjour Browser or some such similar app to be sure ssh/sftp no longer show up.
Lastly, to explain the plus in the hint title: A simple grep -ir bonjour . showed that eppc.plist, ftp.plist, and telnet.plist also had the Bonjour key. I don't use them myself, so this same trick may or may not work for those services, too.