<?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>Le bazar de Nicolas</title> <atom:link href="http://blog.ledez.net/feed/" rel="self" type="application/rss+xml" /><link>http://blog.ledez.net</link> <description>Pense-bête, etc.</description> <lastBuildDate>Sun, 13 May 2012 20:20:03 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Une console cluster avec tmux</title><link>http://blog.ledez.net/informatique/une-console-cluster-avec-tmux/</link> <comments>http://blog.ledez.net/informatique/une-console-cluster-avec-tmux/#comments</comments> <pubDate>Sun, 13 May 2012 19:40:55 +0000</pubDate> <dc:creator>nico</dc:creator> <category><![CDATA[Informatique]]></category> <category><![CDATA[cluster]]></category> <category><![CDATA[tmux]]></category> <category><![CDATA[unix]]></category><guid
isPermaLink="false">http://blog.ledez.net/?p=481</guid> <description><![CDATA[Tous ceux qui ont déjà travaillé avec un cluster le savent bien. Il faut avec deux machines &#8220;strictement&#8221; identiques. La meilleure solution est d&#8217;avoir une &#8220;console cluster&#8221;. Je n&#8217;ai jamais trouvé de solution réellement efficace et pratique à utiliser (la &#8230;<p
class="read-more"><a
href="http://blog.ledez.net/informatique/une-console-cluster-avec-tmux/">Read more &#187;</a></p>]]></description> <content:encoded><![CDATA[<p>Tous ceux qui ont déjà travaillé avec un cluster le savent bien. Il faut avec deux machines &#8220;strictement&#8221; identiques.</p><p>La meilleure solution est d&#8217;avoir une &#8220;console cluster&#8221;. Je n&#8217;ai jamais trouvé de solution réellement efficace et pratique à utiliser (la plus pratique celle de SUN).</p><p>Bref. En parallèle, je voulais regarder ce que <a
title="Tmux - le site" href="http://tmux.sourceforge.net/">Tmux</a> avait dans le ventre pour remplacer <a
title="Screen - Le 'site'" href="https://www.gnu.org/software/screen/">Screen</a> qui a fait son temps.</p><p>Et en pleine lecture de <a
title="tmux: Productive Mouse-Free Development" href="http://pragprog.com/book/bhtmux/tmux">tmux: Productive Mouse-Free Development</a>, je me rends compte qu&#8217;il est surement possible d&#8217;en faire une super console pour cluster.</p><p>Fichier &#8220;.tmux-clust.conf&#8221;</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">new-session <span
style="color: #660033;">-d</span> <span
style="color: #660033;">-s</span> clust <span
style="color: #660033;">-n</span> clust1 <span
style="color: #ff0000;">'ssh clust-root1'</span><br
/> split-window <span
style="color: #660033;">-v</span> <span
style="color: #660033;">-t</span> clust <span
style="color: #ff0000;">'ssh clust-root2'</span><br
/> <span
style="color: #000000; font-weight: bold;">set</span> <span
style="color: #660033;">-g</span> status-right <span
style="color: #ff0000;">&quot;&quot;</span><br
/> source-file ~<span
style="color: #000000; font-weight: bold;">/</span>.tmux-clust-bc.conf</div></div><p>Fichier &#8220;.tmux-clust-bc.conf&#8221;</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">set-window-option synchronize-panes on<br
/> <span
style="color: #7a0874; font-weight: bold;">bind</span> r source-file ~<span
style="color: #000000; font-weight: bold;">/</span>.tmux-clust-nobc.conf \; display <span
style="color: #ff0000;">&quot;Stop broadcast&quot;</span><br
/> <span
style="color: #000000; font-weight: bold;">set</span> <span
style="color: #660033;">-g</span> status-bg green<br
/> <span
style="color: #000000; font-weight: bold;">set</span> <span
style="color: #660033;">-g</span> pane-active-border-fg green<br
/> unbind u<br
/> unbind i<br
/> unbind o<br
/> unbind p<br
/> <br
/> <span
style="color: #7a0874; font-weight: bold;">bind</span> u set-window-option synchronize-panes off \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.0</span> <span
style="color: #ff0000;">'1'</span> \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.1</span> <span
style="color: #ff0000;">'2'</span> \; set-window-option synchronize-panes on<br
/> <span
style="color: #7a0874; font-weight: bold;">bind</span> i set-window-option synchronize-panes off \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.0</span> <span
style="color: #ff0000;">'2'</span> \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.1</span> <span
style="color: #ff0000;">'1'</span> \; set-window-option synchronize-panes on<br
/> <span
style="color: #7a0874; font-weight: bold;">bind</span> o set-window-option synchronize-panes off \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.0</span> <span
style="color: #ff0000;">'192.168.21.'</span> \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.1</span> <span
style="color: #ff0000;">'192.168.22.'</span> \; set-window-option synchronize-panes on<br
/> <span
style="color: #7a0874; font-weight: bold;">bind</span> p set-window-option synchronize-panes off \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.0</span> <span
style="color: #ff0000;">'192.168.22.'</span> \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.1</span> <span
style="color: #ff0000;">'192.168.21.'</span> \; set-window-option synchronize-panes on</div></div><p>Fichier &#8220;.tmux-clust-nobc.conf&#8221;</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">set-window-option synchronize-panes off<br
/> <span
style="color: #7a0874; font-weight: bold;">bind</span> r source-file ~<span
style="color: #000000; font-weight: bold;">/</span>.tmux-clust-bc.conf \; display <span
style="color: #ff0000;">&quot;Now with broadcast&quot;</span><br
/> <span
style="color: #000000; font-weight: bold;">set</span> <span
style="color: #660033;">-g</span> status-bg blue<br
/> <span
style="color: #000000; font-weight: bold;">set</span> <span
style="color: #660033;">-g</span> pane-active-border-fg blue<br
/> <br
/> unbind u<br
/> unbind i<br
/> unbind o<br
/> unbind p<br
/> <span
style="color: #7a0874; font-weight: bold;">bind</span> u send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.0</span> <span
style="color: #ff0000;">'1'</span> \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.1</span> <span
style="color: #ff0000;">'2'</span><br
/> <span
style="color: #7a0874; font-weight: bold;">bind</span> i send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.0</span> <span
style="color: #ff0000;">'2'</span> \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.1</span> <span
style="color: #ff0000;">'1'</span><br
/> <span
style="color: #7a0874; font-weight: bold;">bind</span> o send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.0</span> <span
style="color: #ff0000;">'192.168.21.'</span> \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.1</span> <span
style="color: #ff0000;">'192.168.22.'</span><br
/> <span
style="color: #7a0874; font-weight: bold;">bind</span> p send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.0</span> <span
style="color: #ff0000;">'192.168.22.'</span> \; send-keys <span
style="color: #660033;">-t</span> clust:<span
style="color: #000000;">0.1</span> <span
style="color: #ff0000;">'192.168.21.'</span></div></div><p>Et pour finir le fichier &#8220;tmux-clust&#8221;</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><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
/> tmux <span
style="color: #660033;">-f</span> ~<span
style="color: #000000; font-weight: bold;">/</span>.tmux-clust.conf attach</div></div><p>Du coup, quand je me connecte avec le script &#8220;tmux-clust&#8221;, il lance une connexion vers clust-root1 et clust-root2 chacun dans un panneau. Et par défaut, on est dans le mode &#8220;bc&#8221; pour broadcast.</p><p>Les touches :</p><ul><li>C-b u -> 1 -> node</li><li>C-b i -> 2 -> other_node</li><li>C-b o -> 192.168.21 -> node_addr_base</li><li>C-b p -> 192.168.22 -> other_addr_base</li><li>C-b r -> Change broadcast mode</li></ul><p>&#8220;C-b r&#8221; permet de passer d&#8217;un &#8220;mode&#8221; à un autre :<br
/> - Vert &#8220;broadcast&#8221; on envoie la purée sur les deux machines en même temps<br
/> - Bleu mode normal C-b fléche pour passer de l&#8217;un à l&#8217;autre</p><p>Et voila, une console cluster en mieux :p</p><div
style="float: right; margin-left: 10px;"><a
href="http://twitter.com/share?url=http://blog.ledez.net/informatique/une-console-cluster-avec-tmux/&via=nledez&text=Une console cluster avec tmux&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded> <wfw:commentRss>http://blog.ledez.net/informatique/une-console-cluster-avec-tmux/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Rennes On Rails &#8211; Introduction à Ruby &#8211; 21 mars</title><link>http://blog.ledez.net/blog/rennes-on-rails-introduction-a-ruby-21-mars/</link> <comments>http://blog.ledez.net/blog/rennes-on-rails-introduction-a-ruby-21-mars/#comments</comments> <pubDate>Mon, 12 Mar 2012 21:42:55 +0000</pubDate> <dc:creator>nico</dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[Rails]]></category> <category><![CDATA[Ruby]]></category><guid
isPermaLink="false">http://blog.ledez.net/?p=476</guid> <description><![CDATA[C&#8217;est par là : http://www.rennesonrails.com/?p=360 Tweet]]></description> <content:encoded><![CDATA[<p>C&#8217;est par là :<br
/> <a
href="http://www.rennesonrails.com/?p=360">http://www.rennesonrails.com/?p=360</a></p><div
style="float: right; margin-left: 10px;"><a
href="http://twitter.com/share?url=http://blog.ledez.net/blog/rennes-on-rails-introduction-a-ruby-21-mars/&via=nledez&text=Rennes On Rails - Introduction à Ruby - 21 mars&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded> <wfw:commentRss>http://blog.ledez.net/blog/rennes-on-rails-introduction-a-ruby-21-mars/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Imprimante PDF avec fond/tampon</title><link>http://blog.ledez.net/informatique/tips/imprimante-pdf-avec-fond-tampon/</link> <comments>http://blog.ledez.net/informatique/tips/imprimante-pdf-avec-fond-tampon/#comments</comments> <pubDate>Wed, 22 Feb 2012 08:00:00 +0000</pubDate> <dc:creator>nico</dc:creator> <category><![CDATA[Tips]]></category> <category><![CDATA[automator]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[osx]]></category> <category><![CDATA[pdf]]></category><guid
isPermaLink="false">http://blog.ledez.net/?p=453</guid> <description><![CDATA[Chalenge de la journée : réussir à trouver une solution pour transformer un document Word en PDF avec &#8220;papier à entête&#8221; Coup de bol c&#8217;est sur Mac Etape 1 : transformer un PDF en PDF avec fond de page J&#8217;ai &#8230;<p
class="read-more"><a
href="http://blog.ledez.net/informatique/tips/imprimante-pdf-avec-fond-tampon/">Read more &#187;</a></p>]]></description> <content:encoded><![CDATA[<ol><li>Chalenge de la journée : réussir à trouver une solution pour transformer un document Word en PDF avec &#8220;papier à entête&#8221;</li></ol><p>Coup de bol c&#8217;est sur Mac <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br
/> <span
id="more-453"></span></p><h3>Etape 1 : transformer un PDF en PDF avec fond de page</h3><p>J&#8217;ai trouvé <a
title="Site de PDFTK" href="http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/">pdftk</a> qui permet de travailler le PDF, le couteau suisse du PDF quoi&#8230; En plus avec un logo hyper sexy :</p><p><img
class="alignnone size-medium wp-image-454" title="pdftk-logo" src="http://blog.ledez.net/wp-content/uploads/2012/02/pdftk-logo.png" alt="Logo pdftk" /></p><p> <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>$doc_source est le document que je veux transformer.</p><p>$stamp est le document que je veux utiliser pour mettre en fond.</p><p>Stamp -&gt; en premier plan, background -&gt; en fond.</p><p>Le script suivant va transformer le document avec le fichier $stamp en premier plan :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #007800;">pdftk</span>=<span
style="color: #000000; font-weight: bold;">/</span>usr<span
style="color: #000000; font-weight: bold;">/</span>local<span
style="color: #000000; font-weight: bold;">/</span>bin<span
style="color: #000000; font-weight: bold;">/</span>pdftk<br
/> <span
style="color: #007800;">$pdftk</span> <span
style="color: #ff0000;">&quot;<span
style="color: #007800;">$doc_source</span>&quot;</span> stamp <span
style="color: #ff0000;">&quot;<span
style="color: #007800;">$stamp</span>&quot;</span> output <span
style="color: #ff0000;">&quot;<span
style="color: #007800;">$dest</span>&quot;</span></div></div><p>Un peu plus long, transformer le document avec $stamp en fond, mais que sur la première page :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #666666;">$</span>pdftk <span
style="color: #ff0000;">&quot;<span
style="color: #007800;">$doc_source</span>&quot;</span> <span
style="color: #c20cb9; font-weight: bold;">cat</span> <span
style="color: #000000;">1</span> output - <span
style="color: #000000; font-weight: bold;">|</span> <span
style="color: #007800;">$pdftk</span> - background <span
style="color: #ff0000;">&quot;<span
style="color: #007800;">$stamp</span>&quot;</span> output - <span
style="color: #000000; font-weight: bold;">|</span> <span
style="color: #007800;">$pdftk</span> <span
style="color: #007800;">A</span>=- <span
style="color: #007800;">B</span>=<span
style="color: #ff0000;">&quot;<span
style="color: #007800;">$doc_source</span>&quot;</span> <span
style="color: #c20cb9; font-weight: bold;">cat</span> A1 B2-end output <span
style="color: #ff0000;">&quot;<span
style="color: #007800;">$dest</span>&quot;</span></div></div><h3>Etape 2 : automatiser un peu tout ça</h3><p><a
href="http://blog.ledez.net/wp-content/uploads/2012/02/Automator.png"><img
class="alignleft  wp-image-458" title="Automator" src="http://blog.ledez.net/wp-content/uploads/2012/02/Automator-300x300.png" alt="Logo Automator" width="180" height="180" /></a><a
title="Site d'Automator" href="http://www.apple.com/remotedesktop/automation.html">Automator</a> est fait pour ça non ?</p><p>Simple pour automatiser des trucs, super bien intégré. Avec même des fonctionnalités inattendues.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>Créer un nouveau Workflow avec :<br
/> <a
href="http://blog.ledez.net/wp-content/uploads/2012/02/Workflow-011.png"><img
class="alignnone size-full wp-image-460" title="Workflow-01" src="http://blog.ledez.net/wp-content/uploads/2012/02/Workflow-011.png" alt="" width="896" height="555" /></a></p><p>Et le source :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><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;">cd</span> <span
style="color: #ff0000;">&quot;/Users/nico/Documents/PDF-Watermark&quot;</span><br
/> <span
style="color: #007800;">pdftk</span>=<span
style="color: #000000; font-weight: bold;">/</span>usr<span
style="color: #000000; font-weight: bold;">/</span>local<span
style="color: #000000; font-weight: bold;">/</span>bin<span
style="color: #000000; font-weight: bold;">/</span>pdftk<br
/> <span
style="color: #007800;">doc_source</span>=<span
style="color: #ff0000;">&quot;$1&quot;</span><br
/> <span
style="color: #007800;">stamp</span>=<span
style="color: #ff0000;">&quot;Fond-de-page.pdf&quot;</span><br
/> <span
style="color: #007800;">dest</span>=<span
style="color: #000000; font-weight: bold;">`</span><span
style="color: #7a0874; font-weight: bold;">echo</span> <span
style="color: #ff0000;">&quot;<span
style="color: #007800;">$doc_source</span>&quot;</span> <span
style="color: #000000; font-weight: bold;">|</span> <span
style="color: #c20cb9; font-weight: bold;">sed</span> <span
style="color: #660033;">-E</span> <span
style="color: #ff0000;">'s/.pdf$/-mail.pdf/'</span><span
style="color: #000000; font-weight: bold;">`</span></div></div><p>$pdftk &#8220;$doc_source&#8221; cat 1 output &#8211; | $pdftk &#8211; stamp &#8220;$stamp&#8221; output &#8211; | $pdftk A=- B=&#8221;$doc_source&#8221; cat A1 B2-end output &#8220;$dest&#8221;</p><p>open &#8220;$dest&#8221;</p><p>Explications :</p><ul><li>Je vais dans le répertoire où est mon fond de page</li><li>Je transforme mon nom de fichier de .pdf en -mail.pdf</li><li>J&#8217;utilise pdftk pour transformer mon PDF d&#8217;origine en PDF avec fond de page</li><li>Et pour finir j&#8217;ouvre mon PDF</li></ul><p>Je peux maintenant transformer mon workflow en application. Et faire du glisser-déplacer d&#8217;un PDF sur mon application.</p><p>Bon, ça marche par contre :</p><ol><li>Imprimer mon document en PDF</li><li>Déplacer mon PDF sur mon application</li></ol><p>Je suis un peu fainéant moi <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><h3>Etape 3 : je vous ai bien dit que c&#8217;était magique ?</h3><p>Quand on ouvre l&#8217;application on trouve ça :<a
href="http://blog.ledez.net/wp-content/uploads/2012/02/Workflow-031.png"><img
src="http://blog.ledez.net/wp-content/uploads/2012/02/Workflow-031.png" alt="" title="Workflow-03" width="513" height="292" class="alignnone size-full wp-image-469" /></a></p><p>La petite imprimante doit bien servir à quelque chose <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>Pour éviter de refaire tout mon workflow, je vais le dupliquer :</p><p><a
href="http://blog.ledez.net/wp-content/uploads/2012/02/Workflow-021.png"><img
src="http://blog.ledez.net/wp-content/uploads/2012/02/Workflow-021.png" alt="" title="Workflow-02" width="519" height="299" class="alignnone size-full wp-image-472" /></a></p><p>Ensuite on supprime la première boite qui prend le PDF en paramètre :<br
/> <a
href="http://blog.ledez.net/wp-content/uploads/2012/02/Workflow-04.png"><img
src="http://blog.ledez.net/wp-content/uploads/2012/02/Workflow-04.png" alt="" title="Workflow-04" width="618" height="249" class="alignnone size-full wp-image-470" /></a></p><p>On enregistre le plug-in. La boite de dialogue va simplement demander le nom du plug-in d&#8217;impression.</p><p>Et maintenant pour avoir le document, on va simplement imprimer et dans la liste &#8220;PDF&#8221; on va retrouver notre plug-in <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><div
style="float: right; margin-left: 10px;"><a
href="http://twitter.com/share?url=http://blog.ledez.net/informatique/tips/imprimante-pdf-avec-fond-tampon/&via=nledez&text=Imprimante PDF avec fond/tampon&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded> <wfw:commentRss>http://blog.ledez.net/informatique/tips/imprimante-pdf-avec-fond-tampon/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Vagrant ou les VM pour les nuls</title><link>http://blog.ledez.net/informatique/vagrant-ou-les-vm-pour-les-nuls/</link> <comments>http://blog.ledez.net/informatique/vagrant-ou-les-vm-pour-les-nuls/#comments</comments> <pubDate>Sun, 19 Feb 2012 19:15:15 +0000</pubDate> <dc:creator>nico</dc:creator> <category><![CDATA[Informatique]]></category> <category><![CDATA[vagran]]></category> <category><![CDATA[virtualisation]]></category> <category><![CDATA[vm]]></category><guid
isPermaLink="false">http://blog.ledez.net/?p=410</guid> <description><![CDATA[Pour un administrateur système, la virtualisation est un super jouet. Et pour un développeur cela peut devenir un super outil, mais tellement compliqué à mettre en place. Et c&#8217;est là que Vagrant arrive à la rescousse : Pas d&#8217;installation d&#8217;OS &#8230;<p
class="read-more"><a
href="http://blog.ledez.net/informatique/vagrant-ou-les-vm-pour-les-nuls/">Read more &#187;</a></p>]]></description> <content:encoded><![CDATA[<p><img
class="size-medium wp-image-411 alignright" title="Vagrant" src="http://blog.ledez.net/wp-content/uploads/2012/02/vagrant_chilling-300x300.png" alt="" width="300" height="300" /></p><p>Pour un administrateur système, la virtualisation est un super jouet.</p><p>Et pour un développeur cela peut devenir un super outil, mais tellement compliqué à mettre en place.</p><p>Et c&#8217;est là que Vagrant arrive à la rescousse :</p><ul><li>Pas d&#8217;installation d&#8217;OS</li><li>Pas de réseau à gérer</li><li>Partage de fichier simplifié</li></ul><p>Bref, c&#8217;est dégoutant de simplicité pour un administrateur système.</p><p>Mais (il en faut bien un), la prise en main n&#8217;est pas forcement très simple&#8230;</p><p><span
id="more-410"></span></p><h3>Les termes à comprendre</h3><ul><li>Box</li><li>Package</li></ul><p>Box : en gros, c&#8217;est simplement un modèle décompressé de VM. Vagrant va s&#8217;en servir pour déployer des VM.</p><p>Package : c&#8217;est la version compressée d&#8217;un modèle de VM.</p><p>On télécharge un package pour l&#8217;installer en tant que box. Une instance de VM peut être convertie en package.</p><p><a
href="http://blog.ledez.net/wp-content/uploads/2012/02/vagrant.png"><img
class="alignnone size-medium wp-image-419" title="Workflow Vagrant" src="http://blog.ledez.net/wp-content/uploads/2012/02/vagrant-300x186.png" alt="" width="300" height="186" /></a></p><h3>Installation de VirtualBox</h3><p><img
class="size-full wp-image-416 alignright" title="Virtual Box" src="http://blog.ledez.net/wp-content/uploads/2012/02/vbox_logo2_gradient.png" alt="" width="140" height="180" /></p><p>La première chose à faire est d&#8217;installer Virtual Box : direction <a
title="Le téléchargement de Virtual Box" href="https://www.virtualbox.org/wiki/Downloads">le site de Virtual Box</a>. Prenez l&#8217;installeur qui correspond à votre système d&#8217;exploitation. Attention Vagrant ne supporte que les versions VirtualBox 4.0.x et 4.1.x. Il y a peut-être une solution pour votre distribution Linux du style package tout prêt. Et je ne sais absolument pas ce que ça donne sous Windows.</p><h3>Installation de Vagrant</h3><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ rvm use 1.9.3<span
style="color: #000000; font-weight: bold;">@</span>vagrant <span
style="color: #660033;">--create</span><br
/> $ gem <span
style="color: #c20cb9; font-weight: bold;">install</span> vagrant</div></div><h3>Installation d&#8217;une VM par défaut</h3><p>Pour la première VM on va utiliser un package d&#8217;Internet.</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #666666;">$ </span>vagrant box add lucid64 http:<span
style="color: #000000; font-weight: bold;">//</span>files.vagrantup.com<span
style="color: #000000; font-weight: bold;">/</span>lucid64.box</div></div><h3>Première VM</h3><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vagrant init<br
/> A <span
style="color: #000000; font-weight: bold;">`</span>Vagrantfile<span
style="color: #000000; font-weight: bold;">`</span> has been placed <span
style="color: #000000; font-weight: bold;">in</span> this directory. You are now<br
/> ready to <span
style="color: #000000; font-weight: bold;">`</span>vagrant up<span
style="color: #000000; font-weight: bold;">`</span> your first virtual environment<span
style="color: #000000; font-weight: bold;">!</span> Please <span
style="color: #c20cb9; font-weight: bold;">read</span><br
/> the comments <span
style="color: #000000; font-weight: bold;">in</span> the Vagrantfile <span
style="color: #c20cb9; font-weight: bold;">as</span> well <span
style="color: #c20cb9; font-weight: bold;">as</span> documentation on<br
/> <span
style="color: #000000; font-weight: bold;">`</span>vagrantup.com<span
style="color: #000000; font-weight: bold;">`</span> <span
style="color: #000000; font-weight: bold;">for</span> <span
style="color: #c20cb9; font-weight: bold;">more</span> information on using Vagrant.</div></div><p>Vous pouvez simplifier le fichier Vagrantfile :</p><div
class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color:#6666ff; font-weight:bold;">Vagrant::Config</span>.<span
style="color:#9900CC;">run</span> <span
style="color:#9966CC; font-weight:bold;">do</span> <span
style="color:#006600; font-weight:bold;">|</span>config<span
style="color:#006600; font-weight:bold;">|</span><br
/> &nbsp; config.<span
style="color:#9900CC;">vm</span>.<span
style="color:#9900CC;">box</span> = <span
style="color:#996600;">&quot;base&quot;</span><br
/> &nbsp; <span
style="color:#008000; font-style:italic;"># config.vm.boot_mode = :gui</span><br
/> <span
style="color:#9966CC; font-weight:bold;">end</span></div></div><p>Pensez à remplacer la ligne :</p><div
class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">config.<span
style="color:#9900CC;">vm</span>.<span
style="color:#9900CC;">box</span> = <span
style="color:#996600;">&quot;base&quot;</span></div></div><p>Par notre box installé tout à l&#8217;heure :</p><div
class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">config.<span
style="color:#9900CC;">vm</span>.<span
style="color:#9900CC;">box</span> = <span
style="color:#996600;">&quot;lucid64&quot;</span></div></div><p>Et maintenant lancer la création de la VM. Attention c&#8217;est magique <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vagrant up<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Importing base box <span
style="color: #ff0000;">'lucid64'</span>...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Progress: <span
style="color: #000000;">60</span><span
style="color: #000000; font-weight: bold;">%</span><br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Matching MAC address <span
style="color: #000000; font-weight: bold;">for</span> NAT networking...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Clearing any previously <span
style="color: #000000; font-weight: bold;">set</span> forwarded ports...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Fixed port collision <span
style="color: #000000; font-weight: bold;">for</span> <span
style="color: #000000;">22</span> =<span
style="color: #000000; font-weight: bold;">&gt;</span> <span
style="color: #000000;">2222</span>. Now on port <span
style="color: #000000;">2200</span>.<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Forwarding ports...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> <span
style="color: #660033;">--</span> <span
style="color: #000000;">22</span> =<span
style="color: #000000; font-weight: bold;">&gt;</span> <span
style="color: #000000;">2200</span> <span
style="color: #7a0874; font-weight: bold;">&#40;</span>adapter <span
style="color: #000000;">1</span><span
style="color: #7a0874; font-weight: bold;">&#41;</span><br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Creating shared folders metadata...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Clearing any previously <span
style="color: #000000; font-weight: bold;">set</span> network interfaces...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Booting VM...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Waiting <span
style="color: #000000; font-weight: bold;">for</span> VM to boot. This can take a few minutes.<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> VM booted and ready <span
style="color: #000000; font-weight: bold;">for</span> use<span
style="color: #000000; font-weight: bold;">!</span><br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Mounting shared folders...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> <span
style="color: #660033;">--</span> v-root: <span
style="color: #000000; font-weight: bold;">/</span>vagrant</div></div><p>Notre machine est prête :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vagrant <span
style="color: #c20cb9; font-weight: bold;">ssh</span><br
/> Linux lucid64 2.6.32-<span
style="color: #000000;">33</span>-server <span
style="color: #666666; font-style: italic;">#70-Ubuntu SMP Thu Jul 7 22:28:30 UTC 2011 x86_64 GNU/Linux</span><br
/> Ubuntu 10.04.3 LTS<br
/> <br
/> <span
style="color: #666666;">vagrant@lucid64:~$</span></div></div><p>Et voilà !</p><p>Pour arrêter notre VM, on sort du SSH et :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vagrant halt<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Attempting graceful shutdown of VM...</div></div><h3>Mettre à jour une box</h3><p>Quand j&#8217;ai essayé Vagrant hier, je suis tombé sur cette erreur :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><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: #7a0874; font-weight: bold;">&#93;</span> The guest additions on this VM <span
style="color: #000000; font-weight: bold;">do</span> not match the <span
style="color: #c20cb9; font-weight: bold;">install</span> version of<br
/> VirtualBox<span
style="color: #000000; font-weight: bold;">!</span> This may cause things such <span
style="color: #c20cb9; font-weight: bold;">as</span> forwarded ports, shared<br
/> folders, and <span
style="color: #c20cb9; font-weight: bold;">more</span> to not work properly. If any of those things fail on<br
/> this machine, please update the guest additions and repackage the<br
/> box.<br
/> <br
/> Guest Additions Version: 4.1.0<br
/> VirtualBox Version: 4.1.8</div></div><p>J&#8217;ai trouvé pas mal de solutions, mais trop compliqué et/ou qui télécharges les MAJ sur Internet. Moi je fais comme ça :<br
/> Un petit backup :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><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;">tar</span> cvzf ~<span
style="color: #000000; font-weight: bold;">/</span>.vagrant.d<span
style="color: #000000; font-weight: bold;">/</span>backup<span
style="color: #000000; font-weight: bold;">/</span>lucid64.tgz ~<span
style="color: #000000; font-weight: bold;">/</span>.vagrant.d<span
style="color: #000000; font-weight: bold;">/</span>boxes<span
style="color: #000000; font-weight: bold;">/</span>lucid64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #000000; font-weight: bold;">!</span><span
style="color: #000000;">7295</span><br
/> tar: Removing leading <span
style="color: #ff0000;">'/'</span> from member names<br
/> a ~<span
style="color: #000000; font-weight: bold;">/</span>.vagrant.d<span
style="color: #000000; font-weight: bold;">/</span>boxes<span
style="color: #000000; font-weight: bold;">/</span>lucid64<br
/> a ~<span
style="color: #000000; font-weight: bold;">/</span>.vagrant.d<span
style="color: #000000; font-weight: bold;">/</span>boxes<span
style="color: #000000; font-weight: bold;">/</span>lucid64<span
style="color: #000000; font-weight: bold;">/</span>box-disk1.vmdk<br
/> a ~<span
style="color: #000000; font-weight: bold;">/</span>.vagrant.d<span
style="color: #000000; font-weight: bold;">/</span>boxes<span
style="color: #000000; font-weight: bold;">/</span>lucid64<span
style="color: #000000; font-weight: bold;">/</span>box.mf<br
/> a ~<span
style="color: #000000; font-weight: bold;">/</span>.vagrant.d<span
style="color: #000000; font-weight: bold;">/</span>boxes<span
style="color: #000000; font-weight: bold;">/</span>lucid64<span
style="color: #000000; font-weight: bold;">/</span>box.ovf<br
/> a ~<span
style="color: #000000; font-weight: bold;">/</span>.vagrant.d<span
style="color: #000000; font-weight: bold;">/</span>boxes<span
style="color: #000000; font-weight: bold;">/</span>lucid64<span
style="color: #000000; font-weight: bold;">/</span>Vagrantfile</div></div><p>Dé-commenter la ligne suivante dans le fichier Vagrantfile :</p><div
class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">config.<span
style="color:#9900CC;">vm</span>.<span
style="color:#9900CC;">boot_mode</span> = <span
style="color:#ff3333; font-weight:bold;">:gui</span></div></div><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vagrant destroy<br
/> $ vagrant up<br
/> $ vagrant <span
style="color: #c20cb9; font-weight: bold;">ssh</span></div></div><p>La fenêtre de la VM va s&#8217;ouvrir en parallèle. Sélectionner cette fenêtre et dans le menu &#8220;Périphérique / installer les additions invitées&#8221;</p><p>Donc maintenant nous sommes dans la VM :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #666666;">vagrant@lucid64:~$ </span><span
style="color: #c20cb9; font-weight: bold;">sudo</span> <span
style="color: #c20cb9; font-weight: bold;">mount</span> <span
style="color: #000000; font-weight: bold;">/</span>dev<span
style="color: #000000; font-weight: bold;">/</span>sr0 <span
style="color: #000000; font-weight: bold;">/</span>mnt<br
/> mount: block device <span
style="color: #000000; font-weight: bold;">/</span>dev<span
style="color: #000000; font-weight: bold;">/</span>sr0 is write-protected, mounting read-only<br
/> <span
style="color: #666666;">vagrant@lucid64:~$ </span><span
style="color: #c20cb9; font-weight: bold;">sudo</span> <span
style="color: #000000; font-weight: bold;">/</span>mnt<span
style="color: #000000; font-weight: bold;">/</span>VBoxLinuxAdditions.run <br
/> Verifying archive integrity... All good.<br
/> Uncompressing VirtualBox 4.1.8 Guest Additions <span
style="color: #000000; font-weight: bold;">for</span> Linux..........<br
/> VirtualBox Guest Additions installer<br
/> Removing installed version 4.1.0 of VirtualBox Guest Additions...<br
/> tar: Record <span
style="color: #c20cb9; font-weight: bold;">size</span> = <span
style="color: #000000;">8</span> blocks<br
/> Removing existing VirtualBox DKMS kernel modules ...done.<br
/> Removing existing VirtualBox non-DKMS kernel modules ...done.<br
/> Building the VirtualBox Guest Additions kernel modules<br
/> The headers <span
style="color: #000000; font-weight: bold;">for</span> the current running kernel were not found. If the following<br
/> module compilation fails <span
style="color: #000000; font-weight: bold;">then</span> this could be the reason.<br
/> <br
/> Building the main Guest Additions module ...fail<span
style="color: #000000; font-weight: bold;">!</span><br
/> <span
style="color: #7a0874; font-weight: bold;">&#40;</span>Look at <span
style="color: #000000; font-weight: bold;">/</span>var<span
style="color: #000000; font-weight: bold;">/</span>log<span
style="color: #000000; font-weight: bold;">/</span>vboxadd-install.log to <span
style="color: #c20cb9; font-weight: bold;">find</span> out what went wrong<span
style="color: #7a0874; font-weight: bold;">&#41;</span><br
/> Doing non-kernel setup of the Guest Additions ...done.<br
/> Installing the Window System drivers ...fail<span
style="color: #000000; font-weight: bold;">!</span><br
/> <span
style="color: #7a0874; font-weight: bold;">&#40;</span>Could not <span
style="color: #c20cb9; font-weight: bold;">find</span> the X.Org or XFree86 Window System.<span
style="color: #7a0874; font-weight: bold;">&#41;</span></div></div><p>Un petit tour dans le fichier /var/log/vboxadd-install.log nous dis qu&#8217;il manque les headers du noyau. Pour les installer :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #666666;">vagrant@lucid64:~$ </span><span
style="color: #c20cb9; font-weight: bold;">sudo</span> <span
style="color: #c20cb9; font-weight: bold;">apt-get install</span> linux-headers-$<span
style="color: #7a0874; font-weight: bold;">&#40;</span><span
style="color: #c20cb9; font-weight: bold;">uname</span> -r<span
style="color: #7a0874; font-weight: bold;">&#41;</span> <span
style="color: #660033;">-y</span><br
/> Reading package lists... Done<br
/> Building dependency <span
style="color: #c20cb9; font-weight: bold;">tree</span><br
/> Reading state information... Done<br
/> The following extra packages will be installed:<br
/> &nbsp; linux-headers-2.6.32-<span
style="color: #000000;">33</span><br
/> The following NEW packages will be installed:<br
/> &nbsp; linux-headers-2.6.32-<span
style="color: #000000;">33</span> linux-headers-2.6.32-<span
style="color: #000000;">33</span>-server<br
/> <span
style="color: #000000;">0</span> upgraded, <span
style="color: #000000;">2</span> newly installed, <span
style="color: #000000;">0</span> to remove and <span
style="color: #000000;">5</span> not upgraded.<br
/> Need to get 10.7MB of archives.<br
/> After this operation, 85.5MB of additional disk space will be used.<br
/> Get:<span
style="color: #000000;">1</span> http:<span
style="color: #000000; font-weight: bold;">//</span>us.archive.ubuntu.com<span
style="color: #000000; font-weight: bold;">/</span>ubuntu<span
style="color: #000000; font-weight: bold;">/</span> lucid-updates<span
style="color: #000000; font-weight: bold;">/</span>main linux-headers-2.6.32-<span
style="color: #000000;">33</span> 2.6.32-<span
style="color: #000000;">33.70</span> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>9924kB<span
style="color: #7a0874; font-weight: bold;">&#93;</span><br
/> Get:<span
style="color: #000000;">2</span> http:<span
style="color: #000000; font-weight: bold;">//</span>us.archive.ubuntu.com<span
style="color: #000000; font-weight: bold;">/</span>ubuntu<span
style="color: #000000; font-weight: bold;">/</span> lucid-updates<span
style="color: #000000; font-weight: bold;">/</span>main linux-headers-2.6.32-<span
style="color: #000000;">33</span>-server 2.6.32-<span
style="color: #000000;">33.70</span> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>800kB<span
style="color: #7a0874; font-weight: bold;">&#93;</span><br
/> Fetched 10.7MB <span
style="color: #000000; font-weight: bold;">in</span> 41s <span
style="color: #7a0874; font-weight: bold;">&#40;</span>255kB<span
style="color: #000000; font-weight: bold;">/</span>s<span
style="color: #7a0874; font-weight: bold;">&#41;</span><br
/> Selecting previously deselected package linux-headers-2.6.32-<span
style="color: #000000;">33</span>.<br
/> <span
style="color: #7a0874; font-weight: bold;">&#40;</span>Reading database ... <span
style="color: #000000;">26603</span> files and directories currently installed.<span
style="color: #7a0874; font-weight: bold;">&#41;</span><br
/> Unpacking linux-headers-2.6.32-<span
style="color: #000000;">33</span> <span
style="color: #7a0874; font-weight: bold;">&#40;</span>from ...<span
style="color: #000000; font-weight: bold;">/</span>linux-headers-2.6.32-<span
style="color: #000000;">33</span>_2.6.32-<span
style="color: #000000;">33.70</span>_all.deb<span
style="color: #7a0874; font-weight: bold;">&#41;</span> ...<br
/> Selecting previously deselected package linux-headers-2.6.32-<span
style="color: #000000;">33</span>-server.<br
/> Unpacking linux-headers-2.6.32-<span
style="color: #000000;">33</span>-server <span
style="color: #7a0874; font-weight: bold;">&#40;</span>from ...<span
style="color: #000000; font-weight: bold;">/</span>linux-headers-2.6.32-<span
style="color: #000000;">33</span>-server_2.6.32-<span
style="color: #000000;">33.70</span>_amd64.deb<span
style="color: #7a0874; font-weight: bold;">&#41;</span> ...<br
/> Setting up linux-headers-2.6.32-<span
style="color: #000000;">33</span> <span
style="color: #7a0874; font-weight: bold;">&#40;</span>2.6.32-<span
style="color: #000000;">33.70</span><span
style="color: #7a0874; font-weight: bold;">&#41;</span> ...<br
/> Setting up linux-headers-2.6.32-<span
style="color: #000000;">33</span>-server <span
style="color: #7a0874; font-weight: bold;">&#40;</span>2.6.32-<span
style="color: #000000;">33.70</span><span
style="color: #7a0874; font-weight: bold;">&#41;</span> ...<br
/> <br
/> <span
style="color: #666666;">vagrant@lucid64:~$ </span><span
style="color: #c20cb9; font-weight: bold;">sudo</span> <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>vboxadd<br
/> Usage: <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>vboxadd <span
style="color: #7a0874; font-weight: bold;">&#123;</span>start<span
style="color: #000000; font-weight: bold;">|</span>stop<span
style="color: #000000; font-weight: bold;">|</span>restart<span
style="color: #000000; font-weight: bold;">|</span>status<span
style="color: #000000; font-weight: bold;">|</span>setup<span
style="color: #7a0874; font-weight: bold;">&#125;</span><br
/> <span
style="color: #666666;">vagrant@lucid64:~$ </span><span
style="color: #c20cb9; font-weight: bold;">sudo</span> <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>vboxadd setup<br
/> Removing existing VirtualBox DKMS kernel modules ...done.<br
/> Removing existing VirtualBox non-DKMS kernel modules ...done.<br
/> Building the VirtualBox Guest Additions kernel modules<br
/> Building the main Guest Additions module ...done.<br
/> Building the shared folder support module ...done.<br
/> Building the OpenGL support module ...done.<br
/> Doing non-kernel setup of the Guest Additions ...done.<br
/> You should restart your guest to <span
style="color: #c20cb9; font-weight: bold;">make</span> sure the new modules are actually used</div></div><p>Un petit reboot pour vérifier que ça fonctionne :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vagrant halt<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Attempting graceful shutdown of VM...<br
/> $ vagrant up<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> VM already created. Booting <span
style="color: #000000; font-weight: bold;">if</span> it<span
style="color: #ff0000;">'s not already running...<br
/> [default] Clearing any previously set forwarded ports...<br
/> [default] Forwarding ports...<br
/> [default] -- 22 =&gt; 2222 (adapter 1)<br
/> [default] Creating shared folders metadata...<br
/> [default] Clearing any previously set network interfaces...<br
/> [default] Booting VM...<br
/> [default] Waiting for VM to boot. This can take a few minutes.<br
/> [default] VM booted and ready for use!<br
/> [default] Mounting shared folders...<br
/> [default] -- v-root: /vagrant</span></div></div><p>Maintenant, transformer la VM en package :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vagrant package<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Attempting graceful shutdown of VM...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Clearing any previously <span
style="color: #000000; font-weight: bold;">set</span> forwarded ports...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Creating temporary directory <span
style="color: #000000; font-weight: bold;">for</span> export...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Exporting VM...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Compressing package to: ~<span
style="color: #000000; font-weight: bold;">/</span>Vagrant<span
style="color: #000000; font-weight: bold;">/</span>template<span
style="color: #000000; font-weight: bold;">/</span>package.box</div></div><p>Et installer le nouveau package pour remplacer la box :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vagrant box remove lucid64<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>vagrant<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Deleting box <span
style="color: #ff0000;">'lucid64'</span>...<br
/> <br
/> $ vagrant box add lucid64 package.box<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>vagrant<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Downloading with Vagrant::Downloaders::File...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>vagrant<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Copying box to temporary location...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>vagrant<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Extracting box...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>vagrant<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Verifying box...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>vagrant<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Cleaning up downloaded box...</div></div><p>Maintenant, re-commenter la ligne suivante dans le fichier Vagrantfile :</p><div
class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">config.<span
style="color:#9900CC;">vm</span>.<span
style="color:#9900CC;">boot_mode</span> = <span
style="color:#ff3333; font-weight:bold;">:gui</span></div></div><p>Pour essayer si la nouvelle box fonctionne :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vagrant destroy<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Destroying VM and associated drives...<br
/> <br
/> $ vagrant up<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Importing base box <span
style="color: #ff0000;">'lucid64'</span>...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Matching MAC address <span
style="color: #000000; font-weight: bold;">for</span> NAT networking...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Clearing any previously <span
style="color: #000000; font-weight: bold;">set</span> forwarded ports...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Forwarding ports...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> <span
style="color: #660033;">--</span> <span
style="color: #000000;">22</span> =<span
style="color: #000000; font-weight: bold;">&gt;</span> <span
style="color: #000000;">2222</span> <span
style="color: #7a0874; font-weight: bold;">&#40;</span>adapter <span
style="color: #000000;">1</span><span
style="color: #7a0874; font-weight: bold;">&#41;</span><br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Creating shared folders metadata...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Clearing any previously <span
style="color: #000000; font-weight: bold;">set</span> network interfaces...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Booting VM...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Waiting <span
style="color: #000000; font-weight: bold;">for</span> VM to boot. This can take a few minutes.<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> VM booted and ready <span
style="color: #000000; font-weight: bold;">for</span> use<span
style="color: #000000; font-weight: bold;">!</span><br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> Mounting shared folders...<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>default<span
style="color: #7a0874; font-weight: bold;">&#93;</span> <span
style="color: #660033;">--</span> v-root: <span
style="color: #000000; font-weight: bold;">/</span>vagrant</div></div><p>Si vous avez compris comment mettre à jours la box, immaginez vous faire la même chose avec l&#8217;installation de middleware (Apache, Nginx, PHP, Rails, &#8230;) <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>Prochain épisode ? Déploiment d&#8217;un environnement pour héberger du Rails ?</p><p>Vous pouvez demander si vous avez d&#8217;autres idées d&#8217;articles.</p><p>Edit:<br
/> Je me suis posé la question d’où est-ce que je pouvais trouver des boxes toutes prêtes. Parce que bon, Ubuntu 64bits c&#8217;est bien. Mais moi j&#8217;ai aussi de la Debian <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br
/> J&#8217;ai trouvé http://vagrantbox.es/ et je me suis rendu compte après que <a
href="http://twitter.com/#!/Ethernitys" title="@Ethernitys">@Ethernitys</a> l&#8217;avait ajouté dans un Tweet qui concernait cet article.</p><div
style="float: right; margin-left: 10px;"><a
href="http://twitter.com/share?url=http://blog.ledez.net/informatique/vagrant-ou-les-vm-pour-les-nuls/&via=nledez&text=Vagrant ou les VM pour les nuls&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded> <wfw:commentRss>http://blog.ledez.net/informatique/vagrant-ou-les-vm-pour-les-nuls/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>C&#8217;est quoi Pow ?</title><link>http://blog.ledez.net/informatique/ruby/c-est-quoi-pow/</link> <comments>http://blog.ledez.net/informatique/ruby/c-est-quoi-pow/#comments</comments> <pubDate>Thu, 16 Feb 2012 17:30:18 +0000</pubDate> <dc:creator>nico</dc:creator> <category><![CDATA[Ruby]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[osx]]></category> <category><![CDATA[pow]]></category> <category><![CDATA[rails]]></category> <category><![CDATA[ruby]]></category><guid
isPermaLink="false">http://blog.ledez.net/?p=374</guid> <description><![CDATA[Pour répondre à un commentaire, sur mon prétendent Post &#8220;Pow pour les nuls&#8221; : Pour un développeur web 2 étapes dans la vie du projet : Développement Production Pour un développeur Rails (en général, mais vous pouvez utiliser autre chose) : &#8230;<p
class="read-more"><a
href="http://blog.ledez.net/informatique/ruby/c-est-quoi-pow/">Read more &#187;</a></p>]]></description> <content:encoded><![CDATA[<p>Pour répondre à un commentaire, sur mon prétendent <a
title="Pow pour les nuls" href="http://blog.ledez.net/informatique/tips/pow-pour-les-nuls/">Post &#8220;Pow pour les nuls&#8221;</a> :</p><p>Pour un développeur web 2 étapes dans la vie du projet :</p><ul><li>Développement</li><li>Production</li></ul><p><span
id="more-374"></span><br
/> <span
class="Apple-style-span" style="line-height: 18px;">Pour un développeur Rails (en général, mais vous pouvez utiliser autre chose) :</span></p><ul><li>Développement =&gt; le serveur &#8220;Rails&#8221; embarqué</li><li>Production =&gt; Ex : Ngnix + Passenger</li></ul><div><span
class="Apple-style-span" style="line-height: 18px;">Le serveur de développement est WEBrick, il est génial dans le sens ou il tourne simplement sur toutes les plates-formes sans configuration. Ex :</span></div><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">%</span> rails s &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #000000; font-weight: bold;">!</span><span
style="color: #000000;">6566</span><br
/> =<span
style="color: #000000; font-weight: bold;">&gt;</span> Booting WEBrick<br
/> =<span
style="color: #000000; font-weight: bold;">&gt;</span> Rails 3.2.0 application starting <span
style="color: #000000; font-weight: bold;">in</span> development on http:<span
style="color: #000000; font-weight: bold;">//</span>0.0.0.0:<span
style="color: #000000;">3000</span><br
/> =<span
style="color: #000000; font-weight: bold;">&gt;</span> Call with <span
style="color: #660033;">-d</span> to detach<br
/> =<span
style="color: #000000; font-weight: bold;">&gt;</span> Ctrl-C to shutdown server<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span><span
style="color: #000000;">2012</span>-02-<span
style="color: #000000;">16</span> <span
style="color: #000000;">13</span>:03:<span
style="color: #000000;">21</span><span
style="color: #7a0874; font-weight: bold;">&#93;</span> INFO &nbsp;WEBrick 1.3.1<br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span><span
style="color: #000000;">2012</span>-02-<span
style="color: #000000;">16</span> <span
style="color: #000000;">13</span>:03:<span
style="color: #000000;">21</span><span
style="color: #7a0874; font-weight: bold;">&#93;</span> INFO &nbsp;ruby 1.9.3 <span
style="color: #7a0874; font-weight: bold;">&#40;</span><span
style="color: #000000;">2011</span>-<span
style="color: #000000;">10</span>-<span
style="color: #000000;">30</span><span
style="color: #7a0874; font-weight: bold;">&#41;</span> <span
style="color: #7a0874; font-weight: bold;">&#91;</span>x86_64-darwin11.2.0<span
style="color: #7a0874; font-weight: bold;">&#93;</span><br
/> <span
style="color: #7a0874; font-weight: bold;">&#91;</span><span
style="color: #000000;">2012</span>-02-<span
style="color: #000000;">16</span> <span
style="color: #000000;">13</span>:03:<span
style="color: #000000;">21</span><span
style="color: #7a0874; font-weight: bold;">&#93;</span> INFO &nbsp;WEBrick::HTTPServer<span
style="color: #666666; font-style: italic;">#start: pid=69469 port=3000</span></div></div><div><span
class="Apple-style-span" style="line-height: 18px;">Un navigateur web sur http://localhost:3000/ et c&#8217;est parti. Ca marche aussi sur http://127.0.0.1:3000/ <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</span></div><div></div><div><p>Les inconvénients que j&#8217;arrive à trouver :</p><ul><li>Il faut aller en ligne de commande pour ouvrir le serveur</li><li>On ne peut simplement lancer qu&#8217;un seul serveur à la fois (sinon, &#8220;-p &lt;un autre port&gt;&#8221;, pour binder sur un autre port)</li><li>L&#8217;historique va mélanger toutes les applications dans les URL</li></ul><div><span
class="Apple-style-span" style="line-height: 18px;">Maintenant que je suis convaincu de passer à autre chose <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> :</span></div></div><div><br/></div><div>Et bien les mecs de <a
title="site de 37signals" href="http://37signals.com/">37signals</a> ont fait un super outil pour Mac : <a
title="Le site de Pow" href="http://pow.cx/">Pow</a></div><div><br/></div><div>Pow permet d&#8217;avoir un &#8220;serveur Rails&#8221; hyper simple à installer et zéro configuration.</div><div><br/></div><div>Avantages :</div><div><ul><li><span
class="Apple-style-span" style="line-height: 19px;">Pas de ligne de commande</span></li><li><span
class="Apple-style-span" style="line-height: 19px;">Toutes mes applications peuvent tourner en même temps</span></li><li><span
class="Apple-style-span" style="line-height: 19px;">On est &#8220;proche&#8221; d&#8217;une configuration de production</span></li></ul><div>Voilà, je pense vous avoir donné envie d&#8217;acheter un Mac et de lire mon autre article &#8220;<a
title="Pow pour les nuls" href="http://blog.ledez.net/informatique/tips/pow-pour-les-nuls/">Pow pour les nuls</a>&#8220;</div></div><div
style="float: right; margin-left: 10px;"><a
href="http://twitter.com/share?url=http://blog.ledez.net/informatique/ruby/c-est-quoi-pow/&via=nledez&text=C'est quoi Pow ?&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded> <wfw:commentRss>http://blog.ledez.net/informatique/ruby/c-est-quoi-pow/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Pow pour les nuls</title><link>http://blog.ledez.net/informatique/tips/pow-pour-les-nuls/</link> <comments>http://blog.ledez.net/informatique/tips/pow-pour-les-nuls/#comments</comments> <pubDate>Wed, 15 Feb 2012 20:30:33 +0000</pubDate> <dc:creator>nico</dc:creator> <category><![CDATA[Ruby]]></category> <category><![CDATA[Tips]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[osx]]></category> <category><![CDATA[pow]]></category> <category><![CDATA[rails]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[zsh]]></category><guid
isPermaLink="false">http://blog.ledez.net/?p=356</guid> <description><![CDATA[Toutes les étapes pour avoir une machine avec un Pow et Zsh qui torchent ! : Installer Pow Installer OH MY ZSHELL! Modification de la configuration par défaut Et son utilisation Bonus Installer Pow Extrait du site de Pow C&#8217;est &#8230;<p
class="read-more"><a
href="http://blog.ledez.net/informatique/tips/pow-pour-les-nuls/">Read more &#187;</a></p>]]></description> <content:encoded><![CDATA[<p>Toutes les étapes pour avoir une machine avec un Pow et Zsh qui torchent ! :</p><ul><li>Installer Pow</li><li>Installer OH MY ZSHELL!</li><li>Modification de la configuration par défaut</li><li>Et son utilisation</li><li>Bonus</li></ul><p><span
id="more-356"></span></p><h3>Installer Pow</h3><p><a
title="Site de Pow" href="http://pow.cx/">Extrait du site de Pow</a><br
/> C&#8217;est le plus dur :p</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #666666;">$ </span>curl get.pow.cx <span
style="color: #000000; font-weight: bold;">|</span> <span
style="color: #c20cb9; font-weight: bold;">sh</span></div></div><p>Maintenant une connexion sur un site http://&lt;app&gt;.dev/ doit fonctionner.<br
/> Pour une nouvelle application, le mode opératoire est simple :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><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;">cd</span> ~<span
style="color: #000000; font-weight: bold;">/</span>.pow<br
/> $ <span
style="color: #c20cb9; font-weight: bold;">ln</span> <span
style="color: #660033;">-s</span> <span
style="color: #000000; font-weight: bold;">/</span>path<span
style="color: #000000; font-weight: bold;">/</span>to<span
style="color: #000000; font-weight: bold;">/</span>myapp</div></div><p>Pff trop la flemme&#8230;</p><p>Pour gagner du temps, on va installer ZSH, avec le plugin &#8220;quivabien&#8221; :</p><h3>Installer OH MY ZSHELL!</h3><p><a
title="Site de oh-my-zsh" href="https://github.com/robbyrussell/oh-my-zsh">Extrait du site oh-my-zsh</a></p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #666666;">$ </span>curl <span
style="color: #660033;">-L</span> https:<span
style="color: #000000; font-weight: bold;">//</span>github.com<span
style="color: #000000; font-weight: bold;">/</span>robbyrussell<span
style="color: #000000; font-weight: bold;">/</span>oh-my-zsh<span
style="color: #000000; font-weight: bold;">/</span>raw<span
style="color: #000000; font-weight: bold;">/</span>master<span
style="color: #000000; font-weight: bold;">/</span>tools<span
style="color: #000000; font-weight: bold;">/</span>install.sh <span
style="color: #000000; font-weight: bold;">|</span> <span
style="color: #c20cb9; font-weight: bold;">sh</span></div></div><p>Si jamais votre Shell par défaut est écrasé (en général bash). Vous pouvez revenir en arrière :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><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;">chsh</span> <span
style="color: #660033;">-s</span> <span
style="color: #000000; font-weight: bold;">/</span>bin<span
style="color: #000000; font-weight: bold;">/</span><span
style="color: #c20cb9; font-weight: bold;">bash</span></div></div><h3>Modification de la configuration par défaut</h3><p>Modifier la ligne dans le fichier ~/.zshrc :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #007800;">plugins</span>=<span
style="color: #7a0874; font-weight: bold;">&#40;</span><span
style="color: #c20cb9; font-weight: bold;">git</span> brew bundler gem heroku osx pow rails3 redis-cli textmate<span
style="color: #7a0874; font-weight: bold;">&#41;</span></div></div><p>C&#8217;est surtout le plugin pow qu&#8217;il faut mettre, les autres sont ceux que j&#8217;utilise. Choisissez vos armes.</p><h3>Et son utilisation</h3><p>Si l&#8217;on regarde le contenu du fichier ~/.oh-my-zsh/plugins/pow/pow.plugin.zsh, on apprend qu&#8217;il y a 3 commandes à disposition :</p><ul><li>powit qui permet de &#8220;d&#8217;installer&#8221; un nouveau site</li><li>kapow qui permet de redémarrer une application. Avec en argument le nom du vhost ou sans argument dans le répertoire de l&#8217;application</li><li>kaput (puts) qui permet d&#8217;afficher les logs de l&#8217;application</li></ul><h3>Bonus</h3><p>Je ne me souviens jamais des URL à taper. Et j&#8217;ai trop la (flemme|pas envie de faire peur à mon client), j&#8217;aimerais donc avoir l&#8217;adresse http://index.dev/ qui me donne la liste de toutes mes applications.</p><p>On peut utiliser dans ce cas l&#8217;application <a
title="Site de Pow-index" href="https://github.com/marutanm/Pow-index">Pow-index</a>.</p><p>Si vous n&#8217;avez pas ça :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">%</span> gem search <span
style="color: #660033;">--remote</span> pow-index &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #000000; font-weight: bold;">!</span><span
style="color: #000000;">6441</span><br
/> <br
/> <span
style="color: #000000; font-weight: bold;">***</span> REMOTE GEMS <span
style="color: #000000; font-weight: bold;">***</span><br
/> <br
/> pow-index <span
style="color: #7a0874; font-weight: bold;">&#40;</span>0.0.4<span
style="color: #7a0874; font-weight: bold;">&#41;</span></div></div><p>Regardez plus bas (la version git).</p><p>Sans <a
title="Site de RVM" href="https://rvm.beginrescueend.com/">RVM</a> :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ gem <span
style="color: #c20cb9; font-weight: bold;">install</span> pow-index<br
/> $ pow-index index</div></div><p>Avec <a
title="Site de RVM" href="https://rvm.beginrescueend.com/">RVM</a> :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ rvm use default<span
style="color: #000000; font-weight: bold;">@</span>pow-index <span
style="color: #660033;">--create</span><br
/> $ gem <span
style="color: #c20cb9; font-weight: bold;">install</span> pow-index<br
/> $ pow-index index<br
/> $ gem <span
style="color: #c20cb9; font-weight: bold;">which</span> pow-index<br
/> $ <span
style="color: #7a0874; font-weight: bold;">cd</span> $<span
style="color: #7a0874; font-weight: bold;">&#40;</span>gem <span
style="color: #c20cb9; font-weight: bold;">which</span> pow-index <span
style="color: #000000; font-weight: bold;">|</span> <span
style="color: #c20cb9; font-weight: bold;">sed</span> <span
style="color: #ff0000;">'s#lib/pow-index.rb$##'</span><span
style="color: #7a0874; font-weight: bold;">&#41;</span><br
/> $ <span
style="color: #7a0874; font-weight: bold;">echo</span> <span
style="color: #ff0000;">'rvm use default@pow-index'</span> <span
style="color: #000000; font-weight: bold;">&amp;</span>gt; .rvmrc</div></div><p>J&#8217;ai fais quelques modifications suplémentaires dans un fork sur Github, <a
title="@marutanm" href="https://twitter.com/#!/marutanm">@marutanm</a> répond rapidement aux pull-request il devrait donc y avoir une version 0.0.5. En attendant :</p><div
class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><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;">git clone</span> https:<span
style="color: #000000; font-weight: bold;">//</span>nledez<span
style="color: #000000; font-weight: bold;">@</span>github.com<span
style="color: #000000; font-weight: bold;">/</span>nledez<span
style="color: #000000; font-weight: bold;">/</span>Pow-index.git<br
/> $ <span
style="color: #7a0874; font-weight: bold;">cd</span> Pow-index<br
/> $ <span
style="color: #c20cb9; font-weight: bold;">ln</span> <span
style="color: #660033;">-s</span> $<span
style="color: #7a0874; font-weight: bold;">&#40;</span><span
style="color: #7a0874; font-weight: bold;">pwd</span><span
style="color: #7a0874; font-weight: bold;">&#41;</span> ~<span
style="color: #000000; font-weight: bold;">/</span>.pow<span
style="color: #000000; font-weight: bold;">/</span>index</div></div><p>Vous pouvez aussi remplacer index par default. Dans ce cas, n&#8217;importe quelle URL qui se termine en .dev seras redirigé vers celui-là.</p><p>Et voilà plus qu&#8217;à apprendre coder comme des malades <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><div
style="float: right; margin-left: 10px;"><a
href="http://twitter.com/share?url=http://blog.ledez.net/informatique/tips/pow-pour-les-nuls/&via=nledez&text=Pow pour les nuls&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded> <wfw:commentRss>http://blog.ledez.net/informatique/tips/pow-pour-les-nuls/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Compte-rendu des MS Techdays 2012</title><link>http://blog.ledez.net/blog/compte-rendu-des-ms-techdays-2012/</link> <comments>http://blog.ledez.net/blog/compte-rendu-des-ms-techdays-2012/#comments</comments> <pubDate>Thu, 09 Feb 2012 23:00:31 +0000</pubDate> <dc:creator>nico</dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[Fun]]></category><guid
isPermaLink="false">http://blog.ledez.net/?p=345</guid> <description><![CDATA[Le résultat de ma checklist : &#9745; partir le matin de la session avec verglas et brouillard &#9745; avoir les foies de rater le train &#9745; et finalement y monter avec 1/4h d&#8217;avance &#9745; se dire que le train va &#8230;<p
class="read-more"><a
href="http://blog.ledez.net/blog/compte-rendu-des-ms-techdays-2012/">Read more &#187;</a></p>]]></description> <content:encoded><![CDATA[<p>Le résultat de ma checklist :<br
/> <span
id="more-345"></span></p><ul><li>&#9745; partir le matin de la session avec verglas et brouillard</li><li>&#9745; avoir les foies de rater le train</li><li>&#9745; et finalement y monter avec 1/4h d&#8217;avance</li><li>&#9745; se dire que le train va être bloqué</li><li>&#9745; ne pas se dire que 7h de marge c&#8217;est suffisant</li><li>&#9745; se pommer dans le métro</li><li>&#9745; ne pas savoir qu&#8217;il ne faut pas attendre avec son sac à gauche dans l&#8217;Escalator (dédicace à Fanny et François <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</li><li>&#9745; arrivé au Palais des congrès prendre 3 cafés pour s&#8217;y mettre</li><li>&#9745; terminer mes slides au dernier moment</li><li>&#9745; me dire que c&#8217;est la dernière fois</li><li>&#9745; se rendre compte que tout le monde fait la même chose <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></li><li>&#9745; passer des heures pour avoir des slides qui déchirent</li><li>&#9745; se rendre compte pendant la session qu&#8217;il manque le bas des slides</li><li>&#9745; ha merde ! J&#8217;ai mis du code dans le bas de slides</li><li>&#9745; Powerpoint est pas si mal pour faire des slides</li><li>&#9745; ils sont hyper ouverts sur l&#8217;extérieur chez MS</li><li>&#9745; on ne jeté pas de cailloux sur les propriétaires de Mac</li><li>&#9745; les ennemis de mes ennemis sont mes amis. Mise en pratique : un Rubiste à côté d&#8217;un Pythoniste commence à se &#8220;taper&#8221; dessus et finir par casser du sucre sur PHP <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></li><li>&#9745; terminer claqué à la fin de la journée et se coucher à 23h30</li><li>&#9745; épater un pro MS avec l&#8217;interface de Mac OS <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></li><li>&#9745; profiter d&#8217;avoir un speaker SQL à côté de moi pour lui demander des ressources TSQL (encore merci)</li><li>&#9745; se faire avoir sur un stand où les hôtesses scannaient tous ceux qui passaient</li><li>&#9745; se fixer une nouvelle règle : pas de goodies -> pas de scan</li></ul><p>Les bonnes surprises dans les stands :</p><ul><li><a
href="http://www.mongodb.org/" title="Le site de MongoDB">MongoDB</a> distribuait des bouquins gratuis</li><li>Le stand super sympa de <a
href="http://www.programmez.com/magazine.php" title="Le site du magazine">PROgrammez!</a> m&#8217;a fait découvrir un abonnement à 30€/ans</li></ul><p>Merci à mon sponsor <a
href="http://www.itlabs.fr.orange-business.com/">IT&#038;L@bs</a> <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><div
style="float: right; margin-left: 10px;"><a
href="http://twitter.com/share?url=http://blog.ledez.net/blog/compte-rendu-des-ms-techdays-2012/&via=nledez&text=Compte-rendu des MS Techdays 2012&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded> <wfw:commentRss>http://blog.ledez.net/blog/compte-rendu-des-ms-techdays-2012/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Array ruby tricks</title><link>http://blog.ledez.net/informatique/array-ruby-tricks/</link> <comments>http://blog.ledez.net/informatique/array-ruby-tricks/#comments</comments> <pubDate>Thu, 09 Feb 2012 22:24:42 +0000</pubDate> <dc:creator>nico</dc:creator> <category><![CDATA[Informatique]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[Tips]]></category> <category><![CDATA[array]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[tips]]></category><guid
isPermaLink="false">http://blog.ledez.net/?p=336</guid> <description><![CDATA[J&#8217;en ai parlé lors de ma session aux MS Techdays. On vous donne 2 fichiers : Le fichier avec les UUID à enlever Le fichier avec tous les UUID Le chalenge, ne garder que les UUID absent :p Les armes &#8230;<p
class="read-more"><a
href="http://blog.ledez.net/informatique/array-ruby-tricks/">Read more &#187;</a></p>]]></description> <content:encoded><![CDATA[<p>J&#8217;en ai parlé lors de ma session aux MS Techdays.</p><p>On vous donne 2 fichiers :</p><ul><li>Le fichier avec les UUID à enlever</li><li>Le fichier avec tous les UUID</li></ul><p>Le chalenge, ne garder que les UUID absent :p</p><p>Les armes :</p><ul><li>Ruby</li><li>Ben&#8230; c&#8217;est tout</li></ul><p><span
id="more-336"></span></p><div
class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color:#008000; font-style:italic;"># Initialisation des variables, je vais utiliser 2 tableaux</span><br
/> remove = <span
style="color:#006600; font-weight:bold;">&#91;</span><span
style="color:#006600; font-weight:bold;">&#93;</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># J'ouvre les fichiers, et pour chaque ligne la pousser dans son tableau.</span><br
/> <span
style="color:#008000; font-style:italic;"># Pour l'exemple, j'utilise 2 méthodes pour remplir les tableaux</span><br
/> all = <span
style="color:#CC00FF; font-weight:bold;">File</span>.<span
style="color:#CC0066; font-weight:bold;">readlines</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#996600;">&quot;01-all.csv&quot;</span><span
style="color:#006600; font-weight:bold;">&#41;</span><br
/> <span
style="color:#CC00FF; font-weight:bold;">File</span>.<span
style="color:#CC0066; font-weight:bold;">open</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#996600;">&quot;02-to-remove.csv&quot;</span><span
style="color:#006600; font-weight:bold;">&#41;</span>.<span
style="color:#9900CC;">each</span> <span
style="color:#006600; font-weight:bold;">&#123;</span> <span
style="color:#006600; font-weight:bold;">|</span>l<span
style="color:#006600; font-weight:bold;">|</span> remove <span
style="color:#006600; font-weight:bold;">&lt;&lt;</span> l <span
style="color:#006600; font-weight:bold;">&#125;</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># Afficher le nombre d'éléments dans chaque tableau</span><br
/> <span
style="color:#CC0066; font-weight:bold;">puts</span> <span
style="color:#996600;">&quot;All: #{all.count}&quot;</span><br
/> <span
style="color:#CC0066; font-weight:bold;">puts</span> <span
style="color:#996600;">&quot;Remove: #{remove.count}&quot;</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># La partie intéressante : la soustraction</span><br
/> keep = all <span
style="color:#006600; font-weight:bold;">-</span> remove<br
/> <br
/> <span
style="color:#008000; font-style:italic;"># J'affiche le nombre d'éléments dans le tableau restant</span><br
/> <span
style="color:#CC0066; font-weight:bold;">puts</span> <span
style="color:#996600;">&quot;Keep: #{keep.count}&quot;</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># Et vérifie si le nombre d'éléments correspond à ce que je voudrais</span><br
/> <span
style="color:#CC0066; font-weight:bold;">puts</span> <span
style="color:#996600;">&quot;Groovy !!!&quot;</span> <span
style="color:#9966CC; font-weight:bold;">if</span> keep.<span
style="color:#9900CC;">count</span> == <span
style="color:#006600; font-weight:bold;">&#40;</span>all.<span
style="color:#9900CC;">count</span> <span
style="color:#006600; font-weight:bold;">-</span> remove.<span
style="color:#9900CC;">count</span><span
style="color:#006600; font-weight:bold;">&#41;</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># J'enregistre le résultat dans un fichier</span><br
/> file = <span
style="color:#CC00FF; font-weight:bold;">File</span>.<span
style="color:#CC0066; font-weight:bold;">open</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#996600;">&quot;03-to-keep.csv&quot;</span>, <span
style="color:#996600;">&quot;w+&quot;</span><span
style="color:#006600; font-weight:bold;">&#41;</span><br
/> keep.<span
style="color:#9900CC;">each</span> <span
style="color:#006600; font-weight:bold;">&#123;</span> <span
style="color:#006600; font-weight:bold;">|</span>lun<span
style="color:#006600; font-weight:bold;">|</span> file.<span
style="color:#CC0066; font-weight:bold;">puts</span> lun <span
style="color:#006600; font-weight:bold;">&#125;</span><br
/> file.<span
style="color:#9900CC;">close</span></div></div><p>Le résultat :</p><div
class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">All: 31<br
/> Remove: 7<br
/> Keep: 24<br
/> Groovy !!!</div></div><p>La version courte de &#8220;prod&#8221; :</p><div
class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">remove = <span
style="color:#006600; font-weight:bold;">&#91;</span><span
style="color:#006600; font-weight:bold;">&#93;</span><br
/> <br
/> all = <span
style="color:#CC00FF; font-weight:bold;">File</span>.<span
style="color:#CC0066; font-weight:bold;">readlines</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#996600;">&quot;01-all.csv&quot;</span><span
style="color:#006600; font-weight:bold;">&#41;</span><br
/> <span
style="color:#CC00FF; font-weight:bold;">File</span>.<span
style="color:#CC0066; font-weight:bold;">open</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#996600;">&quot;02-to-remove.csv&quot;</span><span
style="color:#006600; font-weight:bold;">&#41;</span>.<span
style="color:#9900CC;">each</span> <span
style="color:#006600; font-weight:bold;">&#123;</span> <span
style="color:#006600; font-weight:bold;">|</span>l<span
style="color:#006600; font-weight:bold;">|</span> remove.<span
style="color:#9900CC;">push</span> l <span
style="color:#006600; font-weight:bold;">&#125;</span><br
/> <br
/> keep = all <span
style="color:#006600; font-weight:bold;">-</span> remove<br
/> <br
/> file = <span
style="color:#CC00FF; font-weight:bold;">File</span>.<span
style="color:#CC0066; font-weight:bold;">open</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#996600;">&quot;03-to-keep.csv&quot;</span>, <span
style="color:#996600;">&quot;w+&quot;</span><span
style="color:#006600; font-weight:bold;">&#41;</span><br
/> keep.<span
style="color:#9900CC;">each</span> <span
style="color:#006600; font-weight:bold;">&#123;</span> <span
style="color:#006600; font-weight:bold;">|</span>lun<span
style="color:#006600; font-weight:bold;">|</span> file.<span
style="color:#CC0066; font-weight:bold;">puts</span> lun <span
style="color:#006600; font-weight:bold;">&#125;</span><br
/> file.<span
style="color:#9900CC;">close</span></div></div><p>Si vous voulez générer des fichiers pour faire le test vous même :</p><div
class="codecolorer-container ruby default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">all = <span
style="color:#CC00FF; font-weight:bold;">File</span>.<span
style="color:#CC0066; font-weight:bold;">open</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#996600;">&quot;01-all.csv&quot;</span>, <span
style="color:#996600;">&quot;w&quot;</span><span
style="color:#006600; font-weight:bold;">&#41;</span><br
/> remove = <span
style="color:#CC00FF; font-weight:bold;">File</span>.<span
style="color:#CC0066; font-weight:bold;">open</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#996600;">&quot;02-to-remove.csv&quot;</span>, <span
style="color:#996600;">&quot;w&quot;</span><span
style="color:#006600; font-weight:bold;">&#41;</span><br
/> <br
/> <span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#006666;">0</span>..<span
style="color:#006666;">30</span><span
style="color:#006600; font-weight:bold;">&#41;</span>.<span
style="color:#9900CC;">each</span> <span
style="color:#9966CC; font-weight:bold;">do</span><br
/> &nbsp; val = <span
style="color:#CC0066; font-weight:bold;">rand</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#006666;">10000000000000</span><span
style="color:#006600; font-weight:bold;">&#41;</span><br
/> &nbsp; all.<span
style="color:#CC0066; font-weight:bold;">puts</span> val<br
/> &nbsp; remove.<span
style="color:#CC0066; font-weight:bold;">puts</span> val <span
style="color:#9966CC; font-weight:bold;">if</span> <span
style="color:#CC0066; font-weight:bold;">rand</span><span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#006666;">5</span><span
style="color:#006600; font-weight:bold;">&#41;</span> <span
style="color:#006600; font-weight:bold;">&gt;</span> <span
style="color:#006666;">3</span><br
/> <span
style="color:#9966CC; font-weight:bold;">end</span><br
/> <br
/> remove.<span
style="color:#9900CC;">close</span><br
/> all.<span
style="color:#9900CC;">close</span></div></div><p>Edit: Sur une suggestion de Ghislain, j&#8217;ai modifié le code d&#8217;exemple pour ajouter une variante plus courte</p><div
style="float: right; margin-left: 10px;"><a
href="http://twitter.com/share?url=http://blog.ledez.net/informatique/array-ruby-tricks/&via=nledez&text=Array ruby tricks&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded> <wfw:commentRss>http://blog.ledez.net/informatique/array-ruby-tricks/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Techdays 2012 – Et ma session introduction à Ruby &#8211; CR</title><link>http://blog.ledez.net/informatique/ruby/techdays-2012-et-ma-session-introduction-a-ruby-cr/</link> <comments>http://blog.ledez.net/informatique/ruby/techdays-2012-et-ma-session-introduction-a-ruby-cr/#comments</comments> <pubDate>Wed, 08 Feb 2012 10:35:40 +0000</pubDate> <dc:creator>nico</dc:creator> <category><![CDATA[Rails]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[rails]]></category> <category><![CDATA[ruby]]></category><guid
isPermaLink="false">http://blog.ledez.net/?p=329</guid> <description><![CDATA[Ci-dessous les slides de la session. Merci à tout le monde : d&#8217;être venu pour l&#8217;organisation pour la logistique etc, etc Introduction à Ruby &#8211; MS Techdays 2012 View more presentations from Nicolas Ledez. Télécharger la version Porwerpoint (à préférer, &#8230;<p
class="read-more"><a
href="http://blog.ledez.net/informatique/ruby/techdays-2012-et-ma-session-introduction-a-ruby-cr/">Read more &#187;</a></p>]]></description> <content:encoded><![CDATA[<p>Ci-dessous les slides de la session.</p><p>Merci à tout le monde :</p><ul><li>d&#8217;être venu</li><li>pour l&#8217;organisation</li><li>pour la logistique</li><li>etc, etc <img
src='http://blog.ledez.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></li></ul><p><span
id="more-329"></span></p><div
id="__ss_11478113" style="width: 425px;"><strong
style="display: block; margin: 12px 0 4px;"><a
title="Introduction à Ruby - MS Techdays 2012" href="http://www.slideshare.net/nledez/introduction-ruby-ms-techdays-2012">Introduction à Ruby &#8211; MS Techdays 2012</a></strong><object
id="__sse11478113" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param
name="allowFullScreen" value="true" /><param
name="allowScriptAccess" value="always" /><param
name="wmode" value="transparent" /><param
name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=int102-introruby-120208034520-phpapp02&amp;stripped_title=introduction-ruby-ms-techdays-2012&amp;userName=nledez" /><param
name="allowscriptaccess" value="always" /><param
name="allowfullscreen" value="true" /><embed
id="__sse11478113" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=int102-introruby-120208034520-phpapp02&amp;stripped_title=introduction-ruby-ms-techdays-2012&amp;userName=nledez" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></p><div
style="padding: 5px 0 12px;">View more <a
href="http://www.slideshare.net/">presentations</a> from <a
href="http://www.slideshare.net/nledez">Nicolas Ledez</a>.</div></div><p> <a
href="http://publicshare.ledez.net/keynotes/INT102%20-%20Intro%20Ruby.pptx">Télécharger la version Porwerpoint (à préférer, il y a les transitions)</a><br/><br
/> <a
href="http://publicshare.ledez.net/keynotes/INT102%20-%20Intro%20Ruby.pdf">Télécharger la version PDF</a></p><p><strong>Edit:</strong><br
/> Et les slides de Simon :<br
/> <a
href="http://www.slideshare.net/happynoff/pourquoi-ruby-on-rails-a-dchire" title="Ruby on Rails Pourquoi ça déchire ?">Ruby on Rails Pourquoi ça déchire ?</a></p><div
style="float: right; margin-left: 10px;"><a
href="http://twitter.com/share?url=http://blog.ledez.net/informatique/ruby/techdays-2012-et-ma-session-introduction-a-ruby-cr/&via=nledez&text=Techdays 2012 – Et ma session introduction à Ruby - CR&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded> <wfw:commentRss>http://blog.ledez.net/informatique/ruby/techdays-2012-et-ma-session-introduction-a-ruby-cr/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Techdays 2012 &#8211; Et ma session introduction à Ruby</title><link>http://blog.ledez.net/blog/techdays-2012-et-ma-session-introduction-a-ruby/</link> <comments>http://blog.ledez.net/blog/techdays-2012-et-ma-session-introduction-a-ruby/#comments</comments> <pubDate>Mon, 06 Feb 2012 12:41:38 +0000</pubDate> <dc:creator>nico</dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[communauté]]></category> <category><![CDATA[rails]]></category> <category><![CDATA[ruby]]></category><guid
isPermaLink="false">http://blog.ledez.net/?p=324</guid> <description><![CDATA[Je participe cette année aux Techdays de Microsoft. J&#8217;y anime une session d&#8217;introduction à Ruby : Introduction à Ruby (INT102) Pour suivre les Techdays en direct : Necessite Silverlight pour fonctionner. Tweet]]></description> <content:encoded><![CDATA[<p>Je participe cette année aux Techdays de Microsoft.</p><p>J&#8217;y anime une session d&#8217;introduction à Ruby :</p><p><a
href="http://www.microsoft.com/france/mstechdays/programmes/parcours.aspx#SessionID=2c463fe7-a295-4803-a24b-d3d4c11f0521" title="Introduction à Ruby (INT102)">Introduction à Ruby (INT102)</a></p><p>Pour suivre les Techdays en direct :</p><p><object
data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="576" height="365"><param
name="source" value="http://tdtv.microsoft.fr//Live.xap"/><param
name="onError" value="onSilverlightError" /><param
name="background" value="white" /><param
name="minRuntimeVersion" value="3.0.40624.0" /><param
name="autoUpgrade" value="true" /><param
name="enableHtmlAccess" value="true" /><param
name="initParams" value="rootUri=http://tdtv.microsoft.fr/j1/,statRootUri=http://live-stats.brainsonic.com/services/,projectName=techdays12,suffixName= pmsft" /><a
href="http://go.microsoft.com/fwlink/?LinkID=149156&#038;v=3.0.40624.0" style="text-decoration:none"><img
src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/></a></object></p><p>Necessite Silverlight pour fonctionner.</p><div
style="float: right; margin-left: 10px;"><a
href="http://twitter.com/share?url=http://blog.ledez.net/blog/techdays-2012-et-ma-session-introduction-a-ruby/&via=nledez&text=Techdays 2012 - Et ma session introduction à Ruby&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded> <wfw:commentRss>http://blog.ledez.net/blog/techdays-2012-et-ma-session-introduction-a-ruby/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 3497/3640 objects using disk: basic

Served from: blog.ledez.net @ 2012-05-20 10:46:21 -->
