Tuesday, April 16, 2013

SBT Generate Executable JAR

Similar to Maven SBT also has a plugin called assembly which can generate executable JAR files

Plugin GitHub URL

It is easy to config it following the instruction, but I do have problem to add custom task in SBT because it dose not have phase like Maven's life cycle. After all SBT is not that simple at all.

Tuesday, November 13, 2012

Nvidia GT220 Dual Monitor on Xubuntu12.10

I run into a problem when install Xubuntu on one desktop which has GT220 Nvidia video card.

Thanks for this post,

http://italyherald.wordpress.com/2012/05/08/how-to-fix-ubuntu-12-04-nvidia-gt220-freezes-with-dual-monitor-and-hdmi-audio/

I successfully fixed the issue with Nvidia 304.60 linux driver.

Firstly download Nvidia 304.60 driver
32bit from
http://us.download.nvidia.com/XFree86/Linux-x86/304.43/NVIDIA-Linux-x86-304.43.run
64bit from
http://us.download.nvidia.com/XFree86/Linux-x86_64/304.43/NVIDIA-Linux-x86_64-304.43.run
Save it to home directory

Remove existing video driver by


sudo apt-get --purge remove xserver-xorg-video-nouveau

And add those lines into  /etc/modprobe.d/blacklist.conf
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv



Reboot and during start press Ctrl-Alt-F1  to enter first console mode.
Turn off GUI by

sudo service lightdm  stop

If there is no command line terminal try press Ctrl-Alt-F3 login then run command
sudo sh ./NVidiaTabToCompleteTheFilesName.run



Thursday, November 1, 2012

Dual Monitor on Xubuntu

Install arandr from ubuntu software center and run it then set monitors layout properly and save settings into a shell script
Mine looks like

#!/bin/sh
xrandr --output VGA-1 --mode 1920x1080 --pos 0x0 --rotate normal --output DVI-I-1 --mode 1920x1080 --pos 1920x0 --rotate normal --output HDMI-1 --off

Add it into start up session in ubuntu session and startup settings.


Tuesday, September 4, 2012

Dropbox on Ubuntu12

Check this if dropbox broken on ubuntu
http://www.muktware.com/3742/dropbox-broken-linux



32-bit:
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf -

64-bit:
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

Now run the Dropbox daemon from the newly created .dropbox-dist folder.
~/.dropbox-dist/dropboxd

Thursday, January 12, 2012

See what process is using a TCP port in Windows

It is annoying to see "address already in use" in log files.

To check which process uses TCP port in windows,
1) netstat -ano
find the right port and remember the PID
2)tasklist /svc /FI "PID eq ${PID}"

Original Post

Tuesday, January 10, 2012

Checkstyle suppression configuration in Maven

Recently I ran into this checkstyle configuration problem. Basically we have this multi-module maven project and we would like to put checkstyle config and suppression in the parent maven pom but apparently checkstyle maven plugin not very happy with the relative path of suppression config file, for example


<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
<suppressionsLocation>config/checkstyle-suppressions.xml</suppressionsLocation>

During the build modules look for checkstyle-suppressions.xml at its own directory not parent and checkstyle plugin just simply ignores the error when file not found. Some people had the same problem with me on Stackoverflow and here too. I just choose the easy solution to add a new property in both parent and children pom files to set the correct location of the config file. 

parent pom

<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
<suppressionsLocation>${main.basedir}/config/checkstyle-suppressions.xml</suppressionsLocation>

<main.basedir>${project.basedir}</main.basedir>

children pom
<main.basedir>${project.basedir}/..</main.basedir>

And there is another way, I guess the better one, to share resource across project in Maven here.