Google provides a handy hybrid solution for single-sign-on + access authorisation for Google Apps with Federated Login — which is a combination of OpenID and OAuth.
Looking at Google’s OpenID documentation, we note that certain parameters are required to send an authentication request to Google in order for the user to log in using the service. (Steps 5 and 6 below.)

One of the parameters required in the auth request URL is the ”return_to” parameter. Importantly, note that this parameter is both required and needs to point to a currently valid domain. What this means, is that if you’re doing development internally, setting the “return_to” parameter to testing, or localhost, or similar, will cause the request to fail with a sufficiently cryptic, “The page you requested is invalid.” Even attempting to have the return sent to a port other than 80, eg. http://my.valid.domain:8080, will also cause the request to fail.
Unfortunately, all these requirements seem to have been assumed, and not documented on Google’s site.
A trick!
One trick to get around this no-local-testing conundrum is to set the return_to parameter to a subdomain (or otherwise) of a valid domain, eg. http://testing.my.valid.domain, and then set that address in /etc/hosts to point to your testing server.
Filed under: Uncategorized | Leave a Comment
Tags: auth, federated login, google, oauth, openid
Mac OS X 10.6 Snow Leopard: Re-enable LCD font smoothing for some monitors [via macosxhints.com]
Information below taken from the post on MacOSXHints.com
So recently ran into an issue with my new HP LCD monitor where Snow Leopard suddenly decided to make my fonts look all skinny and malnourished (that’s turning font smoothing off, apparently). Which was really annoying, since I was using Monaco on the Terminal and in my code editors and they looked really horrible after that.
Finally get fed up enough to Google around a bit for Mac OS X font tweaks and ran into the solution below.
And now my fonts are happy! Or at least I am.
Hope it helps someone too.
Reposting here just so it gets out on the web more:
There is a bug in Snow Leopard that disables LCD (sub-pixel) font smoothing on many third party LCD displays, including models from Dell, Samsung, LG, HP, EIZO, and Lenovo. Here are the details:
Snow Leopard introduces simplified Font Smoothing options under the Appearance pane in System Preferences. Prior to Snow Leopard, the available options were:
- Automatic – Best for Main Display
- Standard – Best for CRT
- Light
- Medium – Best for Flat Panel
- Strong
In Snow Leopard, you can only choose between Automatic and Standard CRT. Since few people use CRTs these days, most users now have only one option: Automatic. The problem with the Automatic option is that OS X incorrectly detects many third party LCD monitors as CRTs, and consequently, disables LCD font smoothing.
You can force OS X to use LCD font smoothing on all displays with this Terminal command:
defaults -currentHost write -globalDomain AppleFontSmoothing -int 2
The number 2 here corresponds to Medium – Best for Flat Panel. You may also use 1 for light smoothing, and 3 for strong smoothing, as per the original OS X font smoothing options.
Filed under: mac | Leave a Comment
Tags: "mac os x", "snow leopard", anti aliasing, font smoothing, fonts, mac, monaco, terminal
New open source projects
I’ve been working on some stuff lately, and have found the need to dig deep and write some code of my own. They’re really small now, but all the same, I hope it’ll be useful to someone. Both DustJacket and isbndbpy below are written in Python.
DustJacket
A Python wrapper library for handling ebooks (only ePubs for now).
I’d been looking around for one of these in Python for a while but was unable to find one. It was really annoying being told, “Oh, an ePub is just a ZIP file, so you should be able to easily unzip it and read its contents.” Well, yeah. A car is essentially a platform on four wheels, but they’re much nicer than that now aren’t they?
isbndbpy
A Python API wrapper library for the ISBNdb.com API
Same scenario as above. Need the code, couldn’t find a decent one (especially not in Python!), so decided to scratch that itch and make one myself. So here you go.
isbndbpy‘s implementation of the API is still quite incomplete though, so you have been warned.
That said, if anyone finds these projects even mildly useful, leave a comment! (And even better, help contribute to the projects! Basic stuff like tests, docs and general completeness is still greatly needed!)
Filed under: code, projects | Leave a Comment
Tags: "python", ebooks, epub, github, isbn, isbndb, opensource
Ran into an interesting problem with Python on Mac OS X (Snow Leopard). Part and parcel of writing web application is dealing with information transfer between the server and the client, and the most common format for this is JSON.
JSON is exceedingly common across the web, so imagine my surprise when I found that the default installation of Python on Mac OS X didn’t seem to include simplejson.
Resolving this is easy. The Python installation comes with a handy utility called easy_install, which, well, easily installs missing components:
$ sudo easy_install simplejson Password: Searching for simplejson Reading http://pypi.python.org/simple/simplejson/ Reading http://undefined.org/python/#simplejson Best match: simplejson 2.1.1 Downloading http://pypi.python.org/packages/source/s/simplejson/simplejson-2.1.1.tar.gz#md5=0bbe3a2e5e4cac040013733aca159d89 Processing simplejson-2.1.1.tar.gz Running simplejson-2.1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Ii_EU9/simplejson-2.1.1/egg-dist-tmp-79Fj1U Adding simplejson 2.1.1 to easy-install.pth file Installed /Library/Python/2.6/site-packages/simplejson-2.1.1-py2.6-macosx-10.6-universal.egg Processing dependencies for simplejson Finished processing dependencies for simplejson $
And there you go!
Filed under: Uncategorized | 4 Comments
Tags: "easy_install", "json", "mac os x", "python", "simplejson", "snow leopard"
Android SDK on Fedora 10
Had a little trouble trying to get the Android SDK running on Fedora Eclipse on Fedora 10 recently.
The problem I ran into upon attempting to install the Android Eclipse ADT was, as such:
- Following the installations Android SDK site and adding the repository site for the ADT,
- I get the following error about org.eclipse.wst.sse.ui not being found
- Which meant that the dependency checking for ADT failed, and I couldn’t get it installed.
The only tip Google could provide was that the default eclipse-platform package that Fedora 10 provided was lacking in the particular Eclipse component that the Android ADT needed, ie. org.eclipse.wst.sse.ui (and friends, presumably).
So here’s how to get around that:
- Add the Eclipse Ganymede updates repository in Help -> Software updates.. -> Available Software.. (details).
- You’ll get a new menu item in your Available Software tab: “Ganymede Update Site“
- In the search box, enter “WST Common UI“, and hit Install.
That would’ve brought in the necessary Eclipse components that the ADT requires. From there, follow the usual ADT installation instructions, and you’re done!
Filed under: Uncategorized | 1 Comment
Tags: adt, android, eclipse, fedora
After puzzling for quite a while on how to get the Fn keys working on a Macbook Pro (4,1) in Linux (they work fine in Mac OS X, of course), I came across a forum thread today that presented a very promising solution.
Traditionally, the problem with the Fn-keys of the Feb ’08 edition of the MBPs was that they simply didn’t work. Not even with pommed.
The issue seemed to be an erroneous hardware ID listing in hid-quirks.c, under drivers/hid/usbhid/, where the Device ID for the keyboard was listed as 0x021b instead of the proper 0×0230, as shown when doing an lsusb. (More details in this bug report.)
The fix in the forum post describes how to dynamically load the usbhid module, with the proper Device ID passed to it as a parameter.
Thanks loads to _alex_ and his wonderfully elegant solution, described below:
The fix described is for an Ubuntu system, but there’s no reason why the concept wouldn’t work on any other distro.
- Edit /etc/modprobe.d/options
- Add the line below at the end of the file:
- For Macbook Air users, _alex_ recommends this line:
options usbhid quirks=0x05ac:0x0230:0x00000800,0x05ac:0x0231:0x00004800,0x05ac:0x0232:0x00000800
options usbhid quirks=0x05ac:0x0223:0x00000800,0x05ac:0x0224:0x00004800,0x05ac:0x0225:0x00000800
Following the changes, you should be able to restart your machine and have your Fn-keys working, no additional configuration required. On Ubuntu, the screen brightness keys (F1 and F2) and the volume keys (F10, F11 and F12) and the Eject key (beside F12) work fine.
Filed under: linux | Leave a Comment
Tags: apple, brightness, fn, keyboard, macbook pro, penryn, volume
gEdit a la TextMate
Hands up those of you who have Mac-using friends who rave about wonder-boy code editor TextMate.
Ever wondered what the type was about? Yeah? So did I.
Anyways, had the luck of chancing upon a few blogs that, with a few tweaks, allows you to jostle gEdit into behaving somewhat like TextMate (especially in the context of Ruby on Rails). Not all the features though, but close enough.
Check out
- http://robzon.aenima.pl/2007/10/ubuntu-710-rails-gedit-and.html
- http://grigio.org/textmate_gedit_few_steps
And other useful links
- x-rhtml.xml (RHTML mime type definition)
- rhtml.lang (RHTML language definition for gtksourceview-2.0) (Updated link – 19 Aug)
- rhtml-snippets
The 3 files above allowed me to get up and running with RHTML syntax highlighting and snippets
Filed under: Uncategorized | 2 Comments
Tags: gedit, rhtml, ruby on rails
Recent Entries
- Federated (OpenID) Login on Google Apps
- Mac OS X 10.6 Snow Leopard: Re-enable LCD font smoothing for some monitors [via macosxhints.com]
- New open source projects
- simplejson for Python on Mac OS X
- Android SDK on Fedora 10
- Missing formatting toolbar on Trac
- Apache permissions with SELinux
- Problems with Apache and .htaccess on a HFS+ partition
- [SOLVED] Fn-keys on Macbook Pro 4,1
- gEdit a la TextMate
- PH(im)P my Zone
Categories
- benchmarks (1)
- centos (1)
- code (1)
- cron (1)
- dual booting (1)
- file systems (1)
- linux (8)
- mac (1)
- misc (1)
- openoffice (1)
- projects (1)
- skype (2)
- slackware (2)
- solaris (1)
- tips (2)
- Uncategorized (6)
- vmware (2)
