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
RewriteEngine on | |
RewriteCond %{HTTP_USER_AGENT} ^Bingbot [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^bingbot [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} Baiduspider [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} linkdexbot [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} coccocbot-web [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} FemtosearchBot [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} Owler [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} Pinterestbot [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} GrapeshotCrawler [NC,OR] |
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
<?php | |
/** | |
* User: vyacheslav.demyanov | |
* Check brackets for balance | |
* [([]{[]})] — balanced, but {[}], [{)] and ]{}[ - not. | |
*/ | |
if (isset($argv[1])) { | |
$str = $argv[1]; | |
} else { | |
$str = '[([]{[]})]'; |
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
events {} | |
http { | |
include mime.types; | |
server { | |
listen 80; | |
server_name 167.99.93.26; |
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
local red = redis:new() | |
local ok, err = red:connect("127.0.0.1", "6379") | |
if not ok then | |
ngx.status = 503 | |
ngx.say("Can't connect to redis: "..err) | |
ngx.exit(ngx.OK) | |
else | |
red:set_timeout(1000) -- 1 sec | |
end |
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/bash | |
yum update -y | |
sudo yum install -y perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA.x86_64 | |
cd /home/ec2-user/ | |
curl https://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.2.zip -O | |
unzip CloudWatchMonitoringScripts-1.2.2.zip | |
rm -rf CloudWatchMonitoringScripts-1.2.2.zip | |
# Use the commands below for the lab. | |
# /home/ec2-user/aws-scripts-mon/mon-put-instance-data.pl --mem-util --verify --verbose |