Archive for the 'mac' Category

Kindle 2 is very slow over USB on Mac

Usually I like to post solutions to problems here – but this one I haven’t been able to figure out… maybe someone else has an idea? Please comment.

When connecting the Kindle 2 to a MacBook Pro via USB the connection is basically unusable. I get no where near the 480Mbit/s that USB2 would promise (and I checked in the System Profiler – the Kindle does show up as a USB2 device). I appear to be getting a few kbit/s – transferring a 3MB file takes 15+ minutes.

Doing some googling points to SpotLight as a potential problem. Since the Kinde 2 shows up as a FAT partition many of the usual ways of preventing SpotLight from indexing it don’t appear to work. Certainly disabling Spotlight for the Kindle through the Preferences tab failed for me (with the always helpful “an error occurred” message). What does seem to work is to create a file named .metadata_never_index in the root directory of the Kindle (something like

touch /Volumes/Kindle/.metadata_never_index

in a terminal window.

But even after doing that (and verifying that SpotLight is no longer trying to index the drive) transfer performance over USB is still abysmal.

Help?

Disk Utility Bugs with Software RAID

Looks like the Mac OS 10.5 (Leopard) Disk Utility has even more issues than the partition resize bug that I already talked about.

Fundamentally it seems to fail when trying to add members to a mirrored RAID Volume. I tried several ways to do this but every time I try I get one of these fundamentally useless error messages: “Unrecognized Filesystem”.

Turns out you need to go back to the command line and use the underlying tools that the GUI tool is supposed to use. Here’s a description of the steps that worked for me:

  • diskutil list
    Now find the Identifier of the partition or disk you want to add; it’s something like disk4 for a disk or disk4s2 for a partition. While you are at it, make sure that the disk that you want to add has the same partition scheme as the one that holds the existing RAID slide – otherwise this won’t work, anyway.
  • sudo diskutil addToRAID member Identifier /Volumes/Mountpoint
    where Mountpoint is the name under which the original RAID is mounted (TAB-expansion will give you the options of what’s there under /Volumes/, so this should be rather straight forward). Note that this command should be issued as superuser, so you need the sudo
  • diskutil listRAID
    will show you the progress of rebuilding the mirror. Depending on size and connection speed this can take a long time. I did a 500GB RAID of two external disks connected via USB and that’s estimated to take 16 hours…

I wish they paid more attention to the functionality of their tools. Being pretty and easy to use is nice – but it actually needs to work, too.

Mac Pro impressions

No, this won’t be a real benchmark comparing my PowerMac G5 Dual Core 2.0GHz with my brand new Mac Pro 8-core 2.8GHz. I haven’t spent the time to create hard numbers. But I can give you some subjective impressions.

First, things that are I/O bound are still as slow as they were. Like reading eight gigabytes of photos from the SanDisk Extreme FireWire 800 reader. Or transferring 200+ gigabytes of data from one disk to another. Not surprising, but still… darn.

Second, and much more important – Adobe Lightroom and Adobe Photoshop CS3 just fly on the new box. Especially compute intensive operations that mostly happen in memory (sync the settings of 25 pictures Lightroom; apply filters in Photoshop) – you suddenly see all eight cores busy in MenuMeters and things that took several seconds on the PowerMac are done instantaneously.

Nice – I will post more comparisons later. Promise.

Geeking out again

Instead of enduring the cold, rain and even snow in Portland, I am in Australia at Linux.Conf.Au. 24 hours of travel suck. Days filled with great talks and a chance to connect with lots of friends and many new people, all working in open source. Worth it.

I brought both the Mac and the eeePC. Surprisingly, the eeePC seemed a lot better at hanging on to the wireless connection – it keeps dropping on the Mac at times. I need to Mac to be able to access work email and connect to the VPN, but for everything else, so far, the eeePC was actually the better solution. Smaller, easier to carry around, no problem to just put it down (it’s solid state, after all).

It’s not great for kernel builds, though. Or for editing source files. Darn.

Modem scripts for Mac OS 10.5 Leopard

It seems lots of people find this site looking for modem scripts for their devices, now that Leopard has changed the script format.

While I have written about the necessary modifications to have your Motorola Ming work with Leopard I don’t know much about any other device. But it turns out that Apple actually has a really useful tool to simply convert what you have for Tiger! Go, check out their CCL Modem Scripting Release Notes – it’s all explained there.

Hope this helps some of you.

The coolest eeePC hack so far

Ok, this isn’t brand new, but I just found it… and haven’t even had the time to try it. But I have to give it extra points for coolness.

Dan at UneasySilence has figured out how to run Mac OS X on an eeePC. So after the default Xandros Linux, Fedora Linux, Debian, OpenSuSE, Ubuntu and of course Windows XP and even (Yikes!) Vista, the list of OSs to run on the eeePC is pretty complete now.

I’m still using the default Xandros install and Fedora, installed on an 8GB SD card, and switch between them via the BIOS… it’s still impressive that it’s possible :-)

Resizing Partitions on Mac OS 10.5 Leopard

Leopard moves the ability to resize partitions from BootCamp (which is no longer supported) to the disk utility. But there are some pitfalls.

  • You cannot have booted from the partition that you want to resize. This should be obvious, but there’s no documentation that appears to point that out, nor is the error message you get really useful (either “not enough space” or “the resource is temporarily unavailable”, both after the program works for quite a long time – come on, this is the first thing the application should check!)
  • You cannot have files larger than about 1GB on the partition if you want to shrink it. Again, no useful error message (only the “not enough space” one).
  • Related to the last point, on MacBooks and MacBook Pros there is a hibernation image /private/var/vm/sleepimage that is the same size as your system memory – 4GB in my case. Which you cannot delete unless you turn off hibernation and sleep support.

So here’s what you need to do.

  • Back up your data. I mean it. All of it.
  • Find all files larger than 1GB. I assume that you want to resize your / partition – if it’s another one, change the starting point of the following command accordingly. In a terminal window run
    sudo find -x / -regex /dev\* -prune -o -regex /net\* -prune -o -size +1G
    and look at the output. Since you made a full backup, delete the files that are 1GB or larger (which are the ones that should be listed by this command).
  • The one you can’t simply delete is the the sleepimage mentioned above. Follow these steps:
    • Save the current hibernation mode
      sudo pmset -g | grep hibernatemode > ~/current_mode.txt
    • Turn of hibernation
      sudo pmset -a hibernatemode 0
    • Delete the file
      sudo rm /private/var/vm/sleepimage
    • Don’t forget to restore the hibernation mode after you are done resizing your partition:
      sudo pmset -a hibernatemode `cat ~/current_mode.txt`
  • Now boot from your Leopard DVD
  • After selecting the language wait for the menu bar to show up and under Utilities pick the Disk Utility.
  • Click on your disk on the left, and click on Partition in the header of the main area of the window.
  • Now you can resize the partitions, add new partitions, etc.
  • Click Apply, wait for it to finish, and reboot the system.

Surprisingly hard – I think Apple could have solved this one better…

Using the Motorola Ming (A1200) as GPRS / EDGE modem on a Mac running Leopard

This is an update to an older post of mine that dealt with this same issue under Tiger. Since I wrote that post I have upgraded to Leopard and found out that things are once again different. So her are the instructions for Leopard.

Let’s start with something that has nothing to do with the OS your are running on your Mac. The Motorola Ming (or A1200) supports EDGE! It seems all phones shipped so far have this feature disabled, but there’s a detailed post that explains how to enable EDGE on Motorolahelper. Using EDGE appears to drain the battery even faster than using GPRS, but it does give you a nice speed boost (still nowhere near 3G speed, but at least now you are on par with an iPhone…).

But let’s get to the real story – making this work with Leopard!

Leopard changed the format of the Modem Scripts and brings many new configuration options. That’s all nice and well, except that the initialization sequence it uses for Motorola GPRS phones is simply wrong! So the first thing you need to do is to update the modem properties in
/Library/Modem Scripts/Generic GPRS.ccl/Contents/Info.plist. Double click it in Finder and the Property List Editor will open. Click on the little triangle in front of Root, then on the little triangle in front of CCL Personalities and then on the one in front of Motorola GPRS and finally CCL Parameters.

Now double click on the value that is there and replace it with &FE0V1&C1S0=0 and hit return. Click Save in the File menu and close the application.

Next you go through the steps to pair with the phone and setup the connection details.

  1. Enable Bluetooth on your Ming (you can do this with the Bluetooth application that you can find in the Home folder or via the the status screen that you get when clicking on the status bar that includes the battery indicator and time). Make sure you set it to be discoverable.
  2. On the Mac, open System Preferences -> Bluetooth.
  3. Click on the ‘+’ sign in the lower left corner which opens the Bluetooth Setup Assistant. Click Continue, select Mobile Phone and again click Continue
  4. You should now see your phone listed – if not, make sure it is still discoverable (that lasts only for 3 minutes) and make sure Bluetooth is turned on on your Mac.

  5. With your Ming highlighted click on Continue again. The Mac is “gathering information on your device”. If this is the first time you pair the computer with the phone via Bluetooth you’ll be asked to enter a numeric passphrase on the phone. Once that is done once again click Continue.
  6. On the next screen make sure that “Access the Internet with your phone’s data connection” is enabled and click Continue again.
  7. Now you are at the “Bluetooth Mobile Phone Set Up” screen. Select Phone Vendor Motorola, Phone Model GPRS (GSM/3G) (that’s the one we just fixed). Username tmobile, Password tmobile, APN internet2.voicestream.com and CID 2. Make sure that “Show Modem status in the menu bar” is selected.

The screen should look like this:

Bluetooth Mobile Phone Set Up

Clicking Continue again gets you to the final screen that sums up your settings.

Now you can click on the little phone symbol in your menu bar, select Bluetooth and connect to the internet!

Postfix and SpamAssassin on OS X Tiger

I wrote about setting up Postfix on Tiger before. But after quite a while of procrastination I decided I also wanted to do something about the flood of spam that was sent to hohndel.org. SpamAssassin seems to be the preferred method to go (if you are in the open source camp). It’s bundled with Mac OS X server – but why spend that money… it’s easy enough to set up from scratch.

These instructions are based on a posting by Kalinga Athulathmudali where he describes a similar setup, but not for OS X.

First make sure you have your CPAN setup straight. Some hints to make sure all is well are here.

Next, install SpamAssasin.
$ sudo perl -MCPAN -e shell
cpan[1]> install Mail::SpamAssassin
quit

Use the System Preferences of OS X to create a user named spamfilter. Give it a random password and make sure the user isn’t allowed to administer the system.

To work around a couple of issues with the way postfix deals with the return values of filters we’ll create a little script that will do the filtering.

# Clean up when done or when aborting.
trap "rm -f /tmp/out.$$" 0 1 2 3 15
# Pipe message to spamc
cat | /usr/bin/spamc -u spamfilter > /tmp/out.$$
/usr/sbin/sendmail -i "$@" < /tmp/out.$$
# Postfix returns the exit status of the Postfix sendmail command.
exit $?

Next we make sure that spamd is started whenever the system boots. For this we simply create an entry in the StartupItems – a tar file with the necessary instructions can be found on the SpamAssassin Wiki.

Now you need to make sure that SpamAssassin is called from postfix; edit /etc/postfix/master.cf with the following two changes. First make sure that smtp over inet looks like this

smtp inet n - n - - smtpd
    -o content_filter=spamfilter:dummy


and then add an entry for the spamfilter:

spamfilter unix - n n - - pipe
    flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter -f ${sender} -- ${recipient}


the last line starting with flags=Rq is actually one line; this WordPress theme makes it a little hard to render this correctly.

Run postfix reload to force postfix to read the new configuration and watch your logfiles to make sure that spamd is called correctly (remember that you need to start spamd as root in the background – or you can just reboot which will take care of that as well). Your /var/log/mail.log file should contain entries like this:

spamd[???]: spamd: connection from localhost [127.0.0.1] at port 49671
spamd[???]: spamd: setuid to spamfilter succeeded
spamd[???]: spamd: processing message for spamfilter:???

The final step is now to filter the spam mail from your normal mail flow. I prefer to use procmail for that. A simple entry like this in your .procmailrc file should do the trick (but that depends on the folder layout of your preferred mail client… as I mentioned before, I prefer mutt. In that case this should work:

PATH=/usr/bin:/bin:/usr/local/bin:.
SPAMMAIL=$HOME/Mail/spam

:0:
* ^X-Spam-Level: \*\*\*\*\*
$SPAMMAIL

With this all mail with a Spam-Level of five or more will not be in your normal inbox but instead in a mailbox named spam in your mail folder.

As always, corrections and suggestions for improvement are welcome.

Getting the Motorola Ming (A1200) to work as GPRS modem for a Mac

These instructions worked for me, using a MacBook Pro running Mac OS 10.4 (Tiger) and a Motorola Ming (A1200) running the generic 46p firmware and connecting to T-Mobile in the US via GPRS. Please let me know if they work or don’t work for you – and remember to check the A1200 forum at MotorolaFans.com

Step 1: preparing your Mac to use the phone

Add this Motorola Ming script to /Library/Modem Scripts on your Mac.

Next open a terminal window (Terminal can be found under Applications/Utilities) and execute the following:
echo ":192.168.0.254" > /tmp/options; sudo mv /tmp/options /etc/ppp/options
(you’ll have to type in your password here to authenticate as administrator in order to be allowed to write in /etc/ppp).

Step 2: getting your phone ready to connect

In the main menu click on Bluetooth. Click on the menu button (lower left corner) and switch the phone to be “Discoverable”.

Step 3: starting the communication on your Mac

Turn Bluetooth on on the Mac as well and start the Bluetooth Setup Assistant (you can get to that from System Preferences -> Bluetooth -> Devices -> Set Up New Device…). Search for “Mobile Phone” and it should list all the Bluetooth phones in the vicinity that are discoverable. Click on “Motorola A1200″ (or, if you have a China Mobile flash image, click on Motorola 明) and continue.

Next you need to exchange the secret key for pairing the Bluetooth devices (just follow the requests on both the computer and the phone) and then grant the computer access. After a moment the Mac will suggest that it can use the Address Book and offer Internet through the phone. Since we want to set up GPRS you need to select the “Use a direct, higher speed connection…” option (even though “higher speed” is rather subjective, here).

Next comes the “Bluetooth Mobile Phone Set Up” dialog. As username and password you can pick anything, tmobile / tmobile works. The GPRS CID String is *99***2#. As Modem Script pick the “Motorola Ming” script that we installed earlier. Hit Continue and you should be done here.

Step 4: dialing out

Start “Internet Connect” (under Applications). Click on Bluetooth. The Configuration should all be set up correctly, all you need to do hit Connect (for some reason I occasionally am asked to type in the password again – no idea when and why then – just type “tmobile”).

You should be connected!

Update: these instructions won’t work if you are using Mac OS 10.5 Leopard – they were written for 10.4 Tiger. I wrote another post on how to use the Ming as GPRS (and EDGE!) modem under Leopard.

Next Page »