Thursday, October 17, 2013

SSH Port Forward multiple hops

Let's use VNC server two hops away.

ssh -4 -v -A -t -L 15902:localhost:15902 user1@host1 \
ssh -4 -v -A -L    15902:localhost:5900  user2@host2

vncviewer localhost:15902

Wednesday, October 16, 2013

Enable VNC Server on Mac OS X remotely

Thanks Apple, they use shell.

ssh to Mac OS X

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -configure -clientopts -setvnclegacy -vnclegacy yes -setvncpw -vncpw YOUR_PASSWORD  -access -on -users admin -privs -all -restart -agent -menu

Src: don't rememmber

Decompiling Java classes on Linux with Krakatu just for fun


To execute:
python decompile.py -path libs/lib1.jar -path libs/lib2.jar -out decompiled.dir/ jar_to_decompile.jar

Parse JUnit XML reports and output them in HTML

Just add following to ant's task:

<junitreport todir="build/reports">
    <fileset dir="build/reports">
        <include name="TEST-*.xml"/>
    </fileset>
    <report format="frames" todir="build/reports/html"/>
</junitreport>


Auto build project with ant in Eclipse

Who needs Eclipse if there is a shell?

In Eclipse, go to Project's properties and add a new builder of type ant.

On tab Main provide:
  • Build file
  • Base Directory
  • Desired arguments that will be passed to ant ( -Dproperty=value style)

On tab Targets provide ant tasks for targets Auto Build, After a Clean.

Now you can just change sources and save the source file, 
Eclipse will execute "Auto Build" target right away.