<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technical Diary &#187; Scripting</title>
	<atom:link href="http://andriigrytsenko.net/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://andriigrytsenko.net</link>
	<description>With Andrii Grytsenko</description>
	<lastBuildDate>Tue, 17 Aug 2010 08:25:33 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Anonymous proxy checker</title>
		<link>http://andriigrytsenko.net/2009/07/anonymous-proxy-checker/</link>
		<comments>http://andriigrytsenko.net/2009/07/anonymous-proxy-checker/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 11:29:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://andriigrytsenko.net/?p=201</guid>
		<description><![CDATA[There is anonymous proxy checker written by me.

To run it on your box you should have perl interpreter and some perl modules. Such as:
LWP::UserAgent
Getopt::Long 
You can get it directly from site or over the cpan util as well.  The source of script here You have to put it on your computer. Also  you [...]]]></description>
			<content:encoded><![CDATA[<p>There is anonymous proxy checker written by me.<br />
<span id="more-201"></span></p>
<p>To run it on your box you should have perl interpreter and some perl modules. Such as:</p>
<p><strong>LWP::UserAgent<br />
Getopt::Long </strong></p>
<p>You can get it directly from <a href="http://cpan.org">site</a> or over the cpan util as well.  The source of script <a href="http://andriigrytsenko.net/files/proxy_checker.txt">here</a> You have to put it on your computer. Also  you need get the list of proxy(It can be easily done by google, just type &#8220;anonymous proxy list&#8221; and you will get a lot of links). Take list and put into the file. Like this : </p>
<pre>
agrytsenko:~/tmp$ cat proxy.2
64.66.192.61:80 0.8680  Transp. US      Y       65%     2008-12-04 09:51:23
89.114.36.221:8000      1.0750  Elite   RO      ?       30%     2008-12-04 09:39:18
74.65.65.195:8000       1.1030  Elite   US      Y       47%     2008-12-04 09:40:49
89.97.128.86:6588       1.1630  Elite   IT      N       33%     2008-12-04 09:37:52
200.179.72.132:80       1.1830  Transp. BR      Y       91%     2008-12-04 09:51:23
207.182.129.90:3128     1.2570  Transp. US      Y       54%     2008-12-04 09:51:23
207.182.129.91:3128     1.2850  Transp. US      Y       57%     2008-12-04 09:51:23
66.98.152.157:6654      1.4750  Elite   US      Y       11%     2008-12-04 09:37:52
92.48.119.220:6654      1.6100  Elite   GB      Y       29%     2008-12-04 09:36:26</pre>
<p>or like this: </p>
<pre>
agrytsenko:~/tmp$ cat proxy
64.66.192.61:80
150.101.196.52:3128
114.30.47.10:80
114.127.246.36</pre>
<p>The main rule of file format: <strong>the first field has to be ip:port of proxy.</strong> </p>
<p>The script has several keys. Here they are:</p>
<pre>
agrytsenko:~/tmp$ ./proxy_checker.pl -h
-f file         Specify file
-v              Turn on verbose mode
-h              Print this help</pre>
<p>Okay, now you are ready to run it: </p>
<pre>
agrytsenko:~/tmp$ ./proxy_checker.pl -f ./proxy -v
Try to open proxy list ./proxy
Connect to site over 64.66.192.61:80...
Connection was not established. The reason is :
500 Can't connect to 64.66.192.61:80 (connect: timeout)</pre>
<pre>
Connect to site over 150.101.196.52:3128...
Success connected with IP=150.101.196.52
Proxy 150.101.196.52:3128 is avaible for connections
The 150.101.196.52:3128 is not fully anonymous. You ip address is 79.124.129.220</pre>
<pre>
Connect to site over 114.30.47.10:80...
Connection was not established. The reason is :
503 Service Unavailable</pre>
<pre>
Connect to site over 114.127.246.36:8080...
Success connected with IP=114.127.246.36
Proxy 114.127.246.36:8080 is avaible for connections</pre>
<p>As you can see we have only one fully anonymous proxy for now. It&#8217;s 114.127.246.36. </p>
<p>Done.</p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2009/07/anonymous-proxy-checker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple web statistic script</title>
		<link>http://andriigrytsenko.net/2009/06/simple-web-statistic-script/</link>
		<comments>http://andriigrytsenko.net/2009/06/simple-web-statistic-script/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 19:24:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://andriigrytsenko.net/?p=53</guid>
		<description><![CDATA[There is a little script which provide simple statistic about web visitation. 

Set &#8220;rotation_period&#8221; by days at variable section to define log rotation period. Set to &#8220;0&#8243; if you want to turn off rotation.
NOTICE: This script works only if perl interpreter is available on web server. You can check it in next way:
$ perl -v
This [...]]]></description>
			<content:encoded><![CDATA[<p>There is a little script which provide simple statistic about web visitation. </p>
<p><span id="more-53"></span></p>
<p>Set &#8220;rotation_period&#8221; by days at variable section to define log rotation period. Set to &#8220;0&#8243; if you want to turn off rotation.</p>
<p>NOTICE: This script works only if perl interpreter is available on web server. You can check it in next way:<br />
<code>$ perl -v</p>
<p>This is perl, v5.8.8 built for x86_64-Linux</p>
<p>Copyright 1987-2006, Larry Wall<br />
</code></p>
<p>You can view and download it from <a href="http://andriigrytsenko.net/files/stat.txt">here</a>.</p>
<p>This script should be put into the web server. My web-hoster doesn&#8217;t allow me send mail through shell. That&#8217;s why all lines concerning mail issue are commented out in my script. In case your hoster provides you this feature you can use it after drop comments and define variables related to mail. </p>
<p>Don&#8217;t forget to put script in the crontab. It&#8217;s should be executed at the end of the day:<br />
<code>$ crontab -l<br />
# DO NOT EDIT THIS FILE - edit the master and reinstall.<br />
# (/tmp/crontab.XXXXQpChAn installed on Sun Jun 14 21:56:42 2009)<br />
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)<br />
HOME=/home/virtwww/w_andriigrytse-net_9c210a4f<br />
SHELL=/bin/bash<br />
MAILTO=w_andriigrytse-net_9c210a4f</p>
<p>59 23 * * *     $HOME/stat.pl<br />
</code></p>
<p>Good luck:)</p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2009/06/simple-web-statistic-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some perl functions for monitoring</title>
		<link>http://andriigrytsenko.net/2009/06/some-perl-functions-for-monitoring/</link>
		<comments>http://andriigrytsenko.net/2009/06/some-perl-functions-for-monitoring/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 15:30:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://localhost/?p=16</guid>
		<description><![CDATA[I would like to provide you library which was very useful for me during my working under monitoring system.

To make it works you have to install next perl libraries :
Net::SSH::Expect;
Net::SCP::Expect;
Net::SFTP::Foreign;
Net::FTP;
It&#8217;s easy to do through cpan. For example:
# cpan i Net::SSH::Expect
or download directly from cpan
function  exec_cmd__ :
This function execute command at remote host. Example:
exec_cmd__(hostname, username, [...]]]></description>
			<content:encoded><![CDATA[<p>I would like to provide you library which was very useful for me during my working under monitoring system.<br />
<span id="more-16"></span></p>
<p>To make it works you have to install next perl libraries :</p>
<p>Net::SSH::Expect;<br />
Net::SCP::Expect;<br />
Net::SFTP::Foreign;<br />
Net::FTP;</p>
<p>It&#8217;s easy to do through cpan. For example:</p>
<p><code># cpan i Net::SSH::Expect</code></p>
<p>or download directly from <a href="http://cpan.org">cpan</a></p>
<p><strong>function  exec_cmd__ </strong>:</p>
<p>This function execute command at remote host. Example:</p>
<p>exec_cmd__(hostname, username, password, port, command)</p>
<p><strong>function sub transfer_file__ </strong>:</p>
<p>This function  can get or put file to remote host via ssh. Example :</p>
<p>transfer_file__(hostname, username, password, port, source file|directory, destination file|directory, method)</p>
<p>where option &#8220;method&#8221;  can be &#8220;fh&#8221;(means get file from somewhere and put to localhost) or &#8220;th&#8221;(send file to host)</p>
<p><strong>function sub sftp_func__</strong> :</p>
<p>This function can get and send file to remote computer via sftp protocol. Example<br />
sftp_func__(hostname, username, password, port, source file|directory, destination file|directory, method)</p>
<p>Where option &#8220;method&#8221; can be &#8216;get&#8217;(get file from remote host) and &#8216;put&#8217;(put file to remote host) and &#8216;del&#8217;(delete file from remote host )<br />
<em>NOTICE: if you use method &#8220;del&#8221; please specify the target as &#8220;source_file&#8221; and skip &#8220;destination_file&#8221; option</em></p>
<p><strong>function  ftp_func__</strong> :</p>
<p>This function get and delete remote file via ftp protocol. Example:</p>
<p>ftp_func__(hostname, username, password, port, source file|directory, destination file|directory, method)<br />
where option &#8220;method&#8221; can be &#8216;get&#8217; or &#8216;put&#8217;</p>
<p><strong>function get_file_via_ftp__</strong>:</p>
<p>This function is the same to previous one EXCEPT its doesn&#8217;t put a file at remote computer and when its get a file doesn&#8217;t remove it at remote system. Example:</p>
<p>get_file_via_ftp(hostname, username, password, port, source file|directory,  destination file|directory)</p>
<p><strong>function get_yesterday__</strong>:</p>
<p>This function return date of yesterday in format which was got by function as first argument. Example:</p>
<p>get_yesterday__(&#8221;YYYYDDMM&#8221;), get_yesterday__(&#8221;DDMMYYYY&#8221;) and so on.</p>
<p>How it&#8217;s use? Good question :) </p>
<p>Download <a href="http://andriigrytsenko.net/files/monitoring.pm">this</a> library and put into the /usr/lib/perl5/Net/. Ex.:  </p>
<p><code># cp monitoring.pm /usr/lib/perl5/Net/</code></p>
<p>Create new test script :<br />
<code>$ cat > test.pl<br />
#!/usr/bin/perl<br />
use monitoring;<br />
$yesterday=monitoring::get_yesterday__("DDMMYYYY");<br />
print "$yesterday\n";<br />
</code></p>
<p>Set executable rights:<br />
<code>$ chmod +x test.pl</code></p>
<p>And run it:<br />
<code>$ ./test.pl</code><br />
11062009</p>
<p>That&#8217;s all :)</p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2009/06/some-perl-functions-for-monitoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
