Thursday, April 16, 2015

Update Surface Pro with Ubuntu to support pen pressure sensitivity using the wacom drivers.

I purchased a Surface Pro tablet to be able to use it as a portable Cintiq tablet. I own a Cintiq 21ux and use it with Ubuntu. I was kinda disappointed after installing Ubuntu since pen pressure sensitivity did not work.

I poked around and realized that Microsoft shipped a wacom driver compatible device but changed the vendor and device id.

I wrote a script to use the wacom drivers and calibrate the stylus and eraser:

I'll try to add my changes to the wacom drivers to avoid having to do this hack if I get some time.

Saturday, March 16, 2013

Debug android NDK

I have been trying to debug my android application for a few weeks now, and was unable to set breakpoints.
I finally figured out that there is a bug in the NDK, following the steps in this article link
To be able to set breakpoints I had to only build only one version of the shared libraries to avoid the linker from choosing the wrong shared library. Basically I had to change the file with the following:
APP_ABI := armeabi armeabi-v7a
APP_ABI := armeabi #armeabi-v7a
Now I can continue using breakpoints within the android NDK.

Sunday, February 3, 2013

Ubuntu disable ctrl-p

Some laptops use ctrl-p to switch display. Ubuntu added support for this and broke my shortcut configuration. To disable ctrl-p switching displays type the following on a terminal:
dconf write /org/gnome/settings-daemon/plugins/media-keys/active false

Monday, July 2, 2012

Disable super key gnome shell 3.4 (gnome3)

I don't like how gnome-shell uses the super key for the overlay shortcut. This can be disabled by typing the following command in a terminal.
gsettings set org.gnome.mutter overlay-key ''
When changing workspaces only the primary monitor changes. To allow all monitors to change use the following.
gsettings set workspaces-only-on-primary false

Thursday, June 7, 2012

Generate XmlRootElement for jaxb objects

I recently had to add XmlRootElement to a class. After using google for a while, I finally figured out a way to do it. I Updated the pom jaxb plugin to include the annotate plugin and created a mappings file that customizes the jaxb object. pom.xml:
<!--?xml version="1.0" encoding="UTF-8" standalone="yes"?-->
<jaxb:bindings version="2.1"
    <jaxb:bindings schemalocation="filename.xsd" node="/xs:schema">
        <jaxb:bindings node="xs:complexType[@name='ObjectType']">

Wednesday, May 30, 2012

inotifywait - run scripts on file changes

When working on a project in Java, I often need to stop/start maven whenever I make changes to the source code. I wanted to have maven restart automatically whenever I changed the source code. I ended up using some bash scripts to get the job done. inotifywait will run the script whenever a file inside src is saved. This could also be done to automatically run test when source code changes.
while inotifywait -re close_write src; do ./; done
sleep 1
mvn tomcat:run -o &
pkill -kill -f tomcat:run

Tuesday, February 28, 2012

python rfoo rconsole

I ran accross this today. rfoo allows connecting to a remote running session of python and inspect the session's values, modify the data, etc. You can read more about it here Install in ubuntu:
sudo apt-get install python-dev
pip install cython
pip install rfoo
rconsole is a remote Python console with auto completion, which can be used to inspect and modify the namespace of a running script. To invoke in a script do:
from rfoo.utils import rconsole
To attach from a shell do: