<?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>sysadmin Tips &#187; Tips</title>
	<atom:link href="http://www.djinns.net/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.djinns.net</link>
	<description></description>
	<lastBuildDate>Sat, 09 Jan 2010 15:12:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to remove ^M from files</title>
		<link>http://www.djinns.net/2010/01/09/how-to-remove-m-from-files/</link>
		<comments>http://www.djinns.net/2010/01/09/how-to-remove-m-from-files/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 15:12:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Devian]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://www.djinns.net/?p=74</guid>
		<description><![CDATA[When you transfered a file from Windows to Linux, you have ^ M characters that appear. This is due to the end line characters on Windows (\ r \ n) which are differents from Linux (\ n). There is some tips to remove them.

On vi, in command mode

:%s/[ctrl+v][ctrl+M]//

On emacs

M-%

From the shell, install tofrodos (on Debian):

$ [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">When you transfered a file from Windows to Linux, you have ^ M characters that appear. This is due to the end line characters on Windows (\ r \ n) which are differents from Linux (\ n). There is some tips to remove them.</p>
<ul>
<li>On vi, in command mode</li>
</ul>
<pre class="brush: php">:%s/[ctrl+v][ctrl+M]//</pre>
<ul>
<li>On emacs</li>
</ul>
<pre class="brush: php">M-%</pre>
<ul>
<li>From the shell, install tofrodos (on Debian):</li>
</ul>
<pre class="brush: php">$ dos2unix file.txt

$ unix2dos file.txt</pre>
<p>The second command do the opposite.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djinns.net/2010/01/09/how-to-remove-m-from-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Squid, HTTP authentification in accelerator mode</title>
		<link>http://www.djinns.net/2010/01/06/squid-http-authentification-in-accelerator-mode/</link>
		<comments>http://www.djinns.net/2010/01/06/squid-http-authentification-in-accelerator-mode/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 19:12:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Squid]]></category>

		<guid isPermaLink="false">http://www.djinns.net/?p=42</guid>
		<description><![CDATA[When you use HTTP authentification, like in .htaccess with Apache, by default Squid doesn&#8217;t support this feature. You need to add an option, login=PASS,  to the cache_peer to forward HTTP authentification requests to the backend servers:


cache_peer 172.16.1.1 parent 80 0 login=PASS no-query originserver weight=1

]]></description>
			<content:encoded><![CDATA[<p>When you use HTTP authentification, like in .htaccess with Apache, by default Squid doesn&#8217;t support this feature. You need to add an option, <em>login=PASS</em>,  to the cache_peer to forward HTTP authentification requests to the backend servers:</p>
<pre class="brush: php">

cache_peer 172.16.1.1 parent 80 0 login=PASS no-query originserver weight=1
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.djinns.net/2010/01/06/squid-http-authentification-in-accelerator-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use differents cache_peer in Squid</title>
		<link>http://www.djinns.net/2010/01/06/how-to-use-differents-cache_peer-in-squid/</link>
		<comments>http://www.djinns.net/2010/01/06/how-to-use-differents-cache_peer-in-squid/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 18:56:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Squid]]></category>

		<guid isPermaLink="false">http://www.djinns.net/?p=18</guid>
		<description><![CDATA[In accelerator mode, you can use the same Squid instance with differents cache_peer configuration using acl to choose where requests will go:
acl example2 dstdomain www.example2.com

cache_peer 172.16.1.1 parent 80 0 no-query originserver weight=1 name=clust1

cache_peer 172.16.1.2 parent 80 0 no-query originserver weight=1 name=clust2

cache_peer_access clust1 allow !example2

cache_peer_access clust2 allow example2&#60;code&#62;
Request for the domain www.example2.com go to clust2 (172.16.1.2). [...]]]></description>
			<content:encoded><![CDATA[<p>In accelerator mode, you can use the same Squid instance with differents cache_peer configuration using acl to choose where requests will go:</p>
<pre class="brush: sh">acl example2 dstdomain www.example2.com

cache_peer 172.16.1.1 parent 80 0 no-query originserver weight=1 name=clust1

cache_peer 172.16.1.2 parent 80 0 no-query originserver weight=1 name=clust2

cache_peer_access clust1 allow !example2

cache_peer_access clust2 allow example2&lt;code&gt;</pre>
<p>Request for the domain <em>www.example2.com</em> go to clust2 (172.16.1.2). However, request for others domain, like www.toto.com go to clust1 (172.16.1.1).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djinns.net/2010/01/06/how-to-use-differents-cache_peer-in-squid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rewrite rules for maintenance</title>
		<link>http://www.djinns.net/2009/12/21/rewrite-rules-for-maintenance/</link>
		<comments>http://www.djinns.net/2009/12/21/rewrite-rules-for-maintenance/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 16:50:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Apache2]]></category>
		<category><![CDATA[Rewrite]]></category>

		<guid isPermaLink="false">http://www.djinns.net/sysadmin/?p=4</guid>
		<description><![CDATA[Here is the minimal (and the ultimate) rewrite rules to put a website in maintenance mode, works for Apache 2.x:
Options FollowSymLinks

AllowOverride All

RewriteEngine On

RewriteEngine on

RewriteCond %{REQUEST_URI} !\.gif$ [NC]

RewriteCond %{REQUEST_URI} !/maintenance.html$

RewriteRule $ /maintenance.html [R=307,L]
If you have anothers ressources in the maintenance.html page, like a css or js files, add more RewriteCond conditions:
RewriteCond %{REQUEST_URI} !\.css$ [NC]

RewriteCond %{REQUEST_URI} !\.js$ [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Here is the minimal (and the ultimate) rewrite rules to put a website in maintenance mode, works for Apache 2.x:</p>
<pre class="brush: php">Options FollowSymLinks

AllowOverride All

RewriteEngine On

RewriteEngine on

RewriteCond %{REQUEST_URI} !\.gif$ [NC]

RewriteCond %{REQUEST_URI} !/maintenance.html$

RewriteRule $ /maintenance.html [R=307,L]</pre>
<p style="text-align: justify;">If you have anothers ressources in the maintenance.html page, like a css or js files, add more RewriteCond conditions:</p>
<pre class="brush: php">RewriteCond %{REQUEST_URI} !\.css$ [NC]

RewriteCond %{REQUEST_URI} !\.js$ [NC]

RewriteCond %{REQUEST_URI} !\.png$ [NC]</pre>
<p style="text-align: justify;">Also, you can add a RewriteCond conditions to bypass the maintenance mode from a specific IP (or subnet &#8230;):</p>
<pre class="brush: php">RewirteCond %{REMOTE_ADDR} !xxx\.xxx\.xxx\.xxx</pre>
<p style="text-align: justify;">Don&#8217;t forget to activate the rewrite module in Apache2, on a Debian:</p>
<pre class="brush: php"># a2enmod rewrite

# apache2ctl configtest

# /etc/init.d/apache2 reload</pre>
<p style="text-align: justify;">Externals resources:</p>
<ul style="text-align: justify;">
<li><a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html">Apache 2.2 mod_rewrite</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.djinns.net/2009/12/21/rewrite-rules-for-maintenance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
