{"id":320214,"date":"2021-03-24T21:01:38","date_gmt":"2021-03-24T21:01:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320214"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320214","title":{"rendered":"\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 lightsquid \u0438\u043b\u0438 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0418\u0442\u0430\u043a, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443 \u043c\u0435\u043d\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435: \u0434\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0432\u043e\u0438 \u043b\u043e\u0433\u0438 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u0412\u0440\u043e\u0434\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0442\u0430\u043a\u0430\u044f \u2014 \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u0436\u0435 \u0441\u043e \u0432\u0441\u0435\u0445 \u0441\u0442\u043e\u0440\u043e\u043d \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0444\u043e\u0440\u0443\u043c\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u0441\u044f \u0438 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f. \u041d\u043e \u043d\u0438 \u0442\u043e\u0433\u043e \u043d\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c lightsquid \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0427\u0442\u043e \u043d\u0443\u0436\u043d\u043e<\/h4>\n<p>  <\/p>\n<ul>\n<li> \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f Ubuntu server (\u043b\u0438\u0447\u043d\u043e \u0432 \u043c\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f 13.04)<\/li>\n<li> \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 Apache2<\/li>\n<li> \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0438 \u0443\u0436\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 squid (\u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e 2.7)<\/li>\n<\/ul>\n<h4>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f:<\/h4>\n<p>  <\/p>\n<ul>\n<li> \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u0435\u0433\u043e IP \u0430\u0434\u0440\u0435\u0441\u0443<\/li>\n<li> \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 <\/li>\n<li> \u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 WEB \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/li>\n<\/ul>\n<h4>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c<\/h4>\n<p>  <\/p>\n<h5>\u041d\u0443\u0436\u0435\u043d \u0441\u0430\u043c lighsquid<\/h5>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0441\u043a\u0430\u0447\u0430\u0435 LightSquid  <\/p>\n<blockquote><p> <code>wget http:\/\/downloads.sourceforge.net\/project\/lightsquid\/lightsquid\/1.8\/lightsquid-1.8.tgz<\/code><\/p><\/blockquote>\n<p>  \u0420\u0430\u0437\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u043c. \u042f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0435\u043b \u0440\u0430\u0437\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \/var, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438 \u0432 \/www (\u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u044b \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435)  <\/p>\n<blockquote><p>tar -zxf lightsquid-1.8.tgz \/var\/lightsquid<\/p><\/blockquote>\n<p>  \u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u043f\u0440\u0430\u0432\u0430 755 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0438 \u0433\u0440\u0443\u043f\u043f\u0435 www-data \u043d\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0438 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435  <\/p>\n<blockquote><p>chmod -R 755 \/var\/lightsquid<br \/>  chown -R www-data:www-data \/var\/lightsquid  <\/p><\/blockquote>\n<p>  \u0414\u0435\u043b\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c\u0438:  <\/p>\n<blockquote><p>chmod +x *.cgi<br \/>  chmod +x *.pl  <\/p><\/blockquote>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u044b \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 libgd-gd2-perl   <\/p>\n<blockquote><p>sudo apt-get install libgd-gd2-perl<\/p><\/blockquote>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433 LightSquid  <\/p>\n<blockquote><p>nano \/var\/lightsquid\/lightsquid.cfg<\/p><\/blockquote>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043c \u043f\u0443\u0442\u0438 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 GLOBAL VARIABLES  <\/p>\n<blockquote><p> #path to additional `cfg` files<br \/>   $cfgpath =&quot;\/var\/lightsquid&quot;;<br \/>   #path to `tpl` folder<br \/>   $tplpath =&quot;\/var\/lightsquid\/tpl&quot;;<br \/>   #path to `lang` folder<br \/>   $langpath =&quot;\/var\/lightsquid\/lang&quot;;<br \/>   #path to `report` folder<br \/>   $reportpath =&quot;\/var\/lightsquid\/report&quot;;<br \/>   #path to access.log<br \/>   $logpath =&quot;\/var\/log\/squid&quot;;<br \/>   #path to `ip2name` folder<br \/>   $ip2namepath =&quot;\/var\/lightsquid\/ip2name&quot;;  <\/p><\/blockquote>\n<p>  \u0412 \u0441\u0435\u043a\u0446\u0438\u0438 WEB VARIABLES \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0443\u0441\u0441\u043a\u0438\u0439.  <\/p>\n<blockquote><p>$lang =\u00abru\u00bb;<\/p><\/blockquote>\n<p>  \u041d\u0443 \u0432\u0441\u0435 lightsquid \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043b\u043e\u0433\u0438 squid \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0445 \u043f\u0440\u043e \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0438\u0445 \u0432 \u043e\u0442\u0447\u0435\u0442\u0435:  <\/p>\n<blockquote><p>\/var\/lightsquid# .\/lightparser.pl access.log.59 &#038;&#038; .\/lightparser.pl access.log.58 &#038;&#038; .\/lightparser.pl access.log.57 &#038;&#038; .\/lightparser.pl access.log.56 &#038;&#038; .\/lightparser.pl access.log.55 &#038;&#038; .\/lightparser.pl access.log.54 &#038;&#038; .\/lightparser.pl access.log.53\u2026 \u0438 \u0442.\u0434.<\/p><\/blockquote>\n<h4>\u0421\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441<\/h4>\n<p>  \u0422.\u043a. LightSquid \u0441 \u043f\u043e\u043c\u043e\u0449\u044c cgi \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 html \u0442\u044d\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0434\u0430\u0435\u0442 \u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432\u0438\u0434\u0438\u0442 \u0412\u0421\u042e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u0412\u0421\u0415\u041c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u2014 \u044d\u0442\u043e \u043d\u0435 \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0430, \u00ab\u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c\u00bb \u0432\u044b\u0432\u043e\u0434, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 html \u0444\u0430\u0439\u043b\u0438 \u0441 \u043f\u0440\u0435\u0444\u0435\u0440\u0430\u043d\u0441\u043e\u043c \u0438 \u043a\u0443\u0440\u0442\u0438\u0437\u0430\u043d\u043a\u0430\u043c\u0438 \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<h5>\u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 PHP<\/h5>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b:<\/p>\n<blockquote><p>nano \/var\/www\/index.php<\/p><\/blockquote>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u043d \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0420\u041d\u0420: \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u00ab\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0443\u044e\u00bb \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 ligsquid. \u0417\u0430\u043d\u043e\u0441\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"php\">&lt;?php $year = &quot; {$_GET['year']}&quot;; $month = &quot; {$_GET['month']}&quot;; $day = &quot; {$_GET['day']}&quot;; $ip_host = &quot;{$_SERVER['REMOTE_ADDR']}&quot;; $str = &quot;sudo \/var\/lightsquid\/my_scr\/index.sh &quot;.$ip_host.$year.$month.$day; echo exec($str); include &quot;\/var\/lightsquid\/my_tmp\/&quot;.$ip_host.&quot;log_file.html&quot; ?&gt; <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0442\u0430\u043a\u043e\u0432. \u041c\u044b \u0447\u0435\u0440\u0435\u0437 \u0420\u041d\u0420 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u0430\u043a\u0438\u0435 \u043b\u0438\u0431\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0433\u043e\u0434, \u043c\u0435\u0441\u044f\u0446, \u0434\u0435\u043d\u044c, \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0443\u0441\u0442\u044b, \u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0435\u0441\u044f\u0446, \u0438\u043b\u0438 \u0433\u043e\u0434, \u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0441\u0430\u043c\u0438 \u0443\u0437\u043d\u0430\u0435\u043c IP \u0445\u043e\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443. \u042d\u0442\u043e\u0442 ip \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0422\u041e\u041b\u042c\u041a\u041e \u043f\u043e \u043d\u0435\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0435, \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043a\u0430\u043a \u2014 \u0442\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0440\u0435\u0434\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u043d\u0430\u043c\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043a \u0435\u0433\u043e IP \u0430\u0434\u0440\u0435\u0441\u0443.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443. \u041a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 ( \u0431\u0443\u0434\u0435\u0442 \u043d\u0438\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d) \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 \u043d\u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b IP, \u0433\u043e\u0434, \u043c\u0435\u0441\u044f\u0446, \u0434\u0435\u043d\u044c.<br \/>  \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c html \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0438\u043c\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 IP \u0430\u0434\u0440\u0435\u0441\u0430 \u0445\u043e\u0441\u0442\u0430 \u0438 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0438 \u00ablog_file.html\u00bb <\/p>\n<h5>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 shell<\/h5>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a cgi \u0441\u043a\u0438\u043f\u0442\u0440\u0430 lightsquid \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (cgi \u0441\u043a\u0440\u0438\u043f\u0442\u0430) \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u0410 \u043f\u043e\u0442\u043e\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0432 \u043d\u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0438\u0436\u0435).<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0438\u043b  <\/p>\n<blockquote><p>nano \/var\/lightsquid\/my_scr\/index.sh<\/p><\/blockquote>\n<p>  \u0414\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c   <\/p>\n<blockquote><p>chmod +x index.sh  <\/p><\/blockquote>\n<p>  \u0412\u0430\u0436\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435, \u0442.\u043a. \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u0441\u044f \u0438\u0437 \u043f\u043e\u0434 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f www-data. \u0422\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0444\u0430\u0439\u043b \/etc\/sudoers \u0432 \u0431\u043b\u043e\u043a # User privilege specification, \u0442\u0430\u043a\u0443\u044e \u0432\u043e\u0442 \u0441\u0442\u0440\u043e\u043a\u0443:   <\/p>\n<blockquote><p>www-data ALL=(ALL) NOPASSWD: \/var\/lightsquid\/my_scr\/index.sh  <\/p><\/blockquote>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0444\u0430\u0439\u043b \u0441\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0435  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh $1 #ip \u0430\u0434\u0440\u0435\u0441 $2 #\u0433\u043e\u0434 $3 #\u043c\u0435\u0441\u044f\u0446 $4 #\u0434\u0435\u043d\u044c  str=&quot;log_file&quot; param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&day=&quot;$4  LOG_FILE=\/var\/lightsquid\/my_tmp\/$1$str.html { export REQUEST_METHOD=GET export QUERY_STRING=$param \/var\/lightsquid\/index.cgi }&gt; $LOG_FILE 2&gt;&1 \/var\/lightsquid\/my_scr\/index.py $1 <\/code><\/pre>\n<p>  \u0420\u0430\u0437\u044c\u044f\u0441\u043d\u044e:<br \/>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b IP, \u0433\u043e\u0434, \u0434\u0435\u043d\u044c, \u043c\u0435\u0441\u044f\u0446<br \/>  \u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u00ablog_file\u00bb<br \/>  \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<br \/>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c cgi \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u0444\u0430\u0439\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c IP \u0445\u043e\u0441\u0442\u0430 + \u00ablog_file.html\u00bb<br \/>  \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<h5>\u0422\u0440\u0435\u0442\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python<\/h5>\n<p>  \u0422.\u043a. \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c \u043c\u043d\u043e\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u043d\u0430 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 cgi \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c), \u0438 \u043f\u0440\u043e\u0447\u0435\u0435, \u043d\u0430\u0434\u043e \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043f\u043e\u0434\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043d\u0430\u0448\u0438 \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b:  <\/p>\n<blockquote><p>nano \/var\/lightsquid\/my_scr\/index.py<\/p><\/blockquote>\n<p>  \u0414\u0435\u043b\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c.  <\/p>\n<blockquote><p>chmod +x index.sh  <\/p><\/blockquote>\n<p>  \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python #coding: utf-8  import sys #\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c sys \u043e\u043d \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b  ip_host = sys.argv[1] #\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441 #\u0441\u043a\u0440\u0438\u043f\u0442 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c lightsquid  seach_ip = ip_host  path_file = '\/var\/lightsquid\/my_tmp\/'+ ip_host + 'log_file.html' #\u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c  count_line = sum(1 for l in open(path_file, 'r')) #\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 #len(open(path_file, 'r').readlines())            #\u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u043c  file = open(path_file, 'r') # \u043e\u0442\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b lines = file.readlines()    # \u043f\u0440\u043e\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e file.close()                #\u0437\u0430\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b   i = 0 for i in range(count_line): #\u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 if &quot;day_detail.cgi&quot; in lines[i]:  #\u0435\u0441\u043b\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0444\u0430\u0439\u043b\u0443 cgi         lines[i] = lines[i].replace('day_detail.cgi','day_detail.php') #\u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 , \u0447\u0442\u043e\u0431\u044b \u0441\u0441\u044b\u043b\u043a\u0430 \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0430\u0441\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443     if &quot;group_detail.cgi&quot; in lines[i]: #\u0418\u0449\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0433\u0434\u0435 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u043e\u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f         lines[i] = &quot; &lt;code&gt;&lt;TD&gt; &lt;\/TD&gt;&lt;\/code&gt;&quot;  #\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u044d\u0442\u0443 \u0432\u0441\u044e \u0441\u0442\u043e\u043a\u0443 \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b     if &quot;index.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('index.cgi','index.php')     if &quot;month_detail.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('month_detail.cgi','month_detail.php')     if &quot;graph.cgi&quot; in lines[i]:         lines[i] = &quot; &quot;     if &quot;topsites.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('topsites.cgi','topsites.php')   file = open('\/var\/lightsquid\/my_tmp\/' + ip_host + 'log_file.html','w') file.writelines(lines) file.close <\/code><\/pre>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435 \u0432 Python \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u0441\u0442\u0443\u043f\u044b (\u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u0430) \u0434\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0432 \u043a\u0443\u0440\u0441\u0435 \ud83d\ude42<br \/>  \u041f\u043e\u044f\u0441\u043d\u044e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442. <br \/>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c IP \u0430\u0434\u0440\u0435\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 (\u044d\u0442\u043e\u0442 IP \u0430\u0434\u0440\u0435\u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u044e\u0434\u0430 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430).<br \/>  \u0414\u0430\u043b\u0435\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 cgi \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c lightsquid&#8217;\u0430<br \/>  \u0423\u0437\u043d\u0430\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0435\u043c \u0441\u0442\u0440\u043e\u043a<br \/>  \u0414\u0435\u043b\u0430\u0435\u043c \u0446\u0438\u043a\u043b, \u0432 \u044d\u0442\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0430\u0448\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0443\u0442\u0438 \u0441\u0441\u044b\u043b\u043e\u043a \u0441 cgi \u043d\u0430 php, \u0442\u0430\u043a \u0436\u0435 \u043c\u043d\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u0432\u0438\u0434\u0435\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0434\u0435\u043b\u0430\u044e \u044d\u0442\u043e\u0442 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0443\u0441\u0442\u044b\u043c (). <br \/>  \u041d\u0443 \u0438 \u0432\u0441\u0435, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0443\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<p>  \u0418 \u0442\u0430\u043a, \u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b \u043e\u0434\u0438\u043d \u043f\u0443\u0442\u044c \u043a\u0430\u043a \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f. \u041d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e 27 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0432\u043f\u0438\u0445\u043d\u0443\u0442\u044c \u0432 \u043e\u0434\u043d\u0438 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0431\u044b \u0442\u043e\u043b\u044c\u043a\u043e 3, \u043d\u043e \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0441\u0435\u0431\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0436\u0438\u0437\u043d\u044c. \u041d\u0438\u0436\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043d\u043e \u0441 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c \u0438\u0445 \u0440\u0430\u0437\u0431\u043e\u0440\u043e\u043c \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f (\u0442.\u043a. \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u044b\u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u044b\u0448\u0435).<\/p>\n<h4>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043a\u0438\u043f\u0442\u044b<\/h4>\n<p>  <\/p>\n<h5>\u0412\u0441\u0435, \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a bigfiles<\/h5>\n<p>  <\/p>\n<h6>bigfiles.php<\/h6>\n<p>  <\/p>\n<pre><code class=\"php\">&lt;?php $year = &quot; {$_GET['year']}&quot;; $month = &quot; {$_GET['month']}&quot;; $day = &quot; {$_GET['day']}&quot;; $ip_host = &quot;{$_SERVER['REMOTE_ADDR']}&quot;; $str = &quot;sudo \/var\/lightsquid\/my_scr\/my_bigfiles.sh &quot;.$ip_host.$year.$month.$day; echo exec($str); include &quot;\/var\/lightsquid\/my_tmp\/&quot;.$ip_host.&quot;log_file.html&quot; ?&gt; <\/code><\/pre>\n<h6>my_bigfiles.sh<\/h6>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh $1 #ip \u0430\u0434\u0440\u0435\u0441 $2 #\u0433\u043e\u0434 $3 #\u043c\u0435\u0441\u044f\u0446 $4 #\u0434\u0435\u043d\u044c  str=&quot;log_file&quot; param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&day=&quot;$4&quot;&user=&quot;$1   LOG_FILE=\/var\/lightsquid\/my_tmp\/$1$str.html { export REQUEST_METHOD=GET export QUERY_STRING=$param \/var\/lightsquid\/bigfiles.cgi }&gt; $LOG_FILE 2&gt;&1  \/var\/lightsquid\/my_scr\/my_bigfiles.py $1  <\/code><\/pre>\n<h6>my_bigfiles.py<\/h6>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python #coding: utf-8  import sys #\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c sys \u043e\u043d \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b  ip_host = sys.argv[1] #\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441  seach_ip = ip_host  path_file = '\/var\/lightsquid\/my_tmp\/'+ ip_host + 'log_file.html' #\u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c  count_line = sum(1 for l in open(path_file, 'r')) #\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 #len(open(path_file, 'r').readlines())            #\u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u043c  file = open(path_file, 'r') # \u043e\u0442\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b lines = file.readlines()    # \u043f\u0440\u043e\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e file.close()                #\u0437\u0430\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b   i = 0 for i in range(count_line): #\u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435     if &quot;index.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('index.cgi','index.php')     if &quot;user_detail.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('user_detail.cgi','user_detail.php')  file = open('\/var\/lightsquid\/my_tmp\/' + ip_host + 'log_file.html','w') file.writelines(lines) file.close  <\/code><\/pre>\n<h5>\u0412\u0441\u0435 \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a day_detail<\/h5>\n<p>  <\/p>\n<h6>bigfiles.php<\/h6>\n<p>  <\/p>\n<pre><code class=\"php\">&lt;?php $year = &quot; {$_GET['year']}&quot;; $month = &quot; {$_GET['month']}&quot;; $day = &quot; {$_GET['day']}&quot;; $ip_host = &quot;{$_SERVER['REMOTE_ADDR']}&quot;; $str = &quot;sudo \/var\/lightsquid\/my_scr\/my_day_detail.sh &quot;.$ip_host.$year.$month.$day; echo exec($str); include &quot;\/var\/lightsquid\/my_tmp\/&quot;.$ip_host.&quot;log_file.html&quot; ?&gt;  <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">!\/bin\/sh $1 #ip \u0430\u0434\u0440\u0435\u0441 $2 #\u0433\u043e\u0434 $3 #\u043c\u0435\u0441\u044f\u0446 $4 #\u0434\u0435\u043d\u044c str=&quot;log_file&quot;  #\u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&day=&quot;$4  #\u0442\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442  LOG_FILE=\/var\/lightsquid\/my_tmp\/$1$str.html  # \u043c\u0435\u0441\u0442\u043e \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 { export REQUEST_METHOD=GET export QUERY_STRING=$param  \/var\/lightsquid\/day_detail.cgi }&gt; $LOG_FILE 2&gt;&1  \/var\/lightsquid\/my_scr\/my_day_detail.py $1  #\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 , \u043a\u043e\u0442\u043e\u0440\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u043d\u0430\u0434\u043e ;)  <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python #coding: utf-8  import sys #\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c sys \u043e\u043d \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b  ip_host = sys.argv[1] #\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441 #\u0441\u043a\u0440\u0438\u043f\u0442 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c lightsquid #\u043a\u0440\u043e\u043c\u0435 \u0441\u0442\u0440\u043e\u043a \u0433\u0434\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f ip \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443  seach_ip = ip_host  path_file = '\/var\/lightsquid\/my_tmp\/'+ ip_host + 'log_file.html' #\u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c  count_line = sum(1 for l in open(path_file, 'r')) #\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435     #len(open(path_file, 'r').readlines())            #\u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u043c  file = open(path_file, 'r') # \u043e\u0442\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b lines = file.readlines()    # \u043f\u0440\u043e\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e file.close()                #\u0437\u0430\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b  for i in range(count_line): #\u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435     if &quot;tr bgcolor=&quot; + &quot;\\42&quot; + &quot;cornsilk&quot; + &quot;\\42&quot; in lines[i] or &quot;tr bgcolor=&quot; + &quot;\\42&quot; + &quot;beige&quot; + &quot;\\42&quot; in lines[i]:  #\u0435\u0441\u043b\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u04301 \u0438\u043b\u0438 \u0446\u0432\u0435\u0442\u04302 , \u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435         if seach_ip in lines[i+3]: continue   #\u0435\u0441\u043b\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u043d\u0443\u0436\u043d\u0439 ip \u0430\u0434\u0440\u0435\u0441 \u0442\u043e \u0432\u0441\u0435 \u043e\u043a , \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u0442\u043e \u0443\u0434\u0430\u043b\u044f\u0435 \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u043e         else:             lines[i] = &quot; &quot;             lines[i+1] = &quot; &quot;             lines[i+2] = &quot; &quot;             lines[i+3] = &quot; &quot;             lines[i+4] = &quot; &quot;             lines[i+5] = &quot; &quot;             lines[i+6] = &quot; &quot;             lines[i+7] = &quot; &quot;             lines[i+8] = &quot; &quot;             lines[i+9] = &quot; &quot;             lines[i+10] = &quot; &quot;             lines[i+11] = &quot; &quot;             lines[i+12] = &quot; &quot;             lines[i+13] = &quot; &quot;             lines[i+14] = &quot; &quot;             lines[i+15] = &quot; &quot;             lines[i+16] = &quot; &quot;     if &quot;user_time.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('user_time.cgi','user_time.php')     if &quot;index.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('index.cgi','index.php')     if &quot;user_detail.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('user_detail.cgi','user_detail.php')     if &quot;topsites.cgi&quot; in lines[i]:         lines[i] = &quot; &quot;     if &quot;bigfiles.cgi&quot; in lines[i]:         lines[i] = &quot; &quot;     if &quot;group_detail.cgi&quot; in lines[i]: #\u0418\u0449\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0433\u0434\u0435 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u043e\u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f         lines[i] = &quot; &lt;TD&gt; &lt;\/TD&gt;&quot;  #\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u044d\u0442\u0443 \u0432\u0441\u044e \u0441\u0442\u043e\u043a\u0443 \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b     if &quot;get.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('get.cgi?png=datetime','datetime.png')  file = open('\/var\/lightsquid\/my_tmp\/' + ip_host + 'log_file.html','w') file.writelines(lines) file.close  <\/code><\/pre>\n<p>  \u0421\u0447\u0438\u0442\u0430\u044e \u043d\u0443\u0436\u043d\u044b\u043c \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442. <br \/>  \u0421\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 IP \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b \u0434\u0430\u043d\u043d\u044b\u0435. <br \/>  \u0422.\u043a. \u0444\u0430\u0439\u043b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 cgi \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0439, \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043d\u0443\u0436\u043d\u043e\u0439 \u043c\u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a \u0446\u0432\u0435\u0442\u0443 \u0441\u0442\u0440\u043e\u043a\u0438, \u0442\u0430\u043c \u0438\u0445 \u0434\u0432\u0430 <code>&quot;cornsilk&quot;<\/code> \u0438 <code>&quot;beige&quot;<\/code>. \u0415\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0442 \u0446\u0432\u0435\u0442, \u0442\u043e \u043c\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0432\u043d\u0438\u0437, \u0442\u0430\u043c \u0435\u0441\u0442\u044c IP \u0430\u0434\u0440\u0435\u0441. \u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0442\u043e\u0442 \u0438\u043b\u0438 \u043d\u0435 \u0442\u043e\u0442, \u0438 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0442\u043e\u0442 \u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0441\u0435 16 \u0441\u0442\u0440\u043e\u043a. (\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0432 \u043e\u0442\u0447\u0435\u0442\u0435).<\/p>\n<h5>\u0412\u0441\u0435 \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a month_detail<\/h5>\n<p>  <\/p>\n<h6>month_detail.php<\/h6>\n<p>  <\/p>\n<pre><code class=\"php\">&lt;?php $year = &quot; {$_GET['year']}&quot;; $month = &quot; {$_GET['month']}&quot;; $mode = &quot; {$_GET['mode']}&quot;; $ip_host = &quot;{$_SERVER['REMOTE_ADDR']}&quot;; $str = &quot;sudo \/var\/lightsquid\/my_scr\/my_month_detail.sh &quot;.$ip_host.$year.$month.$mode; echo exec($str); include &quot;\/var\/lightsquid\/my_tmp\/&quot;.$ip_host.&quot;log_file.html&quot; ?&gt; <\/code><\/pre>\n<h6>my_month_detail.sh<\/h6>\n<p>  <\/p>\n<pre><code class=\"bash\">!\/bin\/sh $1 #ip \u0430\u0434\u0440\u0435\u0441 $2 #\u0433\u043e\u0434 $3 #\u043c\u0435\u0441\u044f\u0446 $4 #\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 str=&quot;log_file&quot;  #\u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&mode=&quot;$4  #\u0442\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442   LOG_FILE=\/var\/lightsquid\/my_tmp\/$1$str.html  # \u043c\u0435\u0441\u0442\u043e \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 { export REQUEST_METHOD=GET export QUERY_STRING=$param  \/var\/lightsquid\/month_detail.cgi }&gt; $LOG_FILE 2&gt;&1  \/var\/lightsquid\/my_scr\/my_month_detail.py $1 $3  #\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 , \u043a\u043e\u0442\u043e\u0440\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u043d\u0430\u0434\u043e ;)  <\/code><\/pre>\n<h6>my_month_detail.py<\/h6>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python #coding: utf-8  import sys #\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c sys \u043e\u043d \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b  ip_host = sys.argv[1] #\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441 month = sys.argv[2] #\u0441\u043a\u0440\u0438\u043f\u0442 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c lightsquid #\u043a\u0440\u043e\u043c\u0435 \u0441\u0442\u0440\u043e\u043a \u0433\u0434\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f ip \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443  seach_ip = ip_host  path_file = '\/var\/lightsquid\/my_tmp\/'+ ip_host + 'log_file.html' #\u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c  count_line = sum(1 for l in open(path_file, 'r')) #\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435     #len(open(path_file, 'r').readlines())            #\u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u043c  file = open(path_file, 'r') # \u043e\u0442\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b lines = file.readlines()    # \u043f\u0440\u043e\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e file.close()                #\u0437\u0430\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b  for i in range(count_line): #\u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435     if &quot;tr bgcolor=&quot; + &quot;\\42&quot; + &quot;cornsilk&quot; + &quot;\\42&quot; in lines[i] or &quot;tr bgcolor=&quot; + &quot;\\42&quot; + &quot;beige&quot; + &quot;\\42&quot; in lines[i]:  #\u0435\u0441\u043b\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u04301 \u0438\u043b\u0438 \u0446\u0432\u0435\u0442\u04302 , \u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435         if seach_ip in lines[i+3]: continue   #\u0435\u0441\u043b\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u043d\u0443\u0436\u043d\u0439 ip \u0430\u0434\u0440\u0435\u0441 \u0442\u043e \u0432\u0441\u0435 \u043e\u043a , \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u0442\u043e \u0443\u0434\u0430\u043b\u044f\u0435 \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u043e         else:             if month == &quot;all&quot;:  # \u0442\u0443\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 . \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u044f\u0446\u0430 , \u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e \u043e\u0434\u043d\u043e , \u0430 \u0435\u0441\u043b\u0438 \u0432\u0435\u0441\u044c \u0433\u043e\u0434 , \u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0434\u0440\u0443\u0433\u043e\u0435                 lines[i] = &quot; &quot;                 lines[i+1] = &quot; &quot;                 lines[i+2] = &quot; &quot;                 lines[i+3] = &quot; &quot;                 lines[i+4] = &quot; &quot;                 lines[i+5] = &quot; &quot;                 lines[i+6] = &quot; &quot;                 lines[i+7] = &quot; &quot;                 lines[i+8] = &quot; &quot;                 lines[i+9] = &quot; &quot;                 lines[i+10] = &quot; &quot;                 lines[i+11] = &quot; &quot;                 lines[i+12] = &quot; &quot;                 lines[i+13] = &quot; &quot;                 lines[i+14] = &quot; &quot;             else:                 lines[i] = &quot; &quot;                 lines[i+1] = &quot; &quot;                 lines[i+2] = &quot; &quot;                 lines[i+3] = &quot; &quot;                 lines[i+4] = &quot; &quot;                 lines[i+5] = &quot; &quot;                 lines[i+6] = &quot; &quot;                 lines[i+7] = &quot; &quot;                 lines[i+8] = &quot; &quot;                 lines[i+9] = &quot; &quot;                 lines[i+10] = &quot; &quot;                 lines[i+11] = &quot; &quot;                 lines[i+12] = &quot; &quot;                 lines[i+13] = &quot; &quot;                 lines[i+14] = &quot; &quot;                 lines[i+15] = &quot; &quot;  for i in range(count_line): #\u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435     if  lines[i]&lt;&gt; &quot; &quot;:         if &quot;index.cgi&quot; in lines[i]:             lines[i] = lines[i].replace('index.cgi','index.php')         if &quot;user_time.cgi&quot; in lines[i]:             lines[i] = lines[i].replace('user_time.cgi','user_time.php')         if &quot;graph.cgi&quot; in lines[i]:             lines[i] = '&lt;TD&gt;&lt;\/TD&gt;'         if &quot;user_month.cgi&quot; in lines[i]:             lines[i] = lines[i].replace('user_month.cgi','user_month.php')         if &quot;user_detail.cgi&quot; in lines[i]:             lines[i] = lines[i].replace('user_detail.cgi','user_detail.php')         if &quot;get.cgi&quot; in lines[i]:             lines[i] = lines[i].replace('get.cgi?png=datetime','datetime.png')         if &quot;get.cgi&quot; in lines[i]:             lines[i] = lines[i].replace('get.cgi?png=graph','graph.png')  file = open('\/var\/lightsquid\/my_tmp\/' + ip_host + 'log_file.html','w') file.writelines(lines) file.close  <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043f\u043e\u0447\u0442\u0438 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0447\u0442\u043e \u0438 \u0431\u044b\u043b\u043e \u0432\u044b\u0448\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432\u043e\u0442 \u0432 \u0447\u0435\u043c, \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b (\u0433\u043e\u0434 \u0438 \u043c\u0435\u0441\u044f\u0446), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0437\u043d\u044b\u0435. \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>month = sys.argv[2]<\/code> \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435.<\/p>\n<h5>\u0412\u0441\u0435 \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a topsites<\/h5>\n<p>  <\/p>\n<h6>topsites.php<\/h6>\n<p>  <\/p>\n<pre><code class=\"php\">&lt;?php $year = &quot; {$_GET['year']}&quot;; $month = &quot; {$_GET['month']}&quot;; $day = &quot; {$_GET['day']}&quot;; $mode = &quot; {$_GET['mode']}&quot;; $order = &quot; {$_GET['order']}&quot;; $ip_host = &quot;{$_SERVER['REMOTE_ADDR']}&quot;; $str = &quot;sudo \/var\/lightsquid\/my_scr\/my_topsites.sh &quot;.$ip_host.$year.$month.$mode.$order; echo exec($str); include &quot;\/var\/lightsquid\/my_tmp\/&quot;.$ip_host.&quot;log_file.html&quot; ?&gt;  <\/code><\/pre>\n<h6>my_topsites.sh<\/h6>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh $1 #ip \u0430\u0434\u0440\u0435\u0441 $2 #\u0433\u043e\u0434 $3 #\u043c\u0435\u0441\u044f\u0446 $4 #\u0434\u0435\u043d\u044c\\\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 $5 #\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\\\u0434\u0440\u0443\u0433\u043e\u0449\u0435 $6 #\u0434\u0440\u0443\u0433\u043e\u0435 str=&quot;log_file&quot;  #\u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430  if [ $5 = &quot;hits&quot; -o $4 = &quot;size&quot; ] then param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&day=&mode=&quot;$4&quot;&order=&quot;$5 else param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&mode=&quot;$4  #\u0442\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 fi   LOG_FILE=\/var\/lightsquid\/my_tmp\/$1$str.html  # \u043c\u0435\u0441\u0442\u043e \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 { export REQUEST_METHOD=GET export QUERY_STRING=$param  \/var\/lightsquid\/topsites.cgi }&gt; $LOG_FILE 2&gt;&1  \/var\/lightsquid\/my_scr\/my_topsites.py $1  #\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 , \u043a\u043e\u0442\u043e\u0440\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u043d\u0430\u0434\u043e ;)  <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0442\u043e\u0436\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043e\u043d \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a cgi \u0441\u043a\u0440\u0438\u043f\u0442\u0443.<\/p>\n<h6>my_topsites.py<\/h6>\n<p>  <\/p>\n<pre><code class=\"python\">!\/usr\/bin\/env python #coding: utf-8  import sys #\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c sys \u043e\u043d \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b  ip_host = sys.argv[1] #\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441  seach_ip = ip_host  path_file = '\/var\/lightsquid\/my_tmp\/'+ ip_host + 'log_file.html' #\u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c  count_line = sum(1 for l in open(path_file, 'r')) #\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 #len(open(path_file, 'r').readlines())            #\u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u043c  file = open(path_file, 'r') # \u043e\u0442\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b lines = file.readlines()    # \u043f\u0440\u043e\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e file.close()                #\u0437\u0430\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b   i = 0 for i in range(count_line): #\u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435     if &quot;whousesite.cgi&quot; in lines[i]: #\u0418\u0449\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0433\u0434\u0435 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u043e\u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f         lines[i] = &quot; &lt;TD&gt; &lt;\/TD&gt;&quot;  #\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u044d\u0442\u0443 \u0432\u0441\u044e \u0441\u0442\u043e\u043a\u0443 \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b     if &quot;index.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('index.cgi','index.php')     if &quot;topsites.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('topsites.cgi','topsites.php')  file = open('\/var\/lightsquid\/my_tmp\/' + ip_host + 'log_file.html','w') file.writelines(lines) file.close  <\/code><\/pre>\n<h5>\u0412\u0441\u0435 \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a user_detail<\/h5>\n<p>  <\/p>\n<h6>user_detail.php<\/h6>\n<p>  <\/p>\n<pre><code class=\"php\">&lt;?php $year = &quot; {$_GET['year']}&quot;; $month = &quot; {$_GET['month']}&quot;; $day = &quot; {$_GET['day']}&quot;; $mode = &quot; {$_GET['mode']}&quot;; $ip_host = &quot;{$_SERVER['REMOTE_ADDR']}&quot;; $str = &quot;sudo \/var\/lightsquid\/my_scr\/my_user_detail.sh &quot;.$ip_host.$year.$month.$day.$mode; echo exec($str); include &quot;\/var\/lightsquid\/my_tmp\/&quot;.$ip_host.&quot;log_file.html&quot; ?&gt; <\/code><\/pre>\n<h6>user_detail.sh<\/h6>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh $1 #ip \u0430\u0434\u0440\u0435\u0441 $2 #\u0433\u043e\u0434 $3 #\u043c\u0435\u0441\u044f\u0446 $4 #\u0434\u0435\u043d\u044c\\\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 str=&quot;log_file&quot;  #\u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430  if [ $4 = &quot;month&quot; -o $4 = &quot;year&quot; ] then param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&user=&quot;$1&quot;&mode=&quot;$4  #\u0442\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 else param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&day=&quot;$4&quot;&user=&quot;$1 fi   LOG_FILE=\/var\/lightsquid\/my_tmp\/$1$str.html  # \u043c\u0435\u0441\u0442\u043e \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 { export REQUEST_METHOD=GET export QUERY_STRING=$param  \/var\/lightsquid\/user_detail.cgi }&gt; $LOG_FILE 2&gt;&1  \/var\/lightsquid\/my_scr\/my_user_detail.py $1  #\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 , \u043a\u043e\u0442\u043e\u0440\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u043d\u0430\u0434\u043e ;)  <\/code><\/pre>\n<h6>user_detail.py<\/h6>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python #coding: utf-8  import sys #\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c sys \u043e\u043d \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b  ip_host = sys.argv[1] #\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441  seach_ip = ip_host  path_file = '\/var\/lightsquid\/my_tmp\/'+ ip_host + 'log_file.html' #\u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c  count_line = sum(1 for l in open(path_file, 'r')) #\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 #len(open(path_file, 'r').readlines())            #\u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u043c  file = open(path_file, 'r') # \u043e\u0442\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b lines = file.readlines()    # \u043f\u0440\u043e\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e file.close()                #\u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b  i = 0 for i in range(count_line): #\u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435     if &quot;index.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('index.cgi','index.php')     if &quot;user_time.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('user_time.cgi','user_time.php')     if &quot;bigfiles.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('bigfiles.cgi','bigfiles.php')     if &quot;get.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('get.cgi?png=datetime','datetime.png')  file = open('\/var\/lightsquid\/my_tmp\/' + ip_host + 'log_file.html','w') file.writelines(lines) file.close  <\/code><\/pre>\n<h5>\u0412\u0441\u0435 \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a user_month<\/h5>\n<p>  <\/p>\n<h6>user_month.php<\/h6>\n<p>  <\/p>\n<pre><code class=\"php\">&lt;?php $year = &quot; {$_GET['year']}&quot;; $month = &quot; {$_GET['month']}&quot;;  $ip_host = &quot;{$_SERVER['REMOTE_ADDR']}&quot;; $str = &quot;sudo \/var\/lightsquid\/my_scr\/my_user_month.sh &quot;.$ip_host.$year.$month; echo exec($str); include &quot;\/var\/lightsquid\/my_tmp\/&quot;.$ip_host.&quot;log_file.html&quot; ?&gt; <\/code><\/pre>\n<h6>user_month.sh<\/h6>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh $1 #ip \u0430\u0434\u0440\u0435\u0441 $2 #\u0433\u043e\u0434 $3 #\u043c\u0435\u0441\u044f\u0446  str=&quot;log_file&quot; param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&user=&quot;$1  LOG_FILE=\/var\/lightsquid\/my_tmp\/$1$str.html { export REQUEST_METHOD=GET export QUERY_STRING=$param \/var\/lightsquid\/user_month.cgi }&gt; $LOG_FILE 2&gt;&1  \/var\/lightsquid\/my_scr\/my_user_month.py $1 <\/code><\/pre>\n<h6>user_month.py<\/h6>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python #coding: utf-8  import sys #\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c sys \u043e\u043d \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b  ip_host = sys.argv[1] #\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441 #\u0441\u043a\u0440\u0438\u043f\u0442 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c lightsquid #\u043a\u0440\u043e\u043c\u0435 \u0441\u0442\u0440\u043e\u043a \u0433\u0434\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f ip \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443  seach_ip = ip_host  path_file = '\/var\/lightsquid\/my_tmp\/'+ ip_host + 'log_file.html' #\u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c  count_line = sum(1 for l in open(path_file, 'r')) #\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 #len(open(path_file, 'r').readlines())            #\u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u043c  file = open(path_file, 'r') # \u043e\u0442\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b lines = file.readlines()    # \u043f\u0440\u043e\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e file.close()                #\u0437\u0430\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b   i = 0 for i in range(count_line): #\u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435     if &quot;user_detail.cgi&quot; in lines[i]:  #\u0435\u0441\u043b\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0444\u0430\u0439\u043b\u0443 cgi         lines[i] = lines[i].replace('user_detail.cgi','user_detail.php') #\u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 , \u0447\u0442\u043e\u0431\u044b \u0441\u0441\u044b\u043b\u043a\u0430 \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0430\u0441\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443     if &quot;index.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('index.cgi','index.php')     if &quot;graph.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('graph.cgi','graph.php')   file = open('\/var\/lightsquid\/my_tmp\/' + ip_host + 'log_file.html','w') file.writelines(lines) file.close <\/code><\/pre>\n<h5>\u0412\u0441\u0435 \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a user_time<\/h5>\n<p>  <\/p>\n<h6>user_time.php<\/h6>\n<p>  <\/p>\n<pre><code class=\"php\"> &lt;?php $year = &quot; {$_GET['year']}&quot;; $month = &quot; {$_GET['month']}&quot;; $day = &quot; {$_GET['day']}&quot;; $mode = &quot; {$_GET['mode']}&quot;; $ip_host = &quot;{$_SERVER['REMOTE_ADDR']}&quot;; $str = &quot;sudo \/var\/lightsquid\/my_scr\/my_user_time.sh &quot;.$ip_host.$year.$month.$mode; echo exec($str); include &quot;\/var\/lightsquid\/my_tmp\/&quot;.$ip_host.&quot;log_file.html&quot; ?&gt; <\/code><\/pre>\n<h6>user_time.sh<\/h6>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh $1 #ip \u0430\u0434\u0440\u0435\u0441 $2 #\u0433\u043e\u0434 $3 #\u043c\u0435\u0441\u044f\u0446 $4 #\u0434\u0435\u043d\u044c\\\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 str=&quot;log_file&quot;  #\u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430  if [ $4 = &quot;month&quot; -o $4 = &quot;year&quot; ] then param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&user=&quot;$1&quot;&mode=&quot;$4  #\u0442\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 else param=&quot;year=&quot;$2&quot;&month=&quot;$3&quot;&day=&quot;$4&quot;&user=&quot;$1 fi   LOG_FILE=\/var\/lightsquid\/my_tmp\/$1$str.html  # \u043c\u0435\u0441\u0442\u043e \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 { export REQUEST_METHOD=GET export QUERY_STRING=$param  \/var\/lightsquid\/user_time.cgi }&gt; $LOG_FILE 2&gt;&1  \/var\/lightsquid\/my_scr\/my_user_time.py $1  #\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 , \u043a\u043e\u0442\u043e\u0440\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u043d\u0430\u0434\u043e ;)  <\/code><\/pre>\n<h6>user_time.py<\/h6>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python #coding: utf-8  import sys #\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c sys \u043e\u043d \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b  ip_host = sys.argv[1] #\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441 #\u0441\u043a\u0440\u0438\u043f\u0442 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c lightsquid #\u043a\u0440\u043e\u043c\u0435 \u0441\u0442\u0440\u043e\u043a \u0433\u0434\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f ip \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443  seach_ip = ip_host  path_file = '\/var\/lightsquid\/my_tmp\/'+ ip_host + 'log_file.html' #\u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c  count_line = sum(1 for l in open(path_file, 'r')) #\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 #len(open(path_file, 'r').readlines())            #\u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u043c  file = open(path_file, 'r') # \u043e\u0442\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b lines = file.readlines()    # \u043f\u0440\u043e\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e file.close()                #\u0437\u0430\u043a\u0440\u044b\u0430\u0435\u043c \u0444\u0430\u0439\u043b   i = 0 for i in range(count_line): #\u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435     if &quot;index.cgi&quot; in lines[i]:         lines[i] = lines[i].replace('index.cgi','index.php')  file = open('\/var\/lightsquid\/my_tmp\/' + ip_host + 'log_file.html','w') file.writelines(lines) file.close  <\/code><\/pre>\n<h4>\u0418\u0442\u043e\u0433<\/h4>\n<p>  \u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0435, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043d\u0438 \u043a\u043e\u0433\u043e \u043d\u0438 \u0443\u0442\u043e\u043c\u0438\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0443 \u0442\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u043d \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0433\u043e.<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/548782\/\"> https:\/\/habr.com\/ru\/post\/548782\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0418\u0442\u0430\u043a, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443 \u043c\u0435\u043d\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435: \u0434\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0432\u043e\u0438 \u043b\u043e\u0433\u0438 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u0412\u0440\u043e\u0434\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0442\u0430\u043a\u0430\u044f \u2014 \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u0436\u0435 \u0441\u043e \u0432\u0441\u0435\u0445 \u0441\u0442\u043e\u0440\u043e\u043d \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0444\u043e\u0440\u0443\u043c\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u0441\u044f \u0438 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f. \u041d\u043e \u043d\u0438 \u0442\u043e\u0433\u043e \u043d\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c lightsquid \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-320214","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=320214"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320214\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}