Recently in Mac Category

Put the Mechwarrior 2 CD into your Mac's CD drive; it will show up as two mounted discs, one for the audio and one for the game data. The disc I have is for Mechwarrior 2 v1.1, so the game data is mounted as /Volumes/MECH2_V1_1; if you have a different version, the mount point will be slightly different and subsequent commands should be adjusted to match. To access the disc in DOSBox, you must mount it. Start DOSBox and type:

mount d /Volumes/MECH2_V1_1 -t cdrom -usecd 0
You will also need a place to act as a fake `C` drive, where the game will be installed. I created a directory `dosprog` in my home directory and mounted it in DOSBox like so:
mount c ~/dosprog
To install the game simply go to the mounted CD and run the setup:
d:
INSTALL.EXE

Follow the installation program, clicking happy things like "yes", "continue" and "full install". Choose the top-most audio devices in the list. Next, download the NOCD crack from here, unzip it in Mac OS and use the files from the crack to replace those in your dosprog/mech2 folder. Now, back in DOSBox, go to the c:\MECH2 directory and play:

c:
cd c:\MECH2
MECH2.EXE

See also: Vogons

Having a purgatory for files that are on their way to deletion, such as the trash can in Mac OS or the recycle bin in Windows, is a great idea, for even the most careful users occasionally delete something only to find that they later need it. Unfortunately, the two aforementioned implementations, as well as those in Gnome and KDE, only allow you to empty the trash all at once. Much more useful is to have a timeout where files that are sent to the trash are automatically removed after a period of time. I finally got around to implementing this myself in Mac OS by putting the following in my crontab:

0 5 * * * /usr/bin/find /Users//.Trash -mindepth 1 -maxdepth 1 -mtime +14 -exec rm -rf {} \;

Every day at 5 minutes after midnight any item more than 14 days old is delete from the trash can. To install it, read the linked article above or, if you know the command line, open a terminal, type crontab -e, paste the above (substituting your username) and save the file.

Edit: In the comments, Matt mentioned Compost, a preference pane for OS X that provides the functionality I describe, but also the ability to limit the trash based upon size, and also manage the Trash on other volumes. Neat! It's $20, but definitely makes this process easier and understandable if you aren't a Unix person.

If you try to rsync from a Mac OS X machine using the -E switch (capture extended attributes & resource forks - you want this) to a Linux or BSD computer, you'll get something like the following error:

rsync: on remote machine: -vlogDtprzE: unknown option
rsync error: syntax or usage error (code 1) at main.c(1108)
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-30/rsync/io.c(359)

What's the holdup? Well, resource forks are a purely Mac OS construct (though NTFS has Alternative Data Streams that aren't often used) allowing specific data, such as icons and application metadata, to be shoved into a file. The standard version of rsync doesn't support these containers, so Apple includes a patched version in Mac OS X to handle them and in order to get this support on a non-Mac, you must install this patched version. Doing so is a fairly simple affair, since Apple makes the patch readily available through their Darwin source site.

Since I'm running Mac OS 10.5.2 (the latest update to Leopard), the files I need are in the 10.5.2 branch of the darwinsource directory; change that number to your version of OS X or navigate from the above mentioned Darwin source site.

wget http://www.opensource.apple.com/darwinsource/10.5.2/rsync-30/rsync-2.6.3.tar.gz \
http://www.opensource.apple.com/darwinsource/10.5.2/rsync-30/patches/EA.diff

Don't ask me why the directory is rsync-30 when they're using rsync-2.6.3. Now it's just a simple matter of unpacking the source, applying the patch and compiling rsync:

tar zxf rsync-2.6.3.tar.gz && cd rsync-2.6.3 && patch < ../EA.diff && \
./configure --enable-ea-support && make && sudo make install

By default, it installs to /usr/local/bin/rsync so installing this version won't trash that put in place by your sytem's package manager. I also found a post on macosxhints.com concerning rsync interacting with the disk indexing of Spotlight. If you are writing tons of files to a Spotlight-indexed disk on a Mac, the indexer can become overwhelmed. The solution is to disable Spotlight on the disk in question with mdutil -i off <mountpoint> or to write into a directory appended with .noindex.

When you install Mac OS X, it asks you for your full name, which is what it will use for what it calls the username. Despite calling it the username, it is not actually field 1 in /etc/passwd, which is what Unix users would call the username. Mac OS X refers to the first field of /etc/passwd as a user's "short name," normally a concatenated and lowercased version of your full name. As one would expect, your Unix username, what you would use to login at a console or via SSH, is actually the short name; your files are stored in /Users/ and are owned by .

Like many Unix users, I have a username (dinomite) that is different from my real name (Drew Stephens) and I like it that way. Having a username on one machine that doesn't match that on all of my others is a hassle, requiring me to specify a username whenever I SSH to or from said machine. After having reinstalled OS X recently I wanted to change my short name on the system to rectify this problem. Though some tutorials make it seem like an involved process, it's actually fairly straightforward if you have some Unix and OS X experience. Here's how I did it in 10.5 (Leopard).

First, you must enable the root user; we will make all the username changes while logged in as root. You could also login as another user and use sudo (hint: sudo -i) to do this, but I had no other users on my machine. To enable root, open Applications > Utilities > Directory Utility, then click the lock in the Directory Utility window and enter your username & password. Choose "Enable Root User" from the Edit menu and supply a password for root when prompted.

Now that root is enabled, log out of your own account, click "Other..." in the login window and supply root's credentials. Once logged in, we need to create a the new user with the desired short name. Open System Preferences and select the Accounts pane. Add a new user by clicking the '+' at the bottom and fill in the Name & short name fields as desired; I used a temporary name (Drew) and the short name I wanted (dinomite), since you can't have two identically named users and the name can be easily changed later.

Open a terminal (Applications > Utilities > Terminal) and change to /Users. ls ought to show directories for both your current short name and the newly created one. Now you just have to move your files from your old short name to the new one: mv <old short name>/* <old short name>/.* <new short name>/. Once that completes, you need to change the ownership to the new short name: chown -R <new short name> /Users/<new short name>. Since everything is now in the new users' domain, you can now delete your old username, log out of root and log in using your newly short named account.

Pages

About this Archive

This page is an archive of recent entries in the Mac category.

Linux is the previous category.

Networking is the next category.

Find recent content on the main index or look in the archives to find all content.