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

An AppleScript to look up NetBIOS names Network
When pointing the Finder or Print Center at an SMB (Windows) file share or printer (see this hint), NetBIOS names don't seem to do the trick. Mac OS X wants DNS names or IP addresses. So, a share that you "map" on MS Windows clients as MYSERVERMYSHARE has to get translated to something like smb://myserver.company.com/myshare in order for the Finder to understand it in the Connect to Server box. The problem I've found is that these mappings aren't always obvious.

Fortunately, Jaguar comes with some Samba UNIX tools that can help out with this problem, but they're kind of obscure. After much headache and stumbling through web tutorials, I wrote the following AppleScript to make them easy to use for name/address translation.

Read the rest of the hint for the script...
read more (429 words)   Post a comment  •  Comments (15)  
  • Currently 2.40 / 5
  You rated: 1 / 5 (5 votes cast)
 
[32,643 views] Email Article To a Friend View Printable Version
Force Ethernet duplex settings on Startup Network
After much taking, I'm happy to be able to give something to the community! This relates to a previous hint, where some Macintoshes do not auto-negotiate properly with the networking hardware. The current solution is to run a terminal command, sudo ifconfig en0 media 100basetX mediaopt full-duplex, which then correctly sets the media type and speed (in my case, 100basetX and full-duplex). Unfortunately for some of us, these settings don't 'stick' after a restart (the adapter goes back to autoselect), and must be re-set manually each time.

What is needed here is a process that does this type of thing for us on startup, even before reaching the login screen. This is accomplished by creating a StartupItem, and putting it in /Library -> StartupItems. StartupItem is really a folder containing two parts: A shell script of the same name as the folder, and an XML file called StartupParameters.plist.

Create a folder called setDuplex in /Library -> StartupItems, and create a file inside with the same name. The file should contain the following text:
#!/bin/sh
# forces 100baseTX and full-duplex
. /etc/rc.common
ifconfig en0 media 100basetX mediaopt full-duplex
Make it executable by typing chmod a+x setDuplex. Note that you do not need a sudo command in the script, because it is already being run as root.

Next, create another file called StartupParameters.plist, containing the following text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
  <dict>
    <key>Description</key>
    <string>My Force-Duplex</string>
    <key>Messages</key>
    <dict>
      <key>start</key>
      <string>Forcing Full-Duplex</string>
    </dict>
    <key>OrderPreference</key>
    <string>Early</string>
    <key>Provides</key>
    <array>
      <string>Proper Duplexing</string>
    </array>
  </dict>
</plist>
Restart, then type ifconfig -a in the Terminal, and your en0 interface should no longer say autoselect, and should have the correct settings.

Forgive me if there are any errors, etc - this is my first shell script, and first XML file! I believe everything should be ok, though! It works well on my server.
  Post a comment  •  Comments (10)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[16,096 views] Email Article To a Friend View Printable Version
SCSI drive format seems to affect sharing under OS X Network
It appears that SCSI disks initialized with HFS or HFS Extended mount fine on a local machine with a SCSI card installed. However, HFS disks cannot be mounted across a local network ... but HFS Extended disks are seen and mounted by OSX and OS9. Hmmmmm.

[robg adds: If anyone can confirm this, I'd appreciate it. I don't have a SCSI drive...]
  Post a comment  •  Comments (2)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[4,603 views] Email Article To a Friend View Printable Version
Register a MP3 streaming server with JRendezvous Network
I had an old stereo receiver that I wanted to hook up in my basement, but I didn't want to pony up the cash for a new CD player so I improvised. I mounted two shelves on the wall; the top shelf holds my receiver, the second shelf has room for my PowerBook. I bought a "mini jack to RCA" adapter to hook up my PowerBook from the headphone jack to the receiver and play MP3s with iTunes. Easy enough. However, I didn't want to use all my drive space on my Powerbook for MP3s, so I installed an MP3 server, gnumpd, on my Linux Box located on the second floor and access it over my Airport network.

Gnump3d has a nice web interface to select playlists, songs, etc. To make things super easy to find the web server, I created a shell script on my Linux box to register the server with Rendezvous. I used JRendezvous and had the following lines in the shell script:

  java -jar jrendezvous.jar -rs MyTunes _http._tcp local. 8887 index.html
Now all I have to do is launch Safari, open the Rendezvous Tab, and my MP3 server shows up there as MyTunes, ready to go. Hope the rumors of the next iTunes having Rendezvous support are true so I can eliminate the browser all together.
  Post a comment  •  Comments (8)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[6,811 views] Email Article To a Friend View Printable Version
Hiding information from nmap Network
Following a story on slashdot led to this article about hiding your system fingerprint from nmap. Now as far as I know (from nmap scanning on my local network), my machine has never been tagged (identified), but the suggestion about dropping packets to closed ports seemed like a "Good Idea." The instructions, in the BSD section were:
sysctl -w net.inet.tcp.blackhole=[0 | 1 | 2]
sysctl -w net.inet.udp.blackhole=[0 | 1]
I used the values (2,1), and nmap was then unable to even propose a set of values (it failed on tests 2,5,6,7 and U). Note sure of the real value but for the paranoid out there, why not give yourself a little extra edge.

[robg adds: I have not tested this one...]
  Post a comment  •  Comments (9)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,490 views] Email Article To a Friend View Printable Version
Another USB to network printer conversion Network

This is a follow-on to a previous hint. Hawking Technologies now sells a "single USB" version of the print server (Model H-PS1U) mentioned in that hint. Adding it to my network was relatively simple.

My network is cable moden connected to an Snow Airport basestation (acting as a DHCP server). The basestation is hardwired to a five-port hub. A Cube is also hooked to the hub. My wife and I each have an iBook with an Airport card. All computers are running Jaguar 10.2.4. An Epson 777 was connected to the Cube via USB. Of course, the Cube and printer are in the basement, so if we wanted to print from an iBook we had to go downstairs and plug the 777 into the iBook.

I was psyched when the PS1U came out. To add it to the network I had to:

  1. Plug the 777 into the PS1U. Plug the PS1U into the ethernet hub. Plug in the power for to the PS1U.
  2. To assign an IP address to the PS1U start Terminal.
  3. Enter sudo arp -s 10.0.1.222 aa:bb:cc:dd:ee:ff (see man arp). NOTE - A static IP number on an AirPort network should be anything between 10.0.1.201 and 10.0.1.254 (see Airport documentation). I picked 222 because it's easy to remember. Replace 'aa:bb:cc:dd:ee:ff' with the 12 digit MAC number on the white sticker of the PS1U.
  4. Fire up a browser and go to http://10.0.1.222:631.
  5. Click on "Setup" in the lefthand column.
  6. Click on "TCP/IP" under Setup.
  7. In the TCP/IP section, enter 255.255.255.0 for the Mask. Enter 10.0.1.1 for the Gateway. Click on "Submit" at the bottom of the page.
The above only has to be done once. For each computer on the network that has to print to the newly networked printer:
  1. Download Ghostscript and Gimp-Print from the gimp-print website.
  2. Install Ghostscript.
  3. Install Gimp-Print.
  4. Follow the Gimp-Print documentation to add the printer to Print Center.
  5. Print.
  6. Send a kid downstairs to pick up the printout.

Life is sweet.

  Post a comment  •  Comments (6)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[11,747 views] Email Article To a Friend View Printable Version
A script to provide VPN split routing via PPPTP Network
Apple's PPTP Internet Connection app doesn't provide split routing. To avoid that all your traffic going through the VPN tunnel, you could start (as root using sudo), when the VPN connection is already established, the following script.

#! /bin/sh
dr=`netstat -nr | grep ' UHLW ' | awk '{print $1}'`
route delete default AAA.BBB.CCC.DDD
route add    default $dr
route add    AAA.BBB.0.0 AAA.BBB.CCC.DDD
Where AAA.BBB.CCC.DDD is provided by the logfile of the PPTP connection application: "remote IP address AAA.BBB.CCC.DDD" . Then only connections to the AAA.BBB.x.y range of addresses will use the VPN.

[robg adds: I haven't tested this one.]
  Post a comment  •  Comments (16)  
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[31,054 views] Email Article To a Friend View Printable Version
Avoid Finder problems with mount points Network

I have shares on two Samba servers with the same name - server1/home and server2/home. In trying to get OS X to work with them simultaneously,I have discovered three Finder bugs and a workaround for them.

Firstly, the bugs:

  1. Using the GUI to mount one share and then the other (using Connect to Server...), OS X gets confused and simply replaces the first share with the second. I can't access both shares at once!
  2. Switching to the terminal and using mount_smbfs to attach the shares to mount points (see other mount point hints on how to do this), the Finder gives an alias error on the second mount point folder if I have opened the first share before mounting the second. Note that this is purely a Finder problem, and the open/save dialog is happy to use both shares simultaneously.
  3. Writing a shell script to make sure that both shares are always mounted together, the Finder refuses to work with the mount point folders if the containing folder is open when the script is run - it can't seem to cope with the change in state from folder to mount point. This is probably a general mounting bug and not specifically related to my two shares having the same name.

Now the solution, if it's not clear already ... write a shell script to mount all the shares together, and make sure the folder containing the mount points is not open in the Finder when it runs:

#!/bin/bash
mount_smbfs //username:password@server1/home ./s1home
mount_smbfs //username:password@server2/home ./s2home

I know this script could be more secure etc. but it illustrates the point!

  Post a comment  •  Comments (16)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[17,457 views] Email Article To a Friend View Printable Version
Use Bluetooth to share files with Macs and Win PCs Network
The Bluetooth File Exchange v1.1 that comes with OS X 10.2.4 allows ftp browsing of the Mac by another Mac or even by a Windows computer. First, in System Preferences->Sharing, click the box to turn on Personal File Sharing. Then pair the computers using the Bluetooth File Assistant.

On the Mac to use as the FTP "server," place files and folders (but not aliases) to be shared in the folder /Users/Shared. On the Mac to use as the FTP "client," open Bluetooth File Exchange. If it asks you to select a file to send, click "Cancel." On the File menu, choose "Browse Device" and select the "server" Mac. A directory window will open with buttons for "Get..." and "Put..." and you will be able to "download" and "upload" files.

I got the same setup working between my Mac running 10.2.4 and a Windows 98 computer. I used the software that came with the D-Link DT-120 bluetooth USB dongle for Windows/Mac. As with most Windows software, it's hard to describe how to install it, but I did manage to transfer files both ways. In fact, the /Users/Shared folder appears as a folder on the Windows desktop.

It's not quite Rendezvous and the range is limited to 10 meters, but the ability to wirelessly swap files among Macs and Windows PCs will be great to have.
  Post a comment  •  Comments (2)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,960 views] Email Article To a Friend View Printable Version
Registering additional Rendezvous sites in Apache Network
You can set up additional Rendezvous web sites in Apache using the RegisterResource command in the Apache conf file. The format is:
  RegisterResource "Name" path [port]
"Name" is the Rendezvous name that shows up, path is the path to your site, relative to the machine name, and [port] is an optional port number to connect to. Note that the paths are relative to the default site name. I've not found a way to register virtual domains. In fact, Apache will generate an error and refuse to restart if you have RegisterResource inside a VirtualHost declaration.
  Post a comment  •  Comments (4)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[10,233 views] Email Article To a Friend View Printable Version