Should anyone want to set up an OS X box for modem routing, than the following script might be of good use. It sets up all necessary services and daemons to get a clean route to ppp0 through the built-in firewall. It is designed as a usual unix daemon loader, hence usage:
[Editor's note: I have neither looked at nor tried this script, so make sure you're comfortable with what it does before you run it. Nothing intended against the author of this particular script; it's just generally good advice!]
Since MacOS X does not come with a PPTP-client one has to use PPTP-GUI to connect to the provider.
However PPTP-GUI does not currently work when you do not have an internal modem in your Mac since it uses MacOS X's PPP stack which is only set up when a modem is detected.
There is a way around this by "hacking" the Alcatel modem (only works for the ethernet version as far as I know).
Instructions for this can be found here. Basically it makes it so that the ADSL modem will handle the PPTP stuff for you so you can just talk straight ethernet (no PPTP or PPPoE stuff) to it. It will then also do masquerading allowing you to connect multiple machines to it via a hub.
Although this isn't a straight MacOS X tip, it does solve some problems related to MacOS X.
I figured out how to keep AFP Volumes mounted always!!! It's actually quite simple.
Here's how to make the change:
Just go to your NetInfo Manager and click the lock button to unlock to make changes. Then under "Directory Browser" click on "config" in the second column, then click on "AppleFileServer". Below you will find a "Property" and "Value(s)" columns. Go to the "idle_disconnect_flag" property and you will see that it has a value like this:
Notice how each flag has an "ON" at the end of it. You can change this to either "ON" or "OFF". I made mine so that if you are an admin on the machine your trying to mount, that it would keep the volume mounted ALWAYS by changing this value: "AdminUsrDisconnect_ON" to this "AdminUsrDisconnect_OFF". My iMac now has kept my G4's hard disk mounted for over 5 hours without disconnecting and life is wonderful.
IMPORTANT! First, for this work properly you must make this change on the Mac that you are trying to mount, not the client. Second, you must save your changes in NetInfo Manager and Restart/Log Off your computer.
I'm on a college campus and am using DAVE to interact with the non Mac users of the world. If I want to see who's on my server at any given time, all I need to do is a netstat, and it'll list all current connections. But I'm not always around to check on who's connected. So I wrote two scripts to do this for me. One script is run every 15 minutes and gets a list of currently connected computers and stores it to a file. The second script runs daily and takes the output of the first script, cleans it up a it, removes all duplicate listings, then stores it into a second file.
[Editor's note: The following tip has not been tested, and it makes some assumptions about your knowledge of the Terminal, so it may not be applicable to everyone. Still, I thought it was interesting enough to post...]
There is probably an easier way to do this (maybe an applescript app?), but I wanted to have my iDisk mount when the computer starts up. I wanted this in case the machine reboots at home since I serve a few things to my iDisk. iDisk uses the mount_webdav program to do its thing, but it is not clear what all the stuff means in a ps listing.
For example, when I mount an iDisk using the Finder, I see
(xyz = iDisk user name). The -a10 is a file descriptor where keychain data comes from. The http://... is the URL to the idisk, and the /Volumes/xyz is the directory where it will be mounted. If you then use terminal and omit the -a10 you get one or more dialog boxes asking for a username/password.
To make this automatic, you need to manually create the mount directory, then you need to feed mount_webdav your username and password in the form it wants. The format of the username/password is a pair of 4 byte length - characters structure. For example, if my username is xyz, and password is mypass, I must send:
^@ is control-at, or a null - zero decimal, ^C is control-c or 3 decimal, etc. (in emacs, doing control-q control-c inserts a control-c, control-q control-space inserts a null). Once you have this in a file or coming out of a program, you can just do:
Create a shell script so that /Volumes/xyz is created, then using dropscript, you have an app that will mount the iDisk. But DropScript is designed to take a parameter, so assign any document to open with the generated dropscript-idisk and add that to the Login startup tasks. That document will run the script, and the iDisk will mount.
In our first "transference" hint from the new forums site, 'Crusty' wrote about the Sharing Prefs panel crashing whenever it was opened -- see "Sharing Prefs Messed Up". After a few back and forth "try this" exchanges, 'Thundarr' wrote that he had experienced the same problem and had a potential solution.
The resolution? Somehow, the inetd.conf file in /etc had either become damaged or (in this case) was actually missing. Ideally, you should replace the file with a fresh copy, but this may not always be feasible (note to self -- back up inetd.conf now!).
However, it turns out that as long as a placeholder for the file exists, then the Sharing Prefs will work. So if your Sharing Prefs panel is crashing, open a terminal and check for inted.conf in /etc ('ls /etc inetd.conf'). If it's not there, then type sudo touch /etc/inetd.conf. This will create an empty inetd.conf file, and fix your Sharing Prefs crash. Sure enough, when 'Crusty' created the file, the Sharing Prefs started working again!
I have a network of Macintoshes running OS X and a PC running Windows XP. I wanted to enable the PC to print to a LaserWriter that only talks AppleTalk. There is commercial software that enables you to do this, but here's how to do it for free. In brief, the missing piece of the puzzle was figuring how to make OS X print to an AppleTalk printer from the command line. For those of you who want to figure the rest out for yourself, the relevant UNIX commands are at_cho_prn and atprint.
If you'd like the step-by-step instructions, read the rest of the article.
A tip published back in December of 2000 explained how to set up anonymous FTP using the command line to create directories and copy files to various locations. Yesterday someone submitted an anonymous hint regarding a couple of shell scripts which automate the process.
Being somewhat leery of anonymous hints about setting up anonymous FTP, I downloaded the scripts and looked through the code. There are two included scripts (a setup script and a remove script) and neither one does anything malicious - you are never asked for your root password (it just makes sure you have root privileges before running), there are no commands that pass info to any outside URL's, etc. I have not actually tested the scripts (as I use CrushFTP for my FTP needs), but they seem to mirror the commands used in the previously published tip.
After you download the scripts, place them in your home directory and run the "anonftp" script with root privileges (check the included Read Me for more information). To remove anonymous FTP, run the "delanonftp" script with root privileges.
These scripts are hosted on a server with a dyndns address, which indicates it may be an individual machine that could come and go somewhat regularly. This may be the cause of the problem if you get an error when attempting to download the scripts. The URL that is hosting the scripts is http://hamburger.dyndns.org, in case you'd like to try hitting the main page as well.
ApleTalk Filing Protocol (AFP) root login can make it more convenient to remotely administer OS X boxes.
There's a property in NetInfo, found in the path config -> AppleFileServer -> allow_root_login, which serves this very purpose, and which is set to 0 by default. You can set it remotely to 1 locally using NetInfo Manager (or remotely using niutil; you need to kill and restart the AppleFileServer process for the change to take effect).
[Editor's note: I would imagine this is set to off by default as enabling root login via AFP does present some security issues if your root password is ever compromised. A hacker that discovers the root password will have the ability to login remotely at the root level. With the switch in its default setting, the hacker would need physical access to the machine in addition to the root password. So by changing the switch setting, keep in mind you are removing one layer of security ... at least, that's my view of it. Someone please correct me if I'm wrong.]
There are several tricks for sharing a USB printer on a Mac network, using Applescript, or using UNIX tools like Ghostscript, lpr printing, etc, but these are not well suited for novices. This note describes a hardware trick that lets you use at least two Epson printers as sharable network printers on a LAN. This trick may work with other printers, but I have no way to test that.
Basic idea: Get a print server that does parallel port to ethernet conversion, enable the AppleTalk protocol in the print server, then print to the "USB" printer as an AppleTalk printer, with the print server making the printer's parallel port function as an AppleTalk connection. So, the way you share a USB printer on a LAN is that you don't even use the USB connection! Most USB printers also have a parallel port connection.