WebOps Archive

Bash script to get average time from logs

What if we have logs of a server like apache or syslog server and we want to get average time from timestamps of all rows. How can we do it? Basically, we need to filter timestamp (column-8) from each row and just find its average. Below is the screenshot of the problem. (click on the

Kill multiple pid with same process

Sometime back I caught up in a situation where I need to kill multiple pid invoked from same process. So, all process have same name Assume, process invoked for “vim” editor. If I have 20 “vim” process running and I want to kill all of them, what’s the best way to do it? #There are multiple ways:

TCPDUMP examples

Tcpdump is a command-line based packet capture tool like wireshark which is GUI. Capture all traffic on ethernet interface: $tcpdump –i eth0 2. Filter by host IP-address: $tcpdump host 10.0.2.15 3. Filter traffic by source and destination ip-address: TCPDUMP filter by source and destination:             $tcpdump src 10.0.2.15        

CURL command examples

CURL is a command line tool used to transfer and retrieve data in web. Let’s have a look at few of the useful options while debugging web issues. Basic syntax $CURL <Options> <hostname or ip-address> Options are optional. Hostname and IP-address can be interchanged depends upon the options we are selecting. First example is to use