#hints


Find Duplicates in Address Book

Ever had the sit­u­a­tion where you have synced your iPhone (to iTunes OS X) and hap­pen to sync both the con­tacts from your Address Book and Google Con­tacts? Or, just hap­pen to add some­one’s new con­tact info as anoth­er con­tact-card? Well, here’s how I cleaned and merged dupli­cate con­tacts so that my Address Book per­forms like a champ.

  1. Launch Script Edi­tor (Applications/AppleScript/Script Edi­tor)
  2. Paste the fol­low­ing code snip­pet
    tell application "Address Book"
        set biglist to {}
        set theGroup to count every person
        if not (exists (group "Duplicate Entries")) then
            make new group with properties {name:"Duplicate Entries"}
        end if
        set the_names to the name of every person as list
        repeat with i from 1 to number of items in the_names
            set this_Name to item i of the_names
            set theName to name of person this_Name as string
            if this_Name is not in biglist then
                copy this_Name to end of biglist
            else
                add (people whose name is theName) to group "Duplicate Entries"
            end if
        end repeat
        save addressbook
    end tell
  3. Save your new­ly cre­at­ed script (would usu­al­ly default to ~/Documents/AppleScripts/), and just open/run it

Now, the eas­i­est way to fig­ure out if its run­ning or not (at least for me) was to run the Activ­i­ty Mon­i­tor and sort by CPU. I sim­ply just wait­ed to see if Address Book would climb to the top doing 90+, and back down to nil. When this is done, you should be able to see a group called “Dupli­cate Entries”. From there, you may now sort through the details and delete the ones that you don’t need.

Note: You can also do a quick merge via Address Book itself from dupli­cate con­tacts. How­ev­er, you won’t be able to see which con­tacts are being merged as its just a set-it-and-for­get kind of deal. If you do not care and sim­ply just want to get rid of those dupes, you can do so by doing the fol­low­ing:

  1. Launch Address Book
  2. Select Card from its menu
  3. Then, select Look­ing for Dupli­cates… and just go through the fol­low­ing prompts after search results fin­ish­es

How Not to Use Default Gateway on VPN (PPTP) in Mac OSX

Well, after search­ing for hours and hours, I have final­ly found a solu­tion to a small but trou­ble­some prob­lem. The prob­lem (if you call it that) occurs when I tried con­nect­ing to my work’s VPN. Rather than not using my work’s gate­way when con­nect­ed, OSX does this by default. Hence, you can see and hit your inter­nal IPs but not resolve the rest of the inter­net.

In Win­dows XP, this may be dis­abled via the fol­low­ing:

  1. Open Net­work Con­nec­tions
  2. Under Vir­tu­al Pri­vate Net­work, open the Prop­er­ties of your con­nec­tion
  3. Click and open Prop­er­ties for “Inter­net Pro­to­cal (TCP/IP)”
  4. Click on Advanced
  5. Dis­able “Use default gate­way on remote net­work”
  6. Hit OK, OK, and then you’re done

Although it’s easy in Win­dows XP, I could­n’t fig­ure it out for OSX. I searched and search to final­ly get this arti­cle from macosx­hints, Avoid Cre­at­ing PPTP Default Routes. The hints at the very bot­tom of the com­ments helped some­what, but did­n’t get me to view my inter­nal IPs—which was the reverse of the orig­i­nal prob­lem. Luck­i­ly, with a lit­tle bit more search, I land­ed on this arti­cle page by Chris­t­ian Stock­er on Chang­ing default routes on OSX on VPN. Though it was the same as the pre­vi­ous page from macosx­hints, I saw this short and sweet reply which hap­pen to have fixed every­thing:

lon­nie @ 22.08.2006 19:22 CEST
Inter­net Con­nect 1.4.2 has

Con­nect Menu -> Options…

|X| Send all traf­fic over VPN con­nec­tion

Uncheck­ing should do the same.

I hope this arti­cle could be of help, and save those who are look­ing for the same solu­tion san­i­ty and time.

Mac OSX Read and Write to NTFS Drive

Just in case you guys are try­ing to use one exter­nal dri­ve for both Win­dows and Mac envi­ron­ments (as in my sit­u­a­tion), here’s some­thing that will save you all the grief and hours of sit­ting in front of your Macs

  1. Down­load the lat­est Mac­FUSE Core DMG file and restart
  2. Down­load the lat­est NTFS-3g + Mac­FUSE Tools (and Unin­staller if you want) from Fill­ing the Gap NTFS-3g page via NTFS-3G for OS X Revived Blog
  3. Plug-and-play with your exter­nal. It should show up mount­ed auto­mat­i­cal­ly. If not, do a quick restart.

Hope that helps.

PS. The steps above is more updat­ed that what was post­ed over at this MacOSX­Hints arti­cle.

Update 2007-04-28
Grab Win­Clone if you’d like to backup/restore your Boot­Camp par­ti­tion. Great if you’d like to try out Par­al­lels using that WinXP NTFS par­ti­tion.

Update 2008-08-13
Step #2 above has been updat­ed, which links to the lat­est NTFS-3G for OS X devel­op­ment.