So HAProxy is primalery a load balancer an proxy for TCP and HTTP. But it may act as a traffic regulator. It may also be used as a protection against DDoS and service abuse, by maintening a wide variety of statistics (IP, URL, cookie) and when abuse is happening, action as denying, redirecting to other backend may undertaken ([haproxy ddos config], [haproxy ddos])
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
a = [('0001'..'9999').to_a, | |
('D000'..'D999').to_a, | |
('E000'..'E999').to_a].flatten | |
a.each_slice(20).each { |e| | |
puts e.join(",") + ',' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.upto(24).each { |e| | |
ip = 190 + e | |
puts <<__EOF__ | |
auto eth1:#{ip} | |
iface eth1:#{ip} inet static | |
address 192.168.1.#{ip} | |
netmask 255.255.255.0 | |
__EOF__ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 10.0.100.2 ON <=> 94.190.187.19 added by script 2019-05-15 | |
iptables -A DNAT187 -d 94.190.187.19 -j DNAT --to-destination 10.0.100.2 | |
iptables -A SNAT00 -s 10.0.100.2 -j SNAT --to-source 94.190.187.19 | |
# 10.0.100.204 ON <=> 94.190.180.109 added by script 2019-05-15 | |
iptables -A DNAT180 -d 94.190.180.109 -j DNAT --to-destination 10.0.100.204 | |
iptables -A SNAT00 -s 10.0.100.204 -j SNAT --to-source 94.190.180.109 | |
# 10.0.110.57 ON <=> 94.190.180.235 added by script 2019-05-15 | |
iptables -A DNAT180 -d 94.190.180.235 -j DNAT --to-destination 10.0.110.57 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data =<<__EOF__ | |
10.0.100.2 94.190.187.19 ON | |
10.0.100.204 94.190.180.109 ON | |
10.0.110.57 94.190.180.235 ON | |
10.0.110.58 94.190.180.121 ON | |
10.0.110.73 94.190.180.42 ON | |
10.0.150.100 94.190.179.142 ON | |
10.0.199.197 94.190.181.7 ON | |
10.0.20.198 94.190.181.165 ON | |
10.0.200.173 94.190.179.130 ON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim:filetype=ruby | |
p = 1641.23 | |
p = 1914.77 | |
cd = (p * ( 10.00/100 )) | |
dd = ((p-cd)*( 5.00/100 )) | |
cash = p - cd - dd | |
puts "=" * 60 | |
puts ("%8.2f - %8.2f - %8.2f = %8.2f" % [ p, cd, dd, cash ]).center(60).rstrip | |
puts ("%8s - %8s - %8s = %8s" % %w(сума печалба дивидент крайна) ).center(60).rstrip | |
puts ("%8s - %8s - %8s = %8s" % %w(сума 10% 5% крайна) ).center(60).rstrip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = <<__EOF__ | |
node-bg-os 127.0.0.1 127.0.0.1 | |
__EOF__ | |
require 'net/ssh' | |
exit if ARGV[0].nil? | |
count = 0 | |
data.split(/\n/).each do |line| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
domains = %w( | |
beeehappy.eu | |
gb-scaf.bg | |
jambo24.bg | |
knijka.bg | |
lammen.bg | |
onebeerwith.me | |
silvercourt.bg | |
varna-easytransfer.com | |
varna-easytransfer.ru) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> beeehappy.eu | |
beeehappy.eu has address 139.162.131.252 | |
beeehappy.eu mail is handled by 0 mail.beeehappy.eu. | |
beeehappy.eu. 299 IN TXT "v=spf1 +a +mx +ip4:139.162.131.252 +ip4:91.215.216.43 +ip4:91.215.218.156 ~all" | |
mail.beeehappy.eu has address 91.215.218.156 | |
=> gb-scaf.bg | |
gb-scaf.bg has address 139.162.131.252 | |
gb-scaf.bg mail is handled by 0 mail.gb-scaf.bg. | |
gb-scaf.bg. 14399 IN TXT "v=spf1 +a +mx +ip4:139.162.131.252 +ip4:91.215.216.43 +ip4:91.215.218.156 ~all" | |
mail.gb-scaf.bg has address 91.215.218.156 |
NewerOlder