<?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>Ask me Questions and get Answers !</title>
	<atom:link href="http://askmetoo.com/feed" rel="self" type="application/rss+xml" />
	<link>http://askmetoo.com</link>
	<description>Ask Questions and get Answers About everything for free!</description>
	<lastBuildDate>Wed, 02 May 2012 13:39:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>memcached set max memory used</title>
		<link>http://askmetoo.com/memcached-set-max-memory-used.htm</link>
		<comments>http://askmetoo.com/memcached-set-max-memory-used.htm#comments</comments>
		<pubDate>Wed, 02 May 2012 13:39:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[memcached]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://askmetoo.com/?p=261</guid>
		<description><![CDATA[memcached -d -m 2048 -u root - this console command set max used memory of memcached is 2048 MB memcached -h memcached 1.4.5 -p TCP port number to listen on (default: 11211) -U UDP port number to listen on (default: 11211, 0 is off) -s UNIX socket path to listen on (disables network support) -a [...]]]></description>
			<content:encoded><![CDATA[<p>memcached -d -m 2048 -u root<br />
<span id="more-261"></span><br />
- this console command set max used memory of memcached is 2048 MB</p>
<p> memcached -h<br />
memcached 1.4.5<br />
-p <num>      TCP port number to listen on (default: 11211)<br />
-U <num>      UDP port number to listen on (default: 11211, 0 is off)<br />
-s <file>     UNIX socket path to listen on (disables network support)<br />
-a <mask>     access mask for UNIX socket, in octal (default: 0700)<br />
-l <ip_addr>  interface to listen on (default: INADDR_ANY, all addresses)<br />
-d            run as a daemon<br />
-r            maximize core file limit<br />
-u <username> assume identity of <username> (only when run as root)<br />
-m <num>      max memory to use for items in megabytes (default: 64 MB)<br />
-M            return error on memory exhausted (rather than removing items)<br />
-c <num>      max simultaneous connections (default: 1024)<br />
-k            lock down all paged memory.  Note that there is a<br />
              limit on how much memory you may lock.  Trying to<br />
              allocate more than that would fail, so be sure you<br />
              set the limit correctly for the user you started<br />
              the daemon with (not for -u <username> user;<br />
              under sh this is done with &#8216;ulimit -S -l NUM_KB&#8217;).<br />
-v            verbose (print errors/warnings while in event loop)<br />
-vv           very verbose (also print client commands/reponses)<br />
-vvv          extremely verbose (also print internal state transitions)<br />
-h            print this help and exit<br />
-i            print memcached and libevent license<br />
-P <file>     save PID in <file>, only used with -d option<br />
-f <factor>   chunk size growth factor (default: 1.25)<br />
-n <bytes>    minimum space allocated for key+value+flags (default: 48)<br />
-L            Try to use large memory pages (if available). Increasing<br />
              the memory page size could reduce the number of TLB misses<br />
              and improve the performance. In order to get large pages<br />
              from the OS, memcached will allocate the total item-cache<br />
              in one large chunk.<br />
-D <char>     Use <char> as the delimiter between key prefixes and IDs.<br />
              This is used for per-prefix stats reporting. The default is<br />
              &#8220;:&#8221; (colon). If this option is specified, stats collection<br />
              is turned on automatically; if not, then it may be turned on<br />
              by sending the &#8220;stats detail on&#8221; command to the server.<br />
-t <num>      number of threads to use (default: 4)<br />
-R            Maximum number of requests per event, limits the number of<br />
              requests process for a given connection to prevent<br />
              starvation (default: 20)<br />
-C            Disable use of CAS<br />
-b            Set the backlog queue limit (default: 1024)<br />
-B            Binding protocol &#8211; one of ascii, binary, or auto (default)<br />
-I            Override the size of each slab page. Adjusts max item size<br />
              (default: 1mb, min: 1k, max: 128m)</p>
]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/memcached-set-max-memory-used.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>anti ddos script</title>
		<link>http://askmetoo.com/anti-ddos-script.htm</link>
		<comments>http://askmetoo.com/anti-ddos-script.htm#comments</comments>
		<pubDate>Tue, 01 May 2012 12:01:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian 5]]></category>

		<guid isPermaLink="false">http://askmetoo.com/?p=258</guid>
		<description><![CDATA[http://habrahabr.ru/post/84172/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #!/bin/bash # chmod 755 anti_ddos.sh # ./anti_ddos.sh &#160; &#160; #find cat /var/log/nginx/error.log &#124; grep &#34;limiting connections by zone&#34; &#124; grep &#34;request: \&#34;GET / HTTP/1.1&#34;&#124; awk '{print $12}'&#124; awk [...]]]></description>
			<content:encoded><![CDATA[<p>http://habrahabr.ru/post/84172/</p>
<p><span id="more-258"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="sh" style="font-family:monospace;">#!/bin/bash 
# chmod 755 anti_ddos.sh
# ./anti_ddos.sh
&nbsp;
&nbsp;
#find
cat /var/log/nginx/error.log | grep &quot;limiting connections by zone&quot; | grep &quot;request: \&quot;GET / HTTP/1.1&quot;| awk '{print $12}'| awk -F&quot;,&quot; '{print $1}'| sort | uniq -c | sort -nr &gt; /tmp/botnet.blacklist
&nbsp;
#/tmp/botnet.blacklist
# очищаем скрипт бана
cat /dev/null &gt; /tmp/iptables_ban.sh
&nbsp;
# создаем DROP правила для 50 самых агрессивных ботов
awk '{print &quot;iptables -A INPUT -p tcp --dport 80 -s &quot; $2 &quot; -j DROP&quot; }' /tmp/botnet.blacklist | head -n 50 &gt;&gt; /tmp/iptables_ban.sh
&nbsp;
# загружаем blacklist
bash /tmp/iptables_ban.sh
&nbsp;
# делаем ротацию лога
cat /dev/null &gt; /var/log/nginx/error.log
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
&nbsp;
&nbsp;
*/5 * * * * /root/script/ban.sh
&nbsp;
В результате iptables будет пополнятся новыми ботами.</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/anti-ddos-script.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php call function on exit</title>
		<link>http://askmetoo.com/php-call-function-on-exit.htm</link>
		<comments>http://askmetoo.com/php-call-function-on-exit.htm#comments</comments>
		<pubDate>Fri, 27 Apr 2012 15:10:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://askmetoo.com/?p=256</guid>
		<description><![CDATA[you need to use http://php.net/manual/en/function.register-shutdown-function.php]]></description>
			<content:encoded><![CDATA[<p><span id="more-256"></span><br />
you need to use http://php.net/manual/en/function.register-shutdown-function.php</p>
]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/php-call-function-on-exit.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free alternative of teleport pro is httrack</title>
		<link>http://askmetoo.com/free-alternative-of-teleport-pro-is-httrack.htm</link>
		<comments>http://askmetoo.com/free-alternative-of-teleport-pro-is-httrack.htm#comments</comments>
		<pubDate>Mon, 09 Apr 2012 11:54:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://askmetoo.com/?p=253</guid>
		<description><![CDATA[http://www.httrack.com/page/2/en/index.html It allows you to download a World Wide Web site from the Internet to a local directory, building recursively all directories, getting HTML, images, and other files from the server to your computer. HTTrack arranges the original site&#8217;s relative link-structure. Simply open a page of the &#8220;mirrored&#8221; website in your browser, and you can [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-253"></span>http://www.httrack.com/page/2/en/index.html</p>
<p>It allows you to download a World Wide Web site from the Internet to a local directory, building recursively all directories, getting HTML, images, and other files from the server to your computer. HTTrack arranges the original site&#8217;s relative link-structure. Simply open a page of the &#8220;mirrored&#8221; website in your browser, and you can browse the site from link to link, as if you were viewing it online. HTTrack can also update an existing mirrored site, and resume interrupted downloads. HTTrack is fully configurable, and has an integrated help system.</p>
]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/free-alternative-of-teleport-pro-is-httrack.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>301 javascript redirect for google from old website domain to new domain</title>
		<link>http://askmetoo.com/301-javascript-redirect-for-google-from-old-website-domain-to-new-domain.htm</link>
		<comments>http://askmetoo.com/301-javascript-redirect-for-google-from-old-website-domain-to-new-domain.htm#comments</comments>
		<pubDate>Mon, 02 Apr 2012 09:00:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://askmetoo.com/?p=251</guid>
		<description><![CDATA[1 2 3 4 5 6 7 8 &#60;script language=&#34;javascript&#34; type=&#34;text/javascript&#34;&#62; var loc = document.location.href + &#34;&#34;; &#160; loc = loc.replace(&#34;old-website.ru&#34;, &#34;new-website.ru&#34;); &#160; document.write ('&#60;meta http-equiv=&#34;refresh&#34; content=&#34;0;url='+loc+'&#34; /&#62;'); document.write (loc); &#60;/script&#62;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
	var loc = document.location.href + &quot;&quot;;
&nbsp;
	loc = loc.replace(&quot;old-website.ru&quot;, &quot;new-website.ru&quot;);
&nbsp;
	document.write ('&lt;meta http-equiv=&quot;refresh&quot; content=&quot;0;url='+loc+'&quot; /&gt;');
	document.write (loc);
&lt;/script&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/301-javascript-redirect-for-google-from-old-website-domain-to-new-domain.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gz unzip gz file from php</title>
		<link>http://askmetoo.com/gz-unzip-gz-file-from-php.htm</link>
		<comments>http://askmetoo.com/gz-unzip-gz-file-from-php.htm#comments</comments>
		<pubDate>Wed, 21 Dec 2011 08:03:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://askmetoo.com/?p=245</guid>
		<description><![CDATA[php example code 1 2 3 4 5 6 7 8 9 10 11 12 &#60;?php function uncompress&#40;$srcName, $dstName&#41; &#123; $sfp = gzopen&#40;$srcName, &#34;rb&#34;&#41;; $fp = fopen&#40;$dstName, &#34;w&#34;&#41;; &#160; while &#40;$string = gzread&#40;$sfp, 4096&#41;&#41; &#123; fwrite&#40;$fp, $string, strlen&#40;$string&#41;&#41;; &#125; gzclose&#40;$sfp&#41;; fclose&#40;$fp&#41;; &#125; uncompress&#40;'codhacks.sql.gz','codhacks.sql'&#41;;echo 1;exit;]]></description>
			<content:encoded><![CDATA[<p>php example code<br />
<span id="more-245"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> uncompress<span style="color: #009900;">&#40;</span><span style="color: #000088;">$srcName</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dstName</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$sfp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">gzopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$srcName</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;rb&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dstName</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;w&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">gzread</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sfp</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4096</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #990000;">gzclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sfp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
uncompress<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'codhacks.sql.gz'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'codhacks.sql'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>echo <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>exit<span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/gz-unzip-gz-file-from-php.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analyse Logging commands for debian linux</title>
		<link>http://askmetoo.com/analyse-logging-commands-for-debian-linux.htm</link>
		<comments>http://askmetoo.com/analyse-logging-commands-for-debian-linux.htm#comments</comments>
		<pubDate>Fri, 23 Sep 2011 18:27:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian 5]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[Unix-Linux]]></category>

		<guid isPermaLink="false">http://askmetoo.com/?p=241</guid>
		<description><![CDATA[http://stackoverflow.com/questions/473998/tool-or-language-to-count-occurrances-of-errors-in-a-log-file http://www.thinkplexx.com/learn/article/webperf/baslog/statwithbashandawk awk &#8216;{print $1}&#8217; access.log&#124;sort -u awk &#8216;{print $2}&#8217; access.log&#124;sort -u awk &#8216;{print $3}&#8217; access.log&#124;sort -u The awk filters out all IP addresses, the sort then removes duplicates. To find out all accesses to a URL, I do grep URL access.log]]></description>
			<content:encoded><![CDATA[<p>http://stackoverflow.com/questions/473998/tool-or-language-to-count-occurrances-of-errors-in-a-log-file</p>
<p><span id="more-241"></span></p>
<p>http://www.thinkplexx.com/learn/article/webperf/baslog/statwithbashandawk</p>
<p>awk &#8216;{print $1}&#8217; access.log|sort -u<br />
awk &#8216;{print $2}&#8217; access.log|sort -u<br />
awk &#8216;{print $3}&#8217; access.log|sort -u</p>
<p>The awk filters out all IP addresses, the sort then removes duplicates.</p>
<p>To find out all accesses to a URL, I do</p>
<p>grep URL access.log</p>
]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/analyse-logging-commands-for-debian-linux.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache2ctl configtest debian apache</title>
		<link>http://askmetoo.com/apache2ctl-configtest-debian-apache.htm</link>
		<comments>http://askmetoo.com/apache2ctl-configtest-debian-apache.htm#comments</comments>
		<pubDate>Sun, 04 Sep 2011 17:31:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian 5]]></category>

		<guid isPermaLink="false">http://askmetoo.com/?p=239</guid>
		<description><![CDATA[How to test debian config in apache ? in debian ? mnake /usr/sbin/apache2ctl configtest]]></description>
			<content:encoded><![CDATA[<p>How to test debian config in apache ? in debian ?<br />
mnake <span id="more-239"></span><br />
/usr/sbin/apache2ctl configtest</p>
]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/apache2ctl-configtest-debian-apache.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>find files of some user (linux)</title>
		<link>http://askmetoo.com/find-files-of-some-user-linux.htm</link>
		<comments>http://askmetoo.com/find-files-of-some-user-linux.htm#comments</comments>
		<pubDate>Fri, 12 Aug 2011 07:57:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian 5]]></category>

		<guid isPermaLink="false">http://askmetoo.com/?p=236</guid>
		<description><![CDATA[find / -user forumcv]]></description>
			<content:encoded><![CDATA[<p>find / -user forumcv</p>
]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/find-files-of-some-user-linux.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting PostgreSQL 8.3 database server: mainThe PostgreSQL server failed to start.</title>
		<link>http://askmetoo.com/starting-postgresql-8-3-database-server-mainthe-postgresql-server-failed-to-start.htm</link>
		<comments>http://askmetoo.com/starting-postgresql-8-3-database-server-mainthe-postgresql-server-failed-to-start.htm#comments</comments>
		<pubDate>Thu, 21 Jul 2011 15:41:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian 5]]></category>

		<guid isPermaLink="false">http://askmetoo.com/?p=233</guid>
		<description><![CDATA[Starting PostgreSQL 8.3 database server: mainThe PostgreSQL server failed to start. Please check the log output: 2011-07-21 18:34:55 EEST FATAL: unsafe permissions on private key file &#8220;server.key&#8221; 2011-07-21 18:34:55 EEST DETAIL: File must be owned by the database user or root, must have no write permission for &#8220;group&#8221;, and must have no permissions for &#8220;other&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p>Starting PostgreSQL 8.3 database server: mainThe PostgreSQL server failed to start. Please check the log output: 2011-07-21 18:34:55 EEST FATAL: unsafe permissions on private key file &#8220;server.key&#8221; 2011-07-21 18:34:55 EEST DETAIL: File must be owned by the database user or root, must have no write permission for &#8220;group&#8221;, and must have no permissions for &#8220;other&#8221;. failed!<br />
 failed!<span id="more-233"></span></p>
<p>HOw to fix ?<br />
easy</p>
<p>Work Around:</p>
<p>1) Enter the relevant directory (use> locate server.key)<br />
2) Back up old server.key link.<br />
3) Copy ssl-cert-snakeoil.key to server.key<br />
4-5) Change its owner &#038; group to postgres<br />
6) Ensure the permissions are 700 or 740 (as requested by error message)</p>
<p>Recipe for my   w/ postgresql-8.3 (beware of typos):</p>
<p> cd /var/lib/postgresql/8.3/main/<br />
mv server.key server.key-0<br />
 cp /etc/ssl/private/ssl-cert-snakeoil.key server.key<br />
chown postgres server.key<br />
 chgrp postgres server.key<br />
 chmod 740 server.key<br />
 /etc/init.d/postgresql-8.3 start</p>
]]></content:encoded>
			<wfw:commentRss>http://askmetoo.com/starting-postgresql-8-3-database-server-mainthe-postgresql-server-failed-to-start.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

