Prop 19 short clip about how grass became outlawed in the states

April 24th, 2014

Translated to hebrew.


Meat: future

March 15th, 2014

Why we need? we do, stop asking

How to produce? raise animal, kill animal, process animal, eat flesh.

What side-effects? large land use, water use, disease from close proximity crosses to humans, suffering

Is better way? yes, take cell from animal, grow cells to tissue, process tissue, eat tissue.

really? yes, like interleukin, insulin, beer, only more complex. is cultured meat.

is sci-fi? no, human windpipe transplanted, rat kidney research, modern meadow leather TED, cultured hamburger.

is next year? not quite, is new harvest goal

no hebrew? העמותה לחקלאות מודרנית

Good people not caring

December 11th, 2013

That’s what people always say to explain the lack of momentum for their save the world project. It’s automatic: A is good, A is essential, why isn’t everyone doing A? That’s how I feel about my current pet project, medicine. I recall joining my brother for a visit to the carrot forum, a group of green minded people meeting to advance their goals, and feeling like an outsider, thinking ‘this is cool’ and then going back to my business. How do you get people to cross the divide? it’s an age old question, this short post is not contributing to it, simply giving a point in time when I have started considering that question. Keeping in mind my usual attention span it is probably also the point in time when I stopped considering it. Peace.

Bar Kayma Garden

November 29th, 2013

Today I worked on getting a watering system for the north wall plants. I ended up buying the wrong 1/2-1/2-1/2 two way stop plus external 1/2 hose to 1/2 connector adapter, but it is still installable before the existing faucet instead of after, but we will need to turn off the main since no top floor only stop has been found.

Miditech keyboard with linux

July 4th, 2013

Got a “Garagekey mini” usb midi keyboard of miditech for ~300 nis. It doesn’t google well, but surprisingly alsa wise worked out of the box. My only complaint is that occasionally it will stop producing output (aseqdump -p 20 will produce nothing), solvable by disconnecting and reconnecting the device.

Next I wanted to get a working keyboard automatically after connecting it to my laptop. This turned out to be more complex then I thought. Problems included:

1. (not a problem, just a not very optimal thing) have to edit udev as root to respond to insertion events:

$ cat /etc/udev/rules.d/99-miditech-garagekey.rules
ACTION==”add”, ATTR{idVendor}==”1acc”, ATTR{idProduct}==”1a0f”, RUN+=”/home/alon/bin/miditech”

2. jackd is not actually a daemon, and my feeble understanding of dbus resulted in having to run it with DISPLAY set

3. (not absolutely neccessary) had to setup jackd to run as alon, reading /usr/share/doc/jack-audio-connection-kit- and following the instructions to add myself to jackusr group. Edited /etc/security/limits anyway. Currently jackd complains it cannot lock enough memory but it doesn’t seem to bother it (no hickups). It does get realtime scheduling (doesn’t complain).

4. Ran everything under tmux as my daemnizer. Lame. But works, and also got a gnome-terminal for debugging:

(ugly sleeps for debugging)
$ cat ~/bin/miditech


INSTRUMENT=”/usr/share/zynaddsubfx/banks/SynthPiano/0033-Analog Piano 1.xiz”
export DISPLAY=:0.0

if [ $UID == 0 ]; then
su alon -c “tmux new-session -d -s miditech ~alon/bin/miditech”
su alon -c “gnome-terminal -e ‘tmux attach -t miditech'”
exit 0

while [ “x`pgrep jackd`” == “x” ]; do
if [ $tries -gt 5 ]; then
echo failed to launch jackd
sleep 10000
jackd -T -ndefault -dalsa -dhw:0 -r48000 -p1024 -n2 &
sleep 2
sleep 4
if [ x`pgrep zynaddsubfx` == x ]; then
zynaddsubfx -L “$INSTRUMENT” -e $0.zynaddsubfx.init &
aconnect 20 128
sleep 1000


$ cat ~/bin/miditech.zynaddsubfx.init
jack_connect zynaddsubfx:out_1 system:playback_1
jack_connect zynaddsubfx:out_2 system:playback_2
# aconnect numbers are constant? seem to be
aconnect 20 128

5. (note) to attach from within tmux: (unset TMUX; tmux attach-session -t miditech)

6. determining when jack is ready is annoying. no systemd file either (tried – failed with a dbus error, need to look at that / bug some devel). could use systemd approach of checking for a socket (how would I check for a socket being available? need to lookup what systemd actually does. netstat polling is ugly).

reviewed-by and signed-off-by

April 24th, 2013

This took me a whole day: it adds sorted Signed-of-by and Reviewed-by to a bunch of git commits using the –exec option and overriding the EDITOR environment variable.

Half of the code is from my misspelling of Signed-off as Signed-of, and using the script to fix the resulting mess instead of using a hard reset.


REVIEWED_BY="Some One " git rebase -i --exec git-add-review.exec qemu/master

Script 1: git-add-review.exec

# coding: utf-8

import os

author_replacements = {
'Some One Alias ':
'Some One '

lines = os.popen('git show HEAD').readlines()

author = [l for l in lines if 'Author:' in l]
author = author[0].split('Author: ', 1)[1].strip()

if author in author_replacements:
os.environ['EDITOR'] = 'true'
os.system('git commit --amend --author "%s"' % author_replacements[author])

os.environ['EDITOR'] = 'git-add-review.helper'
os.system('git commit --amend')

Script 2: git-add-review.helper


import os
import sys

with open(sys.argv[-1]) as fd:
lines = fd.readlines()

i_last = -1
for i, l in enumerate(lines):
if l[:1] == '#':
i_last = i

author = [l for l in lines if 'Author:' in l]
if len(author) == 0:
author = os.popen('git show HEAD | grep Author').readlines()
author = author[0].split('Author: ', 1)[1].strip()

reviewed_by = os.environ.get('REVIEWED_BY', 'Anonymous').strip()
print 'AUTHOR*** ', repr(author)
print 'REVIEWER* ', repr(reviewed_by)

author_is_reviewer = reviewed_by[:5] == author[:5] # hack

if author_is_reviewer:
print "author is reviewer"

new_lines = []
signed_lines = []
reviewed_lines = []

for l in lines:
if l.startswith('Signed-of-by:') or l.startswith('Signed-off-by:'):
elif l.startswith('Reviewed-by:'):

print "=== Reviewed-by ==="
print ''.join(reviewed_lines)
print "=== Signed-off-by ==="
print ''.join(signed_lines)
def is_valid_email(x):
return '@' in x
reviewers = set([l.split(':', 1)[1].strip() for l in reviewed_lines
if is_valid_email(l.split(':', 1)[1])])
signers = set([l.split(':', 1)[1].strip() for l in signed_lines
if is_valid_email(l.split(':', 1)[1])])
reviewers -= set([''])
signers -= set([''])

if author_is_reviewer:
reviewers -= set([author])
reviewers |= set([reviewed_by])


new_lines.extend(['Signed-off-by: %s\n' % s for s in sorted(signers)])
new_lines.extend(['Reviewed-by: %s\n' % r for r in sorted(reviewers)])

with open(sys.argv[-1], 'w+') as fd:

Mini post – Going to GUADEC 2012 Coruña

July 21st, 2012

I am attending GUADEC at A Coruña, Spain

I’ve been in the spice team for more then two years. I’ve come to work for Red Hat because I believe in open source, and as such I always appreciated being a part of a larger team, the desktop team, inside Red Hat. So going to GUADEC is something personally rewarding to me, like going to FOSDEM was. I’m hoping to attend pdf related talks (I’m interested in better pdf to text hebrew support, and might need to go higher level for that), and actually I’ve already mapped out my talks and am really happy to be going!

moon maps

May 3rd, 2012

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

Xspice talk given at FOSDEM 2012

February 28th, 2012

I gave a talk about the hack that is Xspice during the last awesome-if-you-aren’t-distracted-by-a-pending-talk-or-second-guessing-a-given-talk FOSDEM.

Slides, are in multitalk, also in html. Patches for multitalk used.

Things learned:

  • homework should include debunking assumption that the W thing is probably just a fad that is going away.
  • practicing to not talk fast doesn’t always work.
  • spice is not the greatest thing since sliced bread.

More positive lessons learned:

  • Wspice would be more interesting to the X-turning-W crowd, and in general for the future.
  • Perhaps rendering at the server and that’s it for 3D is a good idea.

DRM progress 1

November 30th, 2011


I’m planning on this being the first of many updates on my ongoing work on adding 3D support to Spice. Right now I have a three stage plan and stage one is adding a DRM driver for linux. Our current linux driver is an X one, adding a DRM driver will allow us to use KMS and have an interrupt handler, and later provide direct rendering of course.

I’ve setup a working environment for developing the DRM driver to it’s current state. I hope that when I look back at this post I’ll notice all the things I missed, but in order to do that I need to write them in the first place:

  1. fedora host, with kernel checkout to /home/alon/src/linux
  2. fedora vm, with 9pfs mount pointing to /home/alon/src, with ttyS0 console (should be hvc0 but this failed for some reason). vm setup with password less login (should be autologin, but still multiuser init level since ssh is helpful). vm boot time is also too long – 10 seconds (was 40-50 before I noticed I was using ide instead of virtio, thanks to writing this blog post), turned off one thing I can’t remember, but a lot more to tweak there.
  3. make install once in vm, get /boot/grub2/grub.cfg to boot the new kernel by default, no quiet, and tty=ttyS0 (again – should be hvc0, not sure why it doesn’t work).

Development iteration:

    1. change code, build driver (make drivers/gpu/drm/qxl/qxl.ko)
    2. reboot vm (can be in parallel to 1)
    3. login and modprobe the new modules. actual keyboard: root<enter> . qxl<enter>.
      qxl is a script that does:
      ifup eth0 # didn’t figure out how to set this up – too used to /etc/network/interfaces. RHCE next week :) This starts sshd
      nc 5678 # knock on host side script that does ssh here
      insmod {ttm.ko,qxl.ko}
      on the host I have complementary script.

Most work so far was in figuring out TTM memory management enough to get memory allocated on the PCI BAR 0 for the commands. Initially I also had to figure out kernel debugging and building – building an individual module is much faster then building the whole kernel, and after trying to debug via qemu’s gdbserver (couldn’t find some symbols) gave up for now and am using printk / DRM_INFO’s, and making sure any module I touch (so far just ttm.ko and qxl.ko) is insmod’ed instead of modprobe’d to be sure I get the fresh one (already got bitten by this a few times – this time by just forgetting to build the specific module. inotify eclipse like instant build?). Reread the coding style, last time I read it was for fun, now I actually need to use it.


ifup eth0
iptables -F
echo go | nc 3456
nc -l 3456
# insmod everything to remove the "make modules_install" slow stage
# defaults to 10, doubled for soft lockup thresh, 22 seconds in reality,
# too long
#echo 1 &gt; /proc/sys/kernel/watchdog_thresh
cd $ROOT
insmod drm_kms_helper.ko
insmod ttm/ttm.ko
insmod qxl/qxl.ko



while [ 1 == 1 ]; do
nc -l 3456
#gnome-terminal -e "ssh root@"
#screen ssh root@
xterm -e "ssh root@" &amp;
sleep 1
echo go | nc 3456


while [ 1 == 1 ]; do
echo ====================== $filename ======================
(nc -l 6666 | tee $filename)

Started the practice of having a ~/tmp-bin with snippets that do not deserve to be in ~/bin but are currently useful. do-ssh, nc-6666 and f16-qxl-drm-6666 are there:

vm command line (need to switch to libvirt, this is done by spice-launcher):

x86_64 garlic:linux alon (qxl)$ cat ~/tmp-bin/f16-qxl-drm-6666
f16-qxl-drm --serial socket,host=,port=6666 --qxldebug 1 --guestdebug 1 $*
x86_64 garlic:linux alon (qxl)$ ls -l ~/bin/f16-qxl-drm
lrwxrwxrwx. 1 alon alon 6 Nov 11 16:49 /home/alon/bin/f16-qxl-drm -&gt; spice2</code>

f16-qxl-drm --serial socket,host=,port=6666 --qxldebug 1 --guestdebug 1

x86_64 garlic:linux alon (qxl)$ . ~/tmp-bin/f16-qxl-drm-6666 --print-commandline-only

/home/alon/spice/upstream/bin/qemu-system-x86_64 -chardev stdio,id=muxstdio,mux=on -mon chardev=muxstdio,mode=readline -vga qxl -drive file=/var/lib/libvirt/images/F16-qxl-drm.img,cache=unsafe,if=virtio,readonly=off -enable-kvm -L /home/alon/spice/upstream/share/qemu -m 1024 -cpu host -spice disable-ticketing,port=10006 -chardev socket,id=qmpmon,host=,port=20006,server,nowait,ipv4 -mon chardev=qmpmon,mode=control -snapshot -no-shutdown -global qxl-vga.guestdebug=1 -global qxl-vga.debug=1 -usb -device virtio-serial,multifunction=on -chardev spicevmc,name=vdagent,id=vdagent -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev socket,server,path=/tmp/tmpCYCBQ1/virtconsole,nowait,id=virtconsole -device virtconsole,chardev=virtconsole,name=org.alon.console -netdev tap,id=hostnet0,ifname=tap0,script=no,downscript=no -device virtio-net-pci,netdev=hostnet0,id=net0 -chardev socket,host=,port=6666,id=serial -serial chardev:serial -virtfs local,path=/home/alon/src/,mount_tag=src,security_model=mapped,writeout=immediate

qxl DRM driver after insmod and ls