Skip to content

Instantly share code, notes, and snippets.

@zviederi
zviederi / java-info
Last active March 4, 2020 13:04
How to get info about java on Linux/Unix machine
Command to get info:
java -XshowSettings:properties -version
Get tomcat info:
java -cp lib/catalina.jar org.apache.catalina.util.ServerInfo
@zviederi
zviederi / remote-port
Last active February 8, 2019 08:53
Test if a port on a remote system is reachable
Test if a port on a remote system is reachable:
nc -zv 10.57.1.61 3307
@zviederi
zviederi / port-forwarding
Last active February 8, 2019 08:51
SSH Port Forwarding
Hint, how to use port forwarding, which allows forward traffic on a port of your local computer to the SSH server, which is forwarded to a destination server.
On your local computer, type in command line:
ssh -N -L 7000:destination.server.com:9300 user@example.com
Any traffic comes to this port is sent to the SSH server and traffic received is sent to port 9300 of destination.server.com, which is the server itself.
Now, you get access to use 127.0.0.1 as the host and 7000 as the port.
@zviederi
zviederi / durationTime.groovy
Last active May 24, 2019 11:46
How to calculate elapsed/duration time in Groovy/Grails
import groovy.time.TimeCategory
import groovy.time.TimeDuration
def timeStart = new Date()
// do something here
def timeStop = new Date()
TimeDuration duration = TimeCategory.minus(timeStop, timeStart)
println duration