Show AdSense Only on Post Pages

If your blog covers a variety of topics, the relevance of Google AdSense ads on the main/index page suffers as it tries to figure out what to display. To minimize this problem, you can restrict the ads to the post pages only where the content is more focused. Here’s how to do it on Blogger.

  1. Log into your blog
  2. Click the Template tab
  3. If you don’t already have an AdSense widget on your blog, add one on the Page Elements page
  4. Make a backup of your template by clicking on the Download Full Template link
  5. On the Edit HTML page, select the Expand Widget Templates checkbox
  6. Scroll down to about the bottom quarter of the template contents (the position will vary based on the template you’re using and number of widgets in your blog)
  7. Look for the following widget code (if you have more than one AdSense widget, there will be more than one of these code blocks, each with a different id)
    <b:widget id=’AdSense1′ locked=’false’ title=” type=’AdSense’>
    <b:includable id=’main’>
    <div class=’widget-content’>
    <data:adCode/>
    </div>
    </b:includable>
    </b:widget>
  8. Add the following <b:if> and </b:if> tags so that the widget looks like the one below
    <b:widget id=’AdSense1′ locked=’false’ title=” type=’AdSense’>
    <b:includable id=’main’>
    <b:if cond=’data:blog.pageType == “item”‘>
    <div class=’widget-content’>
    <data:adCode/>
    </div>
    </b:if>
    </b:includable>
    </b:widget>
  9. Repeat for any other ad widgets you have on your blog
  10. Save the template and then view your blog

The contents of the ad widget should now only appear when viewing an individual post.

Note that the Blogger help topic, Page Elements Tags for Layouts, indicates that a widget tag can have a pageType attribute that, when set to “item”, is supposed to display that widget only on post pages. However, it didn’t work for the AdSense widget. So, I added an if condition to the widget’s contents instead.

I’m not sure if pageType was intended not to work on the AdSense widget but, since this technique helps the relevance of the ads, hopefully no one will complain. If you know a better way to handle this or how to get the pageType attribute to work properly for this widget, leave a comment.

Transfer Palm Treo Data to Blackberry Curve


A friend called me up tonight because he had run into an insurmountable obstacle. He wanted to transfer the contacts from his Treo 680 to his new Blackberry Curve. Simple, right? It comes with software to do that. Well, even after spending hours and hours with AT&T and RIM support, he was left without a successful migration. Even the software tool that’s supposed to transfer the data directly from a Palm Treo to the Blackberry Curve failed to work–it didn’t allow him to select the Treo device as the data source even though it was plugged into the PC. If you’re in this situation as well, here’s how we got the job done.

Note: Since I don’t own these devices, this is written from memory (very recent memory; half an hour ago). Thus, the actual names of some things such as menu items may be slightly different but that won’t prevent you from carrying out the steps.

Before you begin (things you’ll need):

  1. Palm Desktop (the software that came with the Palm Treo)
  2. Blackberry Desktop (the software that came with the RIM Blackberry)
  3. Microsoft Outlook 2000 or newer (even if you don’t normally use it, you’ll need it to act as a translator and synchronization source for the address book data)
  4. Blackberry device and sync cable

Exporting/importing the data:

  1. Start Palm Desktop. (The latest version as of this writing is 4.2 although Palm’s own web site only has the older version 4.1.4 available. [Update: apparently 4.2 has compatibility problems so Palm reverted to an earlier version on their site.])
  2. Create a new entry and in every field, put the name of the field as the value for the field (e.g. in the Last Name field, enter Last Name; in the First Name field, enter First Name). This will make it easier to do the data mapping later.
  3. Go to the address book and select all the entries you want to export (choose Select All from the Edit menu to choose everything). Failure to select entries will result in only the first one being exported.
  4. Choose Export from the File menu.
  5. Choose the file type as CSV (comma-separated value).
  6. Enter the name for the file (e.g. Contacts.csv) and remember where you’re saving it.
  7. Start Microsoft Outlook.
  8. Open your Contacts.
  9. Select Import from the File menu.
  10. For the file type, select Windows CSV or DOS CSV (the name may be different in your version of Outlook).
  11. Select the file you exported in step 6.
  12. If Outlook doesn’t automatically map the fields in the CSV file, you’ll have to map them manually. The easiest way to do this is to go to the address of the person named Last Name (remember that you entered this in step 2?) so that you can easily see which field is which in the CSV file. Then assign them to the appropriate field name in Outlook (the method to do this may vary with different versions of Outlook).
  13. Click the Finish button to import all the addresses.
  14. Go to the Blackberry Desktop and open the synchronization utility.
  15. On the configuration tab, make sure that the Address Book is associated with Microsoft Outlook (there will be a double-headed arrow between the two).
  16. Plug the Blackberry into your PC with the synchronization cable.
  17. Watch all the messages go by as the data is synchronized.
  18. When the sync is done, disconnect the Blackberry and check that everything appears in the Blackberry’s address book. If it doesn’t, reboot the Blackberry (not sure why this is necessary but my friend’s Blackberry wouldn’t show the new data until he took the battery out and put it back in).

That should do it. If you don’t have Outlook, then Outlook Express may also work. I believe I saw it as an option in the Blackberry synchronization software’s configuration options.

Remove Blog Name from Page Title on Blogger.com for Better SEO

By default, the page title of individual blog posts on Blogger.com begin with the name of the blog. Unless your blog name contains keywords relative to your post, they don’t help the ranking of the page by search engines.

For better search engine optimization (SEO), you want to put the blog name at the end of the title after all the good keywords from the post’s heading text. Siege’s blog, Widget-based, has a nice template hack to fix the page titles. The title of the main page won’t change (it’ll still contain the blog’s name) but the title of individual post pages will place the post’s heading first, followed by the blog’s name.

Open Source Alternatives


Are you looking for an open source alternative to a well-known commercial application? Do you use an open source program and want to see what commercial product is similar? Well, check out Open Source Alternative, a directory of cross-referenced open source and commercial applications.

You can browse by categories such as business, communications, multimedia and web development or search the directory by application name. On a program’s detail page will be a short description, a link to its web site, the platforms that are supported (Java, Linux, Mac, Unix and/or Windows), and a list of alternatives. For a commercial product, open source alternatives are listed. For an open source product, commercial alternatives are listed. I’ve found it to be a very handy resource for locating software solutions.

Encrypt Synergy Connections with SSH

If you’re using Synergy, all of your keystrokes are sent over the network as cleartext because Synergy does not provide any encryption. In other words, unless you’re using a private network to connect your computers, anyone can sniff the data to see what you’re typing to client computers including passwords, credit card numbers and other sensitive information.

The good news is that it’s not too difficult to prevent snooping by using OpenSSH. The Synergy Network Security Guide shows you how to do this on Linux/Unix-based systems (which should work similarly on Mac OS X).

The bad news is that if your Synergy server or client is on Windows, setting up OpenSSH isn’t as straightforward. I was in this situation for quite a while and, after several unsuccessful tries, I put it on the shelf for a while. Well, tonight I found a very good resource to get OpenSSH working on Windows. I successfully set up a Synergy/OpenSSH server on a Windows XP laptop and connected a Linux client to it.

Note that if you’re using QuickSynergy to set up a client on Linux or Mac OS X, you can simply enter localhost as the server name in the QuickSynergy dialog instead of running synergyc -f localhost as described in the last step of the Synergy Network Security Guide.

Bear