<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>A random weblog but it's mine</title>
	<atom:link href="http://smaftoul.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://smaftoul.wordpress.com</link>
	<description>(might eventually be interesting :) )</description>
	<lastBuildDate>Fri, 11 Mar 2011 13:23:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='smaftoul.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>A random weblog but it's mine</title>
		<link>http://smaftoul.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://smaftoul.wordpress.com/osd.xml" title="A random weblog but it&#039;s mine" />
	<atom:link rel='hub' href='http://smaftoul.wordpress.com/?pushpress=hub'/>
		<item>
		<title>A little one-liner: rename to lowercase recursively</title>
		<link>http://smaftoul.wordpress.com/2009/06/09/a-little-one-liner-rename-to-lowercase-recursively/</link>
		<comments>http://smaftoul.wordpress.com/2009/06/09/a-little-one-liner-rename-to-lowercase-recursively/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 09:33:33 +0000</pubDate>
		<dc:creator>smaftoul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[one-liner]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://smaftoul.wordpress.com/?p=301</guid>
		<description><![CDATA[Here is my little one-liner, because I used it today and I find it fun:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=301&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is my little one-liner, because I used it today and I find it fun:<br />
<pre class="brush: php;">for f in `find .` ; do mv $f `echo $f | tr '[A-Z]' '[a-z]'` ; done </pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smaftoul.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smaftoul.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/smaftoul.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/smaftoul.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/smaftoul.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/smaftoul.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/smaftoul.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/smaftoul.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/smaftoul.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/smaftoul.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/smaftoul.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/smaftoul.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/smaftoul.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/smaftoul.wordpress.com/301/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=301&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smaftoul.wordpress.com/2009/06/09/a-little-one-liner-rename-to-lowercase-recursively/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1369b222bc03a323e8ccce4bc90a6cc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">smaftoul</media:title>
		</media:content>
	</item>
		<item>
		<title>netcat as a logging tcp proxy</title>
		<link>http://smaftoul.wordpress.com/2009/05/13/netcat-as-a-logging-tcp-proxy/</link>
		<comments>http://smaftoul.wordpress.com/2009/05/13/netcat-as-a-logging-tcp-proxy/#comments</comments>
		<pubDate>Wed, 13 May 2009 09:18:23 +0000</pubDate>
		<dc:creator>smaftoul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[networks]]></category>
		<category><![CDATA[reverse engineeering]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[system administration]]></category>

		<guid isPermaLink="false">http://smaftoul.wordpress.com/?p=134</guid>
		<description><![CDATA[I felt I needed to write an article about netcat, so here is it ! Netcat is an incredibly usefull tool, that allows you to play with tcp connection easily from the shell. Basically, as it name implies, it&#8217;s just cat over the network, but what its name doesn&#8217;t tell you is that it also [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=134&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I felt I needed to write an article about netcat, so here is it !<br />
Netcat is an incredibly usefull tool, that allows you to play with tcp connection easily from the shell.<br />
Basically, as it name implies, it&#8217;s just cat over the network, but what its name doesn&#8217;t tell you is that it also can act as a socket listener.<br />
So let&#8217;s play with pipes, here is one of my favourite use of netcat:<br />
<pre class="brush: php;">
mkfifo proxypipe
cat proxypipe | nc -l -p 80 | tee -a inflow | nc localhost 81 | tee -a outflow 1&gt;proxypipe
</pre><br />
This command will redirect traffic from localhost:80 to localhost:81, in the inflow file you while find the incoming http request, in the outfile, you will find the http response from the server.<br />
Similarly, you can do this:<br />
<pre class="brush: php;">
cat proxypipe | nc -l 80 | tee -a inflow | sed 's/^Host.*/Host: www.google.fr/' |  nc www.google.fr 80 | tee -a outflow &gt;proxypipe
</pre><br />
This will allow your browser to point to google using http://localhost .<br />
Anyway, this is my favourite but netcat has thounds of other uses, have a look at it !<br />
It can be usefull for file transfers (gzip|nc) , performance measurement (dd|gzip), protocol debugging (replaying requests), security testing (nc does port scan) &#8230;  </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smaftoul.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smaftoul.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/smaftoul.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/smaftoul.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/smaftoul.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/smaftoul.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/smaftoul.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/smaftoul.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/smaftoul.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/smaftoul.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/smaftoul.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/smaftoul.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/smaftoul.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/smaftoul.wordpress.com/134/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=134&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smaftoul.wordpress.com/2009/05/13/netcat-as-a-logging-tcp-proxy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1369b222bc03a323e8ccce4bc90a6cc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">smaftoul</media:title>
		</media:content>
	</item>
		<item>
		<title>ubuntu and bind acting as slave</title>
		<link>http://smaftoul.wordpress.com/2009/04/17/ubuntu-and-bind-acting-as-slave/</link>
		<comments>http://smaftoul.wordpress.com/2009/04/17/ubuntu-and-bind-acting-as-slave/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 00:22:24 +0000</pubDate>
		<dc:creator>smaftoul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apparmor]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[hardy]]></category>
		<category><![CDATA[intrepid]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[slave]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://smaftoul.wordpress.com/?p=286</guid>
		<description><![CDATA[While installing a slave dns server with bind, I went into trouble. I could not understand why my slave zone would not synchronize. Actually I found these entries in /var/log/daemon.log: named[24309]: dumping master file: /etc/bind/tmp-b0KyuKU5pG: open: permission denied named[24309]: transfer of 'domain.com/IN' from w.x.y.z#53: failed while receiving responses: permission denied It appears that since hardy, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=286&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While installing a slave dns server with bind, I went into trouble. I could not understand why my slave zone would not synchronize. Actually I found these entries in <code>/var/log/daemon.log</code>:<br />
<code><br />
named[24309]: dumping master file: /etc/bind/tmp-b0KyuKU5pG: open: permission denied<br />
named[24309]: transfer of 'domain.com/IN' from w.x.y.z#53: failed while receiving responses: permission denied<br />
</code><br />
It appears that since hardy, ubuntu doesn&#8217;t allow the <code>named</code> process to write in <code>/etc/bind/</code> while it&#8217;s running.<br />
Ubuntu is configured to allow slave zone to stay in <code>/var/cache/bind/db.domain.com</code></p>
<p>So your slave zone will look like:<br />
<pre class="brush: php;">
zone &quot;domain.com&quot; IN {
        type slave;
        file &quot;/var/cache/bind/db.domain.com&quot;;
        masters { w.x.y.z; };
};
</pre></p>
<p>For the details, it&#8217;s due to apparmor, and precisely the file <code>/etc/apparmor.d/usr.sbin.named</code>.<br />
As shipped with ubuntu, this file contains the authorizations for the named process that restricts where bind can write its zones, and reserves <code>/var/cache/bind/</code> as the directory where bind is supposed to put its slave zones.<br />
This seems to me technically good because <code>/etc</code> is pretty much supposed to be &#8220;read-only able&#8221; (beside <code>/etc/mtab</code> and <code>/etc/resolv.conf</code> that you can put in <code>/dev/shm</code> or link from <code>/var/etc</code>). This makes me wonder where to put master zones that you want to change ? Probably in <code>/var/lib/bind</code> because it&#8217;s where dynamically updated zone are.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smaftoul.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smaftoul.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/smaftoul.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/smaftoul.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/smaftoul.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/smaftoul.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/smaftoul.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/smaftoul.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/smaftoul.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/smaftoul.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/smaftoul.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/smaftoul.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/smaftoul.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/smaftoul.wordpress.com/286/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=286&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smaftoul.wordpress.com/2009/04/17/ubuntu-and-bind-acting-as-slave/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1369b222bc03a323e8ccce4bc90a6cc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">smaftoul</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing redmine 0.8 on intrepid (ubuntu 8.10)</title>
		<link>http://smaftoul.wordpress.com/2009/04/16/installing-redmine-08-on-intrepid-ubuntu-810/</link>
		<comments>http://smaftoul.wordpress.com/2009/04/16/installing-redmine-08-on-intrepid-ubuntu-810/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 16:05:31 +0000</pubDate>
		<dc:creator>smaftoul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[deployement]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pm]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://smaftoul.wordpress.com/?p=279</guid>
		<description><![CDATA[I&#8217;ve successfully insalled redmine pretty much easily but I needed to find out what packages to install with apt, which one with gem, which version &#8230; Here is my magic receipe to install it all: And that&#8217;s it ! Redmine is running on port 3000. I did this on an EC2 instance and it works [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=279&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve successfully insalled redmine pretty much easily but I needed to find out what packages to install with apt, which one with gem, which version &#8230;<br />
Here is my magic receipe to install it all:<br />
<pre class="brush: php;">
apt-get update 
apt-get install subversion mysql-server rubygems rake pwgen
# next line generates a password for the database
export PASSWORD=`pwgen -nc 8 1`
gem install -v=2.1.2 rails
echo &quot;CREATE DATABASE redmine  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY '$PASSWORD' WITH GRANT OPTION; FLUSH PRIVILEGES&quot; | mysql 
cd /opt/
svn export http://redmine.rubyforge.org/svn/branches/0.8-stable redmine-0.8
cd redmine-0.8/
cat &lt;&lt;EOF &gt;&gt; config/database.yml
production:
  adapter: mysql
  socket: /var/run/mysqld/mysqld.sock 
  database: redmine
  host: localhost
  username: redmine
  password: $PASSWORD
  encoding: utf8

EOF
rake db:migrate RAILS_ENV=&quot;production&quot;
rake redmine:load_default_data RAILS_ENV=&quot;production&quot;
apt-get remove pwgen subversion
RAILS_ENV=&quot;production&quot; ./script/server  
</pre></p>
<p>And that&#8217;s it ! Redmine is running on port 3000.<br />
I did this on an EC2 instance and it works like a charm (ami-7cfd1a15).<br />
Maybe next article will discuss running redmine in mongrel or apache, and creating an init script for having redmine running on boot !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smaftoul.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smaftoul.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/smaftoul.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/smaftoul.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/smaftoul.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/smaftoul.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/smaftoul.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/smaftoul.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/smaftoul.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/smaftoul.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/smaftoul.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/smaftoul.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/smaftoul.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/smaftoul.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=279&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smaftoul.wordpress.com/2009/04/16/installing-redmine-08-on-intrepid-ubuntu-810/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1369b222bc03a323e8ccce4bc90a6cc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">smaftoul</media:title>
		</media:content>
	</item>
		<item>
		<title>HTTP&#8217;s 301 and 302</title>
		<link>http://smaftoul.wordpress.com/2009/04/15/https-301-and-302/</link>
		<comments>http://smaftoul.wordpress.com/2009/04/15/https-301-and-302/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 13:38:55 +0000</pubDate>
		<dc:creator>smaftoul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://smaftoul.wordpress.com/?p=94</guid>
		<description><![CDATA[Just a little note, 301 is the HTTP code for &#8220;temporarly moved&#8221;, 302 is &#8220;permanently moved&#8221;. Seems 302 is genereally more usefull and works better. From what I noticed (I&#8217;m not sure about it), 302 has better SEO. Also some browsers seems to make better cache use with 302 and generating less requests on your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=94&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just a little note, 301 is the HTTP code for &#8220;temporarly moved&#8221;, 302 is &#8220;permanently moved&#8221;.<br />
Seems 302 is genereally more usefull and works better.<br />
From what I noticed (I&#8217;m not sure about it), 302 has better SEO. Also some browsers seems to make better cache use with 302 and generating less requests on your webserver.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smaftoul.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smaftoul.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/smaftoul.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/smaftoul.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/smaftoul.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/smaftoul.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/smaftoul.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/smaftoul.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/smaftoul.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/smaftoul.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/smaftoul.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/smaftoul.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/smaftoul.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/smaftoul.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=94&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smaftoul.wordpress.com/2009/04/15/https-301-and-302/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1369b222bc03a323e8ccce4bc90a6cc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">smaftoul</media:title>
		</media:content>
	</item>
		<item>
		<title>Hostname and underscore</title>
		<link>http://smaftoul.wordpress.com/2009/04/14/hostname-and-underscore/</link>
		<comments>http://smaftoul.wordpress.com/2009/04/14/hostname-and-underscore/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 15:20:42 +0000</pubDate>
		<dc:creator>smaftoul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[sys]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://smaftoul.wordpress.com/?p=275</guid>
		<description><![CDATA[RFC 952 and RFC 1123 explains the rules for choosing a hostname. I noticed recently that a lot of admins (including me) are using underscores in hostnames, but this doesn&#8217;t follow RFCs. This can lead to strange behaviours, such as mail not delivered with an RFC compliant mail server to an MX that have underscores [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=275&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ietf.org/rfc/rfc952.txt">RFC 952</a> and <a href="http://www.ietf.org/rfc/rfc1123.txt">RFC 1123</a> explains the rules for choosing a hostname. I noticed recently that a lot of admins (including me) are using underscores in hostnames, but this doesn&#8217;t follow RFCs. This can lead to strange behaviours, such as mail not delivered with an RFC compliant mail server to an MX that have underscores in its name &#8230;<br />
I noticed that because the &#8220;hostname&#8221; command on linux can set the hostname of a system, but the command doesn&#8217;t accept underscores. So guys, don&#8217;t use underscores !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smaftoul.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smaftoul.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/smaftoul.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/smaftoul.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/smaftoul.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/smaftoul.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/smaftoul.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/smaftoul.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/smaftoul.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/smaftoul.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/smaftoul.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/smaftoul.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/smaftoul.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/smaftoul.wordpress.com/275/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=275&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smaftoul.wordpress.com/2009/04/14/hostname-and-underscore/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1369b222bc03a323e8ccce4bc90a6cc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">smaftoul</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL &#8220;pretty printing&#8221;</title>
		<link>http://smaftoul.wordpress.com/2009/04/08/mysql-pretty-printing/</link>
		<comments>http://smaftoul.wordpress.com/2009/04/08/mysql-pretty-printing/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 13:57:44 +0000</pubDate>
		<dc:creator>smaftoul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://smaftoul.wordpress.com/?p=270</guid>
		<description><![CDATA[I just discovered an apparently wide spread tip for mysql: mysql&#62; select 1, 2, 3, 4 ; +---+---+---+---+ &#124; 1 &#124; 2 &#124; 3 &#124; 4 &#124; +---+---+---+---+ &#124; 1 &#124; 2 &#124; 3 &#124; 4 &#124; +---+---+---+---+ 1 row in set (0.00 sec) mysql&#62; select 1, 2, 3, 4 \G; *************************** 1. row *************************** [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=270&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just discovered an apparently wide spread tip for mysql:</p>
<p><code><br />
mysql&gt; select 1, 2, 3, 4 ;<br />
+---+---+---+---+<br />
| 1 | 2 | 3 | 4 |<br />
+---+---+---+---+<br />
| 1 | 2 | 3 | 4 |<br />
+---+---+---+---+<br />
1 row in set (0.00 sec)<br />
</code></p>
<p><code><br />
mysql&gt; select 1, 2, 3, 4 \G;<br />
*************************** 1. row ***************************<br />
1: 1<br />
2: 2<br />
3: 3<br />
4: 4<br />
1 row in set (0.00 sec)<br />
</code><br />
As you might have seen, the difference comes from the &#8220;\G&#8221; !</p>
<p>It&#8217;s very usefull when you select lot of columns that doesn&#8217;t fit the width of your terminal !<br />
Shame on me I didn&#8217;t knew that before !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smaftoul.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smaftoul.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/smaftoul.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/smaftoul.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/smaftoul.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/smaftoul.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/smaftoul.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/smaftoul.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/smaftoul.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/smaftoul.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/smaftoul.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/smaftoul.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/smaftoul.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/smaftoul.wordpress.com/270/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=270&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smaftoul.wordpress.com/2009/04/08/mysql-pretty-printing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1369b222bc03a323e8ccce4bc90a6cc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">smaftoul</media:title>
		</media:content>
	</item>
		<item>
		<title>Two usefull MySQL requests</title>
		<link>http://smaftoul.wordpress.com/2009/01/21/two-usefull-mysql-requests/</link>
		<comments>http://smaftoul.wordpress.com/2009/01/21/two-usefull-mysql-requests/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 13:45:58 +0000</pubDate>
		<dc:creator>smaftoul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dba]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://smaftoul.wordpress.com/?p=24</guid>
		<description><![CDATA[To analyse a database content, I used several times theses two requests: Number of columns for all tables in a database: select TABLE_NAME, count(TABLE_NAME) from columns where TABLE_SCHEMA="dbname" group by TABLE_NAME order by count (TABLE_NAME); Number of rows for all tables in a database: select table_name, table_rows from information_schema.tables where table_schema = 'dbname' order by [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=24&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To analyse a database content, I used several times theses two requests:</p>
<ul>
<li>Number of columns for all tables in a database:<br />
<code>select TABLE_NAME, count(TABLE_NAME) from columns where TABLE_SCHEMA="dbname" group by TABLE_NAME order by count (TABLE_NAME);</code></li>
<li>Number of rows for all tables in a database:<br />
<code>select table_name, table_rows from information_schema.tables where table_schema = 'dbname' order by table_rows;</code></li>
<p>These are simple but effective to know where most of your data are if your database starting to get slow.<br />
Also, it can help for finding a partitionning or sharding strategy.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smaftoul.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smaftoul.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/smaftoul.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/smaftoul.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/smaftoul.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/smaftoul.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/smaftoul.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/smaftoul.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/smaftoul.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/smaftoul.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/smaftoul.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/smaftoul.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/smaftoul.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/smaftoul.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=24&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smaftoul.wordpress.com/2009/01/21/two-usefull-mysql-requests/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1369b222bc03a323e8ccce4bc90a6cc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">smaftoul</media:title>
		</media:content>
	</item>
		<item>
		<title>subversion hooks and &#8220;light&#8221; continuous integration</title>
		<link>http://smaftoul.wordpress.com/2009/01/19/subversion-hooks-and-light-continuous-integration/</link>
		<comments>http://smaftoul.wordpress.com/2009/01/19/subversion-hooks-and-light-continuous-integration/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 15:46:08 +0000</pubDate>
		<dc:creator>smaftoul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code management]]></category>
		<category><![CDATA[continuous]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[versioning]]></category>

		<guid isPermaLink="false">http://smaftoul.wordpress.com/?p=258</guid>
		<description><![CDATA[I recently made something really simple which developpers found really usefull: When a developper commits some code on a subversion repository, he wants to test if it works on an integration plateform. In my case, this was on a php project, so no complilation, to do so, I just need to copy the file in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=258&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently made something really simple which developpers found really usefull:<br />
When a developper commits some code on a subversion repository, he wants to test if it works on an integration plateform.<br />
In my case, this was on a php project, so no complilation, to do so, I just need to copy the file in the right place !<br />
Actually, the right place for me was on another machine.</p>
<p>So, how do you copy files on a remote machine automatically when developpers commits some new code ?<br />
Easy: use <strong>hooks</strong></p>
<p>In your subversion repository you will find a directory called &#8220;hooks&#8221; , all files in this directory are called something.tmpl , those files are examples / templates.</p>
<p>What i did was put this content in post-commit:<br />
<pre class="brush: php;">
REPOS=&quot;$1&quot; 
REV=&quot;$2&quot; 
RESULT=`/usr/bin/svnlook dirs-changed &quot;$REPOS&quot; -r $REV | grep -e &quot;the/dir/in/the/repo/project&quot;`; 
if [ ! -z &quot;$RESULT&quot; ]; then 
    /usr/bin/svn export file:///var/lib/svn/the/dir/in/the/repo/project /tmp/project
    /usr/bin/scp -i /home/apache/id_dsa -r /tmp/project/* user@host:/var/www/project
    /bin/rm -rf /tmp/project
fi 
</pre></p>
<p>Then I needed to do some stuff: </p>
<ol>
<li><code>chmod +x post-commit</code></li>
<li>I also needed to generate ssh keys, put the private key in /home/apache/id_dsa, make it owned by the process running subversion (for me apache, because I&#8217;m using apache&#8217;s mod_dav_svn), and copy the key to a users&#8217; authorized_keys file &#8230;</li>
<li>Authorize the remote host&#8217;s key for the user running the post-commit script (<code>su www-data</code> then <code>ssh host</code> and accept the key)</li>
</ol>
<p>I you make a mistake in your post-commit script (like I did the first time I tried), you get the error on the output when you commit the code !</p>
<p>Easy, fun and nice !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smaftoul.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smaftoul.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/smaftoul.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/smaftoul.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/smaftoul.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/smaftoul.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/smaftoul.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/smaftoul.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/smaftoul.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/smaftoul.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/smaftoul.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/smaftoul.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/smaftoul.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/smaftoul.wordpress.com/258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=258&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smaftoul.wordpress.com/2009/01/19/subversion-hooks-and-light-continuous-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1369b222bc03a323e8ccce4bc90a6cc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">smaftoul</media:title>
		</media:content>
	</item>
		<item>
		<title>limits , open files, pam, daemons and scalability</title>
		<link>http://smaftoul.wordpress.com/2008/12/26/limits-open-files-pam-daemons-and-scalability/</link>
		<comments>http://smaftoul.wordpress.com/2008/12/26/limits-open-files-pam-daemons-and-scalability/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 11:01:28 +0000</pubDate>
		<dc:creator>smaftoul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://smaftoul.wordpress.com/?p=254</guid>
		<description><![CDATA[Be carefull, some daemons have some extensive activity ! It depends on the daemon (its goal, its activity) but some opens a lot of files, some uses a lot a network connections, some both of them (and some takes a lot of cpu , others a lot of ram) &#8230; Anyway, on unix any process [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=254&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Be carefull, some daemons have some extensive activity !<br />
It depends on the daemon (its goal, its activity) but some opens a lot of files, some uses a lot a network connections, some both of them (and some takes a lot of cpu , others a lot of ram) &#8230;<br />
Anyway, on unix any process is limited by the system with the ulimit mechanism, and one of these &#8220;annoying&#8221; limits is the maximum number of file descriptor , that is the maximum number of open files a single process can use including network connections (on unix, a network connections has a file descriptor associated to it).</p>
<p>Depending on your daemon and your case, you sometimes need to get rid of these limits (be sure you need to get rid a of these limits). To do so , on a ubuntu , I have:</p>
<ul>
<li>Added the following to <code>/etc/security/limits.conf</code>:<br />
<code>nobody        soft    nofile          4096<br />
nobody        hard    nofile          63536<br />
</code></li>
<li>Added the following to <code>/etc/pam.d/su</code>:<br />
<code>session    required   pam_limits.so</code></li>
</ul>
<p>Here, I have added to the user <code>nobody</code> the right to open 63536 files <strong>PER PROCESS </strong>(yeah, per process, not for the user).<br />
I added this thing to <code>/etc/pam.d/su</code> because when you run a daemon from an init script, it uses the su mecanism to run as the user it&#8217;s configured for.<br />
I have added the user nobody because unfortunately , my running daemon is memcached which runs as nobody (should probably run as memcache user).</p>
<p>Be carefull, sometime you think you need this, but you don&#8217;t: I wanted to increase the number of files apache user can open, but it wasn&#8217;t needed: my apache was running with forks (because php needs fork), any new connection spawns a new process which has it&#8217;s 1024 file descriptor, the whole apache on the system was opening lot more than 1024 files, as I had a limit of 1100 forks running which I reached several times, but a single process wasn&#8217;t opening more than 1024 files.<br />
You can check how much a process of files opened with lsof (which stands for LiSt Open Files):<br />
<code>lsof -p 3423 -n |wc -l</code> where 3423 is the PID of the process you want to inscpect ( &#8220;-n&#8221; means don&#8217;t do dns resolution, lsof lists sockets and tries to put names to every address, a server process generally accepts a lot of connection from a lot of different hosts. Without &#8220;-n&#8221; , lsof is really slow )</p>
<p>That&#8217;s it, I hope yo uwill make a good use of these tips ! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smaftoul.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smaftoul.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/smaftoul.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/smaftoul.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/smaftoul.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/smaftoul.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/smaftoul.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/smaftoul.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/smaftoul.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/smaftoul.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/smaftoul.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/smaftoul.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/smaftoul.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/smaftoul.wordpress.com/254/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smaftoul.wordpress.com&amp;blog=4231275&amp;post=254&amp;subd=smaftoul&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smaftoul.wordpress.com/2008/12/26/limits-open-files-pam-daemons-and-scalability/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1369b222bc03a323e8ccce4bc90a6cc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">smaftoul</media:title>
		</media:content>
	</item>
	</channel>
</rss>
