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

A script to set SSH proxy based on network location Network
The following script will let you use, or not use, an SSH proxy depending on your machine's location. What you need to make it all work:
  • connect.c for proxying (installed in /usr/local/bin or some such; change script as needed).
  • netcat to act as a "null" proxy (available through Fink).
  • The script -- remember to make it executable and store it somewhere on your path.
Here's how things work, in a nutshell. If you have a proxy configured, then the script will find the hostname and port of the proxy for the given protocol (look for the ****Proxy that you want by doing scutil --proxy -- it's a regex, so it must match the case). Then it will find the username and password for that proxy in your keychain and store them in environment variables that connect.c will understand.

If you don't have a proxy configured, the script will see that there's no proxy and just use netcat to simulate connect.c, and you can go about your SSH as normal. To use it, I have this line...
ProxyCommand /Users/me/bin/mac_proxy.sh -P HTTPS -H %h -p %p
...at the top of ~/.ssh/config -- this means that every SSH connection is automatically proxied when my network "Location" is 'Work,' but not when I'm at 'Home.' Assuming you're using SSH key authentication, you should be able to get to the remote machine without ever entering a single password and still be secure; even with an authenticating proxy between you and the remote machine. Hope this helps somebody.

[robg adds: I haven't tested this one.]
  Post a comment  •  Comments (1)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[17,909 views] Email Article To a Friend View Printable Version
Share Parallels' Windows XP connection with OS X Network
My hotel room only has a modem with Windows drivers, so I got it running under Parallels Desktop Windows XP. However, I wanted to check my email with Apple Mail, so I found this solution:
  1. Set Parallels Desktop' Network Options to "Host-only network"
  2. Start Windows and run the XP Network Setup Wizard
  3. Share Your direct Connection
  4. Open OS X's Network System Preferences panel, and refresh your automatic DHCP address from your local built-in Ethernet. If your Ethernet takes a long time to refresh, and ends up with a random adress like 160.145.5.25 or so, check the Windows network again, and enable the Netbios function for DHCP. It should then get an Adress like 192.168.0.2 or 10.0.0.2.
It runs pretty well, too -- congratulations to Parallels for making the Windows drivers work directly ... wow!
  Post a comment  •  Comments (6)  
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[32,535 views] Email Article To a Friend View Printable Version
Fix a Vista to Mac failure to connect problem Network
Basically I was unable to connect from my PC running Vista to Windows sharing on my Mac -- doing the normal ipaddressusername and supplying username and password failed. Vista seemed convinced that I'd entered an invalid username and/or password, regardless of what I tried. After much searching, I found the solution in this thread on vista64.net's forums.

You need to go into the Administrative Tools and enter the Local Security Policy section. In that section, you need to change the LAN Manager Authentication Level to 'Send LM & NTLM responses.' If you need full details on the steps involved, see the above-linked post. This change will reduce the security level of your Vista installation, as it downgrades the authentication required for Samba connections -- making it the same as Windows XP.

When I made the change as described, I was able to connect to my Mac from Vista.

[robg adds: From some reading on another thread on vista64.com, it seems the problem is that Microsoft has disabled LM and NTLM authentication, which is what OS X's version of Samba uses. Microsoft's preferred solution is to upgrade to Samba 3, which supports NTLMv2, as does Vista. If you happen to be running Vista Home Premium, you won't have the Administrative Tools application (advanced home users don't need to administer their machines, I guess?). The thread I linked to contains a Registry Editor alternative for Home Premium users.]
  Post a comment  •  Comments (8)  
  • Currently 2.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[71,744 views] Email Article To a Friend View Printable Version
Automount Windows Samba shares over Novell Network
There are many hints and Forum discussions about automounting Samba shares, but none seemed to work over our Novell network. Just doing Connect to Server or the equivalent "mount volume" are insufficient -- the share must be mounted to a defined mount point. The following AppleScript solved our problems:

tell application "Finder"
  try
    make new folder at alias "Macintosh HD:Volumes:" with properties {name:"share"}
  end try
end tell

do shell script "mount_smbfs -I ip_address -W WORKGROUP -U userid //server_name/share /Volumes/share"

try
  tell application "Finder" to quit
end try

delay 2

tell application "Finder" to activate

Replace Macintosh HD, ip_address, WORKGROUP, server_name, userid, and share with the appropriate values. First, the script tries to create the needed mount points. If the folders exist, the try will silently fail. (OS X will erase these folders if the servers are unmounted, so you need to check each time before mounting.)

Next, the do shell script runs the command-line executable without opening Terminal. When the system prompts for a password, it's a Finder dialog. Clicking "Remember this password in my keychain" before typing in the password (and clicking OK) will bypass the dialog on future logins. Finally, the Finder needs to be restarted before it will recognize the mounted drives. Apparently a slight delay is needed between the quit and restart commands.

If you save the AppleScript as an application (preferably in ~/Library » Scripts), you can add it to your Login Items (found under System Preferences » Account), and the script will run every time the user restarts or logs in.
  Post a comment  •  Comments (2)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[10,328 views] Email Article To a Friend View Printable Version
10.4: Install ProFTPd with MySQL 5.0 back end Network
This tutorial explains how to install and configure ProFTPD on Mac OS X 10.4 with MySQL 5.0 as the back end. I've tested this in a real production environment; it's really cool because your users are authenticated directly on a MySQL table.

[robg adds: Given the length and complexity of the tutorial, I decided not to try to replicate it here. We have, however, run a few other ProFTPd tips.]
  Post a comment  •  Comments (2)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[9,112 views] Email Article To a Friend View Printable Version
Toggle Bluetooth using Quicksilver and AppleScript Network
I was looking for a way to reduce the amount of clutter in my menu bar and decided the Bluetooth icon was a suitable target. I wanted two things:
  1. The current Bluetooth status displayed on my Desktop
  2. An easy way to toggle Bluetooth on and off
An older hint suggested using blueutil for controlling the Bluetooth daemon in OS X. This nifty little program can both show and set the status of the Bluetooth radio receiver. To display the current Bluetooth status on the Desktop, I use GeekTool with the following shell command:
/usr/local/bin/blueutil status | awk '{print "BT: " $2}'
To toggle Bluetooth on and off, and show a Growl notification, I created this AppleScript. This script is then placed in a directory that is scanned by Quicksilver; I used ~/Library/Scripts. It can then be quickly called with a few keystrokes.

[robg adds: This hint doesn't require Quicksilver; you could use another launcher, or even just keep the script in your dock, toolbar, or sidebar.]
  Post a comment  •  Comments (7)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[23,412 views] Email Article To a Friend View Printable Version
10.4: Use a Bluetooth personal area network (PAN) Network
Rumoured for Leopard, Bluetooth PAN is now in 10.4.9. I've just set up my W810i with my PowerBook, and I have a new network port: Ethernet Adaptor (en2), which is configured with a default name of Bluetooth PAN.

Note that it's now easier to connect to the internet via the Bluetooth menu using "Join Network on [your device]".

[robg adds: I can't confirm this one here, but would appreciate any confirmations -- it sounds quite useful for those with capable Bluetooth devices.]
  Post a comment  •  Comments (20)  
  • Currently 1.83 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[75,242 views] Email Article To a Friend View Printable Version
Allow Address Book to connect to LDAP server Network
There are two pitfalls that may prevent Address Book from connecting to Microsot's LDAP (Active Directory) server:
  1. Default port is 3268; not 389
  2. User name must be in caps; for example DOMAINUSERNAME
[robg adds: I don't have access to an LDAP server to test this one with.]
  Post a comment  •  Comments (9)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[24,915 views] Email Article To a Friend View Printable Version
Share a Windows XP machine's internet connection Network
This hint is intended to instruct a user on how to use Windows' Internet Connection Sharing (ICS) to share an Internet connection from a Windows computer (the host) to a Mac computer (the client).

On the client computer (Mac OS X and a wireless NIC):
  1. Click on the AirPort icon at the top right of the screen.
  2. Click Create Network. A dialog called Computer-to-Computer should pop-up.
  3. Set name to ICS. Click OK.
  4. Open System Preferences from the Apple menu.
  5. Click the Network icon.
  6. Select AirPort from the Show Menu dropdown.
  7. Click the TCP/IP tab.
  8. Select Manually from the Configure IPv4 dropdown.
  9. Set IP Address to 192.168.0.2.
  10. Set Subnet Mask to 255.255.255.0.
  11. Set Router to 192.168.0.1.
  12. Set DNS Servers to 192.168.0.1.
  13. Click Apply Now.
You have now completed setting up the client computer. Read on for the host computer instructions.
read more (193 words)   Post a comment  •  Comments (7)  
  • Currently 3.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[51,438 views] Email Article To a Friend View Printable Version
Reduce spinning beach ball delays on network drives Network
Having finally suffered one too many Spinning Beach Balls of Death, I have switched to using SFTP to move, rename and delete files on remote drives.

Rather than mounting the networked drive to the Finder, I simply use SSH and SFTP functionality that is built into OS X (enable in System Preferences' Sharing tab; check Remote Login) along with an FTP client (Interarchy, Panic, CyberDuck) to deal with remote file management.

Obviously, if you need to open the file from the Network Drive then you are stuck using the Finder, but, at least in my case, the vast majority of the time I am just looking to move, rename and delete files across the Network and SFTP does the trick.
  Post a comment  •  Comments (9)  
  • Currently 3.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[16,748 views] Email Article To a Friend View Printable Version