Archive for February, 2007
Possibly watch unmountable DVDs
Monday, February 26th, 2007This might save someone some frustration. A DVD I just bought would not mount. The optical drive would spin up for a few seconds, and then nothing. DVD Player and MacTheRipper could not see the disc, but Disk Utility could. So I just made a disk image of the DVD and watched the movie from there.
<br><br>
Incidentally, I’ve never had a problem with a DVD before. I think the issue with this one was that the two layers were very, very slightly misaligned. But I guess that was enough to cause a problem for the vertically-oriented drive in my iMac (the disc played in my DVD player just fine).
A visit to Apple
Friday, February 23rd, 2007Posted by Scott Knaster, Mac Team Technical WriterWhen you start work at Google, you get to choose whether you want a Mac, Windows, or Linux computer. For many new employees who have never used a Mac (or who haven’t used one for a long time), this choi…
10.4: Use MacFuse to read and write to NTFS volumes
Friday, February 23rd, 2007
So you have Boot Camp and a big disk to use, but then you are bound to the NTFS format instead of FAT. But Mac OS X 10.4 can only read, not write, to these kind of formatted volumes. Follow these steps and you will be able to write to them as well:
- If you choose to compile yourself, install Xcode 2.4.1, and especially the SDK package within it. Also, compile the latest release of pkgconfig.
- Download MacFuse. Compile it yourself, or easier of course, is to download the binary .dmg file.
- Download ntfs-3g and compile it — there’s also a premade binary .dmg if you prefer.
- In Disk Utility, check out the device identifier (disk0s2 or something) of the NTFS volume…
Make opendiff wait for FileMerge to finish
Friday, February 23rd, 2007opendiff is a command line app for merging text files. It is installed when you install the Xcode Developer Tools on Mac OS X, and calls FileMerge.app. By default, opendiff does not wait for FileMerge.app to finish before exiting. This makes it hard to integrate opendiff with other Unix tools. After some searching, I found a solution.
In particular, opendiff will wait if the output is piped somewhere. I handle this by making a new shell script I call opendiff-w with the following code in it:
#! /bin/zsh `/usr/bin/opendiff $@`Then you can use opendiff-w just as you would opendiff, but it will wait until you quit FileMerge.app before continuing. It would be better still if FileMerge had a way to know when the diff was done without having to actually quit the app. Any suggestions?
Replace the aging standard Apache icons
Thursday, February 22nd, 2007I’ve often searched for a replacement for the standard icons that come with Apache. The default icons date back to Mosaic for X, and have been included in the NCSA httpd and Apache server distributions. These continue to be distributed with even the latest versions of Apache. I haven’t found any publicly available replacements for these icons, so I decided to build my own.
I didn’t reinvent the world here, I just modernized the standard set. The task of creating a whole new representational logic was too great a task for my purposes. Furthermore, the prevalence of these icons makes them easily understood. All icons maintain their original sizes, so they can be used as a drop in replacement.
On OS X, the standard installation location is /usr/share/httpd/icons. This directory is referenced by a global directive in the httpd.conf file. This includes an alias for /icons/ that is resolved for every domain being served. On OS X, this dire…
Disable display dimming via the command line
Wednesday, February 21st, 2007I have one of those 24″ iMacs that hums loudly whenever the display is any dimmer than max. Luckily I like maximum brightness, but I’ve always had to set Energy Saver to never turn off my display because the dimming creates a loud hum. I have, however, found the solution. Go to Terminal and type this command (and enter your password when prompted):
sudo pmset -a halfdim 0The halfdim mode is now disabled, and your display(s) will simply turn off at the interval designated in Energy Saver without ever dimming. Now I can stop leaving my display on permanently and get a bit more life from it.
[robg adds: We’ve run a number of hints on using pmset in the past, but the halfdim setting hasn’t been covered before.]
A perl script to rip and normalize songs for iTunes
Wednesday, February 21st, 2007I received an iPod for Christmas — I’ve admittedly been resisting this convenient technology because I am not satisfied with the audio quality of MP3s, even at the higher bitrates. I’ve revisited this issue since receiving my gift, however, and I’m mightily impressed with AAC at 256kbps: I’ve done listening tests of AAC against uncompressed audio with strings, voice, symphonic, and amplified music, and am sold on 256kbps AAC. It requires nice components for me to discern the difference from the original, and I sure can’t on the little iPod.
I began converting my CD collection to AAC, but quickly became dissatisfied with Apple’s tools to do this, either through iTunes or via Max. Neither does track normalization for a large collection, and Max’s rips often produce white noise output for me.
Having used and trusted cdparanoia and cdrdao to obtain high quality rips for years now, I …
Transliterate Arabic, Greek, and others using UTF-8
Wednesday, February 21st, 2007I wrote this perl script which transliterates ASCII into UTF-8 colloquial and classical Arabic, Greek, and (at some point in the future) Cyrillic, Hebrew, and other scripts. Input: ASCII. Output: UTF-8 and octal representation of UTF-8.
I’ve used this to input foreign language titles into my iTunes world music collection. Once you’ve generated the octal UTF-8, this can be done by hand:
mp4tags -s "`printf '9rabiyuN 'anaa (33027133026133121633025033122033121233121440330243331216331206331216330247'`" -a "Yuri Mrakady" "'ajmal mnw9aat al-jaaz 01.m4a"The iTunes song title of the AAC file ‘ajmal mnw9aat al-jaaz 01.m4a will appear as 9rabiyuN ‘anaa (عرَبِيٌ أَنَا). Or enter these codes into a …
Create custom folder backgrounds on burned CD/DVDs
Tuesday, February 20th, 2007I’ve been struggling quite some time to get this done and couldn’t find anything about it on macosxhints, Apple Discussions, or the Roxio Toast forums, so here we go…
I wanted to burn a folder to DVD and needed it to look exactly the way I set it up in Finder (custom background image, icon view with custom positioning), just like a lot of install media or downloadable DMGs. You could do something like this with earlier versions of Toast, but I never got it to work with OS X 10.4.x and Toast 7/8.
So I created a folder, put everything in it, hit Command-J, and tried burning it with Disk Utility and Toast 8. Since the background image and the size of the folder window got lost, I decided to give disk images a try. I used Disk Utility to create an image, put the folder content directly into it, put the folder itself into the image and so on. I even used all of the available options in Disk Utility to convert the image and did the same (image creation, conversion, etc…
Use the title bar’s document icon to check saved status
Friday, February 16th, 2007Put this in the “almost useless, but interesting feature” category. I recently realized that when working on a new document in most OS X applications (Text Edit, Word, and many others), the icon in the title bar of the document is slightly grayed-out until you save the document. As soon as you edit it more, it goes gray again. Additionally, if you use the Undo feature enough to get your document to match the saved version, the icon will brighten again. If you go past your last save using Undo, you can Redo until the icon brightens again.
I can’t imagine a really good use for this feature except that you can quickly tell if you’ve saved a document since your last edit.
[robg adds: I must admit, I’d never paid much attention to the icon in the title bar, so I hadn’t noticed this behavior. I usually just glance at the red “Close” button, looking for the black dot in its center, which is …
A possible cause for oddly named Preferences folders
Friday, February 16th, 2007A while back, I noticed that my user’s Preferences folder was staring to accumulate some very oddly named (but empty) folders. How odd? Consider these actual folder names from my machine:

The folders would appear at seemingly random intervals, and I could safely delete them with no apparent ill effects. At first, I thought it might some weird form of hard drive corruption, but everything else was fine, and the folders only showed in my user’s Preferences folder, so I was pretty sure it was related to an application. After a few months of manually deleting these empty folders every so often, I finally took the time to look for an answer…and found one, right here on the macosxhints forums.
It turns out it’s related to the Epson TWAIN plug-in for Photoshop CS2. With the plug-in installed, a new randomly-named…
Recover from syntax errors in the sudoers file
Thursday, February 15th, 2007While messing around trying to share my iTunes library between two user accounts on the same iMac, I accidentally introduced a syntax error into my /etc/sudoers file. The big problem here is you need to invoke sudo to edit the sudoers file; I use pico, but visudo is recommended on this site.
So, to recover from this, I had to enable my root account using NetInfo in Applications » Utilities. Log in as root and edit /etc/sudoers, then once it’s fixed and working, disable the root account again.
[robg adds: There’s a good reason visudo is the recommended way to edit your sudoers file, and this hint is a perfect demonstration of why: because visudo includes a basic check for syntax errors, as explained in the man page:
visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against multiple simultaneous edits, provi…
A DIY solution to an invalid node structure problem
Thursday, February 15th, 2007Background. About a month ago, I ran into a problem with Dashboard behaving oddly and after posting a question on the Apple forum, the very helpful Dr Smoke advised me to clear my caches and to run the ‘repair disk’ feature of Disk Utility while booted from the installation CD. (This because I reported that a couple of times I had to do a hard reset.) I got Dashboard fixed, but discovered that my disk had serious errors in the directory structure, reported as “invalid node structure,” which Disk Utility could not repair. The laptop was running perfectly, but several people posted advice that I should not leave this problem unattended to.
Reporting this crisis again on the forum, I was advised to buy Disk Warrior for what might be a once-in-a-lifetime problem, or else I should back up my data and re-install everything. With help again from Dr Smoke, I made my firewire disk bootable for Intel Macbooks (must be partitioned with the GUID option selected), and searched the forum…
A possible fix for failure to sleep when inactive
Wednesday, February 14th, 2007I recently purchased a 17″ MacBook Pro and after I first started using it, it would sleep when inactive (as set in System Preferences » Energy Saver » Sleep ». Put the computer to sleep when it inactive for). After installing the applications I require, and playing with settings (I didn’t use Migration Assistant from my previous PowerBook), I noticed that the laptop had become an insomniac. This same thing happened with my previous PowerBook and the one before that, but I didn’t investigate it too much. But with my week-old MBP displaying the same behaviour, an investigation was warranted.
Sleep worked when booted up in Safe Boot. So using Terminal, I output all the running processes to a text file using top -l 1 > /Users/jj/Desktop/Processes.txt (-l being logging mode, and 1 being the number of samples) during Safe Boot, and then again after a normal boot and compared them. Note that I didn’t have any login items set up from my account…
Use Caps Lock to switch to Japanese
Tuesday, February 13th, 2007I was looking at the big, easy to reach, caps lock key on my Macbook that even has a nice light to let you know when it’s active, and it was sad it was completely going to waste. Also I use Japanese fairly often and since Spotlight hijacked the default hotkey for switching languages anyway, I found a great way to use the caps lock for Japanese. If the light’s on, you’re in Japanese, light’s off, English (or vice versa if you want). I’m not sure if it works with other languages because you need settings specifically in Kotoeri (the Japanese input system). Here’s my setup but you can change it to get a little different behavior if you want.
In the “Input Menu” tab in the International Preferences, make sure Kotoeri is on, and turn on Hiragana and Romaji. Also, be sure to turn off the English input method so your computer will always be in “Japanese,” but don’t worry, switching to romaji is no different from English mode (I tried sending emails with only English characters and…
10.4: Generate PDFs without embedded author information
Monday, February 12th, 2007
I’m submitting what is supposed to be an anonymous review for a paper. I wrote up the review in a text file and generated a PDF from it (using Print » PDF » Save as PDF…) only to find out that the author info was emdedded in the PDF metadata. I thought there would be a free tool to modify PDF metadata in Mac OS X, but I seem to have been wrong.The solution: Instead of using Save as PDF from the PDF pop-up meu, use the Compress PDF option instead. A side effect of this workflow is that the author info does not get embedded in the metadata.
[robg adds: I used Adobe Reader to confirm that this works — the author data is definitely included with the normal Save as PDF, but not when using Compress.]
You can go home again (with Google Maps)
Thursday, February 8th, 2007Posted by Mike Morton, Mac Team Technical StaffMy mother’s parents lived on a farm in New Jersey, or at least it seemed like a farm to me. To a kid from the Boston ’burbs, parking the car in a barn and drinking water from a well seemed very exotic….
Update to the latest Dev Tools before compiling software
Wednesday, February 7th, 2007This may seem like an obvious hint, but I have been caught out by it a couple of times. When installing software using Fink or DarwinPorts (aka MacPorts), make sure you have the latest version of Apple’s Developer Tools (Xcode) installed (free registration required to download).
Developer Tools is ignored by Software Update — and using an old version tends to cause software to fail to compile. I keep getting caught out by these failures, and after making sure I have the latest version of Fink, doing fresh installs, permission repairs, etc., I finally remember to check the developer site for a new version.
A possible fix for invalid sibling links on a hard drive
Tuesday, February 6th, 2007Just recently I ran into a problem when I tried to Verify my hard disk and when it tried to verify the catalog, it responded “Invalid sibling link.” Repair Disk didn’t work. I searched the web and Apple’s site, and couldn’t find anything useful except to buy DiskWarrior or reformat the drive. Knowing that OS X is built on Unix gave me a few clues on how to proceed. The solution is pretty simple:
- Boot off the OS X CD (reboot, hold C while booting).
- The installer will load up, go to Utilities in the menu and run Terminal.
- Type df and look for the drive that has your Mac system mounted—you’ll have to unmount this. On my MacBook Pro, it was /dev/disk0s2.
- Type umount /dev/disk0s2, replacing disk0s2 with whatever disk your OS lives on.
- Type fsck_hfs -r /dev/disk0s2. If you umounted the wrong thing, it will complain that you can’t repair a mounted drive. Go back and umount the right thin…
IPod Will Be the New CD
Monday, February 5th, 2007The Beatles settlement clears the way for Apple to make revolutionary changes to its music player. Commentary by Leander Kahney.
