Skip to content

Instantly share code, notes, and snippets.

View pwielgolaski's full-sized avatar

Piotr Wielgolaski pwielgolaski

View GitHub Profile
#!/usr/bin/env python
import subprocess
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from urlparse import parse_qsl, urlparse
commands = {
"/hello": "cmd /c echo hello {name}"
}
@pwielgolaski
pwielgolaski / MySimulation.scala
Created April 17, 2017 10:01
Simulation with group checker
package io.gatling.test
import io.gatling.app.Gatling
import io.gatling.commons.util.ClockSingleton.nowMillis
import io.gatling.commons.validation.Failure
import io.gatling.core.Predef._
import io.gatling.core.action.builder.ActionBuilder
import io.gatling.core.action.{Action, ExitableAction}
import io.gatling.core.session.{Expression, Session}
import io.gatling.core.stats.StatsEngine
@pwielgolaski
pwielgolaski / gist:cd655afa50d9688ccecffa08730b22cd
Last active January 26, 2017 20:41
connection start per pid
netstat -tap --numeric-port 2>/dev/null |\
awk 'NR >2 { print $6,$4,$5,substr($7,0,index($7, "/")-1);}' |\
sort -ru |\
awk -v pids="$1" 'BEGIN {OFS=","} { port=substr($2,index($2,":")+1) } pids !~ $4 {next} /LISTEN/ { listen[port]=1; $1="LIS"; print $0; next} { (port in listen)?$1="IN":$1="OUT"; print $0 }'