Skip to content

Instantly share code, notes, and snippets.

@x2c3z4
x2c3z4 / requestor.awk
Created November 14, 2016 02:56 — forked from sinegar/requestor.awk
Combine tcpdump packets into requests and response times.
#!/usr/bin/awk -f
# #
#
# Inspired by http://www.percona.com/doc/percona-toolkit/2.1/pt-tcp-model.html
#
# Example usage:
# $ tcpdump -i any -s 0 -nnq -tt 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
# 1349692787.492311 IP X.X.X.X.XXXX > X.X.X.X.XXXX: tcp 1448
# $ ./requestor.awk dump.file
for username in a b c;do
useradd -d /home/${username} -m ${username} -s /bin/bash
pass=`echo $username | rev`
echo -e "$pass\n$pass" | passwd ${username}
echo "${username} ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/${username}
sudo chmod 0440 /etc/sudoers.d/${username}
done
fio --bs=4k --ioengine=libaio --iodepth=128 --size=1g --direct=1 \
--runtime=60 --filename=/tmp/file --name=rand-write --rw=randwrite
brew update
brew upgrade openssl
brew link openssl --force
brew install --with-openssl curl
brew link curl --force
@x2c3z4
x2c3z4 / ddos-deflate-install.sh
Created September 8, 2016 03:08
ddos-deflate
cd /opt
wget https://github.com/jgmdev/ddos-deflate/archive/master.zip
unzip master.zip
rm master.zip
cd ddos-deflate-master
./install.sh
echo '# Paths of the script and other files
PROGDIR="/usr/local/ddos"
UsePAM yes
PasswordAuthentication yes
GatewayPorts=yes
tunip=`proxychains4 ssh root@abest.me "ip addr show" | grep inet | grep tun0 | awk '{print $2}' | awk -F/ '{print $1}'`; ;ssh root@$tunip
debootstrap --arch=amd64 xenial ubuntu http://cn.archive.ubuntu.com/ubuntu/
systemd-nspawn -bD ubuntu --bind /root:/root --bind /home:/home
config rule
option src 'wan'
option target 'ACCEPT'
option proto 'tcp'
option dest_port '22'
config 'rule'
option 'target' 'ACCEPT'
option 'src' 'wan'
option 'proto' 'tcp'
wget http://www.inet.no/dante/files/dante-1.4.1.tar.gz
tar xvfz dante-1.4.1.tar.gz
cd dante-1.4.1
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-client \
--without-libwrap \
--without-bsdauth \