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
module.exports = (req, res, next) => { | |
res.header('Access-Control-Allow-Origin', '*') | |
res.header('Access-Control-Allow-Method','GET HEAD PUT PATCH POST DELETE') | |
res.header('Access-Control-Allow-Headers', 'Origin,Content-Type,Accept,Authorization') | |
res.header('Vary', 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers') | |
next() | |
} |
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
docker run --rm -v /home/mypictures:/home bperel/terminalimageviewer -256 myimage.png |
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
find ./jobs/1/docs/income -type f -print | while read filename ; do a=$(echo $filename | sed 's@./jobs/1/docs/income/@@'); grep $a ./jobs/1/data.html ; done | wc -l |
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
#Off output | |
dmesg -D | |
#on output | |
dmesg -E |
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
when i try | |
docker swarm init --advertise-addr=192.168.56.105 | |
I got message: | |
Error response from daemon: --live-restore daemon configuration is incompatible with swarm mode | |
I edit docker config | |
vi /etc/sysconfig/docker | |
and remove --live-restore options |
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
"verbose show file which produce remap keybinding | |
:redir! > vim_keys.txt | |
:silent verbose map | |
:redir END |
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
:%s/^/\=printf("%04d\t", 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
grep -rl 'Word' | cpio -pdm ./append |
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
grep -rl $'\xEF\xBB\xBF' | |
# remove file with bom | |
# if remove .bak then sed not create backup | |
find . -type f -exec sed '1s/^\xEF\xBB\xBF//' -i.bak {} \; -exec rm {}.bak \; |
NewerOlder