Inspiration: Linux and Unix nc command
Example protobuf definition:
message Person {
required string name = 1;
required int32 id = 2;| # https://www.percona.com/blog/2008/11/07/poor-mans-query-logging/ | |
| tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings | perl -e ' | |
| while(<>) { chomp; next if /^[^ ]+[ ]*$/; | |
| if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER)/i) { | |
| if (defined $q) { print "$q\n"; } | |
| $q=$_; | |
| } else { | |
| $_ =~ s/^[ \t]+//; $q.=" $_"; | |
| } |
| Detecting and Mitigating DDOS Attacks | |
| #List all Finish (FIN) packets | |
| machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 1 != 0' | |
| #List all SYN and SYN-ACK packets | |
| machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 2 != 0' | |
Inspiration: Linux and Unix nc command
Example protobuf definition:
message Person {
required string name = 1;
required int32 id = 2;Use TCPDUMP to Monitor HTTP Traffic
tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
| # osx | |
| lsof -iTCP -sTCP:LISTEN | |
| # linux: tuna please! | |
| netstat -tunapl |
| // +build ignore | |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "runtime" | |
| "syscall" | |
| ) |
# deploy (example)
rpm -iv pkg-{version}-x86_64.rpm
# list current version
rpm -qi pkg
# uninstall
rpm -ev pkg| # osx | |
| cat test.http | nc -l -p 8000 | |
| # linux | |
| cat test.http | nc -l 8000 | |
| # centos fix | |
| # http://serverfault.com/a/729768/71640 | |
| # Removes the old package | |
| yum erase nc |