Monday, February 4, 2013

Maven: debugging

If you've ever been in the situation that you'd need to debug maven build, these are the options that could help.

Debugging maven run

If you need to debug maven plugins run itself use instead of standard:
mvn <your sfuff>
the debug one:
mvnDebug <your sfuff>
It should tell you it's waiting for connection, in a way like this:
Preparing to Execute Maven in Debug Mode
Listening for transport dt_socket at address: 8000
Afterwards use your preffered way to connect to socket 8000 via remote debugger. (For eclipse steps can be found here, or googled)

Debugging test execution

If you need to debug maven-surefire-plugin run use following:
mvn -Dmaven.surefire.debug test
It would wait for connection, in a way like this:
Listening for transport dt_socket at address: 5005
Afterwards use your preffered way to connect to socket 5005 via remote debugger. (For eclipse steps can be found here, or googled)
Easy, isn't it?

Thursday, January 31, 2013

current twitter problems

Twitter seem to be facing some problems at least in my case :(

However the status pages are really nice :)



Friday, January 25, 2013

fedora and freebsd kernel (hoax)


Have you already read the news related to Fedora on freebsd kernel plans for Fedora 19?

Well, that sounds like an ambitious goal. But who is spreading the news?
Some sources people usually trust:
- slashdot: http://slashdot.org/submission/2464323/fedora-proposal-to-support-freebsd-kernel-and-cinnamon-by-default as well as on
- phoronix: http://www.phoronix.com/scan.php?page=news_item&px=MTI4MzQ

But what is the source of this breathtaking decision? In both cases it's fedora wiki: https://fedoraproject.org/wiki/Features/FreeBSD_kernel_integration

And now the funny/real part.

Check the history of wikipage:
https://fedoraproject.org/w/index.php?title=Features/FreeBSD_kernel_integration&action=history
As it's obvious it's been clarified, it's just a joke.

But what is the root cause behind all this?


From now on for the czech speaking people only :)

Original idea: as a result of discussion/comments for the cinnamon coming to fedora news: http://www.abclinuxu.cz/zpravicky/cinnamon-jako-vychozi-rozhrani-ve-fedore-19#9

And the situation clarification is in comments under: http://www.abclinuxu.cz/zpravicky/freebsd-kernel-ve-fedore-19

It's really worth reading :) and enjoying the way how easy it can be to mislead people if you convince source they trust :)

Monday, January 21, 2013

Linux liveCD for unencrypted partition access

Q: Have you ever needed to manipulate the data on the hdd where there would be no operating system to boot to?
A: Linux liveCD could be the answer.

Recently I faced similar problem. In my case it was due to my "wise idea" of putting "/" including "/home" on the same partition, and as I went out of disk space. After reboot, ubuntu was not able to complete the process all the way up to working UI.

Please note that this is the case of unencrypted ext3 filesystem. Might not be your case.

following steps might work (as they did for me):
  • download on the other machine some livecd (livecd of ubuntu could be an option)
  • if there is empty usb key available use: pendrive linux (http://www.pendrivelinux.com/), which has really easy interface, it seems to be able to do even the download of the selected distro for you and does the job of conversion of the liveCD image to bootable usb key
  • after booting from USB on the problematic PC and having some window manager loaded (might be Unity for Ubuntu)
gksudo nautilus
if you can see the mounted filesystem there, you're lucky, just do whatever is required (possibly delete some non-critical stuff).

Otherwise (as in my case) follow the later steps:
sudo fdisk -l
this should show you all the partitions. It's important in this step to identify the one you're interested in to see the files of. You can find it based on size. As I assume you can read the output and find the important one.
In my case it was:
/dev/sdbX
now as we know the partition, let's mount important one:
sudo mkdir /media/ubuntu
sudo mount /dev/sda6 /media/ubuntu
sudo cd /media/ubuntu
now check how much is your disk occupied using:
df -h
afterwards, manipulate the files in a way you need to (possibly delete some non-critical stuff).
I used:
rm -rf /media/ubuntu/home/<user_name>/<some_dir>
And that should be it.
Happy rebooting and using the original system (if there is one) :)

And if you feel like this is too muuch technical task for you to accomplish. Just let me know that with my guidance over the skype call, my wife was able to do these steps successfully, while she's not friend of the linux cli at all.

Monday, January 7, 2013

audacious - audio player for me

Q: What is the most usable cross-platform audio player for me?
A: I've found Audacious (http://audacious-media-player.org/).

I've been searching for a usable audio player for quite some time.
I intentionally won't say best one, but rather usable one, as my player of choice during the years keeps changing :)

My (current) requirements

Might be quite user specific, but still, here they are:
  • runs on linux (windows would be a plus, however since my recent job change, I don't need windows neither at home nor at work)
  • free, or better open source licensed (rather my decision, than a need)
  • integrates lyrics into the UI
  • can be minimized to system tray (by closing it)
  • playback can be controlled by the keyboard (when in the player UI), as I hate those, that can be controlled by mouse only (I consider mouse beeing much slower input device for the specific actions that keyboard)
  • shouldn't eat all my resources just to play music in the background

Well, as far as I remember during these years of my music listening experience I've been using following (more less chronologically)

winamp (http://www.winamp.com/)

  • was quite some time ago, in my "windows ages"
  • I still like it's original look and consider it's UI designers unbeated (with respect to idea and it's realization)
  • major blocker was for me however no linux port

xmms (http://www.xmms.org/)

  • worked well for me on linux
  • supported winamp skins => more less same look
  • not available any more in the most linux distros these days
  • in the time I've been using it I needed windows port as well, there was no such, but winamp did the job there

songbird (http://www.getsongbird.com/)

  • I liked the UI integration of all the song related stuff, but finally I've found myself using only lyrics in my daily life
  • this was the first one, when I started to be OK with no winamp-like look (so it was very valueable for me for my future choices)
  • there were quite some problems with linux port, these made me believe there has to be an alternative:
    • first: no official packages in major linux distros 
    • then: officially announced discontinued support for linux  
    • nightingale (it's linux port http://getnightingale.com/) - had no stable/usable release for quite some time 
    • in the meantime I changed already
  • moreover was quite resource consuming

amarok (http://amarok.kde.org/)

  • worked well for me on linux
  • I even wrote a small plugin for it: http://kde-apps.org/content/show.php?content=137205
  • had nice lyrics integration 
  • ubuntu notifications worked/looked well
  • however I've come to conclusion that there should be some more lightweight/performant player available (for the simple needs I have)

clementine (http://www.clementine-player.org/)

  • worked well for me on both platforms
  • as I've been used to amarok this was to me only a more performant version (as they forked old amarok version)

audacious (http://audacious-media-player.org/)
  • works well for me these days
  • fulfills all my requirements I mentioned in the prio section
  • the greatest advantage to clementine I see is the lower CPU usage

Now the question is: What is your audio player of choice?

Friday, December 14, 2012

jumpstart with eclipse, maven and tomcat (web/app server)

Q: What is the quick way to setup Eclipse war (possibly ear) project built with maven? 

A: In short: Eclipse + wtp + m2e + m2e-wtp

Sometimes from idea to it's realization is not an easy way.

If you're in a need to quickly setup java war project and you like the tools I do: maven, eclipse and tomcat (or any other server of your choice) following might be useful to jumpstart realizing your ideas.

My requirements

I've searched for a solution that would enable me to:
- use eclipse for application development
- manage server lifecycle directly from eclipse and
- use maven as a build tool.

My choice

Following has been found and based on the short project I've tested it with, it worked very well:
- eclipse - no doubts here (it's my favorite IDE for java development)
- wtp - fits me best for the server management directly from eclipse
- m2e - maven eclipse integration (as I'm in love with maven)
- wtp-m2e - wtp m2e integration (this one I've been missing in the puzzle, but only until today)

As  the last one mentioned was new to me the following video convicted me that it's something I need:

 
(the video is reffered on the official site as well)

After the initial project setup (depicted on the video) right clicking on the project and choosing "Run/Debug As" -> "Run/Debug on Server" does the job of publish and run/debug.

And once you change your project contents automatic republish happens in the background as well.

Sounds like the initial infrastructure setup time for my next project can be the question of seconds rather that hours.

Friday, November 30, 2012

My fedora java 7 update

Today I've migrated to java 7 (Oracle version), as our development environment has been "java 7 enabled".

The transition was "rather" smooth, I just had to follow following description: http://fedorasolved.org/Members/zcat/using-sun-java-instead-of-openjdk

When I mentioned "rather", it was not due to description present on the mentioned site :). After I rebooted I could not login to my xfce (or gnome,...), login screen was shown again even after correct password input.

The problem was caused by my laziness. I didn't really read what I copy/pasted :)

After switching to text mode (Ctrl+Alt+F<X>) I've observed some EOF reported problem right after login. And my bash didn't behave :) I had to provide full path when invoking commands.

When thinking of what I've changed, file: /etc/profile.d/sunjava.sh started to be suspicious, after opening it via:
/usr/bin/sudo /usr/bin/vi /etc/profile.d/sunjava.sh
(yes, path didn't work for me somehow :)

my suspect changed to culprit when seeing the content:
export JAVA_HOME=/usr/java/default
export PATH=\$JAVA_HOME/bin:\$PATH
EOF
after fixing it to:
export JAVA_HOME=/usr/java/default
export PATH=$JAVA_HOME/bin:$PATH
and doing the reboot afterwards, via:
/usr/bin/sudo /usr/bin/reboot
all started to work as expected.

So it seems trivial things might become challenges in my hands :)
Now I see why I became a programmer rather than a doctor :)