<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://orgrim.net/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>code. grind. sleep.</title>
  <link>http://orgrim.net/</link>
  <atom:link href="http://orgrim.net/feed/rss2" rel="self" type="application/rss+xml"/>
  <description></description>
  <language>fr</language>
  <pubDate>Fri, 10 May 2013 13:10:34 +0200</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Un bulk build par jour dans un screen</title>
    <link>http://orgrim.net/post/2013/05/10/Un-bulk-build-par-jour-dans-un-screen</link>
    <guid isPermaLink="false">urn:md5:93919bbb8f5a4662f5b3bc2264bddfa2</guid>
    <pubDate>Fri, 10 May 2013 15:05:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>NetBSD</category>
        <category>pbulk</category><category>pkgsrc</category>    
    <description>    &lt;p&gt;Mes packages NetBSD sont préparés par pbulk, qui tourne en continu grâce au script &lt;a href=&quot;https://github.com/orgrim/nb-utils/blob/master/pkgsrc/pbulk-builder&quot;&gt;pbulk-builder&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;J'avais prévu avec l'option &lt;code&gt;-1&lt;/code&gt; de lui éviter d'entrer dans une boucle infinie, et j'ai pas eu tort. En effet, la majorité des tours ne fait que mettre à jour l'arbre &lt;a href=&quot;http://pkgsrc.org&quot;&gt;pkgsrc&lt;/a&gt;, résoudre les dépendances, sans rien compiler de nouveau. La première solution que j'ai trouvé a été de créer une règle sieve pour ne pas recevoir des dizaines de mails de rapport de bulk inutiles, en les plaçant dans un répertoire séparé...&lt;/p&gt;


&lt;p&gt;N'ayant jamais pris le temps d'utiliser cette fameuse option one-shot, j'ai décidé de mettre le lancement du bulk dans la crontab, sauf que c'est long et qu'il vaut mieux suivre ça avec screen. C'est possible grâce aux options &lt;code&gt;-d&lt;/code&gt; et &lt;code&gt;-m&lt;/code&gt; (avec &lt;code&gt;-S&lt;/code&gt; pour mettre un titre)&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
0 23 * * * /usr/pkg/bin/screen -dmS bulk -c /root/.screenrc /usr/pkg/bin/bash ~orgrim/nb-utils/pkgsrc/pbulk-builder -c -1 /data/pbulk
&lt;/pre&gt;


&lt;p&gt;On peut alors attacher le screen quand le bulk tourne.&lt;/p&gt;


&lt;p&gt;PS: merci au fans de tmux de passer sur le chan #netbsdfr sur Freenode pour me dire comment faire pareil avec tmux &lt;img src=&quot;/themes/default/smilies/smile.png&quot; alt=&quot;:)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Oups : des tablespaces imbriqués</title>
    <link>http://orgrim.net/post/2013/04/06/Oups-%3A-des-tablespaces-imbriqu%C3%A9s</link>
    <guid isPermaLink="false">urn:md5:5c8b02da5ee98be1976b490b67af99a5</guid>
    <pubDate>Sat, 06 Apr 2013 09:10:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>PostgreSQL</category>
        <category>PostgreSQL</category><category>tablespaces</category>    
    <description>    &lt;p&gt;Imbriquer des tablespaces n'a pas vraiment de sens dans PostgreSQL surtout si on veut se prendre la tête avec des montages dans tous les sens... Mais bon c'est permis, car PostgreSQL utilise uniquement les liens symboliques dans &lt;code&gt;$PGDATA/pg_tblspc&lt;/code&gt; pour accéder au contenu des tablespaces.&lt;/p&gt;


&lt;p&gt;Si on veut savoir ce qu'il en est voici une requête qui montre ça.&lt;/p&gt;


&lt;p&gt;Pour PostgreSQL &amp;lt;= 9.1&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;sql sql&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spcname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; name&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spclocation &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; location&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt;
  f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spclocation ~ &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'^'&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; setting &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; pg_settings
                           &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; name &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'data_directory'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; inside_pgdata&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt;
  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spcname
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; pg_tablespace o
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spclocation ~ &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'^'&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spclocation &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'/'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
     &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spcname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_default'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_global'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BY&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spclocation &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DESC&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LIMIT&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; parent&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt;
  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spclocation
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; pg_tablespace o
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spclocation ~ &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'^'&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spclocation &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'/'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
     &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spcname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_default'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_global'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BY&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spclocation &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DESC&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LIMIT&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; parent_location
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; pg_tablespace f
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spcname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_default'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_global'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/pre&gt;


&lt;p&gt;Pour PostgreSQL &amp;gt;= 9.2, la colonne &lt;code&gt;spcname&lt;/code&gt; de &lt;code&gt;pg_tablespace&lt;/code&gt; a été remplacée par la fonction &lt;code&gt;pg_tablespace_location()&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;sql sql&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spcname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; name&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; pg_tablespace_location&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; location&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt;
  pg_tablespace_location&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; ~ &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'^'&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; setting &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; pg_settings
                                    &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; name &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'data_directory'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; inside_pgdata&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt;
  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spcname
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; pg_tablespace o
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; pg_tablespace_location&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; ~ &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'^'&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; pg_tablespace_location&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'/'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
     &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spcname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_default'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_global'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BY&lt;/span&gt; pg_tablespace_location&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DESC&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LIMIT&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; parent&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt;
  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; pg_tablespace_location&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; pg_tablespace o
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; pg_tablespace_location&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; ~ &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'^'&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; pg_tablespace_location&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'/'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
     &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spcname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_default'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_global'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
   &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BY&lt;/span&gt; pg_tablespace_location&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;o&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DESC&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;LIMIT&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; parent_location
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; pg_tablespace f
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; f&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;spcname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_default'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'pg_global'&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/pre&gt;


&lt;p&gt;On obtient par exemple&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
  oid  |   name   |                       location                       | inside_pgdata | parent  |                 parent_location                 
-------+----------+------------------------------------------------------+---------------+---------+-------------------------------------------------
 16399 | inside   | /home/pgsql/postgresql-9.0.10/data/inside            | t             |         | 
 16400 | outside  | /home/pgsql/postgresql-9.0.10/outside                | f             |         | 
 16414 | imbrique | /home/pgsql/postgresql-9.0.10/outside/imbrique       | f             | outside | /home/pgsql/postgresql-9.0.10/outside
 16415 | rimb     | /home/pgsql/postgresql-9.0.10/outside/rimb           | f             | outside | /home/pgsql/postgresql-9.0.10/outside
 16416 | rimbimb  | /home/pgsql/postgresql-9.0.10/outside/rimb/imb       | f             | rimb    | /home/pgsql/postgresql-9.0.10/outside/rimb
 16417 | deuimb   | /home/pgsql/postgresql-9.0.10/outside/rimb/truc/2imb | f             | truc    | /home/pgsql/postgresql-9.0.10/outside/rimb/truc
 16418 | truc     | /home/pgsql/postgresql-9.0.10/outside/rimb/truc      | f             | rimb    | /home/pgsql/postgresql-9.0.10/outside/rimb
(7 rows)
&lt;/pre&gt;


&lt;p&gt;Pour bien gérer ses tablespaces, l'idéal est de faire un répertoire dédié au même niveau que &lt;code&gt;$PGDATA&lt;/code&gt;, et de créer les tablespaces dedans, avec un tablespace par répertoire sur un seul niveau&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
 /home/pgsql/postgresql-9.2.4
├── data
└── tblspc
    ├── tbs_1
    ├── tbs_2
    ├── ...
    └── tbs_n
&lt;/pre&gt;


&lt;p&gt;C'est plus propre et on voit tout de suite l'utilisation disque avec &lt;code&gt;df&lt;/code&gt;&amp;nbsp;: parce qu'on met des disques différents derrière, bien entendu... &lt;img src=&quot;/themes/default/smilies/smile.png&quot; alt=&quot;:)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>pbulk-builder et pkgtools/mksandbox</title>
    <link>http://orgrim.net/post/2013/01/26/pbulk-builder-et-pkgtools/mksandbox</link>
    <guid isPermaLink="false">urn:md5:9e425f6f43c4077b84c0254e59c7517d</guid>
    <pubDate>Sat, 26 Jan 2013 18:59:00 +0100</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>NetBSD</category>
        <category>NetBSD</category><category>pbulk</category><category>pkgsrc</category><category>sandbox</category>    
    <description>    &lt;p&gt;Après la réinstall d'une de mes machines de build en 6.0.1, j'ai eu la bonne surprise de voir que le script de build &lt;code&gt;pbulk-builder&lt;/code&gt; (&lt;a href=&quot;https://github.com/orgrim/nb-utils&quot; title=&quot;https://github.com/orgrim/nb-utils&quot;&gt;https://github.com/orgrim/nb-utils&lt;/a&gt;) ne trouvait plus &lt;code&gt;mksandbox&lt;/code&gt; dans l'arbre de pkgsrc. Il est désormais dans son paquet&amp;nbsp;: &lt;code&gt;pkgtools/mksandbox&lt;/code&gt;&lt;/p&gt;


&lt;p&gt;Le script est à jour. le script de montage de la sandbox se prend un &lt;code&gt;sed&lt;/code&gt; dans la foulée pour éviter qu'il force le montage de l'arbre pkgsrc dans &lt;code&gt;/tree/pkgsrc&lt;/code&gt;...&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Got GUC?</title>
    <link>http://orgrim.net/post/2012/01/30/Got-GUC</link>
    <guid isPermaLink="false">urn:md5:62972417741b60a8104975950612ef22</guid>
    <pubDate>Mon, 30 Jan 2012 17:41:00 +0100</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>PostgreSQL</category>
        <category>configuration</category><category>GUC</category><category>PostgreSQL</category>    
    <description>    &lt;p&gt;Les paramètres de configuration de PostgreSQL sont appelés GUC ce qui signifie Grand Unified Configuration, c'est le nom de la partie du code qui gère les paramètres de configuration. En gros, ce sont tous les paramètres du fichier &lt;code&gt;postgresql.conf&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Ce qui est moins connu et utilisé, c'est la possibilité de configurer ces paramètres à différents niveaux&amp;nbsp;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fichier &lt;code&gt;postgresql.conf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Ligne de commande du postmaster, le processus principal du serveur&lt;/li&gt;
&lt;li&gt;Base de données&lt;/li&gt;
&lt;li&gt;Rôle&lt;/li&gt;
&lt;li&gt;Session&lt;/li&gt;
&lt;li&gt;Transaction&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;La précédence des valeurs va en descendant dans la liste, par exemple la valeur d'un paramètre au niveau d'un rôle écrase celle positionnée au niveau de la base de donnée ou la ligne de commande. Ce comportement est très intéressant pour définir une valeur d'un paramètre dépendante du contexte d'exécution d'un traitement. Par exemple on peut placer un timeout des requêtes au niveau de la base pour éviter qu'une application ne jette l'éponge avant PostgreSQL, et configurer l'absence de timeout pour un rôle dédié aux opérations de VACUUM et ANALYSE, on limite ainsi l'effet de bord du timeout&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
-- timeout à 30 secondes sur la base de données
ALTER DATABASE mabase SET statement_timeout TO 30000;

-- pas de timeout pour le role maintenance chargé du vacuum
ALTER ROLE maintenance SET statement_timeout TO 0;
&lt;/pre&gt;


&lt;p&gt;Selon l'endroit où doit être positionné la valeur on utilise&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;postgresql.conf&lt;/code&gt;&amp;nbsp;: directement dans le fichier&lt;/li&gt;
&lt;li&gt;ligne de commande&amp;nbsp;: dans le script d'init avec l'option &lt;code&gt;-c&lt;/code&gt; et à l'exécution de &lt;code&gt;pg_ctl&lt;/code&gt; avec l'option &lt;code&gt;-o&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;base de données&amp;nbsp;: &lt;code&gt;ALTER DATABASE nom_base SET param TO valeur;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;rôle&amp;nbsp;: &lt;code&gt;ALTER ROLE nom_role SET param TO valeur;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;session&amp;nbsp;: &lt;code&gt;SET [ SESSION ] param TO valeur;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;transaction&amp;nbsp;: &lt;code&gt;SET LOCAL param TO valeur;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pour le passage des valeurs au niveau SQL, on peut utiliser &lt;code&gt;... RESET param&lt;/code&gt; à la place de &lt;code&gt;SET param TO&lt;/code&gt; pour réinitialiser la valeur à son défaut pour le contexte choisi.&lt;/p&gt;


&lt;p&gt;On peut également définir des paramètres personnalisés, comme le font certaines extensions. Pour cela il faut définir une classe de variables personnalisée, en déclarant un préfixe (on en sépare plusieurs par des virgules) dans le paramètre de configuration &lt;code&gt;custom_variable_classes&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
custom_variable_classes = 'nico'
&lt;/pre&gt;


&lt;p&gt;Ensuite, on peut directement ajouter nos variables personnalisées en les préfixant par &lt;code&gt;nico.&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
nico.test_guc = 1000
&lt;/pre&gt;


&lt;p&gt;On peut alors manipuler ces variables comme ceci&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
mydb=# SHOW nico.test_guc;
 nico.test_guc 
---------------
 1000
(1 row)

mydb=# SHOW nico.test_guc;
 nico.test_guc 
---------------
 1000
(1 row)

mydb=# SET nico.test_guc = 3;
SET
mydb=# SHOW nico.test_guc;
 nico.test_guc 
---------------
 3
(1 row)

mydb=# SET nico.reguc = on;
SET
mydb=# SHOW nico.reguc;
 nico.reguc 
------------
 on
(1 row)
&lt;/pre&gt;


&lt;p&gt;Enfin, on peut utiliser les fonctions &lt;code&gt;current_setting()&lt;/code&gt; et &lt;code&gt;set_config()&lt;/code&gt; pour manipuler ces variables dans des fonctions&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
mydb=# SELECT set_config('nico.test_guc', '100', false);
 set_config 
------------
 100
(1 row)

mydb=# SELECT current_setting('nico.test_guc');
 current_setting 
-----------------
 100
(1 row)
&lt;/pre&gt;


&lt;p&gt;PS: merci à &lt;a href=&quot;http://momjian.us/main/blogs/pgblog/2011.html#December_1_2011&quot;&gt;ce post&lt;/a&gt; pour l'idée de creuser le sujet.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Compiler dans l'arbre des sources</title>
    <link>http://orgrim.net/post/2012/01/24/Compiler-dans-l-arbre-des-sources</link>
    <guid isPermaLink="false">urn:md5:881d17f4c9365815a5480e3ef53fa225</guid>
    <pubDate>Tue, 24 Jan 2012 19:20:00 +0100</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>NetBSD</category>
        <category>kernel</category><category>make</category><category>NetBSD</category><category>source</category>    
    <description>    &lt;p&gt;Je m'occupe actuellement de préparer ma box pour le FOSDEM, et il s'avère qu'il manque le support du DRM (Direct Rendering Manager, le truc pour avoir de l'accélération graphique dans le kernel pour X.org) pour ma carte vidéo. Il s'agit de NetBSD 5.1.1, la version 6 n'aura pas ce manque.&lt;/p&gt;


&lt;p&gt;Il faut donc recompiler un noyau pour ajouter cette fonctionnalité, pour faire vite on ne passe pas par &lt;code&gt;build.sh&lt;/code&gt;, les tools etc, on compile directement dans l'arbre des sources, montrer comment faire ça est le but de post.&lt;/p&gt;


&lt;p&gt;On commence par récupérer les sources sur un serveur CVS près de chez soi&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# export CVS_RSH=ssh
# export CVSROOT=&amp;quot;anoncvs@anoncvs.NetBSD.org:/cvsroot&amp;quot;
# cd /usr
# cvs -q -z3 co -P -rnetbsd-5-1-1-RELEASE src
&lt;/pre&gt;


&lt;p&gt;Ensuite, on n'a pas besoin d'avoir une conf particulière dans son &lt;code&gt;/etc/mk.conf&lt;/code&gt;, on n'a juste à ajouter les options dans le fichier de conf du kernel et compiler directement par l'intermédiaire de &lt;code&gt;make&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;On édite le fichier &lt;code&gt;/usr/src/sys/arch/i386/conf/GENERIC.local&lt;/code&gt;, pour y ajouter les lignes suivantes, il est inclus par le fichier &lt;code&gt;GENERIC&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# DRI driver    
i915drm*        at vga?         # Intel i915, i945 DRM driver
mach64drm*      at vga?         # mach64 (3D Rage Pro, Rage) DRM driver
mgadrm*         at vga?         # Matrox G[24]00, G[45]50 DRM driver
r128drm*        at vga?         # ATI Rage 128 DRM driver
radeondrm*      at vga?         # ATI Radeon DRM driver
savagedrm*      at vga?         # S3 Savage DRM driver
sisdrm*         at vga?         # SiS DRM driver
tdfxdrm*        at vga?         # 3dfx (voodoo) DRM driver
&lt;/pre&gt;


&lt;p&gt;On compile le kernel à la main&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# config GENERIC
# cd ../compile/GENERIC
# make depend
# make
&lt;/pre&gt;


&lt;p&gt;On installe le kernel à la main&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# mv /netbsd /netbsd.old
# cp netbsd /
# chmod 444 /netbsd
&lt;/pre&gt;


&lt;p&gt;Pour revenir facilement en arrière en cas de souci, on peut ajouter la ligne suivante dans &lt;code&gt;/boot.cfg&lt;/code&gt;, en deuxième position&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
menu=Boot old kernel:boot netbsd.old
&lt;/pre&gt;


&lt;p&gt;Il ne reste plus qu'à rebooter sur le nouveau kernel.&lt;/p&gt;


&lt;p&gt;Référence&amp;nbsp;: &lt;a href=&quot;http://www.netbsd.org/docs/guide/en/chap-kernel.html#chap-kernel-building-manually&quot;&gt;Le guide&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;On peut faire la même manip pour mettre à jour une partie du système seulement, par exemple lorsqu'une faille de sécurité doit être corrigée. La méthode de compilation dans l'arbre des sources est indiquée dans l'avis.&lt;/p&gt;


&lt;p&gt;Plus généralement, la méthode est la suivante, avec l'exemple de &lt;code&gt;ls&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# cd /usr/src/bin/ls
# make USETOOLS=no cleandir
# make USETOOLS=no dependall
&lt;/pre&gt;


&lt;p&gt;Le binaire résultant et sa doc sont prêts dans le répertoire courant, il ne reste qu'à installer&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# make USETOOLS=no install
&lt;/pre&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>X11 forwarding request failed on channel 0</title>
    <link>http://orgrim.net/post/2011/10/21/X11-forwarding-request-failed-on-channel-0</link>
    <guid isPermaLink="false">urn:md5:0c8abe7d4529f23d39181a3ff2b9f509</guid>
    <pubDate>Fri, 21 Oct 2011 12:43:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>NetBSD</category>
        <category>NetBSD</category><category>SSH</category><category>tips</category><category>X.org</category>    
    <description>    &lt;p&gt;Quand j'essaye de me logguer sur ma box NetBSD fraichement passé en X.org modular, j'ai ça&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
orgrim@serfouette ~ $ ssh rateau 
X11 forwarding request failed on channel 0
Last login: Fri Oct 21 12:20:24 2011 from serfouette.home.orgrim.net
&lt;/pre&gt;


&lt;p&gt;WTF? ça tombe en marche SSH normalement.&lt;/p&gt;


&lt;p&gt;Et bien le souci vient de l'échange des magic cookies pour l'authentification entre serveurs X à travers SSH, c'est utilisé par le X11 forwarding et on a besoin de plusieurs choses pour ça&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;le chemin complet vers &lt;code&gt;xauth&lt;/code&gt; sur le client&lt;/li&gt;
&lt;li&gt;le chemin complet vers &lt;code&gt;xauth&lt;/code&gt; sur le serveur&lt;/li&gt;
&lt;li&gt;Avoir &lt;code&gt;X11Forward yes&lt;/code&gt; sur le serveur quand on le demande sur le client (il vaut &lt;code&gt;yes&lt;/code&gt; dans le &lt;code&gt;/etc/ssh/ssh_config&lt;/code&gt; du client par flemme de taper &lt;code&gt;-X&lt;/code&gt; sur la ligne de commande)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Le client est sous Linux, donc pas de soucis le chemin en dur &lt;code&gt;/usr/bin/xauth&lt;/code&gt; dans le binaire &lt;code&gt;sshd&lt;/code&gt; marche. Par contre pour NetBSD avec du X.org modular, il faut décommenter l'option &lt;code&gt;XAuthLocation&lt;/code&gt; dans &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt; et &lt;code&gt;/etc/ssh/ssh_config&lt;/code&gt; pour donner le bon chemin vers &lt;code&gt;xauth&lt;/code&gt;, comme indiqué en commentaire dans ces deux fichiers&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# If you use xorg from pkgsrc then uncomment the following line.
#  XAuthLocation /usr/pkg/bin/xauth
&lt;/pre&gt;


&lt;p&gt;Enfin, comme le &lt;code&gt;X11Forward&lt;/code&gt; est à &lt;code&gt;no&lt;/code&gt; par défaut sur NetBSD, je l'ai activé. La &lt;strong&gt;vrai solution&lt;/strong&gt; est de faire ça côté client en utilisant explicitement l'option &lt;code&gt;-X&lt;/code&gt; quand on veut ouvrir des fenêtres sur le serveur.&lt;/p&gt;


&lt;p&gt;Le pire c'est que Google ne sort rien sur le message &quot;X11 forwarding request failed on channel 0&quot;, à part une question sans réponse sur un stackoverflow-like en Russe&amp;nbsp;!&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Quand PostgreSQL n'a plus d'espace disque à manger</title>
    <link>http://orgrim.net/post/2011/10/18/Quand-PostgreSQL-n-a-plus-d-espace-disque-%C3%A0-manger</link>
    <guid isPermaLink="false">urn:md5:93d4900389efa7aba085d3f49c6eab35</guid>
    <pubDate>Tue, 18 Oct 2011 13:31:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>PostgreSQL</category>
        <category>filesystem</category><category>PostgreSQL</category><category>tips</category>    
    <description>    &lt;p&gt;Voilà donc une question intéressante, comment se comporte PostgreSQL face à un système de fichier plein&amp;nbsp;? Un peu d'expérimentation est nécessaire pour se rassurer...&lt;/p&gt;


&lt;p&gt;On crée deux systèmes de fichiers de faible taille pour les
tests. Le premier stockera PGDATA, ainsi qu'une base de données
nommée db_data. Le second sera le tablesapce ts1, dans lequel on
créera une base de données db_ts1.&lt;/p&gt;


&lt;p&gt;L'objectif est de montrer que seules les transactions modifiant des objets stockés sur des systèmes de fichier plein sont affectées, c'est pourquoi on a besoin de plusieurs tablespaces&lt;/p&gt;


&lt;p&gt;Les binaires se trouvent dans /home/pgsql/postgresql-9.0.4,
PGDATA dans /home/pgsql/postgresql-9.0.4/data, et le tablespace
dans /home/pgsql/postgresql-9.0.4/ts1. On a donc monté et donné
la propriété des deux filesystèmes à orgrim, que fera tourner
PostgreSQL&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# df -h
...
/dev/mapper/sys-pg1   504M   54M  425M  12% /home/pgsql/postgresql-9.0.4/data
/dev/mapper/sys-pg2   504M   17M  462M   4% /home/pgsql/postgresql-9.0.4/ts1
...

# cd /home/pgsql/postgresql-9.0.4/
# chown orgrim: data ts1
# chmod 700 data ts1
&lt;/pre&gt;


&lt;p&gt;Le cluster est préparé avec l'environnement suivant&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ env | grep PG
PGPORT=5904
PGDATABASE=postgres
PGDATA=/home/pgsql/postgresql-9.0.4/data
PATH=/home/pgsql/postgresql-9.0.4/bin:$PATH
&lt;/pre&gt;


&lt;p&gt;On lance donc &lt;code&gt;initdb&lt;/code&gt;, puis on crée les bases avec le tablespace&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ initdb
$ psql
psql (9.0.4)
Type &amp;quot;help&amp;quot; for help.

postgres=# CREATE DATABASE db_data;
CREATE DATABASE
postgres=# CREATE TABLESPACE ts1 LOCATION '/home/pgsql/postgresql-9.0.4/ts1';
CREATE TABLESPACE
postgres=# CREATE DATABASE db_ts1 TABLESPACE ts1;
CREATE DATABASE
&lt;/pre&gt;


&lt;p&gt;Ensuite, on se connecte à la base de données &lt;code&gt;db_ts1&lt;/code&gt; et on y
crée une base qui permettra de remplir le tablespace &lt;code&gt;ts1&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ while ((1)); do psql -c &amp;quot;INSERT INTO t SELECT generate_series(1, 1000) AS i;&amp;quot; db_ts1; done
&lt;/pre&gt;


&lt;p&gt;Au bout, d'un moment le système de fichier du tablespace est
plein et tout requête générant des écritures sort en erreur avec
un message de cette forme&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
ERROR:  could not extend file &amp;quot;pg_tblspc/16385/PG_9.0_201008051/16386/16390&amp;quot;: wrote only 4096 of 8192 bytes at block 58438
HINT:  Check free disk space.
&lt;/pre&gt;


&lt;p&gt;Ensuite, on essaye avec le répertoire PGDATA, on crée donc une table dans la base &lt;code&gt;db_data&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ psql db_data
psql (9.0.4)
Type &amp;quot;help&amp;quot; for help.

db_data=# CREATE TABLE t (i int);
CREATE TABLE
&lt;/pre&gt;


&lt;p&gt;De la même façon, on remplit cette table jusqu'à épuisement de l'espace libre&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ while ((1)); do psql -c &amp;quot;INSERT INTO t SELECT generate_series(1, 1000) AS i;&amp;quot; db_data; done
&lt;/pre&gt;


&lt;p&gt;Résultat, les requêtes sortent en erreur de la même façon. On a peut-être de la chance ici, le filesystem contenant &lt;code&gt;pg_xlog&lt;/code&gt;, les problèmes pourraient être pis.&lt;/p&gt;


&lt;p&gt;Il est également possible de remplir le système de fichiers de journaux de transactions, ce qui est problématique du fait que chaque transaction est écrite ici tout tablespace confondu. On vide donc les deux bases&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ psql db_ts1
psql (9.0.4)
Type &amp;quot;help&amp;quot; for help.

db_ts1=# TRUNCATE t;
TRUNCATE TABLE

$ psql db_data
psql (9.0.4)
Type &amp;quot;help&amp;quot; for help.

db_data=# TRUNCATE t;
TRUNCATE TABLE
&lt;/pre&gt;


&lt;p&gt;Et on place le paramètre &lt;code&gt;checkpoint_segments&lt;/code&gt; à 300, valeur
démesurée par rapport à la place disponible dans PGDATA.&lt;/p&gt;


&lt;p&gt;Après un reload, on refait alors le test de remplissage de la base &lt;code&gt;db_ts1&lt;/code&gt;, qui
assure que les journaux de transactions seuls remplissent PGDATA.&lt;/p&gt;


&lt;p&gt;Le serveur PostgreSQL s'arrête parce qu'il ne peut écrire le journal de transaction&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
PANIC:  could not write to file &amp;quot;pg_xlog/xlogtemp.8795&amp;quot;: No space left on device
STATEMENT:  INSERT INTO t SELECT generate_series(1, 1000) AS i;
LOG:  server process (PID 8795) was terminated by signal 6: Aborted
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat your command.
LOG:  all server processes terminated; reinitializing
&lt;/pre&gt;


&lt;p&gt;Il redémarre illico, mais le problème persiste&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
FATAL:  the database system is in recovery mode
LOG:  database system was interrupted; last known up at 2011-10-12 00:01:40 CEST
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  consistent recovery state reached at 0/5FDB7480
LOG:  redo starts at 0/5AA57D68
LOG:  could not open file &amp;quot;pg_xlog/000000010000000000000074&amp;quot; (log file 0, segment 116): No such file or directory
LOG:  redo done at 0/73FFFF90
LOG:  last completed transaction was at log time 2011-10-12 00:05:11.710639+02
PANIC:  could not write to file &amp;quot;pg_xlog/xlogtemp.8797&amp;quot;: No space left on device
LOG:  startup process (PID 8797) was terminated by signal 6: Aborted
LOG:  aborting startup due to startup process failure
&lt;/pre&gt;


&lt;p&gt;Le seul moyen de se sortir de cette situation est d'utiliser les
5% d'espace libre du filesystème réservés au super utilisateur, de baisser la valeur de &lt;code&gt;checkpoint_segments&lt;/code&gt; à une valeur évitant le filesystem full, les checkpoints successif supprimeront les fichiers en trop.&lt;/p&gt;


&lt;p&gt;Lorsqu'on a plus besoin de 5% réservés, il ne faut pas oublier de remettre la réservation.&lt;/p&gt;


&lt;p&gt;Enfin, ce cas le plus critique peut arriver assez facilement lorsqu'on a de l'archivage, si le serveur ne peut plus archiver les fichiers WAL, alors il les conserve, un filesystem full sur un espace d'archivage peut donc être transmis au serveur...&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Passer de X.org natif à modular</title>
    <link>http://orgrim.net/post/2011/10/04/Passer-de-X.org-natif-%C3%A0-modular</link>
    <guid isPermaLink="false">urn:md5:60a61404106e225d4a1fa88206ba3279</guid>
    <pubDate>Tue, 04 Oct 2011 18:37:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>NetBSD</category>
        <category>NetBSD</category><category>pkgsrc</category><category>X.org</category>    
    <description>    &lt;p&gt;X.org est fourni dans le basesys et dans pkgsrc, on appelle le premier «&amp;nbsp;native&amp;nbsp;» et le second «&amp;nbsp;modular&amp;nbsp;» selon la valeur de la variable &lt;code&gt;X11_TYPE&lt;/code&gt; que l'on positionne dans son &lt;code&gt;/etc/mk.conf&lt;/code&gt; pour signifier à pkgsrc sur lequel linker.&lt;/p&gt;


&lt;p&gt;Il s'agit des mêmes versions à peu de choses prêt, et X.org native n'est pas vieux ou non maintenu comme la rumeur voudrait le faire croire. Il est juste en retard parce qu'il suit le cycle de release du basesys alors que modular suit celui de pkgsrc et est tiré vers l'avant par les packages qui en dépendent. Cela peut poser problème lorsqu'on suit la cible mouvante qu'est pkgsrc-current.&lt;/p&gt;


&lt;p&gt;La première chose à faire pour passer de native à modular est d'éditer &lt;code&gt;/etc/mk.conf&lt;/code&gt; pour changer &lt;code&gt;X11_TYPE&lt;/code&gt;, on en profite pour ne plus compiler le native&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
MKX11=no 
X11_TYPE=modular
&lt;/pre&gt;


&lt;p&gt;Ensuite, il faut modifier la liste de packages à compiler pour y ajouter soit tout modular en installant &lt;code&gt;meta-pkgs/modular-xorg&lt;/code&gt;, soit en n'installant que le nécessaire, ça fait plus cool, dans &lt;code&gt;/usr/pkgsrc/pkgchk.conf&lt;/code&gt; (si vous avez suivi les docs ici ou dans le wiki)&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
meta-pkgs/modular-xorg-apps
meta-pkgs/modular-xorg-libs
meta-pkgs/modular-xorg-fonts
x11/xf86-input-keyboard
x11/xf86-input-mouse
x11/xf86-input-void
x11/xf86-video-nv
x11/xf86-video-vesa
x11/xf86-video-vga
x11/xf86-video-wsfb
x11/modular-xorg-server
&lt;/pre&gt;


&lt;p&gt;Ensuite on donne ça à manger à &lt;code&gt;pkg_comp&lt;/code&gt; ou à son bulk. L'important ici est de tout recompiler pour bien transférer les dépendances de native vers modular&amp;nbsp;: en gros on pète la sandbox, que ça soit de &lt;code&gt;mk/bulk&lt;/code&gt; ou &lt;code&gt;pkg_comp&lt;/code&gt; et on recommence. Etant passé en mode bulk partiel comme indiqué dans un précédent &lt;a href=&quot;http://orgrim.net/post/2011/08/19/Bulk-build-partiel-de-pkgsrc&quot;&gt;post&lt;/a&gt;, voici comment faire&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;1. On vérifie avec &lt;code&gt;mount&lt;/code&gt; que la standbox n'est pas montée ni qu'un build tourne (dans ce cas faut le killer), sinon&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# /usr/sandbox/sandbox umount
&lt;/pre&gt;


&lt;p&gt;2. On vérifie que le contenu des mk.conf du système et de la sandbox sont en phase, c'est le seul fichier de la sandbox à sauver&lt;/p&gt;


&lt;p&gt;3. On recrée la sandbox&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# rm -rf /usr/sandbox
# cd /usr/pkgsrc/mk/bulk
# sh mksandbox --without-x /usr/sandbox
&lt;/pre&gt;


&lt;p&gt;4. On nettoie les packages déjà compilés, pour forcer leur recompilation, et les fichiers cachés du bulk build&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# cd /usr/pkgsrc/packages/
# mv CVS .CVS
# rm -rf *
# mv .CVS CVS
# cd /usr/pkgsrc
# rm .broken.html .bulk_build_id .bulk_db .bulklock .depends .dependstree .index  .order .start .supports
# pkgclean
&lt;/pre&gt;


&lt;p&gt;5. On lance le bulk build et on attend, il faut prévoir entre 150 et 200 packages supplémentaires à compiler.&lt;/p&gt;


&lt;p&gt;Les étapes suivantes sont simples, on sauvegarde tout ce qu'il faut dans &lt;code&gt;/usr/pkg&lt;/code&gt;, puis on supprime tous les packages installés&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# cd /usr
# mv pkg pkg.old
# cd /var/db
# mkdir old_pkgdb
# mv pkg pkg.refcount old_pkgdb
# rm -rf pkgin
&lt;/pre&gt;


&lt;p&gt;A partir d'ici, on n'a plus de programmes issus de pkgsrc, en gros par de sudo, vim et autres...&lt;/p&gt;


&lt;p&gt;Puis, il faut supprimer les fichiers des sets de X.org, on se base pour cela sur le contenu de &lt;code&gt;/etc/mtree/set.x*&lt;/code&gt;. On en arrive donc à un stade où on est dans la même situation qu'après une installation du système sans les sets de X.org natif.&lt;/p&gt;


&lt;p&gt;Enfin, on réinstalle tout les packages avec &lt;a href=&quot;http://www.pkgin.net&quot;&gt;pkgin&lt;/a&gt;, qui dans sa version 0.5.0 (du CVS) peut importer une liste de packages au format de pkg_chk, qui se trouve être le même utilisé par le bulk-build, comme de par hasard&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# pkg_add http://pkgsrc.orgrim.net/NetBSD/5.1/amd64/All/pkg_install-20110805.tgz
# mkdir -p /usr/pkg/etc
# cp -r /usr/pkg.old/etc/pkgin /usr/pkg/etc
# ./pkgin up
# ./pkgin im pkgchk.conf
&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Note :&lt;/strong&gt; si le &lt;code&gt;pkg_add&lt;/code&gt; de pkg_install ne passe pas, essayer avec &lt;code&gt;-f&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;et hop, reste plus qu'à reconfigurer les chemins dans &lt;code&gt;/etc/X11/xorg.conf&lt;/code&gt; et c'est bon.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Bulk build partiel de pkgsrc</title>
    <link>http://orgrim.net/post/2011/08/19/Bulk-build-partiel-de-pkgsrc</link>
    <guid isPermaLink="false">urn:md5:7babb51b06284bdf2cb83178a05eb529</guid>
    <pubDate>Fri, 19 Aug 2011 10:43:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>NetBSD</category>
        <category>NetBSD</category><category>pkgin</category><category>pkgsrc</category><category>tips</category>    
    <description>    &lt;p&gt;En suivant l'&lt;a href=&quot;http://www.guigui2.net/dotclear/index.php?post/2011/07/30/sudo-sh-/usr/pkgsrc/mk/bulk/do-sandbox-build-s&quot;&gt;excellent tip de Mr GuiGui2&lt;/a&gt;, j'ai pu monter ma petite archi de bulk build personnelle pour fournir du package tout frais à &lt;a href=&quot;http://pkgin.net&quot;&gt;pkgin&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;J'ai donc ajouté le bloc magique suivant à mon &lt;code&gt;/etc/mk.conf&lt;/code&gt;, qui permet de gérer la présence de commentaires dans &lt;code&gt;pkgchk.conf&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# bulk build config
DEPENDS_TARGET= bulk-install
BATCH=          yes

BULK_PREREQ+=   pkgtools/lintpkgsrc
.if defined(SPECIFIC_PKGS)
PKGLIST!=               awk '$$1 !~ /^\#/ {print $$1}' ${PKGCHK_CONF}
.       for _pkg_ in ${PKGLIST}
HOST_SPECIFIC_PKGS+=    ${_pkg_}
.       endfor
.endif
&lt;/pre&gt;


&lt;p&gt;Pour aller plus loin, j'ai automatisé le process au maximum pour lancer des bulk build réguliers par cron, grâce au script &lt;a href=&quot;https://raw.github.com/orgrim/nb-utils/master/pkgsrc/bulk-builder&quot;&gt;bulk-builder&lt;/a&gt;. Ce script remplace &lt;code&gt;do-sandbox-build&lt;/code&gt; et &lt;code&gt;do-sandbox-upload&lt;/code&gt;, il est également capable de gérer des chemins alternatifs, mettre à jour &lt;code&gt;pkgsrc&lt;/code&gt; avant de lancer le bulk.&lt;/p&gt;


&lt;p&gt;La procédure pour mettre ça en place est donc&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;1. Ajouter le bloc montré plus haut à &lt;code&gt;/etc/mk.conf&lt;/code&gt; et y définir &lt;code&gt;PKGCHK_CONF&lt;/code&gt;, il s'agit du chemin vers une liste de packages au format &quot;catetgorie/package&quot;, un par ligne, qu'on peut automatiquement créer avec &lt;code&gt;pkg_chk -g&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;2. Créer la sandbox&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# cd /usr/pkgsrc/mk/bulk
# sh mksandbox --without-x /usr/sandbox
&lt;/pre&gt;


&lt;p&gt;3. Créer et configurer &lt;code&gt;/usr/pkgsrc/mk/bulk/build.conf&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# cd /usr/pkgsrc/mk/bulk
# cp build.conf-example build.conf
# vi build.conf
&lt;/pre&gt;


&lt;p&gt;4. Lancer le bulk build&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# sh bulk-builder -u -R
&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-u&lt;/code&gt; demande de &lt;code&gt;cvs up&lt;/code&gt; le répertoire &lt;code&gt;/usr/pkgsrc&lt;/code&gt; avant de commencer&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-R&lt;/code&gt; demande de ne pas uploader le résultat (les packages)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Enfin, il suffit d'utiliser la ligne suivante pour utiliser les packages avec &lt;code&gt;pkgin&lt;/code&gt;, dans &lt;code&gt;/usr/pkg/etc/pkgin/repositories.conf&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
file:///usr/pkgsrc/packages/All
&lt;/pre&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Montrer les dépendances avec make dans pkgsrc</title>
    <link>http://orgrim.net/post/2011/08/18/Montrer-les-d%C3%A9pendances-avec-make-dans-pkgsrc</link>
    <guid isPermaLink="false">urn:md5:4a82d6d576380c469b9cbfe75cb4ad50</guid>
    <pubDate>Thu, 18 Aug 2011 15:33:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>NetBSD</category>
        <category>NetBSD</category><category>pkgsrc</category><category>tips</category>    
    <description>    &lt;p&gt;Généralement, on peut savoir quelles sont les dépendances d'un package en utilisant &lt;code&gt;make show-depends&lt;/code&gt;, mais cela ne montre que les dépendances pour l'installation, les dépendances pour la compilation ne sont pas montrées.&lt;/p&gt;

&lt;pre&gt;
$ cd /usr/pkgsrc/databases/postgresql90-server/
$ make show-depends
postgresql90-client&amp;gt;=9.0.4:../../databases/postgresql90-client
&lt;/pre&gt;



&lt;p&gt;Pour connaître les dépendances selon leur type (installation ou compilation), on peut utiliser la cible &lt;code&gt;show-depends-pkgpaths&lt;/code&gt; alliée à la variable &lt;code&gt;DEPENDS_TYPE&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Pour avoir seulement les dépendances de compilation&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ make DEPENDS_TYPE=build show-depends-pkgpaths
devel/bison
devel/gmake
pkgtools/digest
&lt;/pre&gt;


&lt;p&gt;Pour avoir seulement celles d'installation&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ make DEPENDS_TYPE=install show-depends-pkgpaths
databases/postgresql90-client
&lt;/pre&gt;


&lt;p&gt;Et enfin pour montrer les deux types, qui est aussi le comportement par défaut&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ make DEPENDS_TYPE=all show-depends-pkgpaths
databases/postgresql90-client
devel/bison
devel/gmake
pkgtools/digest

$ make show-depends-pkgpaths
databases/postgresql90-client
devel/bison
devel/gmake
pkgtools/digest
&lt;/pre&gt;


&lt;p&gt;Pour plus d'information, le Makefile qui contrôle cette cible est &lt;code&gt;mk/bsd.utils.mk&lt;/code&gt;.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Le client de la BuildFarm de PostgreSQL dans pkgsrc-wip</title>
    <link>http://orgrim.net/post/2011/08/06/Le-client-de-la-BuildFarm-de-PostgreSQL-dans-pkgsrc-wip</link>
    <guid isPermaLink="false">urn:md5:a67e5ae4ac6c8bd0609863b7cb81bf2c</guid>
    <pubDate>Sat, 06 Aug 2011 22:39:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>NetBSD</category>
        <category>contrib</category><category>NetBSD</category><category>pkgsrc</category><category>PostgreSQL</category>    
    <description>    &lt;p&gt;Comme j'annonçais précédemment, je contribue deux machines NetBSD à la BuildFarm de PostgreSQL. La compilation ne se fait automagiquement qu'après la configuration du client (écrit en Perl). Il n'est d'ailleurs pas forcément très convi à installer, c'est pourquoi je l'ai packagé pour pkgsrc&amp;nbsp;: &lt;a href=&quot;http://pkgsrc.se/wip/pgbuildfarm&quot; title=&quot;http://pkgsrc.se/wip/pgbuildfarm&quot;&gt;http://pkgsrc.se/wip/pgbuildfarm&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;En espérant qu'il soit ajouté à l'arbre officiel...&lt;/p&gt;


&lt;p&gt;Voici la configuration pour lancer des builds sur NetBSD, dans &lt;code&gt;/usr/pkg/etc/pgbuildfarm/build-farm.conf&lt;/code&gt;, en commençant par le chemin du miroir du dépôt Git&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
# Modifier dans %conf
scmrepo =&amp;gt; '/usr/pgbuildfarm/pgsql-base.git',
&lt;/pre&gt;


&lt;p&gt;Le client est destiné à être lancé par cron, connu pour son environnement light, c'est pourquoi les paramètres d'environnement doivent être adaptés&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Le make GNU s'appelle gmake chez nous&lt;/li&gt;
&lt;li&gt;Pas mal de programmes proviennent de pkgsrc, il faut donc que le client ait &lt;code&gt;/usr/pkg/bin&lt;/code&gt; dans son PATH, et puisse trouver les bibliothèques issues des packages.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;
make =&amp;gt; 'gmake',
aux_path =&amp;gt; &amp;quot;/usr/pkg/bin&amp;quot;,

build_env =&amp;gt;
{
    PATH =&amp;gt; &amp;quot;/usr/pkg/bin:$ENV{PATH}&amp;quot;,
    LD_LIBRARY_PATH =&amp;gt; &amp;quot;/usr/pkg/lib&amp;quot;,
},

config_env =&amp;gt;
{
    CC =&amp;gt; 'gcc',
    PATH =&amp;gt; &amp;quot;/usr/pkg/bin:$ENV{PATH}&amp;quot;,
    LD_LIBRARY_PATH =&amp;gt; &amp;quot;/usr/pkg/lib&amp;quot;,
},
&lt;/pre&gt;


&lt;p&gt;Enfin le plus important, les options du &lt;code&gt;configure&lt;/code&gt;, la plupart nécessitent des packages supplémentaires comme &lt;code&gt;python&lt;/code&gt; ou la &lt;code&gt;libxml&lt;/code&gt;. Ce qui est primordial ici est d'utiliser le «&amp;nbsp;template&amp;nbsp;» NetBSD&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
config_opts =&amp;gt;
[qw(
    --enable-cassert
    --enable-debug
    --enable-nls
    --enable-integer-datetimes
    --with-perl
    --with-python
    --with-tcl
    --with-krb5
    --with-includes=/usr/include/krb5:/usr/pkg/include
    --with-libraries=/usr/pkg/lib
    --with-openssl
    --with-template=netbsd
    --enable-thread-safety
)],
&lt;/pre&gt;


&lt;p&gt;Pour toutes ces options, les packages suivants ont été installés&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;devel/bison&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devel/flex&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lang/python26&lt;/code&gt; (et &lt;code&gt;pkgtools/pkg_alternatives&lt;/code&gt; pour avoir le lien python)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lang/perl5&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lang/tcl&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;textproc/libxml2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;textproc/libxslt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devel/readline&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;P.S.&amp;nbsp;: Il n'y a que les particularités de NetBSD décrites ici, en complément du &lt;a href=&quot;http://wiki.postgresql.org/wiki/PostgreSQL_Buildfarm_Howto&quot;&gt;wiki de PostgreSQL&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Could not open relation with oid N</title>
    <link>http://orgrim.net/post/2011/08/05/Could-not-open-relation-with-oid-N</link>
    <guid isPermaLink="false">urn:md5:4b90b8ad3e7359f3ec2a51a69c6a6d8a</guid>
    <pubDate>Fri, 05 Aug 2011 15:32:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>PostgreSQL</category>
        <category>locks</category><category>pg_catalog</category><category>PostgreSQL</category>    
    <description>    &lt;p&gt;On peut parfois trouver cet étrange message d'erreur dans les traces de PostgreSQL (N étant un nombre) ou lors de l'exécution d'une requête&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
ERROR:  could not open relation with OID N
&lt;/pre&gt;


&lt;p&gt;Si on recherche ce message dans les mailing-lists du projet, on peut facilement conclure que la base de données est corrompue, qu'il y a des problèmes matériels et que la sécurité des données est en péril. Et bien, ce n'est pas forcément le cas&amp;nbsp;: obtenir ce message peut être tout à fait normal.&lt;/p&gt;


&lt;p&gt;Pour démontrer cela, on a besoin d'une table&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ createdb test
$ psql test
psql (9.0.4)
Type &amp;quot;help&amp;quot; for help.

test=# CREATE TABLE truc AS SELECT generate_series(0, 5) AS i;
SELECT 6
test=#
&lt;/pre&gt;


&lt;p&gt;On lance une session qui bloquerait un &lt;code&gt;DROP&lt;/code&gt; de cette table, pour cela on pose un verrou exclusif, le mode «&amp;nbsp;ExclusiveLock&amp;nbsp;» ne laisse passer que les lectures (c'est important pour la suite)&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ psql test
psql (9.0.4)
Type &amp;quot;help&amp;quot; for help.

test=# BEGIN;
BEGIN
test=# LOCK TABLE truc IN EXCLUSIVE MODE;
LOCK TABLE
test=#
&lt;/pre&gt;


&lt;p&gt;On laisse cette transaction «&amp;nbsp;ouverte », avec le verrou posé et on lance une session pour supprimer la table&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ psql test
psql (9.0.4)
Type &amp;quot;help&amp;quot; for help.

test=# BEGIN;
BEGIN
test=# DROP TABLE truc;
&lt;/pre&gt;


&lt;p&gt;L'ordre SQL &lt;code&gt;DROP TABLE&lt;/code&gt; ne rend pas la main, cette deuxième session attend le verrou «&amp;nbsp;AccessExclusiveLock », qui est le plus restrictif, sur la table pour pouvoir la supprimer. La page &lt;a href=&quot;http://wiki.postgresql.org/wiki/Lock_dependency_information&quot; title=&quot;http://wiki.postgresql.org/wiki/Lock_dependency_information&quot;&gt;http://wiki.postgresql.org/wiki/Loc...&lt;/a&gt; fournie une requête montrant les dépendances entre requêtes du point de vue du verrouillage. Dans ce cas, elle donne le résultat suivant&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
 waiting_locktype | waiting_table |  waiting_query   |    waiting_mode     | waiting_pid | other_locktype | other_table |      other_query      |  other_mode   | other_pid | other_granted 
------------------+---------------+------------------+---------------------+-------------+----------------+-------------+-----------------------+---------------+-----------+---------------
 relation         | truc          | DROP TABLE truc; | AccessExclusiveLock |       25632 | relation       | truc        | &amp;lt;IDLE&amp;gt; in transaction | ExclusiveLock |     24217 | t
&lt;/pre&gt;


&lt;p&gt;On lance une troisième session, avec un &lt;code&gt;SELECT&lt;/code&gt; sur notre table&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ psql test
psql (9.0.4)
Type &amp;quot;help&amp;quot; for help.

test=# SELECT * FROM truc;
&lt;/pre&gt;


&lt;p&gt;L'ordre &lt;code&gt;SELECT&lt;/code&gt; ne rend pas la main, cette troisième session se met à attendre le &lt;code&gt;DROP TABLE&lt;/code&gt; et la première session. C'est d'ailleurs le &lt;code&gt;DROP TABLE&lt;/code&gt; qui bloque réellement le &lt;code&gt;SELECT&lt;/code&gt;, car la première session à verrouillé la table en lecture seule&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
 waiting_locktype | waiting_table |    waiting_query    |    waiting_mode     | waiting_pid | other_locktype | other_table |      other_query      |     other_mode      | other_pid | other_granted 
------------------+---------------+---------------------+---------------------+-------------+----------------+-------------+-----------------------+---------------------+-----------+---------------
 relation         | truc          | SELECT * FROM truc; | AccessShareLock     |       28629 | relation       | truc        | DROP TABLE truc;      | AccessExclusiveLock |     25632 | f
 relation         | truc          | DROP TABLE truc;    | AccessExclusiveLock |       25632 | relation       | truc        | &amp;lt;IDLE&amp;gt; in transaction | ExclusiveLock       |     24217 | t
 relation         | truc          | SELECT * FROM truc; | AccessShareLock     |       28629 | relation       | truc        | &amp;lt;IDLE&amp;gt; in transaction | ExclusiveLock       |     24217 | t
 relation         | truc          | DROP TABLE truc;    | AccessExclusiveLock |       25632 | relation       | truc        | SELECT * FROM truc;   | AccessShareLock     |     28629 | f
(4 rows)
&lt;/pre&gt;


&lt;p&gt;On libère la première session&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
test=# ROLLBACK;
ROLLBACK
test=#
&lt;/pre&gt;


&lt;p&gt;Le &lt;code&gt;DROP TABLE&lt;/code&gt; passe, et le &lt;code&gt;SELECT&lt;/code&gt; continue d'attendre&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
 waiting_locktype | waiting_table |    waiting_query    |  waiting_mode   | waiting_pid | other_locktype | other_table |      other_query      |     other_mode      | other_pid | other_granted 
------------------+---------------+---------------------+-----------------+-------------+----------------+-------------+-----------------------+---------------------+-----------+---------------
 relation         | truc          | SELECT * FROM truc; | AccessShareLock |       28629 | relation       | truc        | &amp;lt;IDLE&amp;gt; in transaction | AccessExclusiveLock |     25632 | t
&lt;/pre&gt;


&lt;p&gt;On voit que le &lt;code&gt;SELECT&lt;/code&gt; attend la transaction qui a lancé le &lt;code&gt;DROP TABLE&lt;/code&gt;. Même si le &lt;code&gt;DROP TABLE&lt;/code&gt; est terminé, son effet ne sera connu des transactions concurrentes seulement ou moment du commit ou rollback, parce qu'on utilise le niveau d'isolation des transaction «&amp;nbsp;read committed&amp;nbsp;» (par défaut). Il n'y a pas de «&amp;nbsp;&lt;code&gt;UNLOCK&lt;/code&gt;&amp;nbsp;» sur les tables dans PostgreSQL, il faut attendre la fin de la transaction pour que les verrous soient libérés, du moins lorsqu'on n'utilise pas de savepoints.&lt;/p&gt;


&lt;p&gt;Maintenant, on valide le &lt;code&gt;DROP TABLE&lt;/code&gt;, avec l'ordre &lt;code&gt;COMMIT&lt;/code&gt;. Le &lt;code&gt;SELECT&lt;/code&gt; termine en erreur, on voit alors le message dans les logs&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
ERROR:  could not open relation with OID 17366 at character 15
STATEMENT:  SELECT * FROM truc;
&lt;/pre&gt;


&lt;p&gt;Lorsque le &lt;code&gt;SELECT&lt;/code&gt; n'est plus bloqué par le verrou, il ne peut accéder pas à la table car elle n'existe plus. Le message n'est pas très explicite parce que la requête est en cours d'exécution&amp;nbsp;: le moteur a déjà terminé le travail de parsing et de planification, il ne travaille qu'avec les OID qu'il a récupéré du catalogue système à ce moment là.&lt;/p&gt;


&lt;p&gt;Dans ce cas précis, obtenir ce message n'est un problème de corruption de la base ou du catalogue système.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Deux machines NetBSD dans la buildfarm de PostgreSQL</title>
    <link>http://orgrim.net/post/2011/08/05/Deux-machines-NetBSD-dans-la-buildfarm-de-PostgreSQL</link>
    <guid isPermaLink="false">urn:md5:ce3ead2ca74c2535621f87f0b7990646</guid>
    <pubDate>Fri, 05 Aug 2011 10:56:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>PostgreSQL</category>
        <category>contrib</category><category>NetBSD</category><category>PostgreSQL</category>    
    <description>    &lt;p&gt;Il y a quelques temps, j'avais remarqué que seules deux machines NetBSD étaient présentes dans la &lt;a href=&quot;http://www.pgbuildfarm.org&quot;&gt;buildfarm de PostgreSQL&lt;/a&gt; sur du powerpc et du mips. Pas de machines i386 et amd64, qui sont pourtant les architectures phares du &lt;a href=&quot;http://www.netbsd.org/ports/&quot;&gt;TIER 1&lt;/a&gt;, et ce depuis plus d'un an.&lt;/p&gt;


&lt;p&gt;L'affront est désormais réparé et deux nouveaux drapeaux oranges flottent fièrement dans les prés de la buildfarm, fournies par votre serviteur&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.pgbuildfarm.org/cgi-bin/show_status.pl?member=panther&quot;&gt;panther&lt;/a&gt;&amp;nbsp;: NetBSD 5.1 gcc 4.1.3 i386&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.pgbuildfarm.org/cgi-bin/show_status.pl?member=smilodon&quot;&gt;smilodon&lt;/a&gt;&amp;nbsp;: NetBSD 5.1 gcc 4.1.3 amd64&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Les machines tournent maintenant depuis quelques temps, sans aucun soucis.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>pitrery : des scripts pour faciliter la sauvegarde PITR</title>
    <link>http://orgrim.net/post/2011/08/04/pitrery-des-scripts-pour-faciliter-la-sauvegarde-PITR</link>
    <guid isPermaLink="false">urn:md5:a8cac5023423cd1eac13c9a657a0dc9e</guid>
    <pubDate>Thu, 04 Aug 2011 21:43:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>PostgreSQL</category>
        <category>backup</category><category>bash</category><category>PostgreSQL</category>    
    <description>    &lt;p&gt;Gérer une sauvegarde PITR (Point-In-Time Recovery), permettant de revenir à un point précis dans le temps sur un serveur PostgreSQL, n'est pas forcément évident à mettre en place et ensuite à gérer au quotidien&amp;nbsp;: la restauration en cas de problème peut même prendre beaucoup de temps à mettre en place, avec des possibilités d'erreurs non négligeables. C'est d'autant plus stressant que la pression monte quand on en a besoin...&lt;/p&gt;


&lt;p&gt;C'est pourquoi, dans le cadre de mon travail, j'ai écrit un ensemble de scripts shell en Bash (ce qui permet d'utiliser des commandes qui sont déjà sur une installation classique de Linux) pour faciliter ce travail. Le code est hébergé sur github&amp;nbsp;: &lt;a href=&quot;https://github.com/dalibo/pitrery&quot; title=&quot;https://github.com/dalibo/pitrery&quot;&gt;https://github.com/dalibo/pitrery&lt;/a&gt;. La version 1.0 vient d'être taguée. C'est encore un peu brut de décoffrage niveau documentation, mais les scripts ont été testés dans tous les sens, donc ce jeu d'outils devrait être utilisable en production sans trop de difficultés.&lt;/p&gt;


&lt;p&gt;Il y a un Makefile GNU, à l'ancienne, les fichiers de configuration sont plein de commentaires pour expliquer et il y des «&amp;nbsp;usage&amp;nbsp;» pour chaque script à base de &lt;code&gt;-?&lt;/code&gt; ou &lt;code&gt;-h&lt;/code&gt; qui devraient parler à ceux qui savent déjà gérer du PITR.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Configuration réseau pour virtualiser chez OVH</title>
    <link>http://orgrim.net/post/2011/07/05/Configuration-r%C3%A9seau-pour-virtualiser-chez-OVH</link>
    <guid isPermaLink="false">urn:md5:34b7cf278e3130b983fe78a6c3605f09</guid>
    <pubDate>Tue, 05 Jul 2011 01:24:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>Unix Libre</category>
        <category>Debian</category><category>IPv6</category><category>KVM</category><category>Proxy NDP</category><category>Réseau</category>    
    <description>    &lt;p&gt;Sur mon serveur chez OVH, j'ai un ensemble de machines virtuelles KVM et (bientôt) de conteneurs LXC. Pour fournir du réseau à tout ce petit monde, j'utilise de l'IPv4 et de l'IPv6, voici comment c'est configuré.&lt;/p&gt;


&lt;p&gt;Pour l'IPv4, on a un nombre limité d'IP publiques parce que ça vaut de la thune et que ça va être de plus en tendu de multiplier les adresses, il nous faut un réseau privé (beurk), du NAT (rebeurk) et des redirections à base d'iptables (re-rebeurk). Il nous faut surtout un bridge, c'est une Debian donc ça se passe dans &lt;code&gt;/etc/network/interfaces&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
	bridge_ports eth0
	bridge_fd 0
	bridge_maxwait 0
	address 188.165.205.xxx
	netmask 255.255.255.0
	network 188.165.205.0
	broadcast 188.165.205.255
	gateway 188.165.205.254
	post-up iptables -t nat -A POSTROUTING -s 10.42.0.0/24 -o br0 -j SNAT --to 188.165.205.xxx
	pre-down iptables -t nat -D POSTROUTING -s 10.42.0.0/24 -o br0 -j SNAT --to 188.165.205.xxx

iface br0 inet6 static
	address 2001:41D0:xxxx:96ce::1
	netmask 64

auto br0:0
iface br0:0 inet static
	address 10.42.0.1
	netmask 255.255.255.0
&lt;/pre&gt;


&lt;p&gt;Pour le bridge, on met l'IPv4 publique et une règle iptable pour NAT-er ce qui sort. Le réseau privé est 10.42.0.0/24, on peut bien sûr choisir ce qu'on veut dans ce que fourni la RFC 1918.&lt;/p&gt;


&lt;p&gt;Pour l'IPv6, chez OVH c'est bizarre&amp;nbsp;: il fournissent un prefix 64 bit et avec une route accessible sur le /56 incluant, mais pas à partir du /64. Il faut donc ruser de la façon suivante niveau routage&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On assigne l'IPv6 avec le prefix /64, c'est plus propre, sinon le kernel se plaint avec /56&amp;nbsp;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;
# ip -6 addr add 2001:41D0:xxxx:96ce::1/64 dev br0
&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;On met une route pour atteindre la gateway dans le /56&amp;nbsp;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;
# ip -6 route add 2001:41d0:xxxx:96ce::/56 dev br0
&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;On met la route par défaut&amp;nbsp;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;
# ip -6 route add default via 2001:41d0:xxxx:96ff:ff:ff:ff:ff
&lt;/pre&gt;


&lt;p&gt;Pour avoir cette configuration appliquée automatiquement, il faut créer &lt;code&gt;/etc/network/if-up.d/ovh-ipv6-route&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
#!/bin/sh

if [ &amp;quot;$IFACE&amp;quot; = &amp;quot;br0&amp;quot; ]; then
	ip -6 route add 2001:41d0:2:96ce::/56 dev br0
	ip -6 route add default via 2001:41d0:2:96ff:ff:ff:ff:ff
fi
&lt;/pre&gt;

&lt;p&gt;Et pour l'arrêt, &lt;code&gt;/etc/network/if-down.d/ovh-ipv6-route&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
#!/bin/sh

if [ &amp;quot;$IFACE&amp;quot; = &amp;quot;br0&amp;quot; ]; then
	ip -6 route del default via 2001:41d0:2:96ff:ff:ff:ff:ff
	ip -6 route del 2001:41d0:2:96ce::/56 dev br0
fi
&lt;/pre&gt;


&lt;p&gt;Il faut ensuite activer le forward entre interfaces, sinon pas de routage vers les VM, dans &lt;code&gt;/etc/sysctl.conf&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
net.ipv6.conf.all.forwarding=1
&lt;/pre&gt;


&lt;p&gt;Enfin, le routage chez OVH ne permet pas d'intercaler un routeur pour découper le /64, il faut donc ruser avec du proxy NDP (Neighbor Discovery Protocol)&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On active le proxy NDP, dans &lt;code&gt;/etc/sysctl.conf&lt;/code&gt;&amp;nbsp;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;
net.ipv6.conf.all.proxy_ndp=1
&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;On ajoute les IP à proxiser, celle de la gateway et chacune des IP fournies aux VM&amp;nbsp;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;
# ip neigh add proxy 2001:41d0:xxxx:96ff:ff:ff:ff:ff dev br0
# ip neigh add proxy 2001:41d0:xxxx:96ce::2 dev br0
&lt;/pre&gt;


&lt;p&gt;En cas de reboot d'une VM, il faut d'abord virer ses IP du proxy, puis les remettre, sinon le kernel de la VM se plein d'une duplication d'adresse&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
# ip neigh del proxy 2001:41d0:xxxx:96ce::2 dev br0
-&amp;gt; reboot de la VM
# ip neigh add proxy 2001:41d0:xxxx:96ce::2 dev br0
&lt;/pre&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>NetBSD en KVM</title>
    <link>http://orgrim.net/post/2011/07/04/NetBSD-en-KVM</link>
    <guid isPermaLink="false">urn:md5:eddfb9dfe4dc0c74f269bfc32e93f671</guid>
    <pubDate>Mon, 04 Jul 2011 18:45:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>NetBSD</category>
        <category>KVM</category><category>NetBSD</category>    
    <description>    &lt;p&gt;Comme je viens d'investir dans un &lt;a href=&quot;http://www.kimsufi.com/fr/&quot; title=&quot;gros porteur&quot;&gt;&lt;/a&gt; (le 16G), je me suis dis qu'avoir quelques machines NetBSD pour servir la bonne cause ça serait bien cool.&lt;/p&gt;


&lt;p&gt;En fait, j'ai deux besoins&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Avoir un dépôt de paquet et de quoi fait des bulk build réduits de pkgsrc pour me permettre de n'utiliser uniquement l'excellent pkgin&lt;/li&gt;
&lt;li&gt;Fournir des machines à la Build Farm de PostgreSQL, parce qu'il n'y a même pas de machine NetBSD en i386 et en amd64 (seulement powerpc et mips)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;J'ai donc décidé de monter 2 machines NetBSD en KVM sur ma grosse box Debian, qui fait tourner ça grâce à KVM.&lt;/p&gt;


&lt;p&gt;Pour l'installation, il y a 2 possibilités, soit on fait du VNC, soit on redirige la sortie VGA dans du curses. Pour le disque j'ai choisi de poser directement les données sur des volumes logiques, dans ce cas, il faut désactiver le cache ce qui permet une infime perte de puissance en I/O.&lt;/p&gt;


&lt;p&gt;Il faut commencer par récupérer l'ISO d'installation&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
wget ftp://ftp.fr.netbsd.org/pub/NetBSD/iso/5.1/amd64cd-5.1.iso
&lt;/pre&gt;


&lt;p&gt;Ensuite, créer le volume logique (on a choisi de donner 50 Go) et lancer l'installation, en curses ça passe nickel, il faut choisir d'utiliser la console serie&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
kvm -drive file=/dev/system/kvm-nb64-d1,cache=none \
    -m 1024 \
    -net nic,model=e1000 -net tap \
    -name nb64 \
    -curses \
    -cdrom /home/orgrim/netbsd/amd64cd-5.1.iso \
    -boot d \
    -k fr
&lt;/pre&gt;


&lt;p&gt;Une fois installé, on lance la commande suivante dans un screen, on demande à KVM de fournir l'accès console en série dans un fichier, ce qui permet d'avoir la console QEMU disponible directement dans le screen&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
kvm -nographic \
    -drive file=/dev/system/kvm-nb64-d1,cache=none \
    -m 1024 \
    -net nic,model=e1000,macaddr=DE:AD:BE:EF:37:D1 -net tap \
    -name nb64 \
    -boot c \
    -serial unix:/tmp/nb64.sock,server,nowait
&lt;/pre&gt;


&lt;p&gt;Note: merci de changer la MAC de l'interface réseau, c'est utilisé en prod chez moi &lt;img src=&quot;/themes/default/smilies/smile.png&quot; alt=&quot;:)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Enfin, il est important de démarrer le noyau NetBSD sans ACPI ni SMP (en mettant le defaut à 4 dans &lt;code&gt;/boot.cfg&lt;/code&gt;)&lt;/p&gt;


&lt;p&gt;Pour accéder à la machine en console série&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
minicom -D unix#/tmp/nd64.sock
&lt;/pre&gt;


&lt;p&gt;Si on a oublié de choisir la console série, on peut l'activer de cette façon&amp;nbsp;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Booter avec &lt;code&gt;-curses -k fr&lt;/code&gt; à la place de &lt;code&gt;-nographic&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Lancer la commande suivante pour activer la console série&amp;nbsp;:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;
# installboot -v -o console=com0,speed=19200 /dev/rwd0a /usr/mdec/bootxx_ffsv1
File system:         /dev/rwd0a
Primary bootstrap:   /usr/mdec/bootxx_ffsv1
Boot options:        timeout 5, flags 0, speed 19200, ioaddr 0, console com0
&lt;/pre&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Rediriger stdout/stderr depuis un script avec du pipe</title>
    <link>http://orgrim.net/post/2011/06/29/Rediriger-stdout/stderr-depuis-un-script-avec-du-pipe</link>
    <guid isPermaLink="false">urn:md5:6e5179dce167f36f5e73c3a4f173799c</guid>
    <pubDate>Wed, 29 Jun 2011 15:48:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>Unix Libre</category>
        <category>bash</category><category>PostgreSQL</category><category>tips</category>    
    <description>    &lt;p&gt;Pour rediriger stdout/stderr à l'interieur vers l'entrée standard d'un commande, il faut utiliser exec et du sous-shell. Cette astuce est un bashisme a priori.&lt;/p&gt;


&lt;p&gt;L'objectif est de renvoyer tous les messages du script dans syslog sans mettre de redirection sur la ligne de commande. Le principe général est&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
exec FD&amp;gt; &amp;gt;(COMMAND)
&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;FD est le numéro du file descriptor, 1 pour stdout, 2 pour stderr&lt;/li&gt;
&lt;li&gt;COMMAND est la commande a exécuter, elle doit bien sûr lire les données en entrée.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Un plus gros exemple&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;bash bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #007800;&quot;&gt;SYSLOG&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;no&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# Load configuration file&lt;/span&gt;
&lt;span style=&quot;color: #007800;&quot;&gt;CONFIG&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;etc&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;myconfig.conf
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-f&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #007800;&quot;&gt;$CONFIG&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;then&lt;/span&gt;
    . &lt;span style=&quot;color: #007800;&quot;&gt;$CONFIG&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;fi&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# Redirect output to syslog if configured&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #007800;&quot;&gt;$SYSLOG&lt;/span&gt;&amp;quot;&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;yes&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;then&lt;/span&gt;
    &lt;span style=&quot;color: #007800;&quot;&gt;SYSLOG_FACILITY&lt;/span&gt;=&lt;span style=&quot;color: #800000;&quot;&gt;${SYSLOG_FACILITY:-local0}&lt;/span&gt;
    &lt;span style=&quot;color: #007800;&quot;&gt;SYSLOG_IDENT&lt;/span&gt;=&lt;span style=&quot;color: #800000;&quot;&gt;${SYSLOG_IDENT:-postgres}&lt;/span&gt;
&amp;nbsp;
    &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;exec&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;logger &lt;span style=&quot;color: #660033;&quot;&gt;-t&lt;/span&gt; &lt;span style=&quot;color: #800000;&quot;&gt;${SYSLOG_IDENT}&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-p&lt;/span&gt; &lt;span style=&quot;color: #800000;&quot;&gt;${SYSLOG_FACILITY}&lt;/span&gt;.info&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;exec&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;logger &lt;span style=&quot;color: #660033;&quot;&gt;-t&lt;/span&gt; &lt;span style=&quot;color: #800000;&quot;&gt;${SYSLOG_IDENT}&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-p&lt;/span&gt; &lt;span style=&quot;color: #800000;&quot;&gt;${SYSLOG_FACILITY}&lt;/span&gt;.err&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;fi&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;avec dans la configuration&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SYSLOG&amp;nbsp;: mettre à yes ou no pour activer&lt;/li&gt;
&lt;li&gt;SYSLOG_FACILITY&amp;nbsp;: ou envoyer&lt;/li&gt;
&lt;li&gt;SYSLOG_IDENT&amp;nbsp;: avec quel tag&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;L'exemple est pris d'un de mes scripts d'archivage pour PostgreSQL, ce qui permet de logguer dans syslog sans mettre de pipe dans &lt;code&gt;archive_command&lt;/code&gt; (ce qu'il ne faut pas faire parce que ça casse&amp;nbsp;: le code retour donné à PostgreSQL est celui de la dernière commande de la chaîne de pipe)&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Combiner des PDF en un seul</title>
    <link>http://orgrim.net/post/2011/06/21/Combiner-des-PDF-en-un-seul</link>
    <guid isPermaLink="false">urn:md5:ad33d226fba522c01764ec51c7cd6830</guid>
    <pubDate>Tue, 21 Jun 2011 15:58:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>Unix Libre</category>
        <category>tips</category>    
    <description>    &lt;p&gt;Pour combiner des pdf en un seul, on peut essayer &lt;code&gt;pdfjoin&lt;/code&gt; fournit par le projet &lt;a href=&quot;http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic-research/firth/software/pdfjam/&quot; title=&quot;pdfjam&quot;&gt;pdfjam&lt;/a&gt;. En attendant que les 250 Mo de dépendances (Latex principalement) s'installent, on peut utiliser ghostscript&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile=../combined_doc.pdf *.pdf
&lt;/pre&gt;


&lt;p&gt;Merci à &lt;a href=&quot;http://www.perlmonks.org/?node_id=470323&quot; title=&quot;http://www.perlmonks.org/?node_id=470323&quot;&gt;http://www.perlmonks.org/?node_id=4...&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Installation de cgit</title>
    <link>http://orgrim.net/post/2011/04/10/Installation-de-cgit</link>
    <guid isPermaLink="false">urn:md5:4b2223f9eebe21872a26353539618927</guid>
    <pubDate>Sun, 10 Apr 2011 23:17:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>Unix Libre</category>
        <category>cgit</category><category>Debian</category><category>git</category>    
    <description>    &lt;p&gt;Cgit est un programme CGI écrit en C qui permet d'obtenir une interface web de navigation pour un ensemble de dépôts git.&lt;/p&gt;


&lt;p&gt;Cgit a besoin de OpenSSL, le paquet Debian est &lt;code&gt;libssl-dev&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;On récupère la version de stable de cgit&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
$ wget http://hjemli.net/git/cgit/snapshot/cgit-0.9.tar.bz2
$ tar xjf cgit-0.9.tar.bz2
&lt;/pre&gt;


&lt;p&gt;Il faut d'abord configurer l'installation en éditant le fichier Makefile. L'interface a besoin d'un endroit accessible par un serveur web, nous allons prendre &lt;code&gt;/var/www/orgrim.net/git&lt;/code&gt;. On configure donc les chemins dans le Makefile, de cette façon&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
CGIT_SCRIPT_PATH = /var/www/orgrim.net/git
prefix = /usr/local/cgit
&lt;/pre&gt;


&lt;p&gt;Les binaires iront donc dans &lt;code&gt;/var/www/orgrim.net/git/,&lt;/code&gt; les bibliothèques et autres fichiers dans une arborescence sous &lt;code&gt;/usr/local/cgit&lt;/code&gt;, le fichier de configuration, sera &lt;code&gt;/etc/cgitrc&lt;/code&gt;, la valeur par défaut.&lt;/p&gt;


&lt;p&gt;Ensuite, il faut suivre les instructions données dans le README. On doit récupérer le dépôt git de git&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
$ make get-git
&lt;/pre&gt;


&lt;p&gt;Puis on compile et on installe&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
$ make
$ sudo make install
&lt;/pre&gt;


&lt;p&gt;On configure ensuite un virtual host Apache&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
$ cat /etc/apache2/sites-enabled/git.orgrim.net 
&amp;lt;VirtualHost *:80&amp;gt;
	ServerAdmin webmaster@localhost
	ServerName git.orgrim.net

	DocumentRoot /var/www/orgrim.net/git
	&amp;lt;Directory /var/www/orgrim.net/git&amp;gt;
        	Addhandler cgi-script .cgi
        	DirectoryIndex cgit.cgi
		Options +FollowSymLinks +ExecCGI
		AllowOverride None
		Order allow,deny
		allow from all

        	RewriteEngine On
        	RewriteBase /
        	RewriteCond %{REQUEST_FILENAME} !-f
        	RewriteCond %{REQUEST_FILENAME} !-d
        	RewriteRule (.*) cgit.cgi/$1
        	RewriteRule ^cgit.cgi$  cgit.cgi/
	&amp;lt;/Directory&amp;gt;

   	## Logs
	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	ErrorLog /var/log/apache2/orgrim.net/git_error.log
	CustomLog /var/log/apache2/orgrim.net/git_access.log combined

&amp;lt;/VirtualHost&amp;gt;
&lt;/pre&gt;


&lt;p&gt;On peut aller voir le site, il doit afficher une page générée par cgit montrant qu'aucun dépôt n'est configuré pour l'affichage.&lt;/p&gt;


&lt;p&gt;Il faut maintenant créer le fichier de configuration, &lt;code&gt;/etc/cgitrc&lt;/code&gt; en recopiant la partie exemple du fichier source de la doc &lt;code&gt;cgit-0.9/cgitrc.5.txt&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Ici, l'important est de définir le paramètre de configuration pour matcher avec la configuration des rewrite rules du virtual host&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
virtual-root=/
&lt;/pre&gt;


&lt;p&gt;Enfin, les chemins vers la CSS et le logo sont à adapter, par rapport au document root du virtual host&amp;nbsp;:&lt;/p&gt;
&lt;pre&gt;
css=/cgit.css
logo=/cgit.png
&lt;/pre&gt;


&lt;p&gt;Le reste de la configuration est assez facile à adapter, pour pouvoir ajouter ses dépôts.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Retrouver un trigger à partir du nom de la fonction associée</title>
    <link>http://orgrim.net/post/2011/04/07/Retrouver-un-trigger-%C3%A0-partir-du-nom-de-la-fonction-associ%C3%A9e</link>
    <guid isPermaLink="false">urn:md5:e231c3a24951cc3aa5ccd7d5cfd61efe</guid>
    <pubDate>Thu, 07 Apr 2011 14:08:00 +0200</pubDate>
    <dc:creator>Orgrim</dc:creator>
        <category>PostgreSQL</category>
        <category>pg_catalog</category><category>PostgreSQL</category><category>tips</category>    
    <description>    &lt;p&gt;Ici encore, tout est dans le catalogue système de PostgreSQL, il suffit de regarder dans la table &lt;code&gt;pg_trigger&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Avec les jointures qui vont bien, on peut obtenir les informations intéressantes&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;sql sql&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; nspname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; schema&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; relname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; tgname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TRIGGER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; proname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FUNCTION&lt;/span&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; pg_trigger t
  &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; pg_class c &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;t&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;tgrelid &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; c&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; pg_namespace n &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;n&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; c&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;relnamespace&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; pg_proc p &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;p&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; t&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;tgfoid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/pre&gt;


&lt;p&gt;En ajoutant une clause WHERE, on peut facilement retrouver la table associée au trigger&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;sql sql&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; nspname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; schema&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; relname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; tgname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TRIGGER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; proname &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FUNCTION&lt;/span&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; pg_trigger t
  &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; pg_class c &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;t&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;tgrelid &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; c&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; pg_namespace n &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;n&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; c&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;relnamespace&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; pg_proc p &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;p&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;oid &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; t&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;tgfoid&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; proname &lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;'mafonction'&lt;/span&gt;;&lt;/pre&gt;</description>
    
    
    
      </item>
    
</channel>
</rss>