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: