If you try to use public key SSH with GIT on ubuntu 11.10 and it doesn’t see your key it is probably because you don’t have a config file in .ssh.
Go into your .ssh dir and create a config file.
Inside that file you can make it look something like
Host *
IdentityFile /path/to/your/private/key/endingWithYour.key
And then it will all automagically work like all good tech does.
Greetings all 3 of you that are still left:
I am sorry that twitter and fb and work and other stuff have sucked up my energy to write. But I find myself inspired to write more and I don’t want to do it anymore on FB or just twitter. FB is too chatty and twitter, well the 140 chars is great for some stuff but nor for the thoughts and ideas I am having.
So here it is – I am going to write more (I almost said “try to write more” but my therapist would have chided me that “try” is just another way of saying “I am not going to”).
I have a post brewing on my recent job change and other changes in my life. Given the inspiration I have gained from others in their blogs – everyone from Dooce and Dad Gone Mad to Mark Pilgrim and Matt Raible – I am going to be writing about more than code and spatial. As a matter of fact I will write about them some but right now in my life those are not my best contributions to the world. For a while I am going to write more about personal stuff. I did a bit with the cancer but now I am going to return to that and to other things I have grappled with.
Today I read this phenomenal article about a wife dealing with her husband’s issues dealing with his brothers suicide. And this quote just hit right what I have been feeling when I wrote my cancer posts and why I want to write…
Geof gave me the trust, the love, and ultimately his permission to tell his story, believing that storytelling lifts us all up, beyond regret, irrespective of forgiveness, into that place where our shared humanity surpasses our individual pain.
And I hope that my stories and sharing can help others feel less alone, see some of the mistakes I made before they make them, appreciate their lives that much more, or just bring some good in the world.
So welcome back and expect more…
Hey all:
If you like to use filezilla for all your sftp/scp’ing needs AND you are using EC2 (which uses keys only) then this little “how to” is a life saver. Very very nice.
A while ago I wrote this in the online doc for postgres after getting some help on IRC. I Had trouble finding my own comments again but then doing a vanity search research I found the comments – putting them here so it is easier for me to find.
I would love to see more hints or other peoples experience. Postgresql tuning is one of the least explained pieces of Postgresql.
So without further ado – here are some notes for tuning Postgres when your machine has more than 4 gigs of RAM (which is most servers now).
From AndrewSN on the IRC Channel here is the config setting for a Unix like machine with RAM >= 4g
shared_buffers = 5% to 10% of physical RAM
effective_cache_size = 50%-75% of physical RAM (unless you’re using 8.1 or older, in which case 75%-100% of physical RAM)
wal_buffers = 8M
maintenance_work_mem = 384M (or so, there’s not usually much to gain from going higher)
work_mem = this one is harder, since it depends a lot more on the query workload than the others; 16M to 64M might be a reasonable starting point
the more concurrent connections you have doing complex queries, the smaller that needs to be
max_fsm_pages is determined more by the on-disk size of your db than the size of the server. estimate or measure the on-disk db size, divide by 16k, and use that as a starting point
if you use temp tables a lot, a modest increase in temp_buffers may help if you have a lot of RAM.
checkpoint_segments = 32 ?
checkpoint_segments is worth increasing if you have a heavy write load and don’t mind a lot of disk space used for pg_xlog. It does slow down recovery after a crash or unclean shutdown.
I personally increase default_statistics_target to 100 by default regardless of the size of the server
Alright so my brain is really starting to get there with some of this language difference in Python over Java. I am not really close to getting to the cooler features or generators or lambda expressions but I am getting better at getting code to work. So as a PSA here is an example of using Python to interact with the Mashery API. It does some http work, some JSON RPC, some time, and some MD5 stuff. Hope you enjoy and of course would love any feedback.
1 import json 2 from json import JSONEncoder 3 import time 4 import hashlib 5 import http.client 6 7 __author__="scitronpousty" 8 __date__ ="$Jan 11, 2011 10:18:04 AM$" 9 10 11 apiKey = "wewewewewewewewsu" 12 sharedSecret = "97ewewewewewwe" 13 14 #Not using because we are only doing read only operations 15 #sandboxAPIKey = 16 #sandboxSharedSecret = 17 18 endpoint = "api.mashery.com" 19 #sandboxEndpoint = "api.sandbox.mashery.com" 20 21 path = "/v2/json-rpc/789" 22 #sandboxPath = 23 24 def buildAuthParams(): 25 """This function takes our API key and shared secret and uses it to create the signature that mashery wants """ 26 authHash = hashlib.md5(); 27 #time.time() gets the current time since the epoch (1970) with decimals seconds 28 temp = str.encode(apiKey + sharedSecret + repr(int(time.time()))) 29 authHash.update(temp) 30 return authHash.hexdigest() 31 32 33 34 if __name__ == "__main__": 35 36 #make an http connection object pointed at the endpoint 37 conn = http.client.HTTPConnection(endpoint) 38 39 40 #This the mashery JSON-RPC query code 41 paramsForKeys = JSONEncoder().encode({'method': "object.query", 'params': ["SELECT name, keys.apikey from applications where username = 'scitronpousty'"], 'id':1}) 42 43 #Headers required by mashery 44 headers = {"Content-type": "application/json", "Accept": "text/plain", "Content-length": repr(len(params))} 45 46 #send the whole shebang over to mashery 47 conn.request("POST", path + "?apikey=" + apiKey + "&sig=" + buildAuthParams() , params, headers) 48 49 resp = conn.getresponse() 50 51 #response data is a binary string and I want to read it easily 52 responseObject = resp.read().decode() 53 54 #doing a little pretty formating to get it to look nice on my output terminal 55 print(json.dumps(json.loads(responseObject), sort_keys=True, indent=4)) 56 57 #just being safe here 58 conn.close() 59 60 61
[UPDATE - didn't understand as much as I thought I did. I think my third assignment is just telling Python that the class and my maprequest3 are the same object. Back to the drawing board)
So here is a little gotcha for Java (and probably .NET) developers when do OO work in Python. When coding in Python it is possible to change the default value of the Class at runtime.
Almost all the examples of OO in python show all the instance variables being set in the constructor but I didn’t want to do that. So I started digging into some open source python projects – like shapely and saw the _ in front of the instance variables and thought that might be the key. It is not. _ in front of a variable is only a coding convention to other developers that this should be treated as private.
In re-reading the docs and playing with code I finally figured it out.
Here is the code that I used to look at what was happening:
First the objects
class GenericRequest: RID = Nonedef getRID(self): return self.RIDdef __init__(self): passclass MapRequest(GenericRequest): _imgDims = None def __init__(self): GenericRequest.__init__(self)
Now the test code
print(MapRequest.__dict__)
MapRequest.RID = "You are screwed"
print(MapRequest.__dict__)
maprequest1 = MapRequest()
maprequest2 = MapRequest()
maprequest1.RID = "hello"
maprequest2.RID = "goodbye"
maprequest1.imgID = "image"
print(maprequest1.RID + " ::: " + maprequest2.RID)
print(maprequest1.getRID() + " ::: " + maprequest2.getRID())
print(maprequest1.__dict__)
MapRequest.RID = "You are screwed"
maprequest3 = MapRequest
print(maprequest3.__dict__)
and the output is
{'_imgDims': None, '__module__': 'requests', '__doc__': None, '__init__': }
{'_imgDims': None, '__module__': 'requests', 'RID': 'You are screwed', '__doc__': None, '__init__': }
hello ::: goodbye
hello ::: goodbye
{'RID': 'hello', 'imgID': 'image'}
{'_imgDims': None, '__module__': 'requests', 'RID': 'You are screwed', '__doc__': None, '__init__': }
changed something
So what we see is that the MapRequest.RID actually changes the value in the class and new instantiated objects get this new value. We also see that each instance of the class has it’s own private RID – this is like Java
Just a little PSA so that Java developers scouring the web can get their heads around this.
Dear Mr. Arrington:
I know you may be smart in other areas but you are making a fool of yourself with the cloudmade/ OSM post. I know your shoody piece was based off:
“a random discussion I had with someone about how they are doing. And by “they” I mean the combination of CM with OSM.”
But I thought quoting random discussions as fact was the purview of bloggers not journalists or larger sites such as techcrunch. Hey I have an idea, how about you name the source or at least give them credit.
But this statement is the one that shows you are way out of your league in this discussion:
“it’s quite clear who controls the project.”
My friend, cloudmade does anything but come close to control the project. They have offered some APIs on top of OSM and had a few mapping parties, but most of the contributors to the OSM project and the infrastructure are not affiliated or given by cloudmade.
During the Haiti crisis cloudmade was shamefully quiet. Most of the work was done by volunteers like Schuyler, Chris S, Mikel and hundreds of others. They did not use the cloudmade front-end and there was no direction being given by cloudmade.
Please stop wanking and give some real facts to back up your statements. Show me the infrastructure that cloudmade gives to OSM, or the volunteers they give, or any objective measure. I would say for everyone in the community it is quite clear that OSM is marginally connected to cloudmade at best. So my summary of:
“cutting through the bs and getting to the core issues.”
is
1) You are out of your league when discussing geo
2) You are wrong and can’t admit it
3) OSM is not run by and barely has much of a connection to cloudmade.
The other day, Cyrus and I were brainstorming how to build a desktop app that had some minor GIS components and a lot of calculation components.
Our first thought was to go with ESRI software, especially that you can now write native ESRI components in Java.
We just wanted simple that would be easy to give to non-profits, local governments, or other folks who may not have many seats of ESRI software. Given that we were also only going to use a small subset of GIS functionality we really didn’t want to take on the complication of the ESRI Object model. We also didn’t want to have to the specter of having to try and rewrite our plugins if ESRI made breaking changes to the APIs we use.
So we then started to look at using FOSS4G desktop apps. We started with QGIS because
1) it has the most active development going on right now
2) Cyrus feels comfortable with Python and you have access to all the functionality we needed through Python.
And then we hit the wall – QGIS is licensed as GPL – not LGPL or BSD but GPL. The implication of this was huge. We work for a company who is not really into giving out its source code right now – I am just working with them on using FOSS4G tools: baby steps man, baby steps.
With the GPL license any code I write for a plugin has to be released back to the public if I give the plugin to someone outside of my org/company. I do not want to get into a license flame war here I just want to point out the implications for us as the developer. I went into the QGIS IRC channel and asked about the possibility of LGPL licensing. They had thought about it but decided they wanted to encourage people to give back to the community.
For us this is not encouraging but forcing. If I use QGIS or OpenJump I have to give my plugins code back to the community if I distribute the plugin outside of my org. There is no choice .. only do.

The only option left for us to look at was uDIG which has development going on and has a nice, but slightly confusing look and feel. The problem is that I followed the instructions to set up a dev environment and after all the downloads and installation I couldn’t get it running. It failed my 1 hour Yak shaving test.
I tried also setting something up using the Netbeans RCP and Geotools . Getting is set up was really easy and within 20 minutes I was opening a shapefile, reading the features and displaying text boxes with information in them. I had something that would run on any machine that has a 1.6 JRE with no installation. The bad part was I couldn’t get the map display to show – which is probably an ID10T error – but since I needed to show a map in the app I gave up.
We are now at the point of doing Geoserver with Openlayers and custom code on the server. Really would have liked a desktop app but the licenses, given our environment, would not work, and the Yak shaving was beyond my tolerance.
What are your thoughts on this (besides that I should have spent longer setting things up)? If you were building a desktop app – how did you do it? Have you gotten geotools to show a map with the Netbeans RCP?
Help us Mapkenzie – you are our only hope

So I want to follow up on the nuclear bomb dropped on the geospatial industry – but instead I want to focus on what James pointed out about spatial accuracy. I think Goog made the switch to their own data too soon. My wife has used Google religiously for getting driving directions for a couple of years now and always been happy with it. In the past week it has gotten her lost 4 times – she has now switched to MapQuest or Bing. I tried to use it for directions here in the bay area and it took me into the East Bay to get to somewhere on the Peninsula. I went straight back to TeleNav (ATT Navigator) and had no problems. Google’s routing data sucks right now and there are no two ways about it. This is not due to bad algorithms since they used to work great on TeleAtlas (TA) data.
I know there would have been huge $ implications for using TA data for turn by turn navigation routing (they charge a lot more for that “use case”) but Google has a bazillion dollars. So I think there are two reasons why they did it.
1. They think they are smarter than everyone else and their fairy dust network would get them up to speed fast enough.
2. Marc Prioleau had the idea that perhaps TA got wind of what was going down and gave them an ultimatum. Sign a contract or we will never let you do turn by turn.
If it was number one then I think they switched too early.
Getting directions wrong has a lot more serious consequences than giving me the wrong search results. I only need once or twice and I am switching providers. I don’t care if it is free – directions are either right or wrong.
If I am lucky, wrong wastes my time, if I am not so lucky it can put me in danger. Yeah yeah, say all you want about you get what you pay for – but that is not a way to keep users on your service.There are a bunch of other “free services” out there that I could use but I don’t because they are worthless. Google dominated in search because it gave the best results and then inertia set in. They may not be so lucky here – wrong driving directions are useless.
I hope those fairies are working overtime correcting their street network…
Btw, poor TeleNav – guess they picked a bad time to stop being a privately owned firm.

Alright all 3 of you kind readers – my friend Elizabeth Greyber is running the Nike’s Women Marathon this weekend as part of Team in Training in honor of my battle with cancer. Please go to her page and give a little so she can reach her goal.
Thanks and “Mind you, moose bites can be pretty nasty”
