Productivity Sync Just another WordPress weblog

February 21, 2010

recordmydesktop can suck my balls.

Filed under: Uncategorized — admin @ 2:07 pm

WTF is it with this stuff? Do I *always* have to piss away 3 hrs getting something to work correctly?

recordmydesktop is a screen casting tool for recording audio and screen activity into a type of lecture.

out of the box lip sync is all fucked up. After screwing around with it and trying it on multiple computers I lucked out and found another blog that had most of what I needed. (google for “recordmydesktop broken pipe”) One of the hits is the one I used (thefunkcorner… “trials-with-recordmydesktop.html)

Anyway some of that didn’t apply to my hardware and after some more screwing around the magic command line to get a good screen cast with good lip sync is the following.

recordmydesktop --fps 5 --freq 44100 --buffer-size 65536 -device plughw:0,0 --windowid 0x1600003

You get the windowid using the xwindows command:


BTW for the screen cast of the console window session it gave me a data rate of 53KBS. Expect a file size of about 3MB per min out of the box.

February 20, 2010

Using ipython and numpy to do simple linear algebra computations

Filed under: Uncategorized — admin @ 5:16 pm

Every once in a while I need to solve a linear equation and I spend WAY too much time farting around looking for how to do it or attempting to do it by hand. (at one time I have programmed these things but I have long forgotten the details…)

Anyway enter ipython and numpy:
run ipython and have at it:

ipython -p numeric

import numpy
M = numpy.matrix([[a11, a12],[a21,a22]]) # the aij are Floats.
b = numpy.matrix([b1,b2]).T # the bj are floats

easy peesy.

while your at it if you want to make a graph try:

x = array([float(i)*pi/200 for i in xrange(1000)])
y = array([float(i)*pi/100 for i in xrange(1000)])

plot(x,sin(x),x, sin(y))
plot(sin(x), sin(y))

February 15, 2010

Beagleboard adventures

Filed under: Uncategorized — admin @ 11:07 am

I spent some time this weekend bringing up rowboat Android (Donut) and OpenEmbedded Angstrom beagleboard-demo-image up.  The following are notes/links for this effort.


The configure and build instructions pretty much just worked. I did need to install uImage package so I could build the kernel in the proper format. FWIW the build took about 1.5hrs for everything.

Configuring the uboot flash values and booting I used:

setenv bootcmd 'mmc init; fatload mmc 0 84000000 uImage; bootm 84000000'
setenv bootargs 'mem=256M androidboot.console=ttyS2 console=tty0 console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw init=/init rootwait omapfb.video_mode=640x480MR-16@60'
Beagleboard# saveenv
Beagleboard# reset 

The usb requires a hub for the keyboard mouse or event USB2ETH dongle to work.  The system boots and was not too bad.  The power management was anoying so I disabled it by setting the screen off time out to “never”.  The Pegasus USB2ETH dongle failed to work.  I think the kernel is misconfigured but as OE failed in a different way WRT network I can’t say for sure what the deal is.

FWIW I was impressed with the software graphics performance.  This image doesn’t include the PVR grahpics driver that needs to be downloaded from TI separtaly

Open Embedded Angstrom beagleboard-demo-image

holy shit this is a LONG build with a lot of slow downloads.

bitbake beagleboard-demo-image, is a big build too it took up 74,438,612 K of disk, There was some problems with building gimp and some of the extra locals, I had to hack some of the recipes a bit to get around.  When building with all the downloads already cached its a 7.6hr build on a 3Ghz, dual core box with 6MB L2 cache per core system.  (its a pretty fast box).  I even had PARALLEL_MAKE = “-j 2” and BB_NUMBER_THREADS = “2”.

diff --git a/recipes/images/ b/recipes/images/
index d83281c..b6e43df 100644
--- a/recipes/images/
+++ b/recipes/images/
@@ -1,6 +1,7 @@
 # Demo image for beagleboard

-IMAGE_LINGUAS = "de-de fr-fr en-gb en-us pt-br es-es kn-in ml-in ta-in"
+#IMAGE_LINGUAS = "de-de fr-fr en-gb en-us pt-br es-es kn-in ml-in ta-in"
+IMAGE_LINGUAS = "en-us"

 XSERVER ?= "xserver-xorg \
 xf86-input-evdev \
diff --git a/recipes/tasks/ b/recipes/tasks/
index f9867af..27a411a 100644
--- a/recipes/tasks/
+++ b/recipes/tasks/
@@ -22,11 +22,10 @@ RDEPENDS_${PN} = "\
 gecko-mediaplayer-firefox-hack \
 hicolor-icon-theme gnome-icon-theme \
 jaaa nmap iperf gnuplot \
-    abiword-meta \
-    gnumeric \
-    gimp \
+#    abiword-meta \
+#    gnumeric \
 powertop oprofile \
-    pidgin \
+#    pidgin \
 #    irssi \
 mplayer \
 gnome-games \

Configuring the uboot boot loader to do the right thing:

setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait omapfb.video_mode=1024x768MR-16@60'
setenv bootcmd 'mmc init; fatload mmc 0 84000000 uImage-beagleboard.bin; bootm 84000000'

February 14, 2010

Ubuntu 9.10 on the Acer 4810T (Timeline)

Filed under: Uncategorized — admin @ 11:06 am

Post ubuntu 9.10 x86_64 install fix-ups

What didn’t work:

  • brightness control
  • audio input
  • mouse pad annoyances
  • mouse pad on/off button works.  But only one time per boot, then no-mouse 🙁


  • brightness control:
    • edit /etc/default/grub.  Add “nomodeset acpi_backlight=vendor” to GRUB_CMDLINE_LINUX_DEFAULT.  (then run update-grub to make it stick)
  • audio input:
    • apt-get install linux-backports-modules-alsa-karmic-generic, then reboot
    • This fixes the sound recorder application but skype is still busted.
    • also some fiddling with alsamixer was needed (but I didn’t take notes on that.)
  • mouse pad annoyances:
    • to stop the god-damn menu pops from happening I hacked my .bashrc to hit ” synclient clickfinger2=0; synclient clickfinger3=0; synclient maxtaptime=0; synclient maxdoubletoptime=0″
    • I’m sure there is a better way but I don’t want to waist my time looking for it.
  • mouse pad on/off button.
    • edit /etc/default/grub.  Add “i8042.nomux ” to GRUB_CMDLINE_LINUX_DEFAULT.  (then run update-grub to make it stick)


February 13, 2010

How to disable anoying menu pop ups on new laptop

Filed under: Uncategorized — admin @ 8:58 am

When typing on my laptop my palm touches the mouse pad and frequently I get some f-ing menu that comes up and pisses me off, or worse cause me to lose data.

synclient clickfinger1=0
synclient clickfinger2=0
synclient clickfinger3=0

turns that BS off.

February 7, 2010

repo hacking and python reverse engineering

Filed under: Uncategorized — admin @ 7:52 pm

Adding a format-patch feature to the Android repo program

repo is the SCM tool for the google android project its basically a git try aggregator written in python.  Its ok, but when porting Android to a new platform you may want to generate patchsets of your changes of a well defined baseline.  The android project has a way of defininging baselines.  The manifest XML files contain a listing of all the projects, git tree paths, and optionally sha1 git object hashes for the defined version.  For instance there is a file eclair-20091115.xml that defines what the exact code base is for the November 15 2009 posting of the eclare code base.

It is useful to be able to extract the patch-sets from the port and distribute the enabling as a small patch set.  Hence the need for a format-patch feature.

The rest of this port is a combination of reverse engineering tricks and documentation of how the repo program is cobbled together.  Its mostly for me so I can remember what I did, but more importantly how I figured it out enough to make it mostly work.  (and what tripped me up)

  • Find __main__, grep -r __main__
  • see _Repo class, and its _Run function.
  • look closely at _Repo.__init__() what’s that all_commands all about/
  • oh, all_commands gets imported from subcmds!  Why, thats a directory with a file.
  • looking at subcmds/ we see an itteration over all the *.py files in that directory, that fills a dictionary “all” with classes defined (with the proper naming convention WRT the *.py filename…)
  • These subcmd classes need to each be a subclass of Command, and include an Execute function, to be called by _Repo._Run()

Now to find out how code was getting called I stooped to sprinkling print commands, pdb, and ipython loading of selected parts of the program.  I’m sure there must be a better way of doing this sort of thing but this is what I did.

  • first looked at how similar repo commands worked.  (like repo diff)
  • grep for diff, see has hits.  /me takes a closer look.
  • Also, recall how subcmds work, take a look at subcmds/

At this point I should point out the ctags -R * works for python programs.  you want the tags when brousing the code.

  • ooh, see PrintWorkTreeDiff() in its a function in the Project class.
  • At this point I want to know what are the members of the Project class instances.  How do get that data, (ipython is my friend…)
  • Two ways to go at this point pdb and print out selected arguments that get passed to constructors we care about.
  • stick import pdb and pdb.set_trace() in the Execute function in the subcmds/ file
  • use bt, up, and p to see arguments passed into run command.
  • also see that the _Repo() class instance is created by passing the path to the .repo directory.

Now lets go to ipyton and do some poking around.

  • cd the .repo/repo and start ipython.
  • import main
  • repo = main._Repo(‘blaba/.repo’)
  • see that repo._run(argv) sets up a cmd from the dictionay all_commands, lets look at one of those guys
  • diff = repo.commands[‘diff’]
  • lets look at what’s in this guy…
  • see that GetProjects() basically returns the self.manifest.projects in a list.  Looking around we see that the command.manifest is setup in _Run()
  • lets look at that, cmd.manifest = XmlManifest(cmd.repodir)
  • I now know I need one of these for the Baseline.  Lets subclass the XmlManifest do create my baseline manifest so I can get all access to all the goodies in each of the projects in that list.
  • but first lest look at what’s in a project.
  • man = main.XmlManifest(repo.repodir)
  • print man.projects.  Hmm its a dict.  with keys from the xml file.  lets look at one to the project  ojiects…
  • p = man.projects[‘GAID/platform/packages/apps/Sync’]
  • p. tab and look around at what we have.
  • lets try p.PrintWorkTreeDiff()

Ok, at this point I have a good bead on how this guy works.

To do my feature I need to add a function to Project, to do git format-patch, add a subclass to XmlMainfest for the baseline manifest files, and a subcmd/ with a FormatPatch subclass of Command.

So working with python comes down to a combonation of reading code, using pdb, ipython and perhaps some print’s in the code.

Nothing too magical, but these are what I needed to do.

Gotcha: when using subprocess, be sure to make every argument not have any spaces!  I got wrapped up with[‘git’,’format-patch’,’–output-directory /home’, rev]) only to finally figure out that the the 3rd parrameter should be the 3rd and 4th ones.  one trick is to use strace to see what the list should be:

strace -e trace=execve git format-patch –output-directory /home/mgross to see what should be passed in.

Handy bdb commands: help, n, up, down, s, l, p

its not too good at introspection.

Powered by WordPress