Monday, July 30, 2012

Class Broswer Plugin for Gedit

I have just installed a useful plugin for gedit on Fedora 17:

 https://launchpad.net/gedit-classbrowser3g

It provides you a nice pane with method and classes, useful when you are inspecting a portion of code and you do not want to open it in the start to load Eclipse. To work correctly it requires ctags package to be installed too.

Give it a try!

And since it's always nice to stash information all in one place I've also added these ones:

 https://code.google.com/p/advanced-find/

 https://github.com/jonocodes/GeditSplitView

Monday, June 25, 2012

Open Shift on Feodra 17

I have just moved from RHEL 6 to Fedora 17. Not completely seamless but probably I had part in the mess. Anyway it's been quite simple and still feeling more a Windows user than a Linux one, seeing that to restore my previous programs and configurations it is just a matter of moving files, like I used to do on Windows choosing Portable Application make me feel happy (and save a lot of time)

I decided I needed to blog here since I have found a problem with Red Hat Open Shift installation procedure.

If you follow the official steps on Open Shift site you'll receive a 404 error, very disappointing.

But the bug has already been tracked:

https://bugzilla.redhat.com/show_bug.cgi?id=826808 

Anyway it seems that Fedora already includes the right packages, they are just with a slightly different name:

yum search rhc

#will lead you to: 

yum install rubygem-rhc



that will provide you the rhc command!


Sunday, March 4, 2012

RHEL 6 - Toggle trackpad when mouse is plugged in/out

Too often on my RHEL system I hit the mousepad when writing or doing something else, with the result of typing in the wrong part of the document.
This is even more annoying when I am sitting at my desk, with my mouse plugged.
I know that there is a setting to disable the mousepad when typing but I wanted something more robust.

For this reason here is a little guide about how I managed to automatically disable the mousepad when I plug in a usb mouse and how to enable it back when I unplug it.

You need some utility to query your mice.

sudo yum install xorg-x11-apps

Now we can have a list of the recognized plugged input devices on your system:

$ xinput list
⎡ Virtual core pointer                     id=2 [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer               id=4 [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                    id=13 [slave  pointer  (2)]
⎜   ↳ Macintosh mouse button emulation         id=14 [slave  pointer  (2)]
⎜   ↳ Logitech USB Laser Mouse                 id=16 [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad               id=15 [slave  pointer  (2)]
⎣ Virtual core keyboard                    id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard              id=5 [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                   id=6 [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard             id=7 [slave  keyboard (3)]
    ↳ Lid Switch                               id=8 [slave  keyboard (3)]
    ↳ Integrated Camera                        id=9 [slave  keyboard (3)]
    ↳ Sleep Button                             id=10 [slave  keyboard (3)]
    ↳ Video Bus                                id=11 [slave  keyboard (3)]
    ↳ Power Button                             id=12 [slave  keyboard (3)]

My laptop has a touchpad(id=15) and a trackpoint(id=13).
And you can see an entry for my usb mouse (id=16)

If you just want to disable manually the mousepad or any other device it is quite easy.

It is just a matter of:


xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1 # to enable
xinput --set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0 # to disable


Now if we want to automatically execute this commands when the mouse is plugged/unplugged we need to use udev.

sudo yum install udev

We create a new rules file in udev configuration folder:

sudo gedit /etc/udev/rules.d/61-touchpad.rules

And add this code:

# 61-touchpad.rules
#
# this rules file must be named 61* or later because it won't work
# unless it runs after '/lib/udev/rules.d/60-persistent-input.rules'
#
# NOTE: will only affect DISPLAY :0
#
# run:
#   udevadm test --action=add /sys/devices/platform/i8042/serio1/input/input6/mouse1
# or similar to test the following rules
#

ACTION=="add", SUBSYSTEM=="input",  ENV{DISPLAY}=":0.0", DEVPATH=="*/mouse?", RUN+="/usr/bin/xinput --set-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 0"
ACTION=="remove", SUBSYSTEM=="input",  ENV{DISPLAY}=":0.0", DEVPATH=="*/mouse?", RUN+="/usr/bin/xinput --set-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 1"

And we have done!

Try to plug/unplug if it is behaving like expected!


In case of problems there is a way to debug udev events, in case the rules we defined do not apply exactly to your hardware configuration:

sudo killall udevd
sudo udevd --debug-trace --debug

To restart udevd when you have finished the debug:

/sbin/start_udev

Useful link:

https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Disable_touchpad_upon_external_mouse_detection

Wednesday, December 14, 2011

Java in the Cloud

I actually hate the Cloud buzzword. But a word is needed to describe the whole world of ideas and problems that developing and deploying towards a SOA over the internet is needed.

This webinar http://www.infoq.com/presentations/Grails-in-the-Cloud helps to understand all this universe. It does it with the Grails excuse, but it is much more generic, and for this reason, useful.

The first useful concept it explains is the definition of PaaS and in which way it decouples from the generic infrastructure (virtualization) cloud.

I like to define the PaaS concept as a 2nd level virtualization. You are yes working in a virtual environment, but you are further from the virtual machine. You are just required to be aware to services exposed to you: a database, a web container or whatever. You are not responsible to install an operating system in a virtual machine, and on top of that install you typical services. They are already there for you. You can consider yourself nearer to you business problem.

And on the other side, the fact that you are no longer the one responsible of setting up all the services will benefit of all those people that are actually good at doing this task. In fact a good idea that they had is at the moment present in Cloudbees: a multi stages development environment that offers you both a production context and a development context, with the possibility to promote stuff from development to production. It is an implementation of "Continuous Deployment".

Monday, July 25, 2011

Placeholder

Hallo, I' just started a new job that will require me a lot of reading and documentation. As soon as I will have time to write something properly I'll do that.

For now I just put here all the readings I am doing just for a personal reference.

The Zen of Class Loading
JBoss AS7 OSGi Demonstration with Thomas Diesler
OSGi: A Proven Approach for Developing Modular Applications
The basics of Java class loaders
How to create a memory leak with Java



MXBeans
To roo or not to roo

Monday, September 14, 2009

The first present Groovy has made me...

Disclaimer:
Once again i'm moving from Dustin word. Please, don't worry, i'm not a sort of maniac, it's just a coincidence! =)


In my presentation post i wrote that i'd like to talk about Groovy, Grails, Patterns AND Php and Drupal.

And Dustin in his encouraging comment showed an interest in the first three subject. Well, i totally agree with him!


Actually i hate Php (and i just started to stop hating Drupal CMS).


I come from a Java experience. Event spent time on the SCJP to dig deeper. And as you may guess this is enough to love Groovy.
And Design Patterns, you know, are the vocabulary of this work, and a wonderful exercise to understand what Object Oriented Programming really means. (I want to speak about this in another post...)
I've found a common feeling of repulsion between my coworkers and friends, about web programming and i feel this too.
But i have to admit that our feelings were born with the early days of web programming, full of confusion, improvisation and stress caused by the (actually never ended) browsers war. I bet that these same feelings moved people to invent stuff like Struts, Rails and Grails... And because those people hated web programming so much they managed to realize wonderful products that relief us from the sufferings of spaghetti web programming.

But due to my new job requests i'm stuck with php even with those good products around!

Panic!

But listen what i'm discovering in my desperation: that some of the Groovy features i liked that make me consider java as obsolete are present... I recognize it, i do not know how long those features are there but i discover them only today .

And i have to admit the probably i'm able to understand and use the native syntax for maps, closures and parameters defaults without difficulty thanks to the time spent learning Groovy...


In italian we use to say that this kind of silly discovers are like the discovery of hot water.

Sure it is... But i just happy for path that casually drove me through all these step and that took me here.


What's the lesson? Well, maybe someone raised in Php, could make the jump to the Java/Groovy world with less pain than i could ever figured...

Sunday, September 13, 2009

About the title

Someone may be thinking about the meaning of the title of this blog: "Someday Never Comes".

Well, it's the title of a beautiful Creedence Clearwater Revival song. In the song, the singer yell his unsatifsfaction about the idea that every time, during all his life, he asked a question, he was told that he'll understand the answer someday in future. And he sings that the problem is right that this someday never comes.

Well, this is like a metaphore about learning to me. I work, study, read a lot of stuff and there's alway some other interesting stuff to learn. Something to dive into. Some old concept that gains a complete new meaning to me today, even the sentence that describe it is the same old one.

So "Someday Never Comes" represents to me this sort of mix betwen a complain and a joy. That there always something to think about.

The day i'll know all that i need never comes.