Reach local iTunes library over the net
If you want to reach your iTunes library from a remote Mac (a MacBook while traveling, for instance), you can enter these two lines in your Terminal app :$ dns-sd -P "any name" _daap._tcp. local 3690 localhost 127.0.0.1 & $ ssh -N user@server.example.com -L 3690:localhost:3689Replace user with your short username on the remote Mac, and server.example.com with the public IP of the remote Mac. Don't forget to set up your remote router so that the ssh port (22) is forwarded to a Mac on which the SSH daemon is launched (Remote Login enabled on the Sharing System Preferences panel).You can put this in a shell script (thanks to andersB):#!/bin/bash dns-sd -P "name of server" _daap._tcp local 3690 localhost 127.0.0.1 & PID=$! ssh -N user@server.example.com -L 3690:localhost:3689kill $PIDThis will start the broadcaster, set up the tunnel, and kill the broadcaster once the tunnel closes. I use p...
published on Tuesday, the 22. April 2008, macosxhints
Share USB Printer on Mac OS X Server
Normally, you can't share USB printers via Mac OS X Server because the Print Server can only deal with Postscript printers. However, you can share USB printers normally via CUPS. Set up your printer as normal (System Preferences » Print & Fax). Then, in Safari go to CUPS, which is usually at http://localhost:631. Click the Administration tab, then click the Share published printers connected to this system checkbox. Click Change Settings, and enter your admin username and password. Voila, plain old USB Printer Sharing works. Note that you can't use Print Server to manage the printer, but who cares?
published on Friday, the 28. March 2008, macosxhints
Another way to use personal web sharing and FileVault
I noticed that Personal Web Sharing was only partially functional when using FileVault. More precisely, accessing the users web pages inside ~/Sites using a URL similar to http://localhost/~username would always fail with a permissions error. The reason for this failure is fairly simple. When the FileVault user logs in, the encrypted disk image /Users/.username/username.sparseimage is mounted as /Users/username. Apple righty decided that a user using FileVault was trying to protect personal data, and so they set the access rights of /Users/username to 700 (rwx------), thus allowing only the user herself to access anything in her $HOME directory. Unfortunately, this has the side effect of preventing the local Apache server from accessing the contents of /Users/username/Sites/ resulting in the aforementioned error. A simple but unsafe solution: A simple solution would be to change the access rights of ...
published on Monday, the 31. December 2008, macosxhints
10.5: How to use screen sharing remotely and securely
OS X 10.5's screen sharing feature works nicely on local networks. But to control your computer over an internet connection is easy, too.Use SSH to establish a tunnel to the computer you want to control. Be sure to use a local port other than 5900 -- otherwise the screen sharing app will complain about controlling the local screen is not possible. A good example is:ssh -L 1202/192.168.10.10/5900...where 1202 is the local port, and 192.168.10.10:5900 the remote destination.Go into Safari and type in the URL vnc://localhost:1202, if you're using the local port 1202 as in the above example.Now drag the URL to your desktop to create a link to this URLRename and/or change the icon for the URL link with the Get Info window.If the tunnel is established and you clic...
published on Monday, the 19. November 2007, macosxhints
10.5: Modify group memberships in 10.5
If you are looking to add users to custom groups, take a look at this Apple support document. However, occasionally there is a need to add a user to one of the system groups. In 10.4, this was done with NetInfo Manager, but that is gone in 10.5. After poking around a few websites, I wasn't able to find any tutorials on it, so hopefully this will help someone.Everything here should be done on the command line (I looked for a GUI way to do this, but couldn't find one). First start dscl like this:$ dscl localhostThen cd to the Groups node:cd /Local/Default/GroupsYou can see all the groups using ls. Once you have found the group you are interested in, you can view all its properties with cat groupname. When you are r...
published on Wednesday, the 14. November 2007, macosxhints
10.5: Apache 2 site troubles with permissions and folders
Upon upgrading to Leopard via upgrade install, I couldn't get to my Test webserver on my localhost. I got a 403 error, that I wasn't allowed to access my directory. Going to Finder and doing a Get Info on the Sites folder told me that I had read and write privileges, but a user (Unknown) had read privileges. I couldn't remove this user. Clicking the + symbol would crash Finder, every time.The fix to this is to go into Terminal, and from your home folder, type:$ cd ..$ chown -R :staff name_of_home_folderWhere name_of_home_folder is the name of your user's home folder. This will stop Get Info from crashing, but it won't fix the 403 error. Now that 403 error is occurring because Tiger ships with Apache2 and activates it by default, ignoring Apache1.x configuration files -- thanks for making that clear, Apple!To solve that, all you hav...
published on Monday, the 5. November 2007, macosxhints
10.5: Set up NFS exports in 10.5
Setting up NFS exports under Leopard is insanely easy: just add an entry to (or more usually, create) /etc/exports, and it gets picked up automatically. This file survives reboots, as well; pretty cool. Here's an example: muse:~ root# cat /etc/exports /Volumes/BigDisk/Panic -maproot=netroot 10.0.1.1 muse:~ root# showmount -e Exports list on localhost: /Volumes/BigDisk/Panic 10.0.1.1 muse:~ root# [robg adds: I haven't tested this one.]
published on Monday, the 5. November 2007, macosxhints
10.5: Move a user's home directory via the command line
Under Leopard, NetInfo is gone in all its forms. If you want to move a home directory (eg, to another volume) you may now use Directory Services which can be accessed with dscl (Directory Services Command Line). The following is a summary version of this blog post; note that was written back in April, and the users listing is now in /Local/Default/Users not /Local/Users.Open Terminal (in /Applications » Utilities) and become root with sudo su -. Now fire up dscl by typing dscl localhost. Inside dscl, change directory to/Local » Default » Users:cd /Local/Default/UsersYou can list all users, if you want, by typing ls. For the user you wish to move, show all the Directory Services' attributes by typing cat so...
published on Tuesday, the 30. October 2007, macosxhints
A bash script to create RealPlayer playlists
It seems to me that Realplayer 10 for Mac lacks any function for creating or managing a playlist. I have a folder full of .rmvb movies that I would like to play sequentially without having to open each time one movie ends. While I could just convert them to a more usable format (mpeg h.264?) and open them with a better player, instead I created a little bash script to make a playlist of all files in a directory (aka folder). I thought I would post my little script for those who are not clued on regular expressions or shell scripting.I created a file in my home directory called makeram.sh and put in the following code:#!/bin/bashi=`pwd | sed s/'\ '/\%20/g`for j in `ls | grep '\.rmvb$' | sed s/'\ '/\%20/g`; do echo file:\/\/localhost$i\/$j >> ./playlist.ram doneAfter saving the file, don't forget to make it executable with chmod +x ~/makeram.sh. Basically, the script works by repl...
published on Tuesday, the 4. September 2007, macosxhints
10.4: A fix for the modem GUI not showing completed jobs
I recently had the experience that my internal modem did not show my sent faxes anymore. As soon as I clicked on Completed Jobs within the internal modem.app, the window became sluggish and did not react anymore. I finally found out that it had something to do with one of the earlier jobs that was not sent properly. These jobs are stored in /var » spool » cups and begin with somewhat like c0*.In addition to that, there is a wonderful CUPS administrative view that you access with your browser via http://localhost:631 that I hadn´t seen before. There you'll find your printers, but also your internal modem and all the jobs that have ever been faxed with it. One of these jobs had to be my "killer." Note that this job list is generated dynamically at startup of the cups daemon. If you mangle around with the job files (moving or deleting), you won´t see a result until you restart the daemon with sudo killall -1 cups ...
published on Thursday, the 9. August 2007, macosxhints