-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile-run-hub
executable file
·76 lines (72 loc) · 3.45 KB
/
compile-run-hub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Hint 1:
# sudo setcap 'cap_net_bind_service=+ep' /home/dc/src/PtokaX/PtokaX
# sudo apt-get install mc vnstat nload liblua5.4-0-dev zlib1g-dev libtinyxml-dev lua-filesystem lua-iconv lua-sql-sqlite3 lua-svn libsqlite3-dev valgrind cmake build-essential sqlite3 screen curl subversion htop git
# sudo apt-get install mc vnstat nload liblua5.4-0-dev zlib1g-dev libtinyxml-dev lua-filesystem lua-iconv lua-sql-sqlite3 lua-svn libsqlite3-dev cmake build-essential sqlite3 screen curl htop
# allow dns requests to google nameservers
# iptables -A OUTPUT -p udp --dport 53 -d 8.8.8.8 -j ACCEPT
# iptables -A OUTPUT -p udp --dport 53 -d 8.8.4.4 -j ACCEPT
# block all other udp
# iptables -A INPUT -p udp -j DROP
# ip6tables -A INPUT -p udp -j DROP
#
#-----------------------------------------------------
# iptables -vnL
# for port in 411 80
# do
# iptables -A INPUT -p tcp -d x.x.x.x --dport $port -m connlimit --connlimit-above 10 -j DROP
# iptables -I INPUT -p tcp -d x.x.x.x --syn -j DROP -m connlimit --connlimit-above 20
# iptables -A INPUT -p tcp -d x.x.x.x --dport $port -m state --state NEW -m recent --update --seconds 60 --hitcount 20 --rttl -j DROP
# ##iptables -A INPUT -p tcp -d x.x.x.x --dport $port -m state --state NEW,ESTABLISHED -m string --algo bm --string '$MyNick' -j DROP
# done
#-----------------------------------------------------
#
#iptables -A INPUT -p tcp -d x.x.x.x --dport 80 -m connlimit --connlimit-above 10 -j DROP
#iptables -I INPUT -p tcp -d x.x.x.x --syn -j DROP -m connlimit --connlimit-above 20
#iptables -A INPUT -p tcp -d x.x.x.x --dport 80 -m state --state NEW -m recent --update --seconds 60 --hitcount 20 --rttl -j DROP
##iptables -A INPUT -p tcp -d x.x.x.x --dport 80 -m state --state NEW,ESTABLISHED -m string --algo bm --string '$MyNick' -j DROP
# iptables -I INPUT -p tcp -m state --state INVALID -j DROP
# net.ipv4.tcp_dsack = 0
# net.ipv4.tcp_ecn = 0
# net.ipv4.tcp_fack = 0
# net.ipv4.tcp_fin_timeout = 1
# net.ipv4.tcp_keepalive_intvl = 10
# net.ipv4.tcp_keepalive_probes = 3
# net.ipv4.tcp_keepalive_time = 30
# net.ipv4.tcp_low_latency = 1
# net.ipv4.tcp_max_orphans = 524288
# net.ipv4.tcp_max_syn_backlog = 1024
# net.ipv4.tcp_no_metrics_save = 1
# net.ipv4.tcp_retries2 = 10
# net.ipv4.tcp_sack = 1
# net.ipv4.tcp_slow_start_after_idle = 0
# net.ipv4.tcp_synack_retries = 3
# net.ipv4.tcp_syncookies = 2
# net.ipv4.tcp_timestamps = 1
# net.ipv4.tcp_tw_recycle = 1
# net.ipv4.tcp_tw_reuse = 1
# net.ipv4.tcp_window_scaling = 1
# net.netfilter.nf_conntrack_tcp_loose = 0
# net.netfilter.nf_conntrack_max = 2000000
#-----------------------------------------------------
# CentOS
# sudo yum install tinyxml-devel.x86_64
git pull
rm PtokaX
make -B -f makefile-sqlite lua51
ulimit -n 32768
ulimit -c unlimited
LANG=ru_RU.CP1251
if [ -n `locale -a|grep -i ru_RU.cp1251` ]; then
#export MALLOC_TRACE=/tmp/t
./PtokaX
#mtrace ./PtokaX $MALLOC_TRACE
#LD_PRELOAD=../liblog-malloc2.so PtokaX 1022>/tmp/ptokax-malloc.log
#export LD_PRELOAD
else
echo 'ERROR: run $sudo localedef -c -i ru_RU -f CP1251 ru_RU.CP1251'
fi
# ulimit -c unlimited
# valgrind --leak-check=full --leak-resolution=med --log-file=valgrind-log-file.log --time-stamp=yes ./PtokaX
valgrind --tool=callgrind ./PtokaX
#iptables -A INPUT -p tcp -d 193.70.112.113 --dport 80 -m state --state NEW -m recent --update --seconds 10 --hitcount 10 --rttl -j DROP
#iptables -A INPUT -p tcp -d 193.70.112.113 --dport 80 -m state --state NEW -m recent --update --seconds 10 --hitcount 10 --rttl -j DROP