Wednesday, April 20, 2011

Disper indicator for switching Nvidia display modes on Ubuntu 11.04 Natty

This is a small Pyhton script which displays an indicator for Disper in Ubuntu 11.04 Natty (Unity desktop).

Disper can be found at

As far as I know this is the only command line utility which can handle the TwinView settings for Nvidia cards.

import gobject
import gtk
import appindicator
import commands

def single(w):
    commands.getstatusoutput('disper -s')

def extend(w):
    commands.getstatusoutput('disper -e')

def clone(w):
    commands.getstatusoutput('disper -c')

def add_menu_item(name, action):
  menu_item = gtk.MenuItem(name)
  menu_item.connect("activate", action)
if __name__ == "__main__":
  ind = appindicator.Indicator ("disper-indicator",
  ind.set_status (appindicator.STATUS_ACTIVE)

  menu = gtk.Menu()
  add_menu_item('Single', single)
  add_menu_item('Extend', extend)
  add_menu_item('Clone', clone)



Monday, January 10, 2011

Android AppEngine Login Error 500

Android caches authentication tokens. Therefore when getting a 500 error while authenticating against AppEngine the reason might be a timed out authentication token. In this case the token has to be invalidated and a new login request has to be send.

if (response.getStatusLine().getStatusCode() != 302) {
  Log.d(TAG, "Login failed. Trying again with new token.");
  AccountManager accountManager = AccountManager.get(context);