Saturday, August 4, 2012

Gollum Personal Wiki on Openshift

My tabs are begging me to be closed. Even Firefox asks the same.

I have decided that I need to store some of that information somewhere, and that I couldn't just rely on Bookmarks mechanism since I haven't read properly all of those pages and I wouldn't be able to search for the info I would need.


So I have decided I needed a personal wiki.

I wanted something that I could easily push on the web, on Openshift ideally.


I've found out this post:

http://www.highlevelbits.com/2011/11/my-precious-wiki.html


That suggest the usage of Gollum, a personal Wiki based on Sinatra/Rails.

You do not need to know anything about the underlying technology to deploy and use it.

When you want to use it offline, you just have to un

gollum


and the command will execute an in memory webserver that will host locally your wiki. You can start to use it, to read and write what you need and once in a while you just have to push to Openshift git repository to publish all your work online.

The tutorial is a little outdated but it's easy to understand what to change to obtain the result.

If you need any help just drop a line ;)


Note:

Fedora needs  python-pygments and python-develfor the code syntax features


Thursday, August 2, 2012

Gnome Extensions Installation Silent Error

I was one of those unlucky ones not able to install Gnome Extensions via the website, on my Fedora 17.

 I've found out I wasn't the only one but we were not a big number and there was not a clear solution to our problem.

 Apparently I have found that is somewhat related to SSL and the time set in you laptop. Yes. I do not why, but it was definitely my case.  

This is the error I was receiving:

JS ERROR: !!!   Exception was: TypeError: info is null
JS ERROR: !!!     lineNumber = '83'JS ERROR: !!!     fileName = '"/usr/share/gnome-shell/js/ui/extensionSystem.js"'
JS ERROR: !!!     stack = '"([object _private_Soup_SessionAsync],[object _private_Soup_Message])@/usr/share/gnome-shell/js/ui/extensionSystem.js:83"'
JS ERROR: !!!     message = '"info is null"'

If you are also unable to join your Google account to your Gnome 3 profile, ( Check with the Google one since the other options were working fine ) you will probably have my same problem.

For some reason that I cannot explain it seems that the clock or the timezone set on you Linux are involved in the problem.

 Try to change them switching form either network updated to something else like New York timezone and repeat the process.
It's enough to check if you can join the Google account.

As soon as you see you are able, also the extension installation is fixed.

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