Posts Tagged ‘Google’

Using Linode DNS Manager for Google Apps

Monday, December 8th, 2008

I've hosted a few websites for other people and have used Google Apps to handle mail and calendar needs. This way I'm just using my Linode to only host the webpages. After manually creating the Google Apps DNS records a few times, I decided it'd be best to write a script using Linode's API to automate the process.

Since I haven't written a Perl script from scratch in awhile, I thought it would be good to use that. Michael Greb, who works at Linode, published a Perl module on CPAN called "WebService::Linode". Mike also posted some really helpful information regarding the installation of Perl modules under Ubuntu Linux. Instead of downloading, compiling, and installing the module the old fashioned manual way, you can use dh-make-perl. The dh-make-perl program will do all of that for you and create a Debian package file to install. This way if the CPAN module is ever upgraded or becomes part of the distro, it'll be handled automatically. I used the following commands to install the module (I also had to do the same thing for JSON because my installed version was too old).

$ dh-make-perl --cpan JSON --build
$ dh-make-perl --cpan WebService::Linode --build
$ sudo dpkg -i libjson-perl_2.12-1_all.deb libwebservice-linode-perl_0.02-1_all.deb

Once the prerequisites are installed, you can download the googleapps-dns.pl script from my Git repository.

On the first run it will prompt for the Linode API key and store it in ~/.linode-api. Subsequent runs will simply read the key from that file. Below is an example of how it's usage.

$ googleapps-dns.pl -h
Usage:
    googleapps-dns.pl [ -d domainname ] [ -m ] [ -c ] [ -f ] [ -v ] [ -h ]

Options:
            -d domainname
                    Specify the domain name for adding the records.  This field is
                    required.
            -c      Add Google Chat's Jabber and XMPP records to route external
                    chat program to Google's services.
            -g      Add CNAMES that point calendar.domainname, docs.domainname,
                    mail.domainname, sites.domainname, and start.domainname to
                    ghs.google.com.
            -m      Add MX and SPF records for routing mail to Google Apps.
            -f      Force deletion of any conflicting records.
            -v      Enable verbose debugging messages.
            -h      Display help and options.

$ googleapps-dns.pl -d example.com -g -m -c
Would you like to delete any conflicting dns records? [Y/n] y
Please enter your Linode API Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$

I hope this is helpful for other people managing sites hosted on Google Apps.

Googly Goodness

Thursday, November 20th, 2008

I've been impressed with Google recently.  I've started using Google Reader again.  I used it for awhile when it first came out, but I think some RSS feeds were glitchy or it could have been Google Reader in general.  Maybe I just got distracted by some other shiny object and stopped paying attention to it. But, it seems good now and you can share items with friends from your Gmail contact list. So, I'm starting to "share" items now that perk my interest.

This week Google added themes for Gmail.  It took awhile for them to show up for my account, but they're finally here!  So far, I like the shiny and silver lining theme.

The last thing is somewhat unrelated, but awesome nonetheless.  Well, technically Google owns Youtube.  For your viewing pleasure, here's Bike Hero..

http://www.youtube.com/watch?v=NlMYWuGUZlM