Over on the MacNN forums, "kvm_mkdb" posted a couple of useful commands regarding the Mac OS clipboard. If you're in the terminal, and want the output of a command on the clipboard, you can easily get it. For example, to dump a detailed directory list to the clipboard, just type:
ls -al | pbcopy #
You can then paste the contents of the clipboard using pbpaste:
pbpaste > somefile #
This would send the clipboard contents into "somefile". Of course, that's not a great example, as you could have just sent the directory list to the file in the first place (ls -al > somefile). However, it's more useful if you want to paste into a GUI-based application such as Word or BBedit. No more mouse selection required; simply use pbcopy, switch to the GUI app, and hit command-V.
I can't find a 'man' page or help file for either of these commands - anyone know if there are more options available?
Lots of people have been complaining or commenting on how there is no way to use the 'tar' command to backup, share, archive, copy, etc. files on the Mac that have resources and desktop information. Well after a few days of trial and error I have found a way.
I call it "tarw" - The tar Wrapper.
tarw is essentailly a perl script that uses the tar command to archive files individually. This allows you to archive resource forks, desktop files any data that you can get your hands on essentially. The current version simply ads support for resource forks and desktop information like creator, type and attributes. In the future who knows what is possible.
I have placed a gzipped file "tarw.tgz" on my iDisk you are free to download at:
To use the program, simply download and extract it. There is a readme file included with it.
Please provide feedback to this posting or if you like e-mail me I would love to hear what people have to say about it.
Good Luck and long live the Mac.
[Editor's note: I haven't tried this myself yet, but it sounds like a handy command-line utility!]
I have seen some scattered reports of problems connecting to other systems using 10.0.4 (which includes OpenSSH 2.9p1, according to Apple's documentation). The connection begins, but then terminates with the message "Disconnecting: Bad packet length -898731090", or just fails to connect. To help debug the problem, you can try using SSH with a -v option, which is verbose mode and will show you the details of the connection attempt.
The X4U mailing lists have had some discussion on this topic, and have come up with three possible solutions:
Try connecting with the 'blowfish' encryption scheme (ssh -c blowfish xxx.xxx.xxx.xxx)
Compile and install OpenSSH 2.9p2 on your OS X box (there are instructions on StepWise)
Upgrade the other machine (if you can) to OpenSSH 2.9p1 or later
Try forcing SSH to use SSH1 instead of SSH2 (ssh -1 machine.domain.com) [noticed on MacFixit this morning]
Regenerate your SSH keys (use ssh-keygen at the command line) [from the comments below]
Each of the above methods has worked for at least one user. Personally, SSH is working for me just as it did before the upgrade, but if you're having troubles, try one of the above solutions.
Stefan Arentz has discovered a security hole in Apache which affects Mac OS X Clients serving pages off of HFS+ formatted volumes and using .htaccess for protecting directories. Since HFS+ doesn't care about capitalization, but Apache does, you can access a protected directory (say "test") by using a version with capitalization ("tEsT"). Apache won't see this as a request for a protected directory, and HFS+ will return the file, since it doesn't care about the capitalization. Instant password protection workaround.
Stefan has posted a thorough description of the bug on SecurityFocus; check out the article for more information, along with a suggested workaround until Apple releases a patch of some sort (if they do).
If you are serving pages from an HFS+ disk, protected with .htaccess files on your OS X client box, this article and workaround are a must read!
Not sure if this has been posted here yet, but though it might be of interest. Turning your OSX box into a mailserver by replacing sendmail with Postfix. Very easy to follow guide and thorough explanations.
While looking for an easy way to access root UNIX directories in Finder, I have found following: Typing 'open /usr' in the terminal will open Finder window with the appropriate unix directory (in column view as a folder 'Private'). Also, typing 'open /private' will open a window with the root directories 'cores', 'Drivers', 'etc', 'tmp' and 'var'.
[Editor's note: You can also use the "Go -> Go to Folder" menu item and type the path to the folder to open a sub-folder; this doesn't seem to work (thanks sjonke!) for top-level folders.]
The LWP suite of Perl modules and applications is a popular choice for developing powerful automated web clients in Perl. However, if you install it under Mac OS X, it could make a dangerous change to your system (if Mac OS X is installed on an HFS+ file system).
LWP creates an executable program called /usr/bin/HEAD. Because the file system is case-insensitive, this ends up replacing the essential Unix utility called /usr/bin/head. After you install LWP, you can rename /usr/bin/HEAD to /usr/bin/HEAD_LWP, and copy /usr/bin/head from your Mac OS X install CD. I learned about this problem from:
Not sure if this is exactly news, but it's a big help for any other students in science classes out there or anyone else who needs to occasionally convert picometers to fathoms. In the terminal, just type units, which is a UNIX app that knows how to convert between 501 different units of measurement, everything from inches to furlongs to stones.
[Editor's note: Type "man units" to get a couple of useful pages that explain how to use the program. Note that it will not do Fahrenheit/Celcius, but it looks like it can handle almost anything else!]
If you're like me, you've been terribly frustrated by the fact that "hostname name" doesn't permanently set the hostname under MacOS X. After a lot of (unsuccessful) poking around, I finally found a note on the macosx-admin group hosted by omniweb.com.
Edit /etc/hostconfig with your favorite editor. Change the line
HOSTNAME="your favorite name"
Works like a charm! Still, it bugs me that Apple has disabled many of the old unix standards - I think they'd make the platform much more attractive to a very strong unix talent base if they would try to keep the old standards where they still make sense.