Dec. 17, 2013

Here is how you can have a lockscreen on Xubuntu that just displays a custom logo/graphic and asks for your password. The graphic I have used is a white logo on black background, so the background/foreground settings reflect that but you can change these colours to match whatever graphic you use.

sketch of a padlock

First, you need to create a script in $HOME/bin/xflock4 - this should override the default xflock4 script on your system that XFCE uses as a proxy for launching the lock screen. Here are the contents, which just run the xlock program:

#!/bin/sh
xlock

Don't forget to make it executable with chmod 755 ~/bin/xflock4.

Next, you should create an xpm version of the graphic that you want to use, for example in $HOME/.lock.xpm - you can use the Imagemagick convert program (sudo apt-get install imagemagick) to convert some other image into the correct xpm format like this:

convert myimage.png ~/.xlock.xpm

Make a note of the dimensions of your image as you will need them for the 'icongeometry' option below. The largest size appears to be 256x256 pixels and the man page advises to make it as close to square as possible. You will set the 'image.bitmap' setting below to the location of the xpm file. Finally, you should add the following configuration options to a file called $HOME/.Xdefaults:

XLock*mode: image
XLock*image.bitmap: /home/chrism/.lock.xpm
XLock*image.count: 1
XLock*image.erasedelay: 0
XLock*erasedelay: 0
XLock*icongeometry: 180x180
XLock*background: Black
XLock*foreground: White
XLock*description: off
XLock*info:

You can find out other options by running man xlock.

To test select 'Lock Screen' from the user menu.

Enjoy!

Sept. 2, 2013

IMAG0516.jpg

Snug.

June 10, 2013

deviator-sydney.png

Deviator, the show I worked on with PVI Collective and friends, is playing in Sydney, Australia starting tomorrow night. Get in there, tickets sell fast!

March 18, 2013

sunset-newhouse.jpg

These days I am using Bitbucket for the git repository hosting and task management on my commercial projects. One thing I often need to do is fetch a list of current tasks so that I can update a client with what is on our current agenda for them, get feedback about priorities etc. Here's a short Python script I hacked together to do that based on some other public domain scripts I found out there:

import base64
import cookielib
import urllib2
import json

class API:
    api_url = 'http://api.bitbucket.org/1.0/'

    def __init__(self, username, password, proxy=None):
        encodedstring = base64.encodestring("%s:%s" % (username, password))[:-1]
        self._auth = "Basic %s" % encodedstring
        self._opener = self._create_opener(proxy)

    def _create_opener(self, proxy=None):
        cj = cookielib.LWPCookieJar()
        cookie_handler = urllib2.HTTPCookieProcessor(cj)
        if proxy:
            proxy_handler = urllib2.ProxyHandler(proxy)
            opener = urllib2.build_opener(cookie_handler, proxy_handler)
        else:
            opener = urllib2.build_opener(cookie_handler)
        return opener

    def get_issues(self, username, repository, arguments):
        query_url = self.api_url + 'repositories/%s/%s/issues/' % (username, repository)
        if arguments:
            query_url += "?" + "&".join(["=".join(a) for a in arguments])
        try:
            req = urllib2.Request(query_url, None, {"Authorization": self._auth})
            handler = self._opener.open(req)
        except urllib2.HTTPError, e:
            print e.headers
            raise e
        return json.load(handler)

if __name__ == "__main__":
    import sys
    if len(sys.argv) < 5:
        print "Usage: %s username password baseuser repository" % (sys.argv[0],)
    else:
        result = API(sys.argv[1], sys.argv[2]).get_issues(sys.argv[3], sys.argv[4], (("status", "new"), ("status", "open"), ("limit", "50")))
        for p in result["issues"]:
            print " *%s %s" % (p.has_key("responsible") and "**" or "", p["title"])
            #print p["content"]
            print

Run it to get a usage message.

I secretly wish that bzr had won the distributed version control wars because of its superior user interface, but these days I am resigned to using git because pretty much everybody I have to inter-operate with is using it. It's not that bad.

Feb. 20, 2013

Pac-Man Ghost

You can run a single-use instance or site specific browser using Chrome web browser with it's own self-contained user data on GNU/Linux like this:

chromium-browser --app=https://plus.google.com/ --user-data-dir=$HOME/.chromium-googleplus

This launches Chrome in an 'app' style window with just that particular web app visible (in this case, Google Plus) and no location bar, navigation buttons, etc. It isolates the browsing session from your other browsing preventing e.g. social networking sites from tracking you too effectively. If you are logged into Facebook in a regular browser for example, that company can tell every site you visit that contains a Facebook 'like' button or Facebook comments section. They are effectively gathering a comprehensive browsing history of every Facebook user who remains logged in. Do you want Facebook to know your browsing history?

It should be possible to do something very similar with Chrome for Windows and a batch file.

On Mac you can use Fluid if you want to pay for ease of use, or the same trick as above with Chrome by accessing the binary directly e.g. something like /Applications/Google Chrome.app/Contents/MacOS/Google Chrome --app=https://plus.google.com/ --user-data-dir=$HOME/.chrome-googleplus. Save that as a shell script for one-click access.

If you want to further anonymise your browsing (e.g. obscure your IP address for example) you might consider using software like Tor.