Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A script to automtically enable and disable the firewall Network
This hints allows your firewall to automatically turn on or off based upon which network you are on. A LaunchAgent watches resolv.conf in order to detect when there are changes in the network. Save the following in /Library/LaunchAgents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>KeepAlive</key>
  <false/>
  <key>Label</key>
  <string>com.yourcompany.autofirewall</string>
  <key>ProgramArguments</key>
  <array>
    <string>/Library/Scripts/yourcompany/autofirewall.sh</string>
  </array>
  <key>RunAtLoad</key>
  <false/>
  <key>WatchPaths</key>
  <array>
    <string>/var/run/resolv.conf</string>
  </array>
</dict>
</plist>
Create and save the following shell script as autofirewall.sh, in the location specified in the LaunchAgent (/Library/Scripts/yourcompany in this example):
#!/bin/bash

#Written by Nate Walck and Clint Armstrong
#Liberty University 2009

#This Script will automatically enable or disable the firewall depending upon which network it is on.

#This function turns the firewall on or off, depending upon which state is desired.
#If the firwall is already in the state desired, the script will leave it in that state.

function firewall {
  #Reads the current state of the firewall and stores it in variable fw
  fw=$(defaults read /Library/Preferences/com.apple.alf globalstate)
  
  #This compares the option passed to function firewall to its current state.
  if [ "$1" != "$fw" ]
    then
      #If the option pased is different from current state, it changes it to the passed value.
      defaults write /Library/Preferences/com.apple.alf globalstate -int $1
      #For troubleshooting purposes, you can put in 'say $1' to see which state is being set.
  fi
}

#Determines if resolv.conf exists.  
if test -e /var/run/resolv.conf
  then  
    #This stores the domain line of resolv.conf into variable NETWORK.
    NETWORK=$(cat /var/run/resolv.conf | grep domain | awk '{print $2}')
    
    #This case looks at $NETWORK for specific domains and runs commands accordingly
    case "$NETWORK" in
    
    #If on VPN, function firewall turns the firewall on.
    vpn.yourcompany.com
    firewall 1
    ;;
    
    #On any other company domain, function firewall turns firewall off.
    *.yourcompany.com)
    firewall 0
    ;;
    
    #On any other domain, function firewall turns firewall on.
    *)
    firewall 1
    ;;

    esac
    
  else
    #If no network connection exists, function firewall turns the firewall on.
    firewall 1    

fi
[robg adds: I haven't tested this one. You'll have to customize both scripts with your company's own information, replacing references to yourcompany.com.]
  Post a comment  •  Comments (6)  
  • Currently 1.91 / 5
  You rated: 2 / 5 (11 votes cast)
 
[8,834 views]  View Printable Version
How to help AirPort recall passwords Network
The following situation describes a common problem people seem to be having with AirPort reconnections. While most people do not seem to have these symptoms, many, including me, have experienced the following problem with AirPort:

You connect to a password-protected wireless network. In the process, you check the box requesting that AirPort remember the network and password. When you start up your computer, or when you restart your AirPort card, AirPort connects to your preferred network with no difficulty. Hooray, AirPort remembers the password!

However, if you get disconnected and try to reconnect without restarting AirPort or rebooting, AirPort prompts you for a password. For some reason, AirPort forgets that it already has the password. If you try to switch networks on-the-fly, the same thing happens -- AirPort seems to forget that it already has the password.

What's really going on here is that on-the-fly network switches utilize password and permission information from the user's keychain, and the keychain does not have the correct information. This is somewhat more likely to be a problem on systems with more than one user account.
read more (424 words)   Post a comment  •  Comments (6)  
  • Currently 2.58 / 5
  You rated: 4 / 5 (12 votes cast)
 
[20,812 views]  View Printable Version
Make SMB shares appear in Devices section of Finder sidebar Network
It was driving me nuts that SMB shares from my Windows server would not reappear under DEVICES in the sidebar. However, I then figured out that I can do this:
  1. Open System Preferences » Network
  2. Click the network interface you use for the shares
  3. Click on the Advanced button at lower right
  4. Click on WINS tab, and manually enter the workgroup name of the server
  5. Click the '+' under the WINS Servers list
  6. Enter the IP of the server (you are using static IP on your server, right?)
  7. Click OK, Apply, etc. until you're done
The next time I dragged a mounted share to Devices, it then showed up there automatically after the next unmount/mount. My shares seem to mount much faster now, as well. Now if only I could find a way to increase the transfer speed...sigh.
  Post a comment  •  Comments (6)  
  • Currently 1.80 / 5
  You rated: 5 / 5 (10 votes cast)
 
[28,958 views]  View Printable Version
One way to quickly connect to a Cisco VPN Network
In February, this hint explainted how to install vpnc as a replacement for the Cisco VPN client. I finally got it working with a little tweaking and divergence from the original instructions, based in part on follow-up comments.

But what I really wanted was to have my VPN as easy (or easier) to activate than using the (otherwise awful) Cisco application: largely because I use my company's VPN in conjunction with 3G mobile broadband, which has a habit of dropping connection when my commuter train goes through a tunnel, requiring regular reconnection!

I tried using Shimo and vpntool with no success, and finally got it working using the following solution...
read more (239 words)   Post a comment  •  Comments (11)  
  • Currently 1.30 / 5
  You rated: 1 / 5 (10 votes cast)
 
[20,832 views]  View Printable Version
Mutihoming with one Ethernet interface Network
Like many small businesses we have taken advantage of the 'free' DSL services offered as part of an existing mobile phone contract. In this case we use Orange for mobile service (we're based in the UK) and they offer 2 Mbit internet with a wireless router for no extra if you have at least one pay monthly account. I thought that it would be a useful addition to our network for testing and backup, especially as it is from a different ISP and delivered over a physically separate landline from our business internet.

The wireless router arrived yesterday and the DSL activation happened on time so that the line came up first time when I plugged the line into the router. I'd heard a few horror stories about Orange's support for Macs so I was pleasantly surprised when I popped the install CD into my MacBook and it came with full OSX installation instructions. 5 minutes later I was surfing on the internet via my shiny new Orange broadband.

Now that we had two internet accesses functioning, how to use them both?
read more (325 words)   Post a comment  •  Comments (7)  
  • Currently 2.00 / 5
  You rated: 4 / 5 (9 votes cast)
 
[7,687 views]  View Printable Version
Easily stream audio and video between two Macs Network
Problem: I wanted to watch Live TV from a Mac upstairs in a room downstairs with another Mac. Hardware: Elgato EyeTV EZ, AirPort, and two Macs. There are some streaming solutions out there (VLC, CyTV, EyeTV, etc.), but they either do not support my hardware, or seem complicated, or stream re-encoded video only (no live TV, of course).

But there's a really simple solution: OS X 10.5's Screen Sharing, which works flawlessly and 'streams' all of my Mac's contents. The only pity is that it doesn't send the audio as well. Enter Soundfly -- it streams audio in good quality (various settings available). Now with Screen Sharing and Soundfly running, I can watch live TV and movies downstairs. Because I also can remotely control the Mac upstairs, it's also possible to start and stop recordings, and more. This works quite well.

Note: As far as I can tell, Soundfly simply redirects the audio from one Mac to the other -- the sending Mac is then mute. If you want audio on both Macs, install Soundflower, which gives you the ability to hear the audio on both Macs.

[robg adds: I haven't marked this one 10.5 only, even though Screen Sharing is a 10.5-only feature. Pre-10.5 users should be able to do the same with the various VNC server/client solutions out there (i.e. Vine Server, Chicken of the VNC, Jolly's Fast VNC, etc. I haven't, however, tested any of those solutions.]
  Post a comment  •  Comments (8)  
  • Currently 1.78 / 5
  You rated: 5 / 5 (9 votes cast)
 
[27,722 views]  View Printable Version
A fix for failed Airport Extreme-N access control list updates Network
I have confirmed this bug at two sites using seven different AirPort Base Stations. I thought I had updated the Access Control List (ACL) on multiple Base Stations to allow several new computers and devices on the networks. Afterwards, however, users claimed trouble accessing in some locations -- that turned out to be true anywhere there was an AirPort Extreme-N Base Station; the older AirPort-Gs worked fine. Here's the mix of gear I was using to confirm this issue:
  • Airport Utility v5.4.1
  • Airport Extreme-N Firmware v7.4.1
  • Airport Extreme-N Base Station (both 10/100 and 10/100/1000 versions) with an existing ACL
  • PowerMac G5 - Mac OS 10.5.6 Server
  • PowerMac G4 - Mac OS 10.4.11
The Problem: Using Airport Utility v5.4.1, importing an Access Control List (File » (Option key) Import Access Controls) shows the updated ACL in the Access tab list. When the Base Station is updated and the configuration redisplayed, none of the new ACL entries appear on the list -- so none of the new devices have access to the base station. The ACL was not updated or overwritten. I was expecting it to be completely overwritten by the imported data, as happened before the most recent software and firmware updates.

Here's the workaround: Manually delete (by selecting one and clicking the minus sign below the list) all of the existing ACL entries before importing the list. The import/overwrite used to work prior to the AirPort Utility 5.4.1 and v7.4.1 firmware updates -- now it's broken. The need to manually delete dozens of entries on multiple Base Stations is very, very time consuming.]
  Post a comment  •  Comments (3)  
  • Currently 1.80 / 5
  You rated: 1 / 5 (10 votes cast)
 
[9,533 views]  View Printable Version
10.5: Back to My Mac fails to start due to incorrect time Network
For some time now, Back to My Mac (BTMM) has failed to start on my Mac Mini at home, although it worked fine on my MacBook Pro from the same network. After trying many many different things and following a number of hints, I remembered reading that BTMM uses IPsec. IPsec tunnels require endpoints to have their clocks synced, or at least to be set to times that are relatively close to one another.

I noticed the time on my Mac Mini differed from that of my MacBook Pro by about 10 minutes, and was failing to update its local time via time.apple.com (on the Date & Time tab of the Date & Time System Preferences panel). I switched it to time.asia.apple.com, the clock updated, and BTMM connected immediately after I clicked Start in the Mobile Me System Preferences panel.

See the comments for some recommendations on which time servers to use...
  Post a comment  •  Comments (12)  
  • Currently 1.22 / 5
  You rated: 1 / 5 (9 votes cast)
 
[9,102 views]  View Printable Version
Log in to a single SMB share with multiple user names Network
I was having trouble connecting to multiple directories on a single SMB share in Leopard, where the directories had different logins. If I was logged into one directory as one user, then the "Connect to Server..." option in the Finder would default to that user for all directories on the same share and error out. I found a workaround for this.

With one directory already mounted under the first user login, select Go » Connect to Server. Type in your share name with the user before the drive name:
smb://2ndusername@drivename/2ndDirectory
Finder will then prompt you for a password, and mount the directory as a separate network drive. This should also work for AFP shares, though I haven't tried it.
  Post a comment  •  Comments (5)  
  • Currently 1.80 / 5
  You rated: 3 / 5 (10 votes cast)
 
[17,790 views]  View Printable Version
Wirelessly connect Nintendo systems to Time Capsule Network
For some reason, the Nintendo DSi cannot currently connect to a WEP-protected network on the Time Capsule. However, when you remove the WEP key, the Wii will no longer be able to connect as-is. Here is the only way I've found so far to get all three current Nintendo systems to connect to the Time Capsule's network:
  • Remove any security settings (you can still use MAC address filtering and have a closed network, however).
  • Manually set up the connection on the DS/DS lite/DSi by just entering the network's name
  • Manually set up the connection on the Wii by entering the network's name and DNS servers
You should now have all three systems connected to your network, and be able to use all the online features. If anyone finds a better solution, please post it in the comments.
  Post a comment  •  Comments (6)  
  • Currently 1.89 / 5
  You rated: 5 / 5 (9 votes cast)
 
[11,429 views]  View Printable Version