Thursday, February 26, 2009

Uploading apps onto GoogleAppEngine behind a proxy

Was stuck for a while trying to upload my google app from the latest Google App Engine 1.1.9 - what should have been an instant upload turned out to be an all-day adventure because of the complication of behind a proxy that required user/password authentication...

But finally got it to work with the following steps (from a Win XP machine using Python v2.6.1)!

1) Install the Python patch 1424152 from http://bugs.python.org/issue1424152. They only have diff files there - so for those who don't know how to apply diff patches, I have attached the 2 PATCHED files (urllib2.py & httplib.py) for Python 2.6.1. Just replace your corresponding files in your Python26\Lib folder with these (WARNING - these files were patched specifically for Python 2.6.1. For any other Python version, you have to patch your appropriate file from the patch link above).

2) Download the latest ntlmaps proxy (v0.9.9?) from http://ntlmaps.sourceforge.net/
(its only 71kb!).
Change the following attributes in server.cfg: PARENT_PROXY, NT_DOMAIN, USER, PASSWORD.
You can leave the password empty and it will prompt you when you start ntlmaps.

3) Set the following environment values:
set HTTP_PROXY=localhost:5865
set HTTPS_PROXY=localhost:5865
(5685 is the default port used by ntlsmaps which can be changed in server.cfg)

4) Start up the ntlsmaps proxy by running runserver.bat (you might have to edit the
bat file to point to your actual python executable).

5) Test whether ntlsmaps is working by changing your browser proxy to point to
localhost:5865, and try to access some sites. If this fails, your proxy is probably
not understood by ntlsmaps or vice versa - try to finetune ntlsmaps some more.

6) Finally run your upload command:
appcfg.py update xyz/
Hopefully you should get something like this:
...\appcfg.py:40: DeprecationWarning: the sha
module is deprecated; use the hashlib module instead
DIR_PATH,
Scanning files on local disk.
Initiating update.
Email: xyz@gmail.com
Password for xyz@gmail.com:
Cloning 2 static files.
Cloning 5 application files.
Deploying new version.
Checking if new version is ready to serve.
Will check again in 1 seconds.
Checking if new version is ready to serve.
Closing update: new version is ready to start serving.
Uploading index definitions.

Tuesday, February 24, 2009

Error reading from file ... .msi Verify that the file exists and that you can access it

Got a confounding error that occurred when trying to install an msi file on windows XP:

(Error reading from file ... .msi
Verify that the file exists and that you can access it.)


After quite a bit of hair-pulling, I realised this was happening because I had removed Security rights to all users except myself for this folder... including the System group!

I suppose since the System is what performs actions on msi to unpack it, etc, it needs rights here.
So all I had to do was to put the msi file in a folder that has System rights.

In this case, I simply enabled access for System group to the directory and the problem was solved.



Friday, February 20, 2009

Dynamic Label Cloud Gadget

Was looking for a label cloud widget for the blog but was surprised to see no one had come up with any dynamic cloud generator... was a matter of merging a little unused math with simple javascript and the Dynamic Cloud Generator gadget was born.

If you're happy with the gadget (or even particularly upset!), for any feedback, queries or bugs do make a post in Google's gadget directory for this gadget here.
When posting problems, provide as much information like the Gadget properties, what browser the problem is seen, etc.

Gadget Properties:
Cloud Label Max Font Size
eg: 25
Provide the font size for the biggest (most occurring) label.

Cloud Label Min Font Size
eg: 8
Provide the font size for the smallest (least occurring) label.

Cloud Background Colour
eg: red, #aabbdd
Change this from the default value of '#FFFFFF' (white) if you want another background colour.

Cloud Link Colour
This is for choosing the colour of the cloud links.

Base Url For Label link (change this)
eg: http://devsac.blogspot.com/search/label
This is the URL for creating the links that appear on each of the labels in the label cloud - the URL is simply prepended to the Label tag. If the user clicks on the tag "Cool", the URL in this case would be http://devsac.blogspot.com/search/label/Cool

Feed URL to retrieve Labels from (change this)
eg: http://devsac.blogspot.com/feeds/posts/default
You can simply give your blog's Blogger RSS Atom feed (in this case, you can skip the below Label Element and Attribute properties). If you don't have a Blogger atom feed or have a non-standard xml file containing your labels, then provide that URL.

Name of Label Element in Feed URL
eg: category
Leave this with default value as "category", if you provided a Blogger Atom RSS feed for above Feed URL property.
Otherwise, provide the name of the element that contains the labels in your xml.

Name of Label Attribute in Feed URL
eg: term
Leave this with default value as "term", if you provided a Blogger Atom feed for above Feed URL property.
Otherwise, provide the name of the attribute containing the labels in your xml.

Ignore Label Attribute in Feed URL
Leave this as default unchecked if you provided a Blogger RSS Atom feed for above Feed URL property.
Enable this if you are provided a Feed URL that stores the the Label as a value in the Label Element and not in an attribute (such as the RSS feed from Feedster).

Minimum Label Occurences
This is an optional property which will be skipped if it has default value of 0.
This can be used when only those labels that occur more than a minimum count need to be displayed in the cloud.
For e.g.:, if you want to consider only labels that have occurred more than once, then give 2 for this property.

Maximum Label Occurences
This is an optional property which will be skipped if it has default value of 0.
This can be used when only those labels that occur less than a maximum count need to be displayed in the cloud.
For e.g.:, if you want to consider only labels that have occurred less than 100 times, then give 99 for this property.


Updates:
v0.008 [25-May-09]:
Added new properties, min and max label occurrences for feature request from Randi Helene Tillung.
v0.007
Fixed bug that left out border of gadget when setting background colour, Raised by Eemil.
v0.006
Fix for bug in "Ignore Label Attribute" option.
v0.005
Added
"Ignore Label Attribute" option for those who have non-Blogger rss feeds like Feedster RSS.


Properties, etc can be viewed at this Google page.
 
Superblog Directory