Monthly Archives: September 2010

code misc rails

FacebookError: OAuthException – Invalid OAuth access token

On places.ae, we got notified of some issues with Facebook signups and logins. All of the sudden, when the Facebook OAuth service pushed us back to our redirect-page, the HyperGraph Gem threw the following error:

FacebookError: OAuthException – Invalid OAuth access token

This is often thrown because the Access Token could contain a | (pipe) character, which gets encoded to %7C, and this makes HyperGraph choke a bit. So a simple gsub(‘%7C’,’|’) will solve it, such as the code below:

at = HyperGraph.get_access_token(FB_ID, FB_SECRET, FB_RET, code)
at = at.gsub(‘%7C’,’|’)
g = HyperGraph.new(at)
me = g.get(‘me’)

Thanks,
Michael

misc sysadmin

Error mongoDB under Ubuntu – can’t find libmozjs.so

When installing MongoDB under Ubuntu, one could stumble upon the following problem:

mongo: error while loading shared libraries:
libmozjs.so: cannot open shared object file: No such file or directory

This is caused because MongoDB uses XulRunner for it’s operations. (This is also why you see a bunch of X11 programs that are to be installed when using apt-get). XulRunner, however, contains this file, but is not loaded.

Solving the problem:
Make sure you have xulrunner installed (sudo apt-get install xulrunner-1.9.2) and add its path to ldconfig’s configuration files, which are in/etc/ld.so.conf.d. You could create a file, say, /etc/ld.so.conf.d/xulrunner.conf, containing the following line:

/usr/lib/xulrunner-1.9.2.10/

After this, you chould run ldconfig (as root) and that should do the trick. Let me know if you have any problems with this.

uae

TRA to developed e-commerce “policy”

The Telecommunications Regulatory Authority (TRA) wishes to boost the online commerce in the UAE by implementing new policies, said the National.

“The TRA’s aim is to increase and boost the online transactions and the population who are using online commerce,” Ms al Jaberi said at The Internet Show in Abu Dhabi yesterday.

(The National)

Seeing this is the same department that is willing to suspend Blackberry services due to its encrypted nature; Would this mean that solely UAE payment gateways are to be used? Paypal, be worried.