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 hidden or 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
| # tcpdump -A -nn -s 0 'tcp dst port 9200 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i lo | |
| tcpdump: verbose output suppressed, use -v or -vv for full protocol decode | |
| listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes | |
| 14:32:33.525122 IP 127.0.0.1.49777 > 127.0.0.1.9200: Flags [P.], seq 313752908:313753888, ack 2465010394, win 257, options [nop,nop,TS val 2684167067 ecr 2684167066], length 980 | |
| E...^.@.@............q#...}L............... | |
| ..#...#.GET /index/_search HTTP/1.1 | |
| Host: 127.0.0.1:9200 | |
| Accept: */* | |
| Content-Length: 845 | |
| Content-Type: application/x-www-form-urlencoded |
This file contains hidden or 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
| #!/bin/sh | |
| # "include: /etc/unbound/ad-blacklist.conf" in /var/unbound/etc/unbound.conf | |
| # run this script as a daily cron | |
| # | |
| # The list URLs were taken from the pi-hole project. | |
| # More experimental lists are at https://github.com/pi-hole/pi-hole/blob/master/adlists.default | |
| TMPFILE=$( mktemp get_dns_blacklists-XXXXXXXXX ) | |
| trap 'rm -f $TMPFILE; exit 1' EXIT KILL INT QUIT TERM |
This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.
Most the credit for these changes go to Dave Holland.
- Mac OSX 10+
- Administrator privileges
This file contains hidden or 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
| watch --difference=cummulative --interval=1 '(echo device read_IOs read_merges read_sectors read_ticks write_IOs write_merges write_sectors write_ticks in_flight io_ticks time_in_queue; for file in /sys/block/*/stat; do echo -n $file; cat $file; done) | column -t' | |
| # OUTPUTS: | |
| #device read_IOs read_merges read_sectors read_ticks write_IOs write_merges write_sectors write_ticks in_flight io_ticks time_in_queue | |
| #/sys/block/dm-0/stat 116962 0 2212746 314096 7705653 0 150218536 609670232 0 644428 610921004 | |
| #/sys/block/dm-1/stat 116479 0 2208882 313324 7686986 0 150218536 609676068 0 644616 611418072 | |
| #/sys/block/dm-2/stat 302 0 2416 780 0 0 0 0 0 148 780 | |
| #/sys/block/sda/stat 91181 26273 2217246 74876 7314854 388030 150261802 16954364 |
This file contains hidden or 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
| # put this in your .bash_profile | |
| if [ $ITERM_SESSION_ID ]; then | |
| export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND"; | |
| fi | |
| # Piece-by-Piece Explanation: | |
| # the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment | |
| # iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too | |
| # the $PROMPT_COMMAND environment variable is executed every time a command is run | |
| # see: ss64.com/bash/syntax-prompt.html |
This file contains hidden or 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 hidden or 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
| aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1 | |
| aptitude install -y mysql-server libmysqlclient-dev | |
| adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git | |
| adduser --disabled-login --gecos 'gitlab system' gitlab | |
| usermod -a -G git gitlab | |
| su - gitlab | |
| ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa | |
| aptitude install gitolite | |
| cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub | |
| su - git |
This file contains hidden or 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
| # Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
| bg: | |
| errors: | |
| messages: | |
| expired: "е изтекъл, моля заявете нов" | |
| not_found: "не е намерен" | |
| already_confirmed: "е вече потвърден, моля опитайте да влезете в профила си с него" | |
| not_locked: "не бе заключен" | |
| not_saved: |
NewerOlder