Monday, November 15, 2010

Migrating Email From Apple Mail to Windows Live Mail

Yes, some people really do leave Apple for Microsoft...

This applies only to Apple Mail found in Leopard and Snow Leopard - earlier versions store and handle mail differently.

  1. create mbox2eml.pl, and put it on your $PATH
  2. #!/usr/bin/perl -w

    # Copyright (C) 2009 Josh A. Beam
    #
    # Permission to use, copy, modify, and/or distribute this software for any
    # purpose with or without fee is hereby granted, provided that the above
    # copyright notice and this permission notice appear in all copies.
    #
    # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

    # mbox2eml.pl (last modified July 14, 2009)
    # This Perl script creates separate .eml files for each email message in
    # a given mbox file. The .eml files are created in the directory that the
    # script is run from and each file is named according to the position of
    # the message in the mbox file (for example, "1.eml" for the first message).

    use strict;

    # make sure an mbox filename was given
    if($#ARGV != 0) {
    print STDERR "Usage: $0 \n";
    exit(1);
    }

    # open mbox file
    open MBOX, $ARGV[0] or die "Unable to open mbox file\n";

    # loop through each line from mbox file
    my $fileCount = 0;
    my $blankLineCount = 2;
    while(my $line = )
    {
    chomp($line);
    $line =~ s/\r//g;

    # check for the start of a new message
    if($blankLineCount >= 1 && $line =~ /^From /) {
    # open new eml file
    close EML;
    open EML, ">" . ++$fileCount . ".eml";

    print "Saving " . $fileCount . ".eml\r";
    } else {
    # write line to file
    print EML $line . "\n";
    }

    # check for blank lines
    if($line eq "") {
    ++$blankLineCount;
    } else {
    $blankLineCount = 0;
    }
    }

    # close files
    close EML;
    close MBOX;

    print "Saved " . $fileCount . " files\n";

  3. mkdir ~/someFolder
  4. cd ~/Library/Mail
  5. find . -type d -iname '*.mbox' -exec cp -R "{}" ~/someFolder/ \;
  6. cd ~/someFolder
  7. for directory in *.mbox ; do mkdir "${directory}-email" ; done
  8. for directory in *.mbox ; do mbox2eml.pl "${directory}/mbox" ; mv -v *.eml "${directory}-email" ; done
  9. rm -rf *.mbox
  10. Copy someFolder to the Windows computer
  11. Run File -> Import from Windows Live Mail - choose Live Mail format when asked

Thursday, March 25, 2010

Sync Google Contacts to OSX Address Book Without An iPhone

Lifehacker had a quick note pointing out when Apple added their 'sync to Google Contacts' option to OSX 10.5 and 10.6. You had to have an iPhone or iPod touch to use it though.

Shortly after that someone pointed out to them how to hack the ipod plist file to make it think you have one, thus turning the option on.

They didn't point out that if you have had multiple iPods attached to your machine, you'll have multiple entries to choose from when altering the 'Family ID' tag.

I had an entry for my iPod mini, which has long since died and gone to the recyclers. I figured that was the perfect one to change. So I altered the plist with vim, started Address Book and there's the option just like promised. I enabled it, and nothing happened.....

It turns out that syncing to Google in 10.5 is done only when your iPod syncs. (10.6 will do it hourly as well) Then I had a thought. I pulled out my Motorola cell phone which I enabled syncing on previously, and launched iSync.
Tada! When it synced the phone, it synced with Google too.

Tuesday, March 23, 2010

Quick How To - Fix HP 5610 Phantom Paper Jam and Cartridge Jam Errors

Thanks jfasher whoever you are...

http://www.fixya.com/support/t246039-hp_5610_paper_jam_error_clear

The HP 5610 has a clear plastic 'ribbon' above the bar supporing the print heads.
The sensor on the back of the cartridge carriage reads the marks on that ribbon to know when it's moving. It was filthy.

There's a similar clear plastic disc on the end of the paper feed rollers.
You've got to disassemble the printer from the top down, carefully disconnecting the data ribbons as you go to get down there. Cleaned it and blew out the sensor it rotates thru and voila! Phantom paper jam gone to the containment unit :-)

Sunday, February 7, 2010

Quick How-To: Login without a password, Debian/Ubuntu using GDM

Why? (Yes, I know you wanted to ask)
He's three - he can pick his picture from a list, but asking him to remember his password is pushing it a bit I think...

This isn't as easy as you'd think. For the whole dirty story, see this Launchpad entry.

For the quick how to

Make it possible to log in on a console without a password by starting up a terminal and typing:
sudo passwd -d usernameGoesHere

Change the login screen to use a list of users you can click on by going to System -> Administration -> Login Window and after putting in your password select the Local tab. Under Style, pick one of the options that mention a face browser.

Still won't work yet though :-) Last, add 128 (yes, 128) lines to /etc/securetty
It should look like this

# Local X displays
:0
:0.0
:1
:1.0
:2
:2.0
:3
:3.0
and keep going until you hit 63

Hope this helps...