Wednesday 15 May 2013

Gunzip a file on linux

Problem: To zip a file on linux we can use utility like gzip

Solutiongzip -c trace.txt > trace.gz
The above command will compress the file trace.txt

Taking TCP Dump on Linux

Problem: Some times we need to monitor data that is flowing between systems. We can use tcpdump utility to take dump of the data and analyze the data (trace) with tools like wireshark.

Solution
tcpdump -i <interface> -s 65535 -w <some-file> 

Example:  tcpdump -i eth0 -s 65535 -w trace.txt

Tuesday 7 May 2013

Running jetty server as background process in linux

Problem: Some times we need to run jetty server as background process in linux so that when we close the terminal the server will not stop.

Solution: nohup utility can be used to run jetty server (java process) in background. Following command can be used.

#nohup java   -jar start.jar jetty.port=18080  &

In the above command we are running jetty server on port 18080 as back ground process.