Archive for the ‘Uncategorized’ Category

moon maps

Thursday, May 3rd, 2012

Lunar Reconnaissance Orbiter map using openlayers for display and mapaplanet (based on isis3) data:

Announcing Xspice

Saturday, July 23rd, 2011

An X server and a Spice server. Yes, the idea that X is not a good enough networking protocol for WAN has been investigated already many times. Why yet another one? In the end because it seemed like a cool thing to do. And it’s easier to test the qxl driver without the guest/host split.

What I think would be really useful is to be able to use it side by side with an existing X server, i.e. having two drivers both receiving all X operations (vnc doesn’t have this problem because it isn’t implemented as a driver). Sadly this is not yet doable. But happily it is being worked on, mainly due to the relatively-new dual GPU laptops (I don’t know the ETA. I think it’s called sharding, or at least is related to that).

So right now, if you are tired of Xvnc, or Xrdp, or NX, or just want to compare and tell us again that we need to improve SPICE (*) (**)

The source release is one and the same as the xorg qxl driver: xspice source aka xf86-video-qxl-0.0.16.tar.bz2 (see spice-space for the latest)

Building requires the same dependencies as any X video driver, plus spice-server. See README.xspice for details.

XSpice installation as a normal user is a bit of a hassle, since it requires one to build their own X server. If you want to do it, see README.xspice for details. On the other hand, installing as root requires just three things:
* -> with all other xorg video drivers.
* xspice -> /usr/bin
* spiceqxl.xorg.conf.example -> /etc/X11/spiceqxl.xorg.conf (this is the default config file xspice looks for, you can change that with –config)

sudo make install will do the first two for you (assuming you did ./configure –prefix=/usr). The third you’ll have to do by hand.

To summarize, this should get you going:

./configure --prefix=/usr
sudo make install
sudo cp examples/spiceqxl.xorg.conf.example /etc/X11/spiceqxl.xorg.conf

Alternatively, somewhere in the near future I hope this will be enough

yum install xspice

Running is easier:

xspice --disable-ticketing --port 5900 --tls-port 0 :1.0 2>&1 > /dev/null &
spicy -h localhost -p 5900
DISPLAY=:1.0 favorite-window-manager-that-doesnt-need-dbus # i.e. icewm

Note: you don’t have to redirect, there is just a lot of spew, so you might want to run spicec/spicy in another terminal.

Note 2: that –tls-port 0 is weird, right? bug. But I already used one paper bag (0.0.15 never saw daylight), so I’ll just leave this for the next release.

Most of the options familiar from qemu’s -spice option are there, with some exceptions: no sound yet (do a pulseaudio proxy? not sure), no agent implementation (probably a good idea to reuse spice-vdagent for this), and no per channel secure/unsecure port selection (just laziness). The internal mechanism for passing those options is a bit of a hack – XSPICE_* environment variables are set by xspice and read by

I hope someone finds this useful, if you do, do let me know!

*) we know! but thanks for telling us! no, really! 🙂
**) Compared to VNC I don’t think there is a question that Spice is a better (***) protocol. Compared to the rest, it has it’s shortcomings. But it will be 😉
***) ok, I can’t write “better” without saying that it is a function of the optimization criteria. But you know what I mean.

p.s. also, we already had spice-x, so xspice was inevitable. Next, ispice!

tracking release fixed bugs (or, which BZ are missing from spice 0.8.2 NEWS file)

Friday, July 22nd, 2011

Our NEWS file looks like:

spice new-version
* bla
* fixed 666666, 777777

spice old version

To gurantee all the bz’s are in there the next time we need to track which bz’s were fixed in some git branch between the last and new release. Assuming they are tagged, and commits include the bz in the message (the last is hard to verify – could go look at bugzilla for real), this becomes:

git log 0.8.1..0.8.2 | grep -o -E "#[0-9]{6}\>" | tr -d "#"

If you happened to already have done a release, and you want to see how screwed up the NEWS file is, this works:

((git log 0.8.1..0.8.2 | grep -o -E "#[0-9]{6}\>" | tr -d "#" | sort -u); (git show 0.8:NEWS | gawk '/0.8.2/ { a=1; } /0.8.1/ { a=0; } { if (a) print; }' | grep -o -E "[0-9]{6}" | sort -u);) | sort | uniq -u

And if you also want to paste that into a blog post in html, do:

_last_command_output_ | sort | uniq -u | sed -e 's|\(.*\)|<a href="\1" title="\1">\1</a>|'

So let posterity know that the following BZs are also fixed in spice 0.8.2:



Sunday, October 24th, 2010

Creating message sequence charts.

cross site maddness

Thursday, August 12th, 2010

After adding the new fad of like/addthis widgetry (collectively social widgets) to citytree, there is now a bug with the jquery using image display – so whenever you press any zoomable image you get a pretty popup dialog that everyone likes with this message (courtesy of the amazing firebug):

Permission denied for (document.domain has not been set) to get property Window.nodeType from (document.domain=).

Passer by, I crowd source you! do you know how to fix this??

thx bye

life is technical

Tuesday, May 25th, 2010

just a few thoughts I wanted to get to paper, funny that this is what I think of as paper. Here goes:

bpython is the new ipython – well, not quite, actually bpython has a much more modest scope, but it is available on the major linux distributions and is nicer looking then ipython (and that’s saying something). Basically it’s a better console then the default python, gives you syntax highlighting, F2 to view source of current function you are typing, intellisense like completion (based on dynamic introspection and not static analysis of course), and the author’s favorite is pastebin at your fingertips, haven’t tried that yet.

Back to learning haskell, bit by bit, every train ride I progress a little thanks to 3G connection of my N900 (which I have not installed ghci on yet though it is available), and my small PC-Z1 is now used as a haskell learning environment. All thanks to the Real World Haskell book which is an awesome idea, book with inline comments (I think I saw it first done on django project docs?). Plan on buying it once I finish (or getting someone to buy it for me 🙂

Back to learning RRLP I hope, as part of the OpenBTS project, maybe as a joint effort with OpenBSC – will update gnuradio wiki eventually with the current stuff (which is available in the latest git repo from sourceforge for OpenBTS).

Haiku’s strace

Wednesday, May 12th, 2010

Haiku is out, 9 years in the making by copyright, and all I can say is sweet strace.

running in qemu

Deferred based Tasks

Friday, April 9th, 2010

I’m not sure how to call this, but this is basically the method of doing multiple things “simultaneously” or more accurately having outstanding operations with a single thread that we used last year in robocup 2009. The example uses predetermined wait actions but imagine these actions are actually “turn head”, “walk forward 1 meter” etc. Last night a conversation led me to write this almost self contained example.

from twisted.internet.defer import Deferred

class Scheduler:
    def __init__(self):
        self.activities = []
        self.clock = 0

    def wait(self, t):
        """ example action - a real world action would start an actual
        action, here we simply record a time when this action should end
        and the deferred we give to the user """
        d = Deferred()
        self.activities.append((self.clock + t, d))
        return d

    def print_activities(self):
        print "%.2f: %s" % (self.clock, ','.join(
            '%.2f, %s' % (et, d2str(d)) for et, d in self.activities))

    def loop(self):
        """ main loop for test. The real loop (burst) actually checks
        for deferred completion, but here we record the time it will
        complete in activities and simply skip to this time directly
        while self.clock < 20:
            deleted = []
            self.clock = min(et for et, d in self.activities) # progress time
            for i in xrange(len(self.activities)):
                endt, d = self.activities[i]
                if endt >= self.clock:
                    #print "calling %s" % (d2str(d))
            for i in reversed(deleted):
                del self.activities[i]

sched = Scheduler()

def d2str(d):
    f = d.callbacks[1][0][0]
    return '%s.%s' % (f.im_class.__name__, f.im_func.func_name)

class Task:
    _name = 'unnamed'
    def __init__(self):
        self._active = False
        self._done_tasks = []
        self._act_count = 0
    def onDone(self, task):
    def fire(self, _ignored_=None):
        """ do the action if we are not already doing it """
        if self._active: return
        self._active = True
        d = self.act()
        for t in self._done_tasks:
    def act(self):
        self._act_count += 1
        print "%s: %s start" % (self._name, self._act_count)
        return self._act()
    def _act(self):
        raise NotImplementedError
    def _resetActive(self, _ignored_):
        print "%s: %s done" % (self._name, self._act_count)
        self._active = False

class Task1(Task):
    _name = 'task1'
    def _act(self):
        return sched.wait(1.0)

class Task2(Task):
    _name = 'task2'
    def _act(self):
        return sched.wait(1.0)

class Task3(Task):
    _name = 'task3'
    def _act(self):
        return sched.wait(1.0)

def test():
    t1 = Task1()
    t2 = Task2()
    t3 = Task3()

if __name__ == '__main__':

* To be self contained it would need to define Deferred itself, which is not hard since I’m using very few features, but just apt-get install python-twisted or yum install python-twisted-core would get you twisted which is a very capable library to know.

Evil Pigeons

Sunday, January 31st, 2010

My group’s game in globalgamejam 2010 is Evil Pigeons. Simon Reisman was the Producer, Game Designer and did Sounds, Ori Peleg did the Small Assets,  Omer Nainudel did the Background, and I did the Programming. Really cool work and experience, writing a game in 48 hours (even less), except when you are looking for a bug like pygame.mixer loading sounds from non existent files without complaining. But shit happens, which is what the game is about; Get it from Global Game Jam, from saymoo, or get the sources at github.

Screenshot from our game, a two player non symmetric game; as the pigeon master, you try to send the pigeons to do their business over the car, you can use shift+num to distract the shooter. As the shooter, it's your standard shooting game, except you can't hit the sitting pigeons.

Happy new year!

Saturday, January 2nd, 2010

After the last post I had a few nice things going. Visited tokyohackerspace, where I played with the chibi and got one for my “”troubles””. I’m now planning on getting another one and addon adxl345 boards to develop two things: an anti bicycle theft device and juggling balls that teach juggling. Not sure about the order, since the later is way cooler, but the former is very usable considering the rate of stolen bicycle in my personal history.
Also did a three day tour going west of tokyo, didn’t reach all the way to the tip but visited Himeji-jo (jo means castle), great karateka flashback, Kobe, including the earthquake museum, Osaka, half a day spent in den-den and got me a hhk which is my bday present from my brother and his wife, and also saw Osaka-jo and read the long history of this country that keeps reminding me of the mote in gods eye. Well, just the fighting part and fast development part. I guess they still have two arms. Finally visited Kyoto, but it was already the 29th of december so most museums and the castle were closed, to my disappointment. Returned to Tokyo, spent 21$ to see a avatar in 3d (3d is awesome), the next day found out I couldn’t take out money using my visa, some interneting revealed I hit the monthly limit of 19000 nis. Personal record! Which brings us to the What’s next department.
What’s next? I still have a few more days here. I’m not going to ski because it would be idiotic considering my funds and besides I’m not enthused.. strike that, well I am, but next time. So I have 4 days of unlimited train travel over JP and I intend to use them, at least to see nikko (a must), and probably see how far north I can go on local/rapid trains in one day. I do love to use my gps.
Then I’m going back to Oakland and then back home. That raises two issues, that of where to stay and what to do. .. . You don’t think I know, do you?

Thanks for reaching the end of my travel blog. I enjoyed writing some of the posts, and reading all of your comments, but this blog will be going back to it’s original purpose, that of writing obscure technical monologues. Have a wonderful linux-on-the-desktop year!