<?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>linux Архиви - rosen4o.net</title>
	<atom:link href="https://rosen4o.net/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://rosen4o.net/category/linux/</link>
	<description></description>
	<lastBuildDate>Wed, 05 Jun 2024 06:33:24 +0000</lastBuildDate>
	<language>bg-BG</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Debugging dns glue records</title>
		<link>https://rosen4o.net/2024/06/05/debugging-dns-glue-records/</link>
					<comments>https://rosen4o.net/2024/06/05/debugging-dns-glue-records/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Wed, 05 Jun 2024 06:33:23 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[интернет]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[dig]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[glue record]]></category>
		<category><![CDATA[named]]></category>
		<category><![CDATA[resolving]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1168</guid>

					<description><![CDATA[<p>Sometimes you need to check which glue records are used on domain and where they are pointed First you should check which nameserver is responding for this tld. For example if we wanna check .com domain we need to ask<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2024/06/05/debugging-dns-glue-records/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2024/06/05/debugging-dns-glue-records/">Debugging dns glue records</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Sometimes you need to check which glue records are used on domain and where they are pointed</p>



<p>First you should check which nameserver is responding for this tld. For example if we wanna check .com domain we need to ask proper nameserver</p>



<pre class="wp-block-code"><code>dig +short com. NS
e.gtld-servers.net.
k.gtld-servers.net.
j.gtld-servers.net.
h.gtld-servers.net.
m.gtld-servers.net.
a.gtld-servers.net.
l.gtld-servers.net.
i.gtld-servers.net.
g.gtld-servers.net.
c.gtld-servers.net.
d.gtld-servers.net.
f.gtld-servers.net.
b.gtld-servers.net.
</code></pre>



<ol class="wp-block-list"></ol>



<p>We can chose some random dns server from them and execute</p>



<pre class="wp-block-code"><code>dig +norec @b.gtld-servers.net. example.com. NS
</code></pre>



<p>Then we will get which nameservers on which ip are responding for this domain</p>
<p>Материалът <a href="https://rosen4o.net/2024/06/05/debugging-dns-glue-records/">Debugging dns glue records</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2024/06/05/debugging-dns-glue-records/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>chan_dongle modem config</title>
		<link>https://rosen4o.net/2020/11/26/chan_dongle-modem-config/</link>
					<comments>https://rosen4o.net/2020/11/26/chan_dongle-modem-config/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Thu, 26 Nov 2020 12:03:31 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[sip]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[chan_dongle]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1138</guid>

					<description><![CDATA[<p>Modem settings: AT+CCWA=0,0,1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160; #disable call-waitingAT+CFUN=1,1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160; #reset dongleAT^SYSCFG=13,0,3FFFFFFF,0,3&#160; &#160; &#160; #modem 2G only, any band, no roaming Deleting SMS in sim card memory. After deleting messages you should reset modem. dongle cmd dongle0 AT+CPMS=\"SM\",\"SM\",\"SM\" dongle cmd dongle0<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2020/11/26/chan_dongle-modem-config/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2020/11/26/chan_dongle-modem-config/">chan_dongle modem config</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Modem settings:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><code>AT+CCWA=0,0,1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; #disable call-waiting<br>AT+CFUN=1,1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; #reset dongle<br>AT^SYSCFG=13,0,3FFFFFFF,0,3&nbsp; &nbsp; &nbsp; #modem 2G only, any band, no roaming</code></p></blockquote>



<p>Deleting SMS in sim card memory. After deleting messages you should reset modem.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><code>dongle cmd dongle0 AT+CPMS=\"SM\",\"SM\",\"SM\" </code></p><p><code>dongle cmd dongle0 AT+CMGD=1,4</code></p></blockquote>



<p><br>Deleting SMS in modem memory. After deleting messages you should reset modem.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><code>dongle cmd dongle0 AT+CPMS=\"ME\",\"ME\",\"ME\" </code></p><p><code>dongle cmd dongle0 AT+CMGD=1,4</code></p></blockquote>



<p><br>Other</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><code>dongle ussd dongle0 *123#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - sending ussd&nbsp;</code></p></blockquote>



<p>Enabling call forwarding:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>dongle cmd dongle0 AT+CCFC=4,3,&#8220;+3591111111&#8243; ( forwarding all calls)</p><p>dongle cmd dongle0 AT+CCFC=4,0 (disable forwarding)</p></blockquote>



<p><br>Disable call waiting:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><code>dongle cmd dongle01 AT+CCWA=0,0,1</code></p></blockquote>



<p>CLIR</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><code>dongle cmd dongle01 AT+CLIR=1 (включить сокрытие номера)<br>dongle cmd dongle01 AT+CLIR=0 (выключить сокрытие номера)</code></p></blockquote>



<p><br>Sending SMS</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><code>dongle sms dongle01 1234 MESSAGE</code></p></blockquote>



<p></p>
<p>Материалът <a href="https://rosen4o.net/2020/11/26/chan_dongle-modem-config/">chan_dongle modem config</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2020/11/26/chan_dongle-modem-config/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>search for short open tags</title>
		<link>https://rosen4o.net/2020/06/08/search-for-short-open-tags/</link>
					<comments>https://rosen4o.net/2020/06/08/search-for-short-open-tags/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Mon, 08 Jun 2020 15:19:07 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shortopentags]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1134</guid>

					<description><![CDATA[<p>If you use Linux and try to search for all php files containing short open tags you can use following command find -type f -exec grep -IlP &#8216;&#60;\?(?!(php&#124;xml&#124;=))&#8217; {} +</p>
<p>Материалът <a href="https://rosen4o.net/2020/06/08/search-for-short-open-tags/">search for short open tags</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>If you use Linux and try to search for all php files containing short open tags you can use following command</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>find -type f -exec grep -IlP &#8216;&lt;\?(?!(php|xml|=))&#8217; {} +</p></blockquote>
<p>Материалът <a href="https://rosen4o.net/2020/06/08/search-for-short-open-tags/">search for short open tags</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2020/06/08/search-for-short-open-tags/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>split mp4 file by size on linux</title>
		<link>https://rosen4o.net/2019/12/11/split-mp4-file-by-size-on-linux/</link>
					<comments>https://rosen4o.net/2019/12/11/split-mp4-file-by-size-on-linux/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Wed, 11 Dec 2019 15:50:01 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mkvmerge]]></category>
		<category><![CDATA[mkvtoolnix]]></category>
		<category><![CDATA[mp4]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1126</guid>

					<description><![CDATA[<p>mkvmerge -o outputprefix --split 1G origfile.mp4 You can use mkvmerge from the packet mkvtoolnix which can easy and fast do the job</p>
<p>Материалът <a href="https://rosen4o.net/2019/12/11/split-mp4-file-by-size-on-linux/">split mp4 file by size on linux</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><code>mkvmerge -o outputprefix --split 1G origfile.mp4 </code></p>



<p>You can use mkvmerge from the packet mkvtoolnix which can easy and fast do the job</p>
<p>Материалът <a href="https://rosen4o.net/2019/12/11/split-mp4-file-by-size-on-linux/">split mp4 file by size on linux</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2019/12/11/split-mp4-file-by-size-on-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource</title>
		<link>https://rosen4o.net/2016/10/14/cross-origin-request-blocked-the-same-origin-policy-disallows-reading-the-remote-resource/</link>
					<comments>https://rosen4o.net/2016/10/14/cross-origin-request-blocked-the-same-origin-policy-disallows-reading-the-remote-resource/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Fri, 14 Oct 2016 11:28:50 +0000</pubDate>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[rewrite]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1075</guid>

					<description><![CDATA[<p>If you have following error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at Then you need to add some lines to your .htaccess file &#60;IfModule mod_rewrite.c&#62; RewriteEngine On RewriteBase / Header add Access-Control-Allow-Origin &#8222;*&#8220; Header<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2016/10/14/cross-origin-request-blocked-the-same-origin-policy-disallows-reading-the-remote-resource/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2016/10/14/cross-origin-request-blocked-the-same-origin-policy-disallows-reading-the-remote-resource/">Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you have following error</p>
<p>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at</p>
<p>Then you need to add some lines to your .htaccess file</p>
<blockquote><p>&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /</p>
<p><strong>Header add Access-Control-Allow-Origin &#8222;*&#8220;</strong><br />
<strong>Header add Access-Control-Allow-Headers &#8222;origin, x-requested-with, content-type&#8220;</strong><br />
<strong>Header add Access-Control-Allow-Methods &#8222;PUT, GET, POST, DELETE, OPTIONS&#8220;</strong></p>
<p>RewriteRule ^index\.php$ &#8211; [L]<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
&lt;/IfModule&gt;</p></blockquote>
<p>Материалът <a href="https://rosen4o.net/2016/10/14/cross-origin-request-blocked-the-same-origin-policy-disallows-reading-the-remote-resource/">Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2016/10/14/cross-origin-request-blocked-the-same-origin-policy-disallows-reading-the-remote-resource/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>check for eval(base64 in multiple files</title>
		<link>https://rosen4o.net/2014/12/05/check-for-eval-base64-in-multiple-files/</link>
					<comments>https://rosen4o.net/2014/12/05/check-for-eval-base64-in-multiple-files/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Fri, 05 Dec 2014 07:46:25 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1030</guid>

					<description><![CDATA[<p>If you have hacked joomla or wordpress site you need to check all your site files This commans search all files in current dir and subdirs for eval(base64 which is one of most used combination find * -name '*.php' &#124;xargs<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2014/12/05/check-for-eval-base64-in-multiple-files/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2014/12/05/check-for-eval-base64-in-multiple-files/">check for eval(base64 in multiple files</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you have hacked joomla or wordpress site you need to check all your site files<br />
This commans search all files in current dir and subdirs for eval(base64 which is one of most used combination</p>
<p><code>find * -name '*.php' |xargs grep -lirn "eval(base64"</code></p>
<p>Материалът <a href="https://rosen4o.net/2014/12/05/check-for-eval-base64-in-multiple-files/">check for eval(base64 in multiple files</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2014/12/05/check-for-eval-base64-in-multiple-files/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>bash rename file</title>
		<link>https://rosen4o.net/2014/11/19/bash-rename-file/</link>
					<comments>https://rosen4o.net/2014/11/19/bash-rename-file/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Wed, 19 Nov 2014 16:22:46 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Без категория]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1026</guid>

					<description><![CDATA[<p>This is simple script which rename files based on some pattern For example rename all files AABBBCCC and replace BBB with DDD ./ren &#8222;AAABBBCCC&#8220; &#8222;BBB&#8220; &#8222;DDD&#8220; #!/bin/bash # renames.sh # basic file renamer criteria=$1 re_match=$2 replace=$3 for i in $(<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2014/11/19/bash-rename-file/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2014/11/19/bash-rename-file/">bash rename file</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is simple script which rename files based on some pattern<br />
For example rename all files AABBBCCC and replace BBB with DDD<br />
./ren &#8222;AAABBBCCC&#8220; &#8222;BBB&#8220; &#8222;DDD&#8220;</p>
<blockquote><p>#!/bin/bash<br />
# renames.sh<br />
# basic file renamer</p>
<p>criteria=$1<br />
re_match=$2<br />
replace=$3</p>
<p>for i in $( ls *$criteria* );<br />
do<br />
src=$i<br />
tgt=$(echo $i | sed -e &#8222;s/$re_match/$replace/&#8220;)<br />
mv $src $tgt<br />
done</p></blockquote>
<p>Материалът <a href="https://rosen4o.net/2014/11/19/bash-rename-file/">bash rename file</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2014/11/19/bash-rename-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>catch spam from apache</title>
		<link>https://rosen4o.net/2014/05/20/catch-spam-from-apache/</link>
					<comments>https://rosen4o.net/2014/05/20/catch-spam-from-apache/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Tue, 20 May 2014 08:53:53 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[qmail]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[spam]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1006</guid>

					<description><![CDATA[<p>Sometimes is very hard to debug from which virtual host spam is This can be check very easy with this trick create a new file  vim /usr/local/bin/phpsendmail place inside it #!/usr/bin/php &#60;?php $sendmail = &#8216;/usr/sbin/sendmail&#8217;; $logfile = &#8216;/var/log/mail.form&#8217;; /* Get<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2014/05/20/catch-spam-from-apache/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2014/05/20/catch-spam-from-apache/">catch spam from apache</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes is very hard to debug from which virtual host spam is<br />
This can be check very easy with this trick</p>
<p>create a new file</p>
<p style="padding-left: 30px;"> <strong>vim /usr/local/bin/phpsendmail</strong></p>
<p>place inside it</p>
<p style="padding-left: 30px;"><strong>#!/usr/bin/php</strong><br />
<strong> &lt;?php</strong></p>
<p style="padding-left: 30px;"><strong>$sendmail = &#8216;/usr/sbin/sendmail&#8217;;</strong><br />
<strong> $logfile = &#8216;/var/log/mail.form&#8217;;</strong></p>
<p style="padding-left: 30px;"><strong>/* Get email content */</strong><br />
<strong> $logline = &#8220;;</strong><br />
<strong> $mail = &#8220;;</strong><br />
<strong> $fp = fopen(&#8216;php://stdin&#8217;, &#8216;r&#8217;);</strong></p>
<p style="padding-left: 30px;"><strong>while ($line = fgets($fp))</strong><br />
<strong> {</strong><br />
<strong> if(preg_match(&#8216;/^to:/i&#8217;, $line) || preg_match(&#8216;/^from:/i&#8217;, $line))</strong><br />
<strong> {</strong><br />
<strong> $logline .= trim($line).&#8217; &#8216;;</strong><br />
<strong> }</strong><br />
<strong> $mail .= $line;</strong><br />
<strong> }</strong></p>
<p style="padding-left: 30px;"><strong>/* Build sendmail command */</strong><br />
<strong> $cmd = &#8216;echo &#8216; . escapeshellarg($mail) . &#8216; | &#8216;.$sendmail.&#8217; -t -i&#8217;;</strong><br />
<strong> for ($i = 1; $i &lt; $_SERVER[&#8216;argc&#8217;]; $i++)</strong><br />
<strong> {</strong><br />
<strong> $cmd .= escapeshellarg($_SERVER[&#8216;argv&#8217;][$i]).&#8217; &#8216;;</strong><br />
<strong> }</strong></p>
<p style="padding-left: 30px;"><strong>/* Log line */</strong><br />
<strong> $path = isset($_ENV[&#8216;PWD&#8217;]) ? $_ENV[&#8216;PWD&#8217;] : $_SERVER[&#8216;PWD&#8217;];</strong><br />
<strong> file_put_contents($logfile, date(&#8216;Y-m-d H:i:s&#8217;) . &#8216; &#8216; . $logline .&#8217;  ==&gt; &#8216; .$path.&#8220;\n&#8220;, FILE_APPEND);</strong></p>
<p style="padding-left: 30px;"><strong>/* Call sendmail */</strong><br />
<strong> return shell_exec($cmd);</strong><br />
<strong> ?&gt;</strong></p>
<p>Then you need to make it executable</p>
<p style="padding-left: 30px;"><strong>chmod +x /usr/local/bin/phpsendmail</strong></p>
<p style="padding-left: 30px;"><strong>touch /var/log/mail.form</strong></p>
<p style="padding-left: 30px;"><strong>chmod a+w /var/log/mail.form</strong></p>
<p>In your php.ini file you need to add</p>
<p style="padding-left: 30px;"><strong>sendmail_path = /usr/local/bin/phpsendmail</strong></p>
<p>Restart apache</p>
<p>This will cause all emails which are send from apache to be logged in the file /var/log/mail.form</p>
<p>Материалът <a href="https://rosen4o.net/2014/05/20/catch-spam-from-apache/">catch spam from apache</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2014/05/20/catch-spam-from-apache/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>mysql Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.</title>
		<link>https://rosen4o.net/2014/04/12/mysql-warning-using-unique-option-prefix-pass-instead-of-password-is-deprecated-and-will-be-removed-in-a-future-release-please-use-the-full-name-instead/</link>
					<comments>https://rosen4o.net/2014/04/12/mysql-warning-using-unique-option-prefix-pass-instead-of-password-is-deprecated-and-will-be-removed-in-a-future-release-please-use-the-full-name-instead/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Sat, 12 Apr 2014 05:47:40 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[automysqlbackup]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1002</guid>

					<description><![CDATA[<p>If you get some errors like this you need to open your home directory vim ~/.my.cnf and change on the row pass= to password=</p>
<p>Материалът <a href="https://rosen4o.net/2014/04/12/mysql-warning-using-unique-option-prefix-pass-instead-of-password-is-deprecated-and-will-be-removed-in-a-future-release-please-use-the-full-name-instead/">mysql Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you get some errors like this you need to open your home directory</p>
<blockquote><p><strong>vim ~/.my.cnf</strong></p></blockquote>
<p>and change on the row</p>
<blockquote><p><strong>pass=</strong></p></blockquote>
<p>to</p>
<blockquote><p><strong>password=</strong></p></blockquote>
<p>Материалът <a href="https://rosen4o.net/2014/04/12/mysql-warning-using-unique-option-prefix-pass-instead-of-password-is-deprecated-and-will-be-removed-in-a-future-release-please-use-the-full-name-instead/">mysql Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2014/04/12/mysql-warning-using-unique-option-prefix-pass-instead-of-password-is-deprecated-and-will-be-removed-in-a-future-release-please-use-the-full-name-instead/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>dkim on debian with postfix</title>
		<link>https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/</link>
					<comments>https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/#respond</comments>
		
		<dc:creator><![CDATA[rosen4o]]></dc:creator>
		<pubDate>Thu, 10 Apr 2014 14:57:19 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dkim]]></category>
		<category><![CDATA[postfix]]></category>
		<guid isPermaLink="false">http://rosen4o.net/?p=1000</guid>

					<description><![CDATA[<p>This is a guide to installing OpenDKIM for multiple domains on a Postfix-installtion on Debian. I tried some other guides but kept running into problems, so this is how I did it. Among others, Google Gmail and Yahoo mail check<span class="ellipsis">&#8230;</span></p>
<div class="read-more"><a href="https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/">Прочетете повече ›</a></div>
<p><!-- end of .read-more --></p>
<p>Материалът <a href="https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/">dkim on debian with postfix</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is a guide to installing OpenDKIM for multiple domains on a Postfix-installtion on Debian. I tried some other guides but kept running into problems, so this is how I did it.</p>
<p>Among others, Google Gmail and Yahoo mail check your email for a DKIM signature.<br />
Install and Configure OpenDKIM</p>
<p>1. Install OpenDKIM</p>
<blockquote><p><strong>apt-get install opendkim</strong></p></blockquote>
<p>Comment: This will install the latest available stable Debian packaged version of OpenDKIM which is currently 2.0.1. This version is already a couple of years old (2010).<br />
If you know how/want to compile sources yourself, then the latest version is 2.4.3 (and 2.5.0 is right around the corner)</p>
<p>2. Edit the OpenDKIM config file</p>
<blockquote><p><strong>vim /etc/opendkim.conf</strong></p></blockquote>
<p>Add these rows:</p>
<blockquote><p><strong>KeyTable /etc/opendkim/KeyTable</strong><br />
<strong> SigningTable /etc/opendkim/SigningTable</strong><br />
<strong> ExternalIgnoreList /etc/opendkim/TrustedHosts</strong><br />
<strong> InternalHosts /etc/opendkim/TrustedHosts</strong></p></blockquote>
<p>Note: If you run multiple instances of Postfix you need to add this to the opendkim.conf for each instance (or the ones you want to use opendkim)</p>
<p>3. Edit /etc/opendkim/TrustedHosts</p>
<blockquote><p><strong>mkdir -p <strong>/etc/opendkim/</strong></strong><br />
<strong>vim /etc/opendkim/TrustedHosts</strong></p></blockquote>
<p>Add domains, hostnames and/or ip’s that should be handled by OpenDKIM. Don’t forget localhost.</p>
<blockquote><p><strong>127.0.0.1</strong><br />
<strong> localhost</strong></p></blockquote>
<p>4. Edit /etc/default/opendkim</p>
<blockquote><p><strong>vim /etc/default/opendkim</strong></p></blockquote>
<p>Uncomment this row:</p>
<blockquote><p><strong>SOCKET=&#8220;inet:12345@localhost&#8220; # listen on loopback on port 12345</strong></p></blockquote>
<p>Generate keys<br />
Repeat these steps to generate keys for each domain you will send email from. Replace mydomain.com with your domain name in examples below.</p>
<p>1. Generate key</p>
<blockquote><p><strong>mkdir -p /etc/opendkim/keys/mydomain.com</strong><br />
<strong> cd /etc/opendkim/keys/mydomain.com</strong><br />
<strong> opendkim-genkey -r -d mydomain.com</strong><br />
<strong> chown opendkim:opendkim default.private</strong></p></blockquote>
<p>2. Add domain to KeyTable /etc/opendkim/KeyTable</p>
<blockquote><p><strong>vim /etc/opendkim/KeyTable</strong></p></blockquote>
<p>Add line</p>
<blockquote><p><strong>default._domainkey.mydomain.com mydomain.com:default:/etc/opendkim/keys/mydomain.com/default.private</strong></p></blockquote>
<p>3. Add domain to SigningTable /etc/opendkim/SigningTable</p>
<blockquote><p><strong>vim /etc/opendkim/SigningTable</strong></p></blockquote>
<p>Add line:</p>
<blockquote><p><strong>mydomain.com default._domainkey.mydomain.com</strong></p></blockquote>
<p>Note that in OpenDKIM 2.0.1 domain names are case sensitive (supposed to be fixed from 2.3.1 but I have not tested).<br />
This means that in the above example an email from info@mydomain.com will be signed, but an email from info@MyDomain.com will not be signed. The workaround is to add one extra entry for MyDomain.com to SigningTable.</p>
<p>4. Add to DKIM public key to DNS</p>
<p>Add an entry for the public key to the DNS server you are using for your domain. You find the public key here:</p>
<blockquote><p><strong>cat /etc/opendkim/keys/mydomain.com/default.txt</strong></p></blockquote>
<p>And insert it in your zone file<br />
Start OpenDKIM</p>
<blockquote><p><strong>/etc/init.d/opendkim start</strong></p></blockquote>
<p>In the future, if you make any changes to configuration remember to restart: /etc/init.d/opendkim restart<br />
Configure and Restart Postifx</p>
<p>1. Configure Postfix</p>
<blockquote><p><strong>vim /etc/postfix/main.cf</strong></p></blockquote>
<p>Add or edit these lines:</p>
<blockquote><p><strong>milter_default_action = accept</strong><br />
<strong> milter_protocol = 6</strong><br />
<strong> smtpd_milters = inet:localhost:12345</strong><br />
<strong> non_smtpd_milters = inet:localhost:12345</strong></p></blockquote>
<p>2. Restart Postfix</p>
<blockquote><p><strong>/etc/init.d/postfix reload</strong></p></blockquote>
<p>Log files are in the /var/log directory</p>
<blockquote><p><strong>cat /var/log/mail.log</strong><br />
<strong></strong><strong>cat /var/log/mail.warn</strong><br />
<strong> cat /var/log/mail.err</strong></p></blockquote>
<p>Log more info</p>
<blockquote><p><strong>vim /etc/opendkim.conf</strong></p></blockquote>
<p>Add this line:</p>
<blockquote><p><strong>LogWhy yes</strong></p></blockquote>
<p>&nbsp;</p>
<p>Credits</p>
<p>Guides that have helped me along the way: <a href="http://www.debiantutorials.com/setup-domainkeys-identified-mail-dkim-in-postfix/">Debian Tutorials</a> and <a href="http://syslog.tv/2010/01/11/dkim-on-debian-with-postfix/">Syslog</a></p>
<p>Материалът <a href="https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/">dkim on debian with postfix</a> е публикуван за пръв път на <a href="https://rosen4o.net">rosen4o.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rosen4o.net/2014/04/10/dkim-on-debian-with-postfix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
