<?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>Blog d&#039;Idriss Neumann</title>
	<atom:link href="https://blog.developpez.com/ineumann/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.developpez.com/ineumann</link>
	<description>Articles sur Linux et sur le développement sous Linux</description>
	<lastBuildDate>Mon, 14 Jul 2014 08:38:25 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Les dangers du typage faible en PHP</title>
		<link>https://blog.developpez.com/ineumann/p12212/divers/les-dangers-du-typage-faible-en-php</link>
		<comments>https://blog.developpez.com/ineumann/p12212/divers/les-dangers-du-typage-faible-en-php#comments</comments>
		<pubDate>Mon, 02 Sep 2013 22:40:21 +0000</pubDate>
		<dc:creator><![CDATA[ok.Idriss]]></dc:creator>
				<category><![CDATA[Divers]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/ineumann/?p=161</guid>
		<description><![CDATA[Il faut avouer que le langage PHP rend bien service et est un langage assez complet. Toutefois, le typage faible de ce langage peut parfois nous amener à écrire des erreurs surprenantes sans que l&#8217;on s&#8217;en rende compte. Dernière en date : [idriss@hp-dv6:~]$ cat script.php #!/usr/bin/php &#60;?php &#160; &#160; // Bien entendu on désactive les warnings pour la prod :D &#160; &#160; error_reporting&#40;&#34;E_ALL &#38; ~E_NOTICE&#34;&#41;; &#160; &#160; &#160; &#160; $var1 = 'TOTO'; &#160; &#160; $var2 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Il faut avouer que le langage PHP rend bien service et est un langage assez complet. Toutefois, le typage faible de ce langage peut parfois nous amener à écrire des erreurs surprenantes sans que l&rsquo;on s&rsquo;en rende compte.</p>
<p>Dernière en date :</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[idriss@hp-dv6:~]$ cat script.php<br />
#!/usr/bin/php<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Bien entendu on désactive les warnings pour la prod :D</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/error_reporting"><span style="color: #990000;">error_reporting</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;E_ALL &amp; ~E_NOTICE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp;<br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$var1</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'TOTO'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$var2</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'TATA'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Quelqu'un a décidé d'écrire son test en utilisant strcmp, pourquoi pas...</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/strcmp"><span style="color: #990000;">strcmp</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$var2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// tient s'est trompé et compare $var1 à $var2 au lieu de $var2[0], ça arrive...</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;OK<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;KO<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
[idriss@hp-dv6:~]$ chmod +x script.php <br />
[idriss@hp-dv6:~]$ ./script.php <br />
OK<br />
[idriss@hp-dv6:~]$</div></div>
<p>Ici <strong>strcmp</strong>, au lieu de lever une exception ou une erreur renvoie un simple warning (que l&rsquo;on ne voit pas forcément en fonction de la conf PHP) et accepte la comparaison en renvoyant <strong>null</strong>. </p>
<p><strong>null</strong> est ensuite implicitement casté en false, l&rsquo;opérande 0 également et on se retrouve avec une condition qui vaut <strong>true</strong>. Génial non <img src="https://blog.developpez.com/ineumann/wp-includes/images/smilies/icon_biggrin.gif" alt=":D" class="wp-smiley" /> ?</p>
<p>Alors oui, on peut effectivement faire des efforts de rigueur, tenir compte du warning par exemple. Il n&rsquo;empêche qu&rsquo;avec un langage compilé au typage fort, le codeur n&rsquo;aurait jamais eu à attendre de voir une exécution erronée pour se rendre compte du problème&#8230;</p>
<p><strong>Conclusion :</strong> faites attention aux casts implicites de vos if en PHP et à la fonction <strong>strcmp</strong> qui lorsqu&rsquo;elle plante renvoie <strong>null</strong> alors que 0 signifie &laquo;&nbsp;chaînes égales&nbsp;&raquo;. Utilisez toujours les opérateurs <strong>===</strong>, <strong>!==</strong>&#8230; dans le cadre de l&rsquo;utilisation de cette fonction !</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation de MongoDB sous Ubuntu/Mint</title>
		<link>https://blog.developpez.com/ineumann/p11922/nosql/installation-de-mongodb-sous-ubuntumint</link>
		<comments>https://blog.developpez.com/ineumann/p11922/nosql/installation-de-mongodb-sous-ubuntumint#comments</comments>
		<pubDate>Tue, 16 Apr 2013 10:31:43 +0000</pubDate>
		<dc:creator><![CDATA[ok.Idriss]]></dc:creator>
				<category><![CDATA[NoSQL]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/ineumann/?p=134</guid>
		<description><![CDATA[Cet article traite de l&#8217;installation de MongoDB via les dépôts sous Ubuntu. MongoDB est un SGBD assez répandu qui fait partie, au même titre que Cassandra, de la mouvance des SGBD NoSQL. Ces manipulations ont été effectuées sous Ubuntu 12.04 LTS. I &#8211; Installation 1) Exécuter les commandes suivantes : sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 sudo touch /etc/apt/sources.list.d/10gen.list 2) Ajouter la ligne suivante au fichier /etc/apt/source.list (en root) : deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Cet article traite de l&rsquo;installation de MongoDB via les dépôts sous Ubuntu. MongoDB est un SGBD assez répandu qui fait partie, au même titre que Cassandra, de la mouvance des SGBD NoSQL.</p>
<p>Ces manipulations ont été effectuées sous Ubuntu 12.04 LTS.</p>
<p><strong>I &#8211; Installation</strong></p>
<p><span style="text-decoration: underline;"><strong>1)</strong></span> Exécuter les commandes suivantes :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-key adv</span> <span style="color: #660033;">--keyserver</span> keyserver.ubuntu.com <span style="color: #660033;">--recv</span> 7F0CEB10<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list.d<span style="color: #000000; font-weight: bold;">/</span>10gen.list</div></div>
<p><span style="text-decoration: underline;"><strong>2)</strong></span> Ajouter la ligne suivante au fichier <code class="codecolorer text default"><span class="text">/etc/apt/source.list</span></code> (en root) :</p>
<p><code class="codecolorer bash default"><span class="bash">deb http:<span style="color: #000000; font-weight: bold;">//</span>downloads-distro.mongodb.org<span style="color: #000000; font-weight: bold;">/</span>repo<span style="color: #000000; font-weight: bold;">/</span>ubuntu-upstart dist 10gen</span></code></p>
<p><span style="text-decoration: underline;"><strong>3)</strong></span> Mettre à jour la liste des dépôts :</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get update</span></span></code></p>
<p><span style="text-decoration: underline;"><strong>4)</strong></span> Installation :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get install</span> mongodb-<span style="color: #000000;">10</span><span style="color: #007800;">gen</span>=2.2.3<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;mongodb-10gen hold&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">--set-selections</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> mongodb-10gen</div></div>
<p><span style="text-decoration: underline;"><strong>5)</strong></span> Lancer le service :</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service mongodb start</span></code></p>
<p><strong>II &#8211; Utilisation</strong></p>
<p>Lancer le client MongoDB :</p>
<p><code class="codecolorer bash default"><span class="bash">mongo</span></code></p>
<p>Insérer une donnée :</p>
<p><code class="codecolorer bash default"><span class="bash">db.test.save<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span> key: <span style="color: #ff0000;">&quot;value&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span></span></code></p>
<p>Récupérer les valeurs :</p>
<p><code class="codecolorer bash default"><span class="bash">db.test.find<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></span></code></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation de Cassandra sur Ubuntu/Mint</title>
		<link>https://blog.developpez.com/ineumann/p11921/nosql/installation-de-cassandra-sur-ubuntu</link>
		<comments>https://blog.developpez.com/ineumann/p11921/nosql/installation-de-cassandra-sur-ubuntu#comments</comments>
		<pubDate>Tue, 16 Apr 2013 09:49:13 +0000</pubDate>
		<dc:creator><![CDATA[ok.Idriss]]></dc:creator>
				<category><![CDATA[NoSQL]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/ineumann/?p=113</guid>
		<description><![CDATA[Vous souhaitez vous mettre au NoSQL ? Vous avez le choix entre une multitude de SGBD NoSQL orientés clefs/valeurs ou orientés colonnes. Parmi l&#8217;un des plus en vogue, se trouve Cassandra maintenu par la fondation Apache. Il est possible de télécharger une archive .tar.gz et de suivre les directives dans le fichier README mais nous verrons ici comment installer proprement Cassandra depuis les dépôts. L&#8217;avantage ici est que le serveur Cassandra sera automatiquement configuré correctement. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Vous souhaitez vous mettre au NoSQL ? Vous avez le choix entre une multitude de SGBD NoSQL orientés clefs/valeurs ou orientés colonnes.</p>
<p>Parmi l&rsquo;un des plus en vogue, se trouve Cassandra maintenu par la fondation Apache. Il est possible de télécharger une archive .tar.gz et de suivre les directives dans le fichier README mais nous verrons ici comment installer proprement Cassandra depuis les dépôts.</p>
<p>L&rsquo;avantage ici est que le serveur Cassandra sera automatiquement configuré correctement. Ces manipulations ont été effectuées sous Ubuntu 12.04 LTS.</p>
<p><strong>I &#8211; Installation</strong></p>
<p><span style="text-decoration: underline;"><strong>1)</strong></span> Ajouter les lignes suivantes au fichier <code class="codecolorer text default"><span class="text">/etc/apt/sources.list</span></code> (en root)</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">deb http:<span style="color: #000000; font-weight: bold;">//</span>www.apache.org<span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/</span>cassandra<span style="color: #000000; font-weight: bold;">/</span>debian 11x main<br />
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>www.apache.org<span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/</span>cassandra<span style="color: #000000; font-weight: bold;">/</span>debian 11x main</div></div>
<p><span style="text-decoration: underline;"><strong>2)</strong></span> Exécuter les commandes suivantes :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gpg <span style="color: #660033;">--keyserver</span> pgp.mit.edu <span style="color: #660033;">--recv-keys</span> F758CE318D77295D<br />
gpg <span style="color: #660033;">--export</span> <span style="color: #660033;">--armor</span> F758CE318D77295D <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-key add</span> -<br />
gpg <span style="color: #660033;">--keyserver</span> pgp.mit.edu <span style="color: #660033;">--recv-keys</span> 2B5C1B00<br />
gpg <span style="color: #660033;">--export</span> <span style="color: #660033;">--armor</span> 2B5C1B00 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-key add</span> -</div></div>
<p><span style="text-decoration: underline;"><strong>3)</strong></span> Mettre à jour la liste des dépôts</p>
<p><code class="codecolorer text default"><span class="text">sudo apt-get update</span></code></p>
<p><span style="text-decoration: underline;"><strong>4)</strong></span> Installer le serveur</p>
<p><code class="codecolorer text default"><span class="text">sudo apt-get install cassandra</span></code></p>
<p><span style="text-decoration: underline;"><strong>5)</strong></span> Démarrer le service</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service cassandra start</span></code></p>
<p><strong>II &#8211; Utilisation</strong></p>
<p><span style="text-decoration: underline;"><strong>1)</strong></span> Lancer le client cassandra :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cassandra-cli <span style="color: #660033;">--host</span><br />
<span style="color: #666666; font-style: italic;"># ou en local</span><br />
cassandra-cli</div></div>
<p><span style="text-decoration: underline;"><strong>2)</strong></span> Créer un keyspace et s&rsquo;y connecter</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>default<span style="color: #000000; font-weight: bold;">@</span>unknown<span style="color: #7a0874; font-weight: bold;">&#93;</span> create keyspace <span style="color: #7a0874; font-weight: bold;">test</span>;<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>default<span style="color: #000000; font-weight: bold;">@</span>unknown<span style="color: #7a0874; font-weight: bold;">&#93;</span> use <span style="color: #7a0874; font-weight: bold;">test</span>;<br />
Authenticated to keyspace: <span style="color: #7a0874; font-weight: bold;">test</span></div></div>
<p><span style="text-decoration: underline;"><strong>3)</strong></span> Créer une colonne</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>default<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> create column family Users with <span style="color: #007800;">comparator</span>=UTF8Type and <span style="color: #007800;">default_validation_class</span>=UTF8Type and <span style="color: #007800;">key_validation_class</span>=UTF8Type;</div></div>
<p><span style="text-decoration: underline;"><strong>4)</strong></span> Ajouter des entrées :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>default<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">set</span> Users<span style="color: #7a0874; font-weight: bold;">&#91;</span>jsmith<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>first<span style="color: #7a0874; font-weight: bold;">&#93;</span> = <span style="color: #ff0000;">'John'</span>;<br />
Value inserted.<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>default<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">set</span> Users<span style="color: #7a0874; font-weight: bold;">&#91;</span>jsmith<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">last</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> = <span style="color: #ff0000;">'Smith'</span>;<br />
Value inserted.<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>default<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">set</span> Users<span style="color: #7a0874; font-weight: bold;">&#91;</span>jsmith<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>age<span style="color: #7a0874; font-weight: bold;">&#93;</span> = long<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">42</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;<br />
Value inserted.</div></div>
<p><span style="text-decoration: underline;"><strong>5)</strong></span> Récupérer des entrées :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>default<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> get Users<span style="color: #7a0874; font-weight: bold;">&#91;</span>jsmith<span style="color: #7a0874; font-weight: bold;">&#93;</span>;<br />
=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">column</span>=<span style="color: #c20cb9; font-weight: bold;">last</span>, <span style="color: #007800;">value</span>=Smith, <span style="color: #007800;">timestamp</span>=<span style="color: #000000;">1287604215498000</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">column</span>=first, <span style="color: #007800;">value</span>=John, <span style="color: #007800;">timestamp</span>=<span style="color: #000000;">1287604214111000</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">column</span>=age, <span style="color: #007800;">value</span>=<span style="color: #000000;">42</span>, <span style="color: #007800;">timestamp</span>=<span style="color: #000000;">1287604216661000</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Returned <span style="color: #000000;">3</span> results.</div></div>
<p><strong>III &#8211; Impossible de lancer Cassandra</strong></p>
<p>Vous avez une erreur similaire à celle ci-dessous ?</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cassandra <span style="color: #660033;">-f</span> xss = <span style="color: #660033;">-ea</span> -javaagent:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>cassandra<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:<span style="color: #007800;">ThreadPriorityPolicy</span>=<span style="color: #000000;">42</span> <span style="color: #660033;">-Xms1493M</span> <span style="color: #660033;">-Xmx1493M</span> <span style="color: #660033;">-Xmn373M</span> <span style="color: #660033;">-Xss160k</span> Segmentation fault <span style="color: #7a0874; font-weight: bold;">&#40;</span>core dumped<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<p>Ajouter la ligne suivante au fichier <code class="codecolorer text default"><span class="text">/etc/cassandra/cassandra-env.sh</span></code> (en root) :</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">uname</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> =~ <span style="color: #ff0000;">&quot;Linux&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #007800;">JVM_OPTS</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$JVM_OPTS</span> -Xss280k&quot;</span></span></code></p>
<p>Puis redémarrer le serveur :</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service cassandra restart</span></code></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Création d&#8217;un répertoire de partage avec VirtualBox</title>
		<link>https://blog.developpez.com/ineumann/p11556/general-unixlinux/creation-dun-repertoire-de-partage-avec-virtualbox</link>
		<comments>https://blog.developpez.com/ineumann/p11556/general-unixlinux/creation-dun-repertoire-de-partage-avec-virtualbox#comments</comments>
		<pubDate>Sun, 09 Dec 2012 11:18:44 +0000</pubDate>
		<dc:creator><![CDATA[ok.Idriss]]></dc:creator>
				<category><![CDATA[Général Unix/Linux]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/ineumann/?p=50</guid>
		<description><![CDATA[Introduction VirtualBox est un gestionnaire de machines virtuelles, sur les hôtes Windows, GNU/Linux 32 et 64 bits et Mac OS X supportant de nombreux systèmes dont Windows (dont Vista), Linux, OpenSolaris, FreeBSD comme systèmes invités. Elle a été créée par InnoTek (ancienne compagnie allemande de logiciels qui a ensuite été rachetée par Sun elle-même rachetée par Oracle). Création du dossier de partage Cette manipulation a été testée pour 4 distributions distinctes  (Fedora 6 et 7, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>VirtualBox est un gestionnaire de machines virtuelles, sur les hôtes Windows, GNU/Linux 32 et 64 bits et Mac OS X supportant de nombreux systèmes dont Windows (dont Vista), Linux, OpenSolaris, FreeBSD comme systèmes invités. Elle a été créée par InnoTek (ancienne compagnie allemande de logiciels qui a ensuite été rachetée par Sun elle-même rachetée par Oracle).</p>
<p><strong>Création du dossier de partage</strong></p>
<p>Cette manipulation a été testée pour 4 distributions distinctes  (Fedora 6 et 7, Mandriva spring 2008 et Ubuntu 7.10) comme systèmes invités, avec la version 1.6.2 de VirtualBox sous Windows Vista basic. Depuis, il est possible que cela ait évolué &#8230;</p>
<p>Pour commencer, après avoir créé le dossier qui servira de répertoire de partage (nous l&rsquo;appellerons &laquo;&nbsp;partage&nbsp;&raquo;) , entrez le chemin <strong>C:\Users\VotreNom\Documents</strong> dans l&rsquo;onglet &laquo;&nbsp;répertoires partagés&nbsp;&raquo; des préférences de votre machine virtuelle sous VBox (sous Windows). Faites ensuite les étapes suivantes sur votre console (sous Linux) :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span> ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> partage</div></div>
<p>Puis exécutez la commande suivante :</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-t</span> vboxsf partage <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>partage <span style="color: #660033;">-o</span> rw,<span style="color: #007800;">uid</span>=y,<span style="color: #007800;">gid</span>=y</span></code></p>
<p>Enfin créez un nouveau répertoire dans &laquo;&nbsp;Mes documents&nbsp;&raquo; sous Windows, vous y aurez des droits d&rsquo;écriture et il pourra servir de répertoire de transfert.</p>
<p><strong>Remarques</strong></p>
<ul>
<li>Pour connaître les valeurs <strong>uid</strong> et <strong>gid</strong> (notées pour l&rsquo;instant y), faites <code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">id</span></span></code> en console.</li>
<li>Il vous est possible d&rsquo;écrire un script ou un alias pour automatiser cette tâche.</li>
<li>Cette méthode fonctionne uniquement sur un système virtuel de type GNU/Linux (elle ne fonctionne pas sous OpenSolaris par exemple).</li>
<li>Sur le système hôte (dans notre cas Windows), vous ne pourrez pas explorer, depuis le système virtuel, les dossiers systèmes comme &laquo;&nbsp;Mes documents. Vous pourrez néanmoins ouvrir le répertoire de transfert (qui ne sera pas en lecture seule) à partir du dossier &laquo;&nbsp;Documents&nbsp;&raquo; (qui lui sera en lecture seule).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monter votre smartphone Samsung sur Ubuntu</title>
		<link>https://blog.developpez.com/ineumann/p11552/general-unixlinux/monter-votre-smartphone-samsung-sur-ubuntu</link>
		<comments>https://blog.developpez.com/ineumann/p11552/general-unixlinux/monter-votre-smartphone-samsung-sur-ubuntu#comments</comments>
		<pubDate>Thu, 06 Dec 2012 17:06:08 +0000</pubDate>
		<dc:creator><![CDATA[ok.Idriss]]></dc:creator>
				<category><![CDATA[Général Unix/Linux]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/ineumann/?p=33</guid>
		<description><![CDATA[Cette manipulation a été testée sous Ubuntu 12.04 pour un smartphone Samsung Galaxy Note. Cette manipulation devrait également s&#8217;appliquer à d&#8217;autres modèles de smartphones ou de tablettes avec lesquels le système de fichiers est masqué de l&#8217;OS sur lequel on cherche à les monter en tant que périphérique de stockage et dont les échanges de données se font via le protocole MTP (Media Transfer Protocol). C&#8217;est le cas notamment du Samsung Galaxy SIII et de [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Cette manipulation a été testée sous Ubuntu 12.04 pour un smartphone Samsung Galaxy Note. Cette manipulation devrait également s&rsquo;appliquer à d&rsquo;autres modèles de smartphones ou de tablettes avec lesquels le système de fichiers est masqué de l&rsquo;OS sur lequel on cherche à les monter en tant que périphérique de stockage et dont les échanges de données se font via le protocole MTP (<em>Media Transfer Protocol</em>). C&rsquo;est le cas notamment du Samsung Galaxy SIII et de tant d&rsquo;autres appareils (de marques différentes).</p>
<p>Attention pour les libristes : MTP est un protocole de Microsoft soumis à une licence propriétaire bien que les spécifications aient été publiées dans le cadre du protocole USB. Bien entendu, les opérations qui vont suivre n’entraîneront aucun coût mais il est préférable de savoir ce que vous faites.</p>
<p><strong>I &#8211; Installation des packages</strong></p>
<p>Tout d&rsquo;abord, mettre à jour la liste des dépôts si ceci n&rsquo;a pas été effectué récemment :</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get update</span></span></code></p>
<p>Puis installer les packages mtp-tools et mtpfs :</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> mtp-tools mtpfs</span></code></p>
<p>Les packages nécessaires pour pouvoir monter correctement votre appareil.</p>
<p><strong>II &#8211; Création du point de montage</strong></p>
<p>Créer ensuite un répertoire quelconque qui devra rester vide et servir de point de montage. Par exemple :</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>samsung</span></code></p>
<p><strong>III &#8211; Montage de l&rsquo;appareil</strong></p>
<p>Branchez votre appareil en USB puis exécutez la commande suivante :</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> mtpfs <span style="color: #660033;">-o</span> allow_other ~<span style="color: #000000; font-weight: bold;">/</span>samsung</span></code></p>
<p>Il ne reste plus qu&rsquo;à échanger vos données entre le répertoire samsung dans votre répertoire personnel et votre OS. Vous pouvez automatiser cette tâche via un alias ou via un script que vous ajouterez dans votre variable PATH.</p>
<p>Exemple de script :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> ~<span style="color: #000000; font-weight: bold;">/</span>samsung <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>samsung <span style="color: #666666; font-style: italic;"># créer le répertoire s'il n'existe pas (permet de se prémunir des suppressions involontaires)</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> mtpfs <span style="color: #660033;">-o</span> allow_other ~<span style="color: #000000; font-weight: bold;">/</span>samsung</div></div>
<p><strong>IV &#8211; Démontage du périphérique</strong></p>
<p>Une fois que vous souhaitez débrancher votre périphérique, fermez tous les programmes qui lisent ou écrivent sur le point de montage (shell, navigateur de fichier, etc) et exécutez la commande suivante en étant placé en dehors du point de montage :</p>
<p><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> ~<span style="color: #000000; font-weight: bold;">/</span>samsung</span></code></p>
<p>Vous pourrez ensuite débrancher votre périphérique sans risques.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Liste des répertoires principaux et fichiers courants</title>
		<link>https://blog.developpez.com/ineumann/p11551/general-unixlinux/liste-des-repertoires-principaux-et-fichiers-courants</link>
		<comments>https://blog.developpez.com/ineumann/p11551/general-unixlinux/liste-des-repertoires-principaux-et-fichiers-courants#comments</comments>
		<pubDate>Thu, 06 Dec 2012 10:12:17 +0000</pubDate>
		<dc:creator><![CDATA[ok.Idriss]]></dc:creator>
				<category><![CDATA[Général Unix/Linux]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/ineumann/?p=16</guid>
		<description><![CDATA[I &#8211; Les répertoires principaux Voici une liste non exhaustive des répertoires principaux composant l&#8217;arborescence sur les différentes distributions Linux : / : répertoire &#171;&#160;racine&#160;&#187; ; /boot : contient les éléments liés au démarrage du système (kernel, grub&#8230;) ; /bin : contient toutes les commandes (ou exécutables binaires) utilisateurs ; /sbin : contient toutes les commandes (ou exécutables binaires) administrateur ; /home : contient tous les répertoires personnels des utilisateurs ; /dev : contient les [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>I &#8211; Les répertoires principaux</strong></p>
<p>Voici une liste non exhaustive des répertoires principaux composant l&rsquo;arborescence sur les différentes distributions Linux :</p>
<ul>
<li><code class="codecolorer text default"><span class="text">/</span></code> : répertoire &laquo;&nbsp;racine&nbsp;&raquo; ;</li>
<li><code class="codecolorer text default"><span class="text">/boot</span></code> : contient les éléments liés au démarrage du système (kernel, grub&#8230;) ;</li>
<li><code class="codecolorer text default"><span class="text">/bin</span></code> : contient toutes les commandes (ou exécutables binaires) utilisateurs ;</li>
<li><code class="codecolorer text default"><span class="text">/sbin</span></code> : contient toutes les commandes (ou exécutables binaires) administrateur ;</li>
<li><code class="codecolorer text default"><span class="text">/home</span></code> : contient tous les répertoires personnels des utilisateurs ;</li>
<li><code class="codecolorer text default"><span class="text">/dev</span></code> : contient les périphériques réels et virtuels (par exemple les partitions /dev/sda&#8230;) ;</li>
<li><code class="codecolorer text default"><span class="text">/mnt</span></code> : point de montage de volumes aux différents systèmes de fichiers (partitions ext, NTFS&#8230;) ;</li>
<li><code class="codecolorer text default"><span class="text">/media</span></code> : point de montage des périphériques amovibles ;</li>
<li><code class="codecolorer text default"><span class="text">/lib</span></code> : répertoire des bibliothèques ;</li>
<li><code class="codecolorer text default"><span class="text">/tmp</span></code> : contient des fichiers temporaires ;</li>
<li><code class="codecolorer text default"><span class="text">/usr</span></code> : répertoire des installations et configurations communes aux utilisateurs, composé des répertoires suivants (entre autres) :
<ul>
<li><code class="codecolorer text default"><span class="text">/usr/bin</span></code> : contient des commandes et autres binaires utilisateurs ;</li>
<li><code class="codecolorer text default"><span class="text">/usr/sbin</span></code> : contient des commandes et autres binaires administrateur ;</li>
<li><code class="codecolorer text default"><span class="text">/usr/share</span></code> : contient les données statiques (ne nécessitant aucune modification) des différents programmes ou paquetages ;</li>
<li><code class="codecolorer text default"><span class="text">/usr/local</span></code> : répertoire des applications locales ;</li>
<li><code class="codecolorer text default"><span class="text">/usr/include</span></code> : contient les fichiers header (en tête ayant l’extension .h) liés à la compilation d&rsquo;applications développées en C ou C++.</li>
</ul>
</li>
<li><code class="codecolorer text default"><span class="text">/opt</span></code> : contient des applications supplémentaires ;</li>
<li><code class="codecolorer text default"><span class="text">/var</span></code> : composé des répertoires suivants (entre autres) :
<ul>
<li><code class="codecolorer text default"><span class="text">/var/log</span></code> : contient des fichiers de logs ;</li>
<li><code class="codecolorer text default"><span class="text">/var/spool</span></code> : répertoire des mails et files d&rsquo;impression ;</li>
<li><code class="codecolorer text default"><span class="text">/var/tmp</span></code> : contient des fichiers temporaires ;</li>
<li><code class="codecolorer text default"><span class="text">/var/www</span></code> : répertoire par défaut du serveur HTTP apache (DocumentRoot).</li>
</ul>
</li>
<li><code class="codecolorer text default"><span class="text">/etc</span></code> : répertoires des configurations systèmes, composé des répertoires suivants (entre autres) :
<ul>
<li><code class="codecolorer text default"><span class="text">/etc/init.d</span></code> : contient les deamons (scripts ou processus qui s&rsquo;exécutent en arrière plan au démarrage et à l’arrêt du système). Ces scripts sont activés via des liens qui se trouvent dans les répertoires /etc/rc?.d/ ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/X11</span></code> : contient les fichiers de configuration du serveur X (interface graphique) ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/opt</span></code> : contient des fichiers de configurations d&rsquo;applications intallées dans /opt.</li>
</ul>
</li>
</ul>
<p><strong>Remarque :</strong> cette arborescence peut varier sur d&rsquo;autres systèmes de type Unix comme FreeBSD par exemple.</p>
<p><strong>II &#8211; Quelques fichiers courants</strong></p>
<p>Voici une liste non exhaustive des fichiers courants sur les différentes distributions Linux :</p>
<ul>
<li><code class="codecolorer text default"><span class="text">/boot/grub/menu.lst</span></code> ou <code class="codecolorer text default"><span class="text">/boot/grub/grub.cfg</span></code> : fichier de configuration du chargeur GRUB ;</li>
<li><code class="codecolorer text default"><span class="text">~/.bashrc</span></code> ou <code class="codecolorer text default"><span class="text">~/.bash_profile</span></code> : script exécuté au début de chaque session utilisateur ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/contrab</span></code> : fichier contenant les tâches cron<code class="codecolorer text default"><span class="text">/etc/fstab</span></code> : liste des volumes à monter au démarrage du système ainsi que l&rsquo;espace swap à activer ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/hosts</span></code> : table de correspondance entre un nom de machine (hostname) et une adresse IP ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/inittab</span></code> : liste les applications lancées par init (remplacé sur Ubuntu par le système upstart) ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/group</span></code> : liste descriptive des groupes d&rsquo;utilisateurs ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/passwd</span></code> : liste descriptive des utilisateurs ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/shadow</span></code> : liste des mots de passe cryptés des utilisateurs ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/sudoers</span></code> : fichier de configuration de la commande sudo ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/X11/xorg.conf</span></code> : fichier de configuration du serveur graphique X ;</li>
<li><code class="codecolorer text default"><span class="text">/etc/init.d/rc.local</span></code> : dernier script de /etc/init.d à s&rsquo;exécuter au démarrage. Ce script est prévu pour contenir les tâches que l&rsquo;on souhaite exécuter en plus des autres deamons au démarrage du système. Sous Fedora, il s&rsquo;agit d&rsquo;un lien symbolique vers <code class="codecolorer text default"><span class="text">/etc/rc.d/rc.local</span></code> ;</li>
<li><code class="codecolorer text default"><span class="text">/proc/cpuinfo</span></code> : contient des informations sur le processeur.</li>
</ul>
<p><strong>Attention :</strong>  le nom et la place de ces fichiers peuvent varier selon les différentes distributions. Certains de ces fichiers ne sont pas toujours présents d&rsquo;une distribution à l&rsquo;autre.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Initiation à la compilation en console avec gcc, g++, javac et make</title>
		<link>https://blog.developpez.com/ineumann/p11038/developpement-sous-linux/initiation_a_la_compilation_en_console_a</link>
		<comments>https://blog.developpez.com/ineumann/p11038/developpement-sous-linux/initiation_a_la_compilation_en_console_a#comments</comments>
		<pubDate>Tue, 22 May 2012 09:27:46 +0000</pubDate>
		<dc:creator><![CDATA[ok.Idriss]]></dc:creator>
				<category><![CDATA[Développement sous Linux]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Introduction GCC signifie &#171;&#160;Gnu Compiler Collection&#160;&#187;, il s&#8217;agit d&#8217;un compilateur libre créé par le projet GNU. Il rassemble une panoplie de logiciels libres intégrés capables de compiler pour divers langages de programmation, dont le C, C++, Objective-C, &#8230; GCC est à l&#8217;origine de la plupart des logiciels libres et est étroitement lié au noyau Linux. Il a été aussi porté sur quelques plateformes pour Windows comme MinGW qui est utilisé sur certains IDE comme Code::Blocks [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>GCC signifie &laquo;&nbsp;Gnu Compiler Collection&nbsp;&raquo;, il s&rsquo;agit d&rsquo;un compilateur libre créé par le projet GNU. Il rassemble une panoplie de logiciels libres intégrés capables de compiler pour divers langages de programmation, dont le C, C++, Objective-C, &#8230; GCC est à l&rsquo;origine de la plupart des logiciels libres et est étroitement lié au noyau Linux. Il a été aussi porté sur quelques plateformes pour Windows comme MinGW qui est utilisé sur certains IDE comme Code::Blocks ou Dev C++.</p>
<p><strong>I &#8211; Installer <code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">gcc</span></span></code>, <code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">g++</span></span></code>, et <code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">make</span></span></code></strong></p>
<p>Pour Ubuntu/Debian :</p>
<p><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> build-essential</span></code></strong></p>
<p>ou encore :</p>
<p><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential</span></code></strong></p>
<p>Pour Fedora, RHEL et CentOS :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span> ~<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">su</span> -<br />
root<span style="color: #000000; font-weight: bold;">\'</span>s password :<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">yum install</span> <span style="color: #c20cb9; font-weight: bold;">gcc</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">yum install</span> gcc-c++</div></div>
<p>Pour les autres distributions, renseignez-vous sur les différents paquets à installer et sur l&rsquo;utilisation de votre gestionnaire des paquets.</p>
<p><strong>II &#8211; Compiler en C avec <code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">gcc</span></span></code></strong></p>
<p>Pour compiler un seul fichier .c :</p>
<p><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">gcc</span> nom_du_fichier.c <span style="color: #660033;">-o</span> nom_du_programme</span></code></strong></p>
<p>ou encore :</p>
<p><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">cc</span> nom_du_fichier.c <span style="color: #660033;">-o</span> nom_du_programme</span></code></strong></p>
<p>cc étant désormais un alias de la commande gcc (à l&rsquo;origine c&rsquo;était le compilateur C sur Unix dont GCC est le clone GNU).</p>
<p>Pour exécuter le programme, faites <strong><code class="codecolorer bash default"><span class="bash">.<span style="color: #000000; font-weight: bold;">/</span>nom_du_programme</span></code></strong> en console (attention au chemin relatif).</p>
<p>Remarque : si vous faites uniquement <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">gcc</span> nom_du_fichier.c</span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">cc</span> nom_du_fichier</span></code></strong>, vous aurez l&rsquo;apparition d&rsquo;un exécutable <strong><code class="codecolorer bash default"><span class="bash">a.out</span></code></strong>.</p>
<p>Pour compiler un projet composé des fichiers : main.c, fonctions.c et header.h :</p>
<p><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">gcc</span> main.c fonctions.c <span style="color: #660033;">-o</span> nom_du_programme</span></code></strong></p>
<p>Il faut suivre l&rsquo;ordre : cible ; dépendances.</p>
<p>Remarques :</p>
<ul>
<li>Il faut parfois inclure l&rsquo;option <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #660033;">-lm</span></span></code></strong> dans la commande de compilation pour inclure certaines bibliothèques ou fichiers d’entêtes comme <strong><code class="codecolorer bash default"><span class="bash">math.h</span></code></strong>.</li>
<li>Pour afficher les Warnings, il faut utiliser certaines options comme -Wall, -Wextra, &#8230; voir la documentation de GCC ou la manpage de ce dernier</li>
<li>L&rsquo;option -c indique à GCC de ne pas linker, vous n&rsquo;aurez pas de fichier.o, exemple : <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-c</span> main.c <span style="color: #660033;">-o</span> nom_du_programme</span></code></strong>.</li>
</ul>
<p><strong>III &#8211; Compiler en C++ avec <code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">g++</span></span></code> et en java avec <code class="codecolorer bash default"><span class="bash">javac</span></code></strong></p>
<p>Pour compiler en C++, il s&rsquo;agit exactement du même processus sauf qu&rsquo;il faut remplacer la commande <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">gcc</span></span></code></strong> par <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">g++</span></span></code></strong> dans les commandes de compilation.</p>
<p>Exemples :</p>
<p><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">g++</span> nom_du_fichier.cpp <span style="color: #660033;">-o</span> nom_du_programme</span></code></strong><br />
<strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">g++</span> main.cpp fonctions.cpp <span style="color: #660033;">-o</span> nom_du_programme</span></code></strong></p>
<p>Pour le cas de Java, les commandes sont légèrement plus simples :</p>
<p><strong><code class="codecolorer bash default"><span class="bash">javac nom_du_fichier.java</span></code></strong><br />
<strong><code class="codecolorer bash default"><span class="bash">java NomProgramme</span></code></strong></p>
<p><strong>IV &#8211; Compiler ses projet avec make</strong></p>
<p>Vous devez créer un fichier nommé <strong><code class="codecolorer bash default"><span class="bash">Makefile</span></code></strong> dans le répertoire des sources afin de pouvoir utiliser la commande <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">make</span></span></code></strong>. Il s&rsquo;agit du fichier d&rsquo;instruction dans lequel vous écrirez les commandes qui doivent être exécutée par la commande <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">make</span></span></code></strong>.</p>
<p>Les commandes doivent respecter cet ordre :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cible: dépendances<br />
commandes<br />
...</div></div>
<p><strong>Attention :</strong> vous devez impérativement respecter les tabulations devant les commandes.</p>
<p>Voici un exemple de Makefile pour un projet en C composé d&rsquo;un fichier main.c, fonction.c et header.h :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Ceci est un commentaire</span><br />
<span style="color: #666666; font-style: italic;"># création de l'exécutable 'NomDuProgramme'</span><br />
<br />
NomDuProgramme: main.o fonctions.o<br />
<span style="color: #c20cb9; font-weight: bold;">gcc</span> main.o fonctions.o <span style="color: #660033;">-o</span> NomDuProgramme<br />
<br />
main.o: main.c<br />
<span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-c</span> main.c <span style="color: #660033;">-o</span> main.o<br />
<br />
fonctions.o: fonctions.c<br />
<span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-c</span> fonctions.c <span style="color: #660033;">-o</span> fonctions.o<br />
<br />
<span style="color: #666666; font-style: italic;"># suppression des fichiers.o</span><br />
clean:<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">*</span>.o</div></div>
<p>Les commandes à exécuter ensuite sont :</p>
<ul>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">make</span></span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">make</span> NomDuProgramme</span></code></strong> : compiler votre projet</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">make</span> clean</span></code></strong> : supprimera tout les fichiers.o</li>
</ul>
<p>Mais pour l&rsquo;utilisation des warnings, l&rsquo;écriture deviendrait très laborieuse &#8230; c&rsquo;est pourquoi, il est préférable d&rsquo;utiliser une variable qui contient toutes les options de gcc souhaitées.</p>
<p>Exemple :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Déclaration de la variable &quot;warnings&quot;</span><br />
<br />
warnings = <span style="color: #660033;">-Wall</span> <span style="color: #660033;">-Wextra</span> - pedentic <span style="color: #660033;">-ansi</span> <span style="color: #660033;">-Wwrite-strings</span><br />
<span style="color: #660033;">-Wstrict-prototypes</span> <span style="color: #660033;">-Wuninitialized</span> <span style="color: #660033;">-Wunreachable-code</span><br />
<br />
<span style="color: #666666; font-style: italic;">#création de l'exécutable 'NomDuProgramme'</span><br />
<br />
NomDuProgramme: main.o fonctions.o<br />
<span style="color: #c20cb9; font-weight: bold;">gcc</span> main.o fonctions.o <span style="color: #660033;">-o</span> NomDuProgramme<br />
<br />
main.o: main.c<br />
<span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-c</span> main.c $<span style="color: #7a0874; font-weight: bold;">&#40;</span>warnings<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-o</span> main.o<br />
<span style="color: #666666; font-style: italic;"># attention, les parenthèses sont importantes ici</span><br />
<br />
fonctions.o: fonctions.c<br />
<span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-c</span> fonctions.c $<span style="color: #7a0874; font-weight: bold;">&#40;</span>warnings<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-o</span> fonctions.o<br />
<br />
<span style="color: #666666; font-style: italic;">#suppression des fichiers.o</span><br />
clean:<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">*</span>o</div></div>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation et configuration minimale d&#8217;un serveur web Apache/PHP local sous Ubuntu/Debian</title>
		<link>https://blog.developpez.com/ineumann/p11036/developpement-sous-linux/installation_et_configuration_minimale_d</link>
		<comments>https://blog.developpez.com/ineumann/p11036/developpement-sous-linux/installation_et_configuration_minimale_d#comments</comments>
		<pubDate>Mon, 21 May 2012 20:38:07 +0000</pubDate>
		<dc:creator><![CDATA[ok.Idriss]]></dc:creator>
				<category><![CDATA[Développement sous Linux]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Ce billet a pour but de permettre l&#8217;installation et l&#8217;utilisation d&#8217;un serveur HTTP et d&#8217;un SGBD en local sur Debian ou Ubuntu. Il évite ainsi de passer par des outils du type easyPHP, LAMP/WAMP/MAMP, &#8230; Par ailleurs nous ne nous limiterons pas à la simple installation de MySQL comme SGBDR. Parmi toutes les distributions existantes, nous avons ici choisi Debian et Ubuntu pour plusieurs raisons : Elles sont aujourd&#8217;hui parmi les distributions les plus répandues. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Ce billet a pour but de permettre l&rsquo;installation et l&rsquo;utilisation d&rsquo;un serveur HTTP et d&rsquo;un SGBD en local sur Debian ou Ubuntu. Il évite ainsi de passer par des outils du type easyPHP, LAMP/WAMP/MAMP, &#8230; Par ailleurs nous ne nous limiterons pas à la simple installation de MySQL comme SGBDR.</p>
<p>Parmi toutes les distributions existantes, nous avons ici choisi Debian et Ubuntu pour plusieurs raisons :</p>
<ul>
<li>Elles sont aujourd&rsquo;hui parmi les distributions les plus répandues.</li>
<li>Parler de toutes les distributions surchargerait l&rsquo;article.</li>
<li>Si vous êtes utilisateurs d&rsquo;une autre distribution, la démarche sera exactement la même et il faudra simplement adapter les commandes de gestion des paquets.</li>
</ul>
<p><strong>I &#8211; Mise à jour de la liste des dépôts</strong></p>
<p>Tout d&rsquo;abord, il faut mettre la liste des dépôts à jour, pour cela faites en console <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> update</span></code></strong> ou encore <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get update</span></span></code></strong> afin de mettre à jour les informations sur les paquets.</p>
<p><strong>II &#8211; Le serveur HTTP apache</strong></p>
<p>Les versions récentes d&rsquo;Ubuntu et dérivées embarquent automatiquement une version du serveur HTTP apache avec comme répertoire par défaut <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</span></code></strong>. Ainsi pour vérifier si le serveur apache est présent et est lancé, il suffit d&rsquo;exécuter la commande <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 status</span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>httpd status</span></code></strong> selon les versions.</p>
<p>En cas de besoin, vous pouvez lancer le deamon à l&rsquo;aide de la directive <strong><code class="codecolorer bash default"><span class="bash">start</span></code></strong> ou le relancer avec <strong><code class="codecolorer bash default"><span class="bash">restart</span></code></strong> de la même façon que <strong><code class="codecolorer bash default"><span class="bash">status</span></code></strong>. Pour stopper le serveur apache, vous pouvez enfin utiliser la directive <strong><code class="codecolorer bash default"><span class="bash">stop</span></code></strong>.</p>
<p>Si le deamon apache2 ou httpd n&rsquo;est pas présent, lancez l&rsquo;installation à l&rsquo;aide de la commande <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2</span></code></strong> ou encore <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> apache2</span></code></strong>.</p>
<p>Pour une configuration minimale, le répertoire par défaut d&rsquo;apache est <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</span></code></strong>. C&rsquo;est donc dans ce répertoire que devront être placés vos scripts PHP. Ainsi, pour une utilisation plus aisée :</p>
<ul>
<li>Vous pouvez rendre accessible ce répertoire aux autres comptes utilisateurs comme ceci <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</span></code></strong> sinon vous serez obligés de coder et tester vos scripts via le compte root ou le compte d&rsquo;apache (totalement déconseillé).</li>
<li>Vous pouvez créer un lien symbolique de /var/www vers votre répertoire personnel de cette façon : <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www ~<span style="color: #000000; font-weight: bold;">/</span>www</span></code></strong>.</li>
</ul>
<p>Pour exécuter vos scripts PHP à partir de votre navigateur, il faut le faire à partir de ce type d&rsquo;URL : http://localhost/mon_fichier.php ou encore http://127.0.0.1/mon_fichier.php .</p>
<p><strong>III &#8211; MySQL et PHPMyAdmin</strong></p>
<p>MySQL est un SGBDR (système de gestion de bases de données relationnelles) libre et gratuit qui est aujourd&rsquo;hui le plus utilisé dans le domaine du web. Pour l&rsquo;installer, il faut lancer ces deux commandes <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mysql-client</span></code></strong> (ou <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> mysql-client</span></code></strong>) et <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mysql-server</span></code></strong> (ou <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> mysql-server</span></code></strong>).</p>
<p>Pour éviter de vous connecter via un client graphique vous pouvez utiliser cette commande :<br />
<strong><code class="codecolorer bash default"><span class="bash">mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span></span></code></strong> (si vous possédez un utilisateur root), puis <strong><code class="codecolorer bash default"><span class="bash">create database nom_base</span></code></strong> pour créer une base de données et enfin <strong><code class="codecolorer bash default"><span class="bash">use nom_base</span></code></strong> pour travailler sur la bdd &laquo;&nbsp;nom_base&nbsp;&raquo;.</p>
<p>Pour une utilisation plus simple, vous pouvez installer un client graphique tel que PHPMyAdmin, un client léger sous une interface PHP qui est aujourd&rsquo;hui l&rsquo;un des plus connus voire le plus connus. Pour l&rsquo;installer, exécutez la commande <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> phpmyadmin</span></code></strong> ou encore <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> phpmyadmin</span></code></strong>. Il faudra ensuite créer un lien symbolique de <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin</span></code></strong> vers <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</span></code></strong> de cette manière : <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin</span></code></strong>. Ainsi, vous pourrez accéder à PHPMyAdmin à partir du navigateur via ces URLs : http://localhost/phpmyadmin ou encore http://127.0.0.1/phpmyadmin .</p>
<p><strong>IV &#8211; PostgreSQL et PHPPgAdmin</strong></p>
<p>PostgreSQL est un autre SGBDR libre et gratuit. En effet, il est assez apprécié en entreprise pour sa fiabilité, sa sécurité (notamment dû au respect des contraintes d&rsquo;intégrités référentielles, à la puissance de son langage de procédure stockée et de triggers proche de celui d&rsquo;Oracle, &#8230;) et sa stabilité. Il est souvent perçu comme une alternative à Oracle (autre SGBD très puissant, très utilisé en entreprise mais payant avec un ensemble de services qui vont autour). Pour l&rsquo;installer, il faut effectuer cette commande : <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> postgresql</span></code></strong> ou encore <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> postgresql</span></code></strong>.</p>
<p>De même que pour MySQL, vous pouvez vous connecter à PostgreSQL en console ou via un client graphique. Or, il existe un client léger sous une interface Web appelée PHPPgAdmin équivalent à PHPMyAdmin. Pour l&rsquo;installation, il s&rsquo;agit de la même procédure que pour PHPMyAdmin : lancez en console la commande <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> phppgadmin</span></code></strong> ou encore <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> phppgadmin</span></code></strong>. Créez ensuite un lien symbolique de <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>phppgadmin</span></code></strong> vers <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</span></code></strong> de cette façon : <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>phppgadmin <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>phppgadmin</span></code></strong>. Ainsi, vous pourrez enfin accéder à PHPPgAdmin à partir du navigateur via ces URLs : http://localhost/phppgadmin ou encore http://127.0.0.1/phppgadmin .</p>
<p><strong>Conclusion</strong></p>
<p>Vous disposez maintenant de tout ce qu&rsquo;il vous faut pour développer en PHP et SQL localement sur votre machine. Vous pouvez également aller plus loin en apprenant à administrer votre serveur HTTP (par exemple via le fichier httpd.conf ou apache2.conf pour apache2 sous Ubuntu).</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation de Linux en dual boot avec Windows</title>
		<link>https://blog.developpez.com/ineumann/p11034/general-unixlinux/installation_de_linux_en_dual_boot_avec</link>
		<comments>https://blog.developpez.com/ineumann/p11034/general-unixlinux/installation_de_linux_en_dual_boot_avec#comments</comments>
		<pubDate>Mon, 21 May 2012 19:04:18 +0000</pubDate>
		<dc:creator><![CDATA[ok.Idriss]]></dc:creator>
				<category><![CDATA[Général Unix/Linux]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Introduction Il existe aujourd&#8217;hui plusieurs façons de partitionner ses disques et d&#8217;installer Linux. En effet, il existe différents outils de partitionnement plus ou moins évolués et les CD d&#8217;installation intègrent de plus en plus leur propre outil de partitionnement. Mais ces manipulations peuvent toujours entraîner un risque de perte de données par l&#8217;écrasement de la partition Windows NTFS. Ainsi, cette méthode à été choisie parce qu&#8217;elle est assez sûre et simple. Il faut enfin savoir [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>Il existe aujourd&rsquo;hui plusieurs façons de partitionner ses disques et d&rsquo;installer Linux. En effet, il existe différents outils de partitionnement plus ou moins évolués et les CD d&rsquo;installation intègrent de plus en plus leur propre outil de partitionnement. Mais ces manipulations peuvent toujours entraîner un risque de perte de données par l&rsquo;écrasement de la partition Windows NTFS. Ainsi, cette méthode à été choisie parce qu&rsquo;elle est assez sûre et simple. Il faut enfin savoir que l&rsquo;installation de Linux avec tout ce que cela sous entend (téléchargement, gravure, défragmentation, partitionnement, etc) peut s&rsquo;avérer assez longue, soyez patients.</p>
<p><strong>I &#8211; Choix d&rsquo;une distribution</strong></p>
<p>Bien que l&rsquo;on puisse faire absolument tout à partir de n&rsquo;importe quelle distribution de Linux, la configuration initiale de celle-ci doit répondre à des besoins précis. Voici les principales distributions au jour d&rsquo;aujourd&rsquo;hui classées par catégorie d&rsquo;utilisation :</p>
<ul>
<li><strong>Débutants, multimédia et grand public :</strong> Ubuntu, Fedora, Mandriva et OpenSuSE ;</li>
<li><strong>Postes d&rsquo;entreprises :</strong> RHEL (Red Hat Enterprise Linux), CentOS et SuSE ;</li>
<li><strong>Serveurs :</strong> Debian, RHEL et CentOS ;</li>
<li><strong>Plateformes de développement :</strong> Fedora, RHEL et CentOS.</li>
</ul>
<p>Bien sûr cette classification un peu généraliste et minimaliste ne tient pas compte des préférences de chacun et ne parle pas de certaines distributions un peu plus complexes comme Gentoo, Slackware, voire d&rsquo;autres systèmes voisins tels que les BSD, Solaris, AIX&#8230;</p>
<p>Notons également que Fedora sert aussi de vitrine des dernières technologies qui ne sont pas toujours stables et contribue au développement de RHEL (Red Hat Enterprise sponsorisant le développement de Fedora en retour) et de CentOS (clone libre et gratuit de RHEL mais qui ne bénéficie ni du support, ni de la garantie de celle-ci). Une version de Fedora sort environ tous les 6 mois alors que CentOS et RHEL sortent une version basée sur Fedora tous les 4 à 5 ans, d&rsquo;où une stabilité idéale pour les serveurs et postes d&rsquo;entreprises.</p>
<p>Notons enfin qu&rsquo;Ubuntu est une distribution dérivée de Debian réservée au grand public. C&rsquo;est aujourd&rsquo;hui une des distributions les plus utilisées au monde et est fortement recommandée aux débutants. Une version LTS (Long Term Support) sort environ tous les 3 ans (5 ans pour la version serveur) tandis que les versions habituelles sortent tous les 6 mois.</p>
<p><strong>II &#8211; Graver un live CD</strong></p>
<p>Un live CD est un CD à partir duquel on peut booter (démarrer directement sans passer par le ou les OS stockés sur les disques durs). Pour graver un live CD, il faut d&rsquo;abord télécharger une image ISO de la distribution afin de la graver. Il existe plusieurs modes de téléchargement : les plus répandus se font via FTP ou Torrent (conseillé lorsque les serveurs de téléchargement sont surchargés).</p>
<p>La plupart du temps, on peut trouver un lien vers le téléchargement d&rsquo;une image ISO d&rsquo;une distribution en consultant sa documentation.</p>
<p>Voici néanmoins quelques liens de téléchargement :</p>
<ul>
<li><a href="http://torrent.fedoraproject.org/" target="_blank">Télécharger Fedora via Torrent</a> (évitez les versions alpha et bêta pour débuter) ;</li>
<li><a href="http://fedoraproject.org/fr/get-fedora" target="_blank">Télécharger Fedora via HTTP/FTP</a> ;</li>
<li>Télécharger Ubuntu : <a href="http://www.ubuntu.com/desktop/get-ubuntu/download" target="_blank">ici</a> ou <a href="http://www.ubuntu-fr.org/telechargement">là</a>.</li>
</ul>
<p>Assurez-vous également que la version de la distribution souhaitée correspond à l&rsquo;architecture processeur de votre machine (32 bits, 64 bits&#8230;).</p>
<p>Le téléchargement de l&rsquo;image peut s&rsquo;avérer très long mais évitez les interruptions qui facilitent la corruption de cette dernière. Ainsi il vous est recommandé de vérifier son intégrité après téléchargement. Vous devez ensuite graver cette image sur un ou plusieurs CD (ou DVD) avec un logiciel de gravure en choisissant l&rsquo;option &laquo;&nbsp;graver une image&nbsp;&raquo; (ou équivalent). La vitesse de gravure doit être au plus bas pour éviter à nouveau la corruption du fichier ISO sur le futur live-CD. Testez ensuite le live-CD en redémarrant votre PC.</p>
<p>Si le PC démarre immédiatement sur le disque dur, allez dans le setup du bios (voir la touche correspondante au démarrage, il s&rsquo;agit souvent de la touche <strong>F2</strong> ou d&rsquo;une touche similaire, appuyez à plusieurs reprises dessus). Une fois dans le setup, allez dans la liste de démarrage (ou d&rsquo;amorçage) des périphériques et placez le lecteur CD en premier (ou tout au moins avant le ou les disques durs).</p>
<p>Après avoir testé le livre-CD (sans installer Linux), retournez sous Windows. Une option du live-CD permet généralement de booter sur le disque dur, sinon rebootez le PC en retirant rapidement le CD avant l&rsquo;amorçage.</p>
<p>Vous pouvez également, avant de retourner sous Windows, tester Linux à partir du live-CD si il vous propose une options du type &laquo;&nbsp;essayer sans rien installer&nbsp;&raquo; (ce qui est généralement le cas). Cependant le démarrage de l&rsquo;OS en live peut s&rsquo;avérer très long et ceci n&rsquo;est pas indispensable lors de l&rsquo;installation de Linux.</p>
<p><strong>III &#8211; Création d&rsquo;un espace libre</strong></p>
<p>Avant de partitionner une première fois, il faut impérativement défragmenter ses volumes. Cela est possible à partir du poste de travail ou avec d&rsquo;autres outils et cela peut prendre aussi un certain temps.</p>
<p>Une fois la défragmentation achevée, vous pouvez commencer le partitionnement à l&rsquo;aide de différents outils :</p>
<ul>
<li><strong>Norton Partition Magic :</strong> c&rsquo;est un des outils de partitionnement les plus évolués aujourd&rsquo;hui. Cependant, il est payant et assez cher. Avec cet outil, il n&rsquo;est pas forcément utile de défragmenter ses disques car il vous indique s&rsquo;il y a besoin de défragmenter ou pas.</li>
<li><strong>L&rsquo;outil de gestion des disques de Windows :</strong> Les versions récentes de Windows embarquent un outil de gestion des volumes qui permet de partitionner et qui fonctionne assez bien sur les partitions NTFS et FAT32.</li>
<li><strong>GParted :</strong> C&rsquo;est un outil libre et gratuit de partitionnement auquel vous aurez accès à partir d&rsquo;un live CD Linux.</li>
<li><strong>fdisk et cfdisk :</strong> Ce sont des outils disponibles en console depuis un live CD de Linux. Il sont de plus bas niveau que les outils précédemment cités et sont déconseillés aux débutants.</li>
</ul>
<p>Vous devez réduire, à l&rsquo;aide de l&rsquo;un de ces outils, la partition NTFS en faisant bien attention à ne pas empiéter sur l&rsquo;espace occupé. Pour une utilisation suffisamment aisée des dernières versions de Linux, prenez une partition d&rsquo;au moins 15 GO (plus si vous pouvez). Un espace libre sera ensuite créé avec comme taille, l&rsquo;espace retiré lors du redimensionnement de la partition NTFS. Redémarrez ensuite Windows pour vous assurer qu&rsquo;il n&rsquo;y a pas eu de problèmes&#8230;</p>
<p><strong>IV &#8211; Installation de Linux</strong></p>
<p>Insérez maintenant le live CD que vous venez de graver et tester et choisissez le mode &laquo;&nbsp;Installation&nbsp;&raquo; (ou équivalent). La mise en place de la procédure d&rsquo;installation peut elle aussi prendre un certain temps, attendez qu&rsquo;elle se mette en place et poursuivez-la jusqu&rsquo;à l&rsquo;étape de partitionnement (jusque-là, c&rsquo;est assez simple).</p>
<p>Une fois à l&rsquo;étape de partitionnement, n&rsquo;utilisez pas les option du type &laquo;&nbsp;partitionnement automatique&nbsp;&raquo;, &laquo;&nbsp;écraser les partions Linux&nbsp;&raquo;, &laquo;&nbsp;Prendre tout l&rsquo;espace disque&nbsp;&raquo;, &#8230; mais l&rsquo;option &laquo;&nbsp;partitionnement personnalisé&nbsp;&raquo; ou &laquo;&nbsp;partitionnement manuel&nbsp;&raquo; (ou équivalent).</p>
<p>Vous devez d&rsquo;abord créer, à partir de l&rsquo;espace libre (ne touchez pas à la partition <strong>NTFS</strong> !), une partition <strong>swap</strong> qui doit avoir, en théorie, comme espace disque, le double de la capacité de votre PC en mémoire vive. Cette règle était vraie à l&rsquo;époque, mais il est désormais généralement inutile d&rsquo;aller au delà d&rsquo;1 GO de <strong>swap</strong>.</p>
<p>Prenez ensuite le reste de l&rsquo;espace libre pour créer une partition racine <strong><code class="codecolorer text default"><span class="text">/</span></code></strong> et éventuellement une partition <strong><code class="codecolorer text default"><span class="text">/home</span></code></strong> (créer une partition <strong><code class="codecolorer text default"><span class="text">/home</span></code></strong> est une solution avantageuse pour vos données personnelles qui seront disponibles depuis une autre partition Linux si vous installez plusieurs systèmes, et qu&rsquo;elles pourront être conservées lors d&rsquo;une nouvelle installation de Linux), avec comme système de fichier de l&rsquo;<strong>ext3</strong>, de l&rsquo;<strong>ext4</strong> ou du <strong>Brtfs</strong> (ce dernier n&rsquo;étant pas encore supporté par Grub, vous serez obligé de créer une partition <strong><code class="codecolorer text default"><span class="text">/boot</span></code></strong> en <strong>ext3</strong> ou <strong>ext4</strong>). Notez qu&rsquo;un disque dur ne peut pas supporter plus de quatre partitions primaires mais peut supporter un nombre indéterminé de partitions étendues.</p>
<p>Poursuivez ensuite l&rsquo;installation (cela reste encore simple mais peut prendre un certain temps) et redémarrez votre PC sous Linux pour le tester. Si vous êtes sous Ubuntu, il est préférable d&rsquo;activer le compte root qui est par défaut inactif (pour cela faites <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">passwd</span> root</span></code></strong> via un terminal). Testez ensuite Windows au cas où. Si tout fonctionne bien, il ne vous reste plus qu&rsquo;à configurer votre OS (réseau, logiciels, etc), bonne chance.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Les utilisateurs et les droits</title>
		<link>https://blog.developpez.com/ineumann/p11035/general-unixlinux/les_utilisateurs_et_les_droits</link>
		<comments>https://blog.developpez.com/ineumann/p11035/general-unixlinux/les_utilisateurs_et_les_droits#comments</comments>
		<pubDate>Mon, 21 May 2012 19:16:45 +0000</pubDate>
		<dc:creator><![CDATA[ok.Idriss]]></dc:creator>
				<category><![CDATA[Général Unix/Linux]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Commençons par les commandes nécessaires à l&#8217;administration des utilisateurs. Vous vous douterez que les privilèges super utilisateurs sont requis pour exécuter la majorité de ce type de commandes. adduser ou useradd : ajouter un utilisateur. La première commande est plus conviviale mais la seconde reste plus appropriée pour un script. userdel ou deluser : supprimer un utilisateur. addgroup ou groupadd : ajouter un groupe. groupdel ou delgroup : suppression d&#8217;un groupe. passwd : changer le [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Commençons par les commandes nécessaires à l&rsquo;administration des utilisateurs. Vous vous douterez que les privilèges super utilisateurs sont requis pour exécuter la majorité de ce type de commandes.</p>
<ul>
<li><strong><code class="codecolorer bash default"><span class="bash">adduser</span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash">useradd</span></code></strong> : ajouter un utilisateur. La première commande est plus conviviale mais la seconde reste plus appropriée pour un script.</li>
<li><strong><code class="codecolorer bash default"><span class="bash">userdel</span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash">deluser</span></code></strong> : supprimer un utilisateur.</li>
<li><strong><code class="codecolorer bash default"><span class="bash">addgroup</span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash">groupadd</span></code></strong> : ajouter un groupe.</li>
<li><strong><code class="codecolorer bash default"><span class="bash">groupdel</span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash">delgroup</span></code></strong> : suppression d&rsquo;un groupe.</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">passwd</span></span></code></strong> : changer le mot de passe de l&rsquo;utilisateur courant.</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">passwd</span></span></code></strong>: changer le mot de passe d&rsquo;un utilisateur (il peut s&rsquo;agir de root). Le mot de passe administrateur est requis lorsque cette commande est effectuée sur une autre session que celle de l&rsquo;utilisateur concerné.</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">who</span></span></code></strong> : afficher les utilisateurs connectés.</li>
</ul>
<p>Le fichier <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span></span></code></strong> donne la liste des utilisateurs et le fichier <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>shadow</span></code></strong> la liste des mots de passe cryptés pour chaque utilisateur.</p>
<p>Il existe aussi un système de groupes sous les systèmes de type Unix, voici les commandes liées à l&rsquo;administration des groupes (les privilèges root sont encore requis) :</p>
<ul>
<li><strong><code class="codecolorer bash default"><span class="bash">addgroup</span></code></strong> : ajouter un groupe.</li>
<li><strong><code class="codecolorer bash default"><span class="bash">usermod <span style="color: #660033;">-G</span></span></code></strong> : ajouter un utilisateur dans un groupe.</li>
<li><strong><code class="codecolorer bash default"><span class="bash">usermod <span style="color: #660033;">-g</span></span></code></strong> : définir un groupe comme groupe principal d&rsquo;un utilisateur.</li>
</ul>
<p>Le fichier <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>group</span></code></strong> contient lui la liste des groupes.</p>
<p>Maintenant abordons les droits des utilisateurs sur des fichiers de toutes sortes (fichiers textes, répertoires, exécutables, &#8230;). Le tableau ci-dessous résume les différents groupes d&rsquo;utilisateurs et les différents droits que l&rsquo;on peut leur attribuer grâce à la commande <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span></span></code></strong> (qui permet de changer ces droits) :</p>
<table style="width: 568px; height: 205px;" border="1" cellspacing="0" cellpadding="4" align="center">
<tbody>
<tr valign="top">
<td width="25%"><span style="font-size: xx-small;"><strong>Groupes</strong></span></td>
<td colspan="3" width="25%">
<p align="center"><span style="font-size: xx-small;">u</span></p>
</td>
<td colspan="3" width="25%">
<p align="center"><span style="font-size: xx-small;">g</span></p>
</td>
<td colspan="3" width="25%">
<p align="center"><span style="font-size: xx-small;">o</span></p>
</td>
</tr>
<tr valign="top">
<td width="25%"><span style="font-size: xx-small;">Désignation</span></td>
<td colspan="3" width="25%">
<p align="center"><span style="font-size: xx-small;">user </span></p>
</td>
<td colspan="3" width="25%">
<p align="center"><span style="font-size: xx-small;"> group</span></p>
</td>
<td colspan="3" width="25%">
<p align="center"><span style="font-size: xx-small;"> other</span></p>
</td>
</tr>
<tr valign="top">
<td width="25%"><span style="font-size: xx-small;">Signification</span></td>
<td colspan="3" width="25%">
<p align="center"><span style="font-size: xx-small;">Utilisateur propriétaire</span></p>
</td>
<td colspan="3" width="25%">
<p align="center"><span style="font-size: xx-small;">Groupe propriétaire</span></p>
</td>
<td colspan="3" width="25%">
<p align="center"><span style="font-size: xx-small;">Autres utilisateurs</span></p>
</td>
</tr>
<tr valign="top">
<td width="25%"><span style="font-size: xx-small;"><strong>Droits</strong></span></td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">r</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">w</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">x</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">r</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">w</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">x</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">r</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">w</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">x</span></p>
</td>
</tr>
<tr valign="top">
<td width="25%">
<p style="font-weight: normal;"><span style="font-size: xx-small;">Désignation</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">read</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">write</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">execute</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">read</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">write</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">execute</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">read</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">write</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">execute</span></p>
</td>
</tr>
<tr valign="top">
<td width="25%"><span style="font-size: xx-small;">Signification</span></td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">lecture</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">écriture</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">exécution</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">lecture</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">écriture</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">exécution</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">lecture</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">écriture</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">exécution</span></p>
</td>
</tr>
<tr valign="top">
<td width="25%"><span style="font-size: xx-small;">Numéro</span></td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">400</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">200</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">100</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">40</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">20</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">10</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">4</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">2</span></p>
</td>
<td width="8%">
<p align="center"><span style="font-size: xx-small;">1</span></p>
</td>
</tr>
</tbody>
</table>
<p>Il est possible que vous ne perceviez pas immédiatement le fonctionnement de cette commande chmod mais ne vous inquiétez pas, les exemples qui suivent vont éclaircir vos interrogations :</p>
<ul>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x</span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> a+x</span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> ugo+x</span></code></strong> ou encore <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">111</span></span></code></strong> : donner le droit d&rsquo;exécution sur un fichier à tous les groupes.</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> u+x</span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">100</span></span></code></strong> : donner le droit d&rsquo;exécution sur un fichier à l&rsquo;utilisateur propriétaire (et retirer en même temps tous les autres droits pour le cas de la seconde commande).</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +rw</span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> ugo +rw</span></code></strong> ou encore <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">666</span> nom_du_fichier</span></code></strong> : donner le droit de lecture et d&rsquo;écriture sur un fichier (ou répertoire).</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span></span></code></strong> ou <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> ugo+rwx</span></code></strong> ou encore <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +rwx</span></code></strong> : donner tous les droits à tous le monde sur un fichier (ou répertoire).</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">777</span></span></code></strong> : donner tous les droits à tout le monde sur un répertoire et sur son contenu de manière récursive.</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chmod</span> go-rwx</span></code></strong> : retirer tous les droits au groupe propriétaire et aux autres utilisateurs.</li>
</ul>
<p><strong>Remarques :</strong></p>
<ul>
<li>Pour donner plusieurs droits de façon numérique il suffit d&rsquo;additionner les numéros entre eux par dizaines. Par exemple : <strong><code class="codecolorer bash default"><span class="bash">o + rx = 005</span></code></strong>, <strong><code class="codecolorer bash default"><span class="bash">u + rwx = <span style="color: #000000;">700</span></span></code></strong>, <strong><code class="codecolorer bash default"><span class="bash">ug + rw = <span style="color: #000000;">600</span></span></code></strong>, <strong><code class="codecolorer bash default"><span class="bash">ugo + rwx = <span style="color: #000000;">777</span></span></code></strong>, &#8230; attention toutefois à la place des zéros qui signifient &laquo;&nbsp;aucuns droits&nbsp;&raquo;.</li>
<li>Lorsque l&rsquo;on change les droits avec les lettres qui leur correspondent, on utilise <strong><code class="codecolorer bash default"><span class="bash">+</span></code></strong> pour ajouter les droits et <strong><code class="codecolorer bash default"><span class="bash">–</span></code></strong> pour les enlever.</li>
<li>L&rsquo;option <strong><code class="codecolorer bash default"><span class="bash"><span style="color: #660033;">-R</span></span></code></strong> sert à indiquer que les droits s&rsquo;appliquent récursivement aux fichiers contenus dans un répertoire sur lequel on applique la commande (y compris dans les sous-répertoires).</li>
<li>Si vous n&rsquo;êtes pas l&rsquo;utilisateur propriétaire du fichier sur lequel vous lancez un chmod, vous aurez besoin des privilèges administrateur.</li>
</ul>
<p>Pour terminer ce billet, voici les commandes qui permettent de changer les groupes et/ou utilisateurs propriétaires sur un fichier (il faut bien entendu être soit l&rsquo;utilisateur propriétaire du fichier concerné, soit root pour pouvoir exécuter ces commandes) :</p>
<ul>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chown</span></span></code></strong> : changer l&rsquo;utilisateur propriétaire d&rsquo;un fichier quelconque.</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chgrp</span></span></code></strong> : changer le groupe propriétaire d&rsquo;un fichier.</li>
<li><strong><code class="codecolorer bash default"><span class="bash"><span style="color: #c20cb9; font-weight: bold;">chown</span></span></code></strong> : changer l&rsquo;utilisateur et le groupe propriétaire d&rsquo;un fichier.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
