Missing “sync with google” on mac os 10.5.8 address book

If you want to sync your address book to google, you can do it directly from your address book.
some Leopard macs will not show this options and the following will fix it.

Open terminal
Copy and paste the following:

echo "\"{ Devices = { red-herring = { 'Family ID' = 10001; }; }; }\"" >>
~/Library/Preferences/com.apple.iPod.plist

quit/start your address book

Clean up your mac caches

This is an aggressive fix, but one I had to take after numerous ( thousands ) or syslog errors :

2/3/10 6:08:50 PM   com.apple.launchd.peruser.502[407]  (com.akamai.client.plist) Throttling respawn: Will start in 10 seconds
2/3/10 6:08:59 PM   [0x0-0x12012].com.adiumX.adiumX[452]    (process:452): Json-CRITICAL **: json_node_get_int: assertion `node != NULL' failed
2/3/10 6:09:00 PM   com.apple.launchd.peruser.502[407]  (com.akamai.client.plist[6584]) Bug: launchd_core_logic.c:4103 (23932):13
2/3/10 6:09:00 PM   com.apple.launchd.peruser.502[407]  (com.akamai.client.plist[6584]) posix_spawn("/Applications/Akamai/loader.pl", ...): No such file or directory
2/3/10 6:09:00 PM   com.apple.launchd.peruser.502[407]  (com.akamai.client.plist[6584]) Exited with exit code: 1

I followed this process ( found in mac forums ):

WARNING: “rm -rf” IS A DANGEROUS COMMAND, MAKE SURE YOU KNOW WHAT YOU ARE ERASING !!!

boot to single user : (CMD+Option+S) and run the following commands :

fsck -fy
rm -rf /Library/Caches
rm -rf /Users/YOURUSERNAME/Library/Caches
rm -rf /.Spotlight-V100

reboot

ldap_add: Invalid syntax (21) – fix

This error was driving me nuts:

ldap_add: Invalid syntax (21)
    additional info: objectClass: value #0 invalid per syntax

despite looking at my ldif a hundred times, until I relized my perl script added white space at the end of the line ….

        print "objectClass: top\n";
    print "objectClass: person \n";
    print "objectClass: organizationalPerson \n";
    print "objectClass: inetOrgPerson \n";
    print "objectClass: mozillaOrgPerson \n";
    print "objectClass: evolutionPerson \n";
    print "objectClass: simpleSecurityObject \n";

once changed to :

       print "objectClass: top\n";
    print "objectClass: person\n";
    print "objectClass: organizationalPerson\n";
    print "objectClass: inetOrgPerson\n";
    print "objectClass: mozillaOrgPerson\n";
    print "objectClass: evolutionPerson\n";
    print "objectClass: simpleSecurityObject\n";

The ldap gods were smiling again, hope this saves someone some time.

Parse a csv file using perl

While parsing and converting some CSV files to ldif’s I needed a perl script, the Test::CSV module is helpful :

#!/usr/bin/perl
use strict;
use warnings;
use Text::CSV;

my $file = ‘prospects.csv’;

my $csv = Text::CSV->new();

open (CSV, “< ", $file) or die $!;

while () {
if ($csv->parse($_)) {
my @columns = $csv->fields();
print “@columns\n”;
} else {
my $err = $csv->error_input;
print “Failed to parse line: $err”;
}
}
close CSV;

Centos : permission denied when mounting nfs share from client

one thing to check is that /proc/nfs is there, if not , mount it.

mount -t nfsd nodev /proc/fs/nfsd