Google
 

Sunday, February 16, 2014

My sad experience with Google app engine and domain names

So I decided to use Google app engine to host a small website. And no, it's neither the the programming language I'm not familiar with (python, it's cool and I like it by the way) nor the bad development and debugging experience that I had, is what I'm going to tell about this time. So what is it about? read on.

Pick a nice name for your baby
It was super easy to create an app with a temporary name like example.appspot.com. I reserved the domain name with the hosting company I'm used to. So I just need to assign the domain name to the GAE site and that's it. Quite a common task, right?  Sadly not.

You need a Google apps account
First, you need to create a Google apps account. You can't just assign the domain name directly. Anyway, not a big deal when apps had a free tier, but this is no longer the case. So I tried to use my existing free Google apps account that I've created years ago.
For Google to verify your ownership of the domain,  you have to add a value to the domain name DNS records. This sounds OK to prove that you control the domain. To get that value you should go to the Google apps administration page (https://admin.google.com) and click "more controls" then scroll to the right to find the "domains" icon.
Then you should select to add a new domain. and after you get the CANME or TXT record value to add to your DNS and wait for verification,  the domain should now be available for use. Except that it's not.
To make the domain point to the application you created (example.appspot.com) you need to go to the administration home page and select the "App Engine Apps". Then select "Add Services" and enter the app Id.
And now, you select to add a URL to access the app, just to find that you cannot use the domain you've just added!! You can add a sub-domain of the original Google app service login!. What's the point in verifying another domain? I don't know!

Anyway. I went to another option by applying for a new Google apps account with a 30 days trial. And after the tedious steps of domain verification and service addition, finally I have my domain pointing to my GAE app. Hopefully, the domain will still work after the free trial expiration.

End of story? never.


Naked domains: 
Whether you should add www before your domain name or use naked domains is a religious war that I'll not discuss here. But if you want to use naked domains with GAE you're out of luck. It's not supported. 
So if the user writes (example.com) in the browser's address bar, he's not going to your app. You must redirect the user to (www.example.com). Some domain registrars support this feature, but my hosting company doesn't, so I had to do it myself. I pointed the domain (example.com) to a site on my hosting space, and used an asp.net HTTP module to redirect requests to the www version (www.example.com).

Note: Apparently, there is another way to do it. But I'm not sure how get it to work using my hosting provider control panel.

And some spam
Since I did not configure email on my newly created Google apps account, Google kept sending me emails about how much I'm missing. OK. I did not need all this mess in the first place.

Just Why?
My guess is that the whole experience is geared towards promoting the apps model from two sides: you should have a Google apps account, and you should purchase services from Google market place.
The experience was not friendly for people like me, who just wanted to created a web site. When did the www boom happen exactly?

Monday, January 6, 2014

Articles I read in 2013

A new year, a new list...

2012's list can be found here
2011's list can be found here
2010's list can be found here
2009's list can be found here
2008's list can be found here 
2007's list can be found here


Friday, May 24, 2013

Output to multiple destinations in PowerShell

Sometimes you need to output a result of a Cmdlet execution or a variable to screen and a file, for example if you want to log all operations in a script in addition to showing the output to the user.
Calling both Out-Host and Out-File for each operation is clearly not a good option.
The nice Tee-Object Cmdlet can perform this functionality, but till before version 3.0, it cannot append output to an existing file. So be it, I have to code it:


function Out-All([string]$FilePath, [switch]$Append)
{
    Begin
    {
        if($Append -eq $False)
        {
            New-Item -Path $FilePath -ItemType File -Force
        }
    }
    Process
    {
        $_ | Out-Host
        $_ | Out-File -FilePath $FilePath -Append
    }
}



The above function writes the pipline input to both a file using Out-File and screen (or whatever taking the output) using Out-Host. The advantage is that it has the Append  switch.
The Begin block which executes before processing the pipline data checks  the Append switch and creates a new file (or not) accordingly.
The Process block is responsible for the actual writing of data.

Sample use:

(1..100) | Out-All -FilePath "C:\log\data.log"

(1..100) | Out-All -FilePath "C:\log\data.log" -Append

dir | Out-All -FilePath "C:\log\data.log" -Append

Thursday, January 3, 2013

Articles I read in 2012


So it's a new year!! 2012 was a year full of excitement for software lovers. The cloud service providers are competing for the good of the developers and businesses. Mobile technologies continue to emerge and steadily taking more market share from PCs. Also Microsoft released a series of new products.
In this list of articles I read in 2012, you might notice that not all articles are purely technical as I'm trying to find a way in the startup world.

2011's list can be found here
2010's list can be found here
2009's list can be found here
2008's list can be found here 
2007's list can be found here