Archive for the Uncategorized Category

OpenSSL::SSL::SSLError: certificate verify failed open-uri

Posted in Uncategorized with tags , , , , , , on June 10, 2008 by Ben

I wrote a web-crawler today for one of my other projects, and ran into the above problem “OpenSSL::SSL::SSLError: certificate verify failed”, well I was just collecting websites and didn’t really care about the validity of SSL certificates, so I just wanted a quick fix.

Here it is:

require ‘openssl’
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

Essentially, I just change the constant for VERIFY PEER to the Value of VERIFY NONE, pretty sneaky :-), and no real work required.

Take Screenshots of a website from the command line

Posted in Uncategorized with tags , , , , , , , , , , on June 4, 2008 by Ben

I don’t feel like rehashing the hours I spent today trying to get various methods of taking command line screen shots of web-pages to work, but I’ll pull out a few useful pointers here.

There are 2 ways of doing this for free. (That is, if you value your time at $0 an hour)

First: khtml2png

http://khtml2png.sourceforge.net

khtml2png2 can be installed via a debian package, and runs on any variant of linux, as long as you have KDE installed. I didn’t, and thus spent a long time downloading KDE. It uses Konquerer to render the webpages, and Konquerer will often prompt for user input when something is wrong (i.e. — a plugin is missing (FLASH), or the web site wants access to your cookies.) It also was incredibly slow on my relatively fast desktop machine. However, it does the job — alright, and fits the price — free.

Second: webkit2png

Unfortunately, I was determined to make this process a little bit faster, and spent about 4 hours trying to get http://www.paulhammond.org/webkit2png/ to work. Webkit2png will run on OSX and takes screenshots using WebKit. It is fast, and a pain in the ass to install if you are unlucky. You’ll need Python, and the PyObjC wrappers. It was trivial for me to setup the wrappers from http://pyobjc.sourceforge.net/. The whole process should be pretty straightforward, install PyObj, and grab the Python code from the above website, no problem. Of course on my computer WebKit the header files the PyObjC setup.py wanted could not be found, and because of this the PyObj was not generating some of the files that PyObjC needed to run, “_WebKit_Str.inc” in particular. I tried a few tricks to make the setup.py find these header files, and managed to completely screw up my webkit install. Long story short, the script that generates stub files for PYOBJC ONLY looks in /System/Library/Frameworks/ no matter what you specify in the setup.py, and doesn’t even look in /Library/Frameworks even though it is listed in the default setup.py.

For PYOBJC to install correctly, you must have a directory called WebKit.framework in /System/Library/Frameworks, and it MUST have a Headers directory inside of it. And these headers must match the binary version of the WebKit library. I.e. you should have a directory structure that looks like:

bcx-mbp:/System/Library/Frameworks/WebKit.framework root# ls -l
total 24
lrwxr-xr-x    1 root  wheel    27 Jun  3 23:29 Frameworks -> Versions/Current/Frameworks
drwxr-xr-x   42 root  wheel  1428 Jun  3 23:40 Headers
lrwxr-xr-x    1 root  wheel    26 Jun  3 23:29 Resources -> Versions/Current/Resources
drwxr-xr-x    4 root  wheel   136 Jun  3 23:21 Versions
lrwxr-xr-x    1 root  wheel    23 Jun  3 23:29 WebKit -> Versions/Current/WebKit
bcx-mbp:/System/Library/Frameworks/WebKit.framework root#

The problem that I faced, and caused me to waste so much time was that I was missing the Headers directory inside of /System/Library/Frameworks/WebKit.framework. To solve this problem you can try doing a find -name WebKit.h and copying the Headers directory containing this file into your WebKit.framework directory. In my case I had another copy of the WebKit headers at: /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/WebKit.framework . Copying the headers directory from the above directory did the trick.

Now I left out a lot of the indirection that I faced in solving this problem. At some point in this process I broke WebKit and had to installed the 3.1.1 Safari upgrade from apple, (As described by: http://soakedandsoaped.com/articles/read/how-to-fix-broken-webkit-framework-after-safari-3-1-upgrade ) which updated my WebKit binary, but did not give me header files. Luckily the header files from the above /Developer/SDKs/ worked with this new WebKit binary. However the WebKit binary located in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/WebKit.framework did not work with my version of Safari, and still gave me errors when I tried to load it using import WebKit in the python code I was testing. In short, I managed to get everything working, and I believe the root of my problem was a missing Headers directory, but I might have also needed to install Safari to fix issues with my existing WebKit install so that I could install and compile PYOBJC with WebKit bindings.

It is likely that all of these problems are fixed on Leopard, so it’s unlikely anyone else will run into these problems. I believe Leopard comes with PYOBJC preinstalled, so no worries linking the two.

So anyway I got it all working and it was worth it, webkit2png.py is far superior to the konquerer based khtml2png2 even though it was a real pain to configure on Tiger.

I guess this is a little off topic.

Firefox Problem: Can’t Remove or Add Addons

Posted in Uncategorized with tags , , on May 30, 2008 by mabutler

Firebug wasn’t working and upon trying to uninstall it the add ons window would say that the change would be made after upon restarting firefox, even after closing all firefox windows and restarting.

This was fixed upon removing the applications.rdf:

rm ./.mozilla/firefox/g4cuxbnz.default/extensions.rdf

PHP API package

Posted in Uncategorized on April 17, 2008 by Perry

Coolapps PHP API on blog

Posted in Uncategorized on April 17, 2008 by Perry

It’s pretty sparse, but the API is now on the blog, in their own separate pages:

http://situated.wordpress.com/situated-php-api/

http://www.movino.org/application/mobile

Posted in Uncategorized with tags on March 30, 2008 by Ben

http://www.movino.org/application/mobile

A really cool application that captures video using your phone and sends it to your desktop computer, turns your N95 into a portable wireless video camera.

Situated <3 Nokia (AKA Unboxing Pics! w00000000)

Posted in Uncategorized with tags on March 27, 2008 by Perry

A week late, but here they are!

Looks like we are shooting for 80 degree horizontal field of view

Posted in Uncategorized on March 27, 2008 by Ben

http://blogsearch.google.com/blogsearch?hl=en&safe=off&client=firefox-a&um=1&ie=UTF-8&q=wide+angle+webcam&sa=N&start=0

A google blog search, reveals a few companies making cameras with 80 degree optical fields of view.  Mouly’s selected camera has 200degree (range of view), and a ~78-76 degree optical field of view.

Wide Angle web cams

Posted in Random Ideas, Uncategorized on March 26, 2008 by kmouly

I searched for “wide angle web camera” for our display. Creative webcam ultra seems to be good. Many products do not specify the exact vertical and horizontal angels covered.
Creative WebCam Live! Motion

  • Creative Web cam. 200° horizontal and 105° vertical view. It costs $129. Product page.

http://research.nokia.com/projects/activity_monitor

Posted in Uncategorized on March 24, 2008 by Ben