PHP
11
Вклад в тег
server {
listen 80;
server_name example.com www.example.com;
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:5000;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
} server {
listen 80;
server_name example.com;
# Logs
access_log /var/log/nginx/access.log;
}cat access.log | cut -d '"' -f3 | cut -d ' ' -f2 | sort | uniq -c | sort -rnawk '{print $9}' access.log | sort | uniq -c | sort -rnawk -F\" '{print $2}' access.log | awk '{print $2}' | sort | uniq -c | sort -r <?php
// Задаем пароль
$password = "iddqd";
// Берем ссылку для редиректа из ?url=*
$link = array_key_exists("url", $_GET) ? $_GET['url'] : "http://google.com";
// Проверяем сабмит формы с паролем
if (array_key_exists("password", $_POST)) {
// Проверяем введенный пароль
if (strcasecmp($_POST['password'], $password) == 0) {
// Пароль совпал, редиректим
header("Location: {$link}");
}else{
// Пароли не совпали показываем ошибку
require_once 'error.php';
}
}else{
// Показываем форму для ввода пароля
require_once 'form.php';
}
?> <?php
$backgrounds = array_diff(scandir('./backgrounds/'), array('.','..','.DS_Store'));
$texts = array_diff(scandir('./texts/'), array('.','..','.DS_Store'));
$filters = array_diff(scandir('./filters/'), array('.','..','.DS_Store'));
function nameGenerator($length) {
return substr(str_shuffle("_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
}
//
foreach ($backgrounds as $background) {
//
foreach ($texts as $text) {
//
foreach ($filters as $filter) {
//
$layer1 = imagecreatefrompng("./backgrounds/{$background}");
$layer2 = imagecreatefrompng("./texts/{$text}");
$layer3 = imagecreatefrompng("./filters/{$filter}");
//
imagealphablending($layer1, true);
imagesavealpha($layer1, true);
//
imagecopy($layer1, $layer2, 0, 0, 0, 0, 900, 900);
imagecopy($layer1, $layer3, 0, 0, 0, 0, 900, 900);
//
imagejpeg($layer1, "./results/".nameGenerator(10).".jpg");
//
imagedestroy($layer1);
imagedestroy($layer2);
imagedestroy($layer3);
}
}
}
?>